|
|
Created:
3 years, 10 months ago by robertshield Modified:
3 years, 10 months ago Reviewers:
Devlin CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix rare crash in WebstoreInlineInstaller::CheckInlineInstallPermitted.
It assumed that FindBrowserWithWebContents couldn't return nullptr.
BUG=687189
Review-Url: https://codereview.chromium.org/2669563003
Cr-Commit-Position: refs/heads/master@{#451512}
Committed: https://chromium.googlesource.com/chromium/src/+/5418d62d2fd3dc113874faa6f8b1417ba5257f30
Patch Set 1 #
Total comments: 4
Patch Set 2 : Move check to CheckRequestorAlive. #Messages
Total messages: 26 (14 generated)
The CQ bit was checked by robertshield@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Potential fix for a rare-ish crash. This might be wrong and the error string is probably unsatisfactory. Let me know if this is worthwhile or if something else should happen instead :-)
robertshield@chromium.org changed reviewers: + rdevlin.cronin@chromium.org
Potential fix for a rare-ish crash. This might be wrong and the error string is probably unsatisfactory. Let me know if this is worthwhile or if something else should happen instead :-)
https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... File chrome/browser/extensions/webstore_inline_installer.cc (right): https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... chrome/browser/extensions/webstore_inline_installer.cc:140: if (!browser) { Hmm... interesting. Do you know when this might happen? Before calling CheckInlineInstallPermitted(), we call CheckRequestorAlive() (which validates web_contents()) and early-outs if it's not. Is there another case in which FindBrowserWithWebContents() could return null? I wonder if we could catch this case earlier, rather than waiting for the round-trip from the webstore?
https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... File chrome/browser/extensions/webstore_inline_installer.cc (right): https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... chrome/browser/extensions/webstore_inline_installer.cc:140: if (!browser) { On 2017/01/31 20:18:47, Devlin wrote: > Hmm... interesting. Do you know when this might happen? Before calling > CheckInlineInstallPermitted(), we call CheckRequestorAlive() (which validates > web_contents()) and early-outs if it's not. Is there another case in which > FindBrowserWithWebContents() could return null? I wonder if we could catch this > case earlier, rather than waiting for the round-trip from the webstore? Yes, I believe in this case, web_contents() is not null, but the containing tab has been stripped out of the tab_strip_model used by the TabContentsIterator used by FindBrowserWithWebContents (https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tab_contents/t...). I haven't dug very far into exactly when things get pruned out of the tab_strip_model_, happens during window closing though and it can happen slightly before the WebContents gets destroyed as per https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tabs/tab_strip... Checking before the webstore response comes in is an interesting idea, but I'm not sure that the WebContents still being attached to a Browser before the request goes out necessarily guarantees it will still be attached to a Browser when the response has come in.
https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... File chrome/browser/extensions/webstore_inline_installer.cc (right): https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... chrome/browser/extensions/webstore_inline_installer.cc:140: if (!browser) { On 2017/02/01 14:21:32, robertshield_slow_reviews wrote: > On 2017/01/31 20:18:47, Devlin wrote: > > Hmm... interesting. Do you know when this might happen? Before calling > > CheckInlineInstallPermitted(), we call CheckRequestorAlive() (which validates > > web_contents()) and early-outs if it's not. Is there another case in which > > FindBrowserWithWebContents() could return null? I wonder if we could catch > this > > case earlier, rather than waiting for the round-trip from the webstore? > > Yes, I believe in this case, web_contents() is not null, but the containing tab > has been stripped out of the tab_strip_model used by the TabContentsIterator > used by FindBrowserWithWebContents > (https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tab_contents/t...). > > > I haven't dug very far into exactly when things get pruned out of the > tab_strip_model_, happens during window closing though and it can happen > slightly before the WebContents gets destroyed as per > https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tabs/tab_strip... > > Checking before the webstore response comes in is an interesting idea, but I'm > not sure that the WebContents still being attached to a Browser before the > request goes out necessarily guarantees it will still be attached to a Browser > when the response has come in. Hmm, okay. What about merging this logic with CheckRequestorAlive()? I think for all intents and purposes, if the web contents is no longer attached to a browser, we don't want to continue. Then the check in WebstoreStandaloneInstaller() for CheckRequestorAlive() would catch this case.
The CQ bit was checked by robertshield@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... File chrome/browser/extensions/webstore_inline_installer.cc (right): https://codereview.chromium.org/2669563003/diff/1/chrome/browser/extensions/w... chrome/browser/extensions/webstore_inline_installer.cc:140: if (!browser) { On 2017/02/06 16:28:41, Devlin (OOO feb 8 and feb 9) wrote: > On 2017/02/01 14:21:32, robertshield_slow_reviews wrote: > > On 2017/01/31 20:18:47, Devlin wrote: > > > Hmm... interesting. Do you know when this might happen? Before calling > > > CheckInlineInstallPermitted(), we call CheckRequestorAlive() (which > validates > > > web_contents()) and early-outs if it's not. Is there another case in which > > > FindBrowserWithWebContents() could return null? I wonder if we could catch > > this > > > case earlier, rather than waiting for the round-trip from the webstore? > > > > Yes, I believe in this case, web_contents() is not null, but the containing > tab > > has been stripped out of the tab_strip_model used by the TabContentsIterator > > used by FindBrowserWithWebContents > > > (https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tab_contents/t...). > > > > > > I haven't dug very far into exactly when things get pruned out of the > > tab_strip_model_, happens during window closing though and it can happen > > slightly before the WebContents gets destroyed as per > > > https://codesearch.chromium.org/chromium/src/chrome/browser/ui/tabs/tab_strip... > > > > Checking before the webstore response comes in is an interesting idea, but I'm > > not sure that the WebContents still being attached to a Browser before the > > request goes out necessarily guarantees it will still be attached to a Browser > > when the response has come in. > > Hmm, okay. What about merging this logic with CheckRequestorAlive()? I think > for all intents and purposes, if the web contents is no longer attached to a > browser, we don't want to continue. Then the check in > WebstoreStandaloneInstaller() for CheckRequestorAlive() would catch this case. That does seem better. Made it so. Apologies for the delay, I took a stab at a browser_test but couldn't figure out a non-insanely-invasive way of writing one. Let me know if this is ok as is.
lgtm; sorry I missed the latest patch set (feel free to ping if it's more than a day or so :))
On 2017/02/18 02:00:06, Devlin wrote: > lgtm; sorry I missed the latest patch set (feel free to ping if it's more than a > day or so :)) Oh hey, no worries, I got swamped and forgot about this too :-) Thanks for the review!
The CQ bit was checked by robertshield@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
The CQ bit was checked by robertshield@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 20001, "attempt_start_ts": 1487475771000100, "parent_rev": "250263fa2e293a555c78479e00b5758c2e56d97e", "commit_rev": "5418d62d2fd3dc113874faa6f8b1417ba5257f30"}
Message was sent while issue was closed.
Description was changed from ========== Fix rare crash in WebstoreInlineInstaller::CheckInlineInstallPermitted. It assumed that FindBrowserWithWebContents couldn't return nullptr. BUG=687189 ========== to ========== Fix rare crash in WebstoreInlineInstaller::CheckInlineInstallPermitted. It assumed that FindBrowserWithWebContents couldn't return nullptr. BUG=687189 Review-Url: https://codereview.chromium.org/2669563003 Cr-Commit-Position: refs/heads/master@{#451512} Committed: https://chromium.googlesource.com/chromium/src/+/5418d62d2fd3dc113874faa6f8b1... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/5418d62d2fd3dc113874faa6f8b1... |