Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Issue 2688413006: Fixed crash if tab closes while WebShare picker dialog is open. (Closed)

Created:
3 years, 10 months ago by Matt Giuca
Modified:
3 years, 10 months ago
Reviewers:
Sam McNally
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixed crash if tab closes while WebShare picker dialog is open. Now, in this case, the picker dialog will do nothing (it has a weak pointer to the share service which is invalidated if the tab closes). Significantly reworked unit test to make testing this case possible: instead of synchronously closing the picker in ShowPickerDialog, it now stores the callback and exits the run-loop, allowing the individual tests to call the callback as they wish. The new test ShareServiceDeletion deletes the share service before calling the callback, which would have crashed before this fix. BUG=690775 Review-Url: https://codereview.chromium.org/2688413006 Cr-Commit-Position: refs/heads/master@{#451169} Committed: https://chromium.googlesource.com/chromium/src/+/bd4b24d3cb10b535d47005567c3d5589125585fe

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fix comments. #

Total comments: 10

Patch Set 3 : Do Sam's suggestions. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -83 lines) Patch
M chrome/browser/webshare/share_service_impl.h View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/webshare/share_service_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/webshare/share_service_impl_unittest.cc View 1 2 6 chunks +139 lines, -81 lines 0 comments Download

Messages

Total messages: 28 (17 generated)
Matt Giuca
This is pretty complex and I have some questions about it. Let's discuss tomorrow.
3 years, 10 months ago (2017-02-14 07:44:56 UTC) #4
Sam McNally
https://codereview.chromium.org/2688413006/diff/1/chrome/browser/webshare/share_service_impl_unittest.cc File chrome/browser/webshare/share_service_impl_unittest.cc (right): https://codereview.chromium.org/2688413006/diff/1/chrome/browser/webshare/share_service_impl_unittest.cc#newcode163 chrome/browser/webshare/share_service_impl_unittest.cc:163: std::vector<std::pair<base::string16, GURL>> targets_in_picker = Move these out. https://codereview.chromium.org/2688413006/diff/1/chrome/browser/webshare/share_service_impl_unittest.cc#newcode309 chrome/browser/webshare/share_service_impl_unittest.cc:309: ...
3 years, 10 months ago (2017-02-15 06:27:55 UTC) #7
Matt Giuca
https://codereview.chromium.org/2688413006/diff/1/chrome/browser/webshare/share_service_impl_unittest.cc File chrome/browser/webshare/share_service_impl_unittest.cc (right): https://codereview.chromium.org/2688413006/diff/1/chrome/browser/webshare/share_service_impl_unittest.cc#newcode163 chrome/browser/webshare/share_service_impl_unittest.cc:163: std::vector<std::pair<base::string16, GURL>> targets_in_picker = On 2017/02/15 06:27:55, Sam McNally ...
3 years, 10 months ago (2017-02-15 08:13:26 UTC) #9
Sam McNally
lgtm https://codereview.chromium.org/2688413006/diff/20001/chrome/browser/webshare/share_service_impl_unittest.cc File chrome/browser/webshare/share_service_impl_unittest.cc (right): https://codereview.chromium.org/2688413006/diff/20001/chrome/browser/webshare/share_service_impl_unittest.cc#newcode78 chrome/browser/webshare/share_service_impl_unittest.cc:78: void set_runloop(base::RunLoop* runloop) { run_loop https://codereview.chromium.org/2688413006/diff/20001/chrome/browser/webshare/share_service_impl_unittest.cc#newcode121 chrome/browser/webshare/share_service_impl_unittest.cc:121: base::Closure ...
3 years, 10 months ago (2017-02-16 02:12:24 UTC) #13
Matt Giuca
Thanks, good suggestions. https://codereview.chromium.org/2688413006/diff/20001/chrome/browser/webshare/share_service_impl_unittest.cc File chrome/browser/webshare/share_service_impl_unittest.cc (right): https://codereview.chromium.org/2688413006/diff/20001/chrome/browser/webshare/share_service_impl_unittest.cc#newcode78 chrome/browser/webshare/share_service_impl_unittest.cc:78: void set_runloop(base::RunLoop* runloop) { On 2017/02/16 ...
3 years, 10 months ago (2017-02-16 02:25:39 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2688413006/40001
3 years, 10 months ago (2017-02-16 02:29:06 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/391448)
3 years, 10 months ago (2017-02-16 06:19:05 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2688413006/40001
3 years, 10 months ago (2017-02-16 06:53:08 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/391599)
3 years, 10 months ago (2017-02-16 09:06:54 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2688413006/40001
3 years, 10 months ago (2017-02-16 23:40:47 UTC) #25
commit-bot: I haz the power
3 years, 10 months ago (2017-02-17 01:42:42 UTC) #28
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/bd4b24d3cb10b535d47005567c3d...

Powered by Google App Engine
This is Rietveld 408576698