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

Issue 2118473002: 😴 Skip some KeepAlive registrations on shutdown. (Closed)

Created:
4 years, 5 months ago by dgn
Modified:
4 years, 5 months ago
CC:
chromium-reviews, johnme
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[bgmode] Skip some KeepAlive registrations on shutdown. Registering a KeepAlive during shtudown is forbidden and hits a CHECK, so we should avoid starting some operations that do it. This CL adds checks to avoid such situations: - push notifications received from GCM while shutting down will be dropped early instead of causing a crash and being dropped anyway. - Extension functions using chrome_details validate before running that the browser process is not shutting down. BUG=625646 Committed: https://crrev.com/43f25e4fc136ddba3b516c329ac375ce9185b6b3 Cr-Commit-Position: refs/heads/master@{#406001}

Patch Set 1 #

Patch Set 2 : [bgmode] Make KeepAlive registration less strict. #

Patch Set 3 : [bgmode] Make KeepAlive registration less strict. #

Total comments: 1

Patch Set 4 : Check that we are not shutting down in sensitive places instead #

Patch Set 5 : Check that we are not shutting down in sensitive places instead #

Patch Set 6 : #

Patch Set 7 : [more generic anti extension crash check #

Total comments: 7

Patch Set 8 : address comments #

Patch Set 9 : Support Extension Functions though ChromeDetails, add tests #

Patch Set 10 : rebase #

Patch Set 11 : use ExtensionsBrowserClient #

Total comments: 8

Patch Set 12 : address comments #

Total comments: 3

Patch Set 13 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -2 lines) Patch
A chrome/browser/extensions/chrome_extension_function_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +72 lines, -0 lines 0 comments Download
M chrome/browser/lifetime/scoped_keep_alive.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/notifications/message_center_notification_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/api/guest_view/web_view/web_view_internal_api.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/browser/extension_function.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/extension_function.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (16 generated)
dgn
We received crash reports related to posted tasks attempting to register KeepAlives while the browser ...
4 years, 5 months ago (2016-06-30 17:43:48 UTC) #2
sky
https://codereview.chromium.org/2118473002/diff/40001/chrome/browser/lifetime/keep_alive_types.h File chrome/browser/lifetime/keep_alive_types.h (right): https://codereview.chromium.org/2118473002/diff/40001/chrome/browser/lifetime/keep_alive_types.h#newcode54 chrome/browser/lifetime/keep_alive_types.h:54: enum class KeepAliveStrictOption { DISABLED, ENABLED }; This name ...
4 years, 5 months ago (2016-06-30 17:57:40 UTC) #3
dgn
On 2016/06/30 17:57:40, sky wrote: > https://codereview.chromium.org/2118473002/diff/40001/chrome/browser/lifetime/keep_alive_types.h > File chrome/browser/lifetime/keep_alive_types.h (right): > > https://codereview.chromium.org/2118473002/diff/40001/chrome/browser/lifetime/keep_alive_types.h#newcode54 > ...
4 years, 5 months ago (2016-06-30 21:00:39 UTC) #4
Bernhard Bauer
On 2016/06/30 21:00:39, dgn wrote: > On 2016/06/30 17:57:40, sky wrote: > > > https://codereview.chromium.org/2118473002/diff/40001/chrome/browser/lifetime/keep_alive_types.h ...
4 years, 5 months ago (2016-06-30 21:07:08 UTC) #5
sky
On Thu, Jun 30, 2016 at 2:00 PM, <dgn@chromium.org> wrote: > On 2016/06/30 17:57:40, sky ...
4 years, 5 months ago (2016-06-30 22:38:42 UTC) #6
dgn
> >> Although ideally we wouldn't have this. Don't the crash reports show a > ...
4 years, 5 months ago (2016-07-01 16:44:28 UTC) #7
sky
LGTM - but I'm adding johnme@ as owner for the push_messaging change as I'm not ...
4 years, 5 months ago (2016-07-01 19:25:14 UTC) #9
dgn
rdevlin.cronin@: PTAL at the extension changes. Also adding peter@ for push_messaging review, since we discussed ...
4 years, 5 months ago (2016-07-05 12:32:50 UTC) #11
Peter Beverloo
push and notifications lgtm, thanks! https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); Is this ...
4 years, 5 months ago (2016-07-05 12:42:10 UTC) #12
johnme
push_messaging lgtm
4 years, 5 months ago (2016-07-05 12:48:18 UTC) #14
Devlin
https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); On 2016/07/05 12:42:10, Peter Beverloo wrote: > ...
4 years, 5 months ago (2016-07-06 16:54:23 UTC) #15
dgn
https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); On 2016/07/06 16:54:23, Devlin wrote: > On ...
4 years, 5 months ago (2016-07-07 15:20:17 UTC) #17
Devlin
https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); On 2016/07/07 15:20:17, dgn wrote: > On ...
4 years, 5 months ago (2016-07-08 01:01:01 UTC) #18
dgn
PTAL https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); On 2016/07/08 01:01:01, Devlin wrote: > ...
4 years, 5 months ago (2016-07-12 15:58:19 UTC) #19
Devlin
https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc File chrome/browser/extensions/chrome_extension_function.cc (right): https://codereview.chromium.org/2118473002/diff/120001/chrome/browser/extensions/chrome_extension_function.cc#newcode106 chrome/browser/extensions/chrome_extension_function.cc:106: return RespondNow(Error(error_)); On 2016/07/12 15:58:19, dgn wrote: > On ...
4 years, 5 months ago (2016-07-12 16:19:38 UTC) #20
dgn
PTAL. I left the test in //chrome as I would prefer using testing_browser_process and a ...
4 years, 5 months ago (2016-07-13 20:15:08 UTC) #21
Devlin
overall, looks pretty good! https://codereview.chromium.org/2118473002/diff/200001/chrome/browser/extensions/chrome_extension_function_unittest.cc File chrome/browser/extensions/chrome_extension_function_unittest.cc (right): https://codereview.chromium.org/2118473002/diff/200001/chrome/browser/extensions/chrome_extension_function_unittest.cc#newcode14 chrome/browser/extensions/chrome_extension_function_unittest.cc:14: void SuccessCallback(AsyncExtensionFunction::ResponseType type, nit: put ...
4 years, 5 months ago (2016-07-13 20:23:16 UTC) #22
dgn
Thanks for the quick review! PTAL https://codereview.chromium.org/2118473002/diff/200001/chrome/browser/extensions/chrome_extension_function_unittest.cc File chrome/browser/extensions/chrome_extension_function_unittest.cc (right): https://codereview.chromium.org/2118473002/diff/200001/chrome/browser/extensions/chrome_extension_function_unittest.cc#newcode14 chrome/browser/extensions/chrome_extension_function_unittest.cc:14: void SuccessCallback(AsyncExtensionFunction::ResponseType type, ...
4 years, 5 months ago (2016-07-13 20:40:54 UTC) #23
Devlin
https://codereview.chromium.org/2118473002/diff/220001/chrome/browser/extensions/chrome_extension_function_unittest.cc File chrome/browser/extensions/chrome_extension_function_unittest.cc (right): https://codereview.chromium.org/2118473002/diff/220001/chrome/browser/extensions/chrome_extension_function_unittest.cc#newcode16 chrome/browser/extensions/chrome_extension_function_unittest.cc:16: int g_callback_runs = 0; global variables are pretty fragile ...
4 years, 5 months ago (2016-07-15 17:59:40 UTC) #24
dgn
PTAL https://codereview.chromium.org/2118473002/diff/220001/chrome/browser/extensions/chrome_extension_function_unittest.cc File chrome/browser/extensions/chrome_extension_function_unittest.cc (right): https://codereview.chromium.org/2118473002/diff/220001/chrome/browser/extensions/chrome_extension_function_unittest.cc#newcode16 chrome/browser/extensions/chrome_extension_function_unittest.cc:16: int g_callback_runs = 0; On 2016/07/15 17:59:39, Devlin ...
4 years, 5 months ago (2016-07-18 14:44:04 UTC) #31
Devlin
Awesome, lgtm! It looks like your cl description is a little bit out of date, ...
4 years, 5 months ago (2016-07-18 15:08:15 UTC) #32
dgn
On 2016/07/18 15:08:15, Devlin wrote: > Awesome, lgtm! > > It looks like your cl ...
4 years, 5 months ago (2016-07-18 15:39:48 UTC) #34
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/2118473002/240001
4 years, 5 months ago (2016-07-18 15:40:31 UTC) #37
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 5 months ago (2016-07-18 15:46:35 UTC) #39
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-18 15:46:58 UTC) #40
commit-bot: I haz the power
4 years, 5 months ago (2016-07-18 15:48:31 UTC) #42
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/43f25e4fc136ddba3b516c329ac375ce9185b6b3
Cr-Commit-Position: refs/heads/master@{#406001}

Powered by Google App Engine
This is Rietveld 408576698