Closed Bug 1206842 Opened 9 years ago Closed 8 years ago

Improve code stability of SendSSLErrorReport, it may break close tabs

Categories

(Firefox :: General, defect)

41 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 50
Tracking Status
firefox50 --- fixed

People

(Reporter: yfdyh000, Assigned: Gijs)

Details

Attachments

(2 files)

Attached patch patch v1Splinter Review
STR:
Uncertain, I encounter it when closing tabs, a tab is left and become a ghost.


I see the error in Browser Console:
TypeError: docShell.failedChannel.securityInfo is null content.js:304:9


This patch reference to a very similar code.
Attachment #8663818 - Flags: review?(gavin.sharp)
Attachment #8663818 - Flags: review?(gavin.sharp) → review?(ttaubert)
Comment on attachment 8663818 [details] [diff] [review]
patch v1

Review of attachment 8663818 [details] [diff] [review]:
-----------------------------------------------------------------

Instead of try/catch I think it would be better to simply check |if (docShell.failedChannel.securityInfo) { ...|. Also because we need this check in two places, why not add a helper function that takes a docShell and returns its serialized SSL status? If securityInfo==null then it would simply return an empty string.
Attachment #8663818 - Flags: review?(ttaubert)
(In reply to Tim Taubert [:ttaubert] from comment #1)
> Comment on attachment 8663818 [details] [diff] [review]
> patch v1
> 
> Review of attachment 8663818 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Instead of try/catch I think it would be better to simply check |if
> (docShell.failedChannel.securityInfo) { ...|. Also because we need this
> check in two places, why not add a helper function that takes a docShell and
> returns its serialized SSL status? If securityInfo==null then it would
> simply return an empty string.

I'm not sure why we was not do it, but maybe these QueryInterface and SSLStatus may be null too, so try to be more comprehensive.


And, it indeed no error dump, but the same try & catch is rampant in the file. so I did not add it alone, if necessary, it should probably be a separate bug.
Flags: needinfo?(ttaubert)
(In reply to YF (Yang) from comment #2)
> And, it indeed no error dump, but the same try & catch is rampant in the
> file.

Well rampant is maybe not the right word, but yes there's another place doing that already. We can surely leave the try/catch but still, moving it to a helper function is probably good.
Flags: needinfo?(ttaubert)
I don't have experience and interest to writing a new helper function at present :(
Assignee: yfdyh000 → nobody
Status: ASSIGNED → NEW
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Comment on attachment 8768838 [details]
Bug 1206842 - check we have a failedChannel and securityInfo before serializing, extract to helper, original patch by YF (Yang),

https://reviewboard.mozilla.org/r/62852/#review59966

lgtm
Attachment #8768838 - Flags: review?(franziskuskiefer) → review+
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/0164fbe34683
check we have a failedChannel and securityInfo before serializing, extract to helper, original patch by YF (Yang), r=fkiefer
https://hg.mozilla.org/mozilla-central/rev/0164fbe34683
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: