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

Issue 1970613003: Add a new app API to enable watchdog behavior restarts in kiosk apps (Closed)

Created:
4 years, 7 months ago by afakhry
Modified:
4 years, 6 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, asvitkine+watch_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a new app API to enable watchdog behavior restarts in kiosk apps This CL adds chrome.runtime.restartAfterDelay(int seconds, callback) to enable watchdog behavior restarts in kiosk apps. BUG=604578 TEST=browser_tests --gtest_filter=RestartAfterDelayApiTest.RestartAfterDelayTest Committed: https://crrev.com/6c1c80d89c29b22117b13760643c7fd1734e2466 Cr-Commit-Position: refs/heads/master@{#400027}

Patch Set 1 #

Patch Set 2 : Missing include #

Patch Set 3 : Better design and working tests #

Patch Set 4 : Remove unneeded include and forward declare #

Total comments: 20

Patch Set 5 : Rebase #

Patch Set 6 : Xiyuan's comments #

Total comments: 12

Patch Set 7 : Nits #

Total comments: 12

Patch Set 8 : Rebase + Nits #

Total comments: 28

Patch Set 9 : comments #

Patch Set 10 : Rebase + Devlin's comments #

Total comments: 24

Patch Set 11 : Rebase + Devlin's comments + rename to restartAfterDelay(); #

Patch Set 12 : Rebase + Convert browser tests to unit tests. #

Total comments: 16

Patch Set 13 : Comments #

Total comments: 8

Patch Set 14 : #

Patch Set 15 : Mats Nilsson expected behavior implementation #

Patch Set 16 : Revert changes in api_unittests.cc/h #

Patch Set 17 : Rebase ..... #

Patch Set 18 : Missing include #

Total comments: 9

Patch Set 19 : Add a new app API to enable watchdog behavior restarts in kiosk apps #

Total comments: 20

Patch Set 20 : Devlin's comments #

Total comments: 2

Patch Set 21 : Nitty nit. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+562 lines, -7 lines) Patch
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +2 lines, -0 lines 0 comments Download
A extensions/browser/api/runtime/restart_after_delay_api_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +247 lines, -0 lines 0 comments Download
M extensions/browser/api/runtime/runtime_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +80 lines, -4 lines 0 comments Download
M extensions/browser/api/runtime/runtime_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 6 chunks +207 lines, -2 lines 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M extensions/common/api/runtime.json View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +18 lines, -0 lines 0 comments Download
M extensions/extensions_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 56 (11 generated)
afakhry
Xiyuan, this is what I have in mind for this API. I need your advice ...
4 years, 7 months ago (2016-05-12 17:45:44 UTC) #3
xiyuan
https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc#newcode343 extensions/browser/api/runtime/runtime_api.cc:343: watchdog_timer_.Stop(); |watchdog_timer_| is a per-profile resource. We probably should ...
4 years, 7 months ago (2016-05-13 17:56:16 UTC) #4
afakhry
https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc#newcode343 extensions/browser/api/runtime/runtime_api.cc:343: watchdog_timer_.Stop(); On 2016/05/13 17:56:15, xiyuan wrote: > |watchdog_timer_| is ...
4 years, 7 months ago (2016-05-14 01:27:35 UTC) #5
xiyuan
https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc#newcode346 extensions/browser/api/runtime/runtime_api.cc:346: base::Bind(&RuntimeAPI::OnRestartWatchdogTimeout, base::Unretained(this), On 2016/05/14 01:27:35, afakhry wrote: > On ...
4 years, 7 months ago (2016-05-16 18:25:18 UTC) #6
afakhry
https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/60001/extensions/browser/api/runtime/runtime_api.cc#newcode622 extensions/browser/api/runtime/runtime_api.cc:622: EXTENSION_FUNCTION_VALIDATE(params.get()); On 2016/05/13 17:56:15, xiyuan wrote: > Check ExtensionsBrowserClient::Get()->IsRunningInForcedAppMode() ...
4 years, 7 months ago (2016-05-17 18:38:31 UTC) #7
xiyuan
lgtm https://codereview.chromium.org/1970613003/diff/120001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/120001/extensions/browser/api/runtime/runtime_api.cc#newcode84 extensions/browser/api/runtime/runtime_api.cc:84: const int kMinDurationBetweenSuccessiveRestartsHours = 3; nit: const -> ...
4 years, 7 months ago (2016-05-17 21:23:55 UTC) #8
afakhry
Thanks Xiyuan! Devlin, could you please take a look? https://codereview.chromium.org/1970613003/diff/120001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/120001/extensions/browser/api/runtime/runtime_api.cc#newcode84 extensions/browser/api/runtime/runtime_api.cc:84: ...
4 years, 7 months ago (2016-05-17 23:59:45 UTC) #10
afakhry
On 2016/05/17 23:59:45, afakhry wrote: > Thanks Xiyuan! > > Devlin, could you please take ...
4 years, 7 months ago (2016-05-19 17:12:05 UTC) #11
Devlin
Sorry for the delay; still making my way through this one. It's on my radar.
4 years, 7 months ago (2016-05-19 22:42:37 UTC) #12
Devlin
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode49 extensions/browser/api/runtime/runtime_api.cc:49: constexpr char kNoBackgroundPageError[] = "You do not have a ...
4 years, 7 months ago (2016-05-20 17:26:33 UTC) #13
afakhry
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode49 extensions/browser/api/runtime/runtime_api.cc:49: constexpr char kNoBackgroundPageError[] = "You do not have a ...
4 years, 7 months ago (2016-05-21 01:13:00 UTC) #14
Devlin
(just responding, no new comments) https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode49 extensions/browser/api/runtime/runtime_api.cc:49: constexpr char kNoBackgroundPageError[] = ...
4 years, 7 months ago (2016-05-23 16:49:39 UTC) #15
xiyuan
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode375 extensions/browser/api/runtime/runtime_api.cc:375: storage->GetExtensionValue( On 2016/05/23 16:49:39, Devlin wrote: > On 2016/05/21 ...
4 years, 7 months ago (2016-05-24 16:47:05 UTC) #16
Devlin
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode375 extensions/browser/api/runtime/runtime_api.cc:375: storage->GetExtensionValue( On 2016/05/24 16:47:05, xiyuan wrote: > On 2016/05/23 ...
4 years, 7 months ago (2016-05-24 16:51:46 UTC) #17
xiyuan
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode375 extensions/browser/api/runtime/runtime_api.cc:375: storage->GetExtensionValue( On 2016/05/24 16:51:46, Devlin wrote: > On 2016/05/24 ...
4 years, 7 months ago (2016-05-24 16:56:04 UTC) #18
Devlin
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode375 extensions/browser/api/runtime/runtime_api.cc:375: storage->GetExtensionValue( On 2016/05/24 16:56:04, xiyuan wrote: > On 2016/05/24 ...
4 years, 7 months ago (2016-05-24 16:57:32 UTC) #19
afakhry
https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/140001/extensions/browser/api/runtime/runtime_api.cc#newcode49 extensions/browser/api/runtime/runtime_api.cc:49: constexpr char kNoBackgroundPageError[] = "You do not have a ...
4 years, 7 months ago (2016-05-25 01:55:46 UTC) #20
Devlin
Getting closer! I'd still like to see the api renamed, given there's been no objections. ...
4 years, 7 months ago (2016-05-25 21:53:22 UTC) #21
afakhry
Renamed to restartAfterDelay(). PTAL. https://codereview.chromium.org/1970613003/diff/180001/chrome/test/data/extensions/api_test/runtime/restartOnWatchdog/test.js File chrome/test/data/extensions/api_test/runtime/restartOnWatchdog/test.js (right): https://codereview.chromium.org/1970613003/diff/180001/chrome/test/data/extensions/api_test/runtime/restartOnWatchdog/test.js#newcode19 chrome/test/data/extensions/api_test/runtime/restartOnWatchdog/test.js:19: assertTrue(chrome.runtime.lastError === undefined); On 2016/05/25 ...
4 years, 7 months ago (2016-05-26 00:18:40 UTC) #24
Devlin
https://codereview.chromium.org/1970613003/diff/180001/extensions/browser/api/runtime/runtime_apitest.cc File extensions/browser/api/runtime/runtime_apitest.cc (right): https://codereview.chromium.org/1970613003/diff/180001/extensions/browser/api/runtime/runtime_apitest.cc#newcode241 extensions/browser/api/runtime/runtime_apitest.cc:241: IN_PROC_BROWSER_TEST_F(RestartOnWatchdogApiTest, RestartOnWatchdogTest) { On 2016/05/26 00:18:40, afakhry wrote: > ...
4 years, 6 months ago (2016-05-27 15:26:36 UTC) #25
afakhry
Please take a look. Converted the browser tests to unit tests as requested. https://codereview.chromium.org/1970613003/diff/180001/extensions/browser/api/runtime/runtime_apitest.cc File ...
4 years, 6 months ago (2016-06-01 18:44:18 UTC) #26
Devlin
Looks good! :) A few more small things. https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode67 extensions/browser/api/runtime/restart_after_delay_api_unittest.cc:67: base::RunLoop ...
4 years, 6 months ago (2016-06-01 21:29:15 UTC) #27
afakhry
https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode67 extensions/browser/api/runtime/restart_after_delay_api_unittest.cc:67: base::RunLoop run_loop; On 2016/06/01 21:29:15, Devlin wrote: > Isn't ...
4 years, 6 months ago (2016-06-02 01:43:40 UTC) #28
afakhry
On 2016/06/02 01:43:40, afakhry wrote: > https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc > File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): > > https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode67 > ...
4 years, 6 months ago (2016-06-03 19:57:09 UTC) #29
Devlin
lgtm, thank you for bearing with me. :) https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/test_extensions_browser_client.h File extensions/browser/test_extensions_browser_client.h (right): https://codereview.chromium.org/1970613003/diff/220001/extensions/browser/test_extensions_browser_client.h#newcode136 extensions/browser/test_extensions_browser_client.h:136: user_prefs::TestingPrefServiceSyncable ...
4 years, 6 months ago (2016-06-03 21:26:47 UTC) #30
afakhry
Thank you for your detailed review! pam@chromium.org: Please review changes in chrome/browser/prefs/browser_prefs.cc mpearson@chromium.org: Please review ...
4 years, 6 months ago (2016-06-03 23:06:42 UTC) #32
benwells
lgtm
4 years, 6 months ago (2016-06-06 01:32:52 UTC) #33
Mark P
histograms.xml lgtm
4 years, 6 months ago (2016-06-06 22:50:25 UTC) #34
afakhry
Devlin, I'm afraid I'll have to ask you for one extra review round after I ...
4 years, 6 months ago (2016-06-07 22:47:58 UTC) #35
Devlin
Also, please remove trace references to "watchdog", since it's no longer in the API name, ...
4 years, 6 months ago (2016-06-10 00:34:45 UTC) #36
xiyuan
https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc#newcode451 extensions/browser/api/runtime/runtime_api.cc:451: void RuntimeAPI::OnDeviceShutdown() { On 2016/06/10 00:34:45, Devlin wrote: > ...
4 years, 6 months ago (2016-06-10 16:33:48 UTC) #37
Devlin
https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc#newcode451 extensions/browser/api/runtime/runtime_api.cc:451: void RuntimeAPI::OnDeviceShutdown() { On 2016/06/10 16:33:48, xiyuan wrote: > ...
4 years, 6 months ago (2016-06-10 18:06:18 UTC) #38
afakhry
https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc File extensions/browser/api/runtime/runtime_api.cc (right): https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.cc#newcode451 extensions/browser/api/runtime/runtime_api.cc:451: void RuntimeAPI::OnDeviceShutdown() { On 2016/06/10 00:34:45, Devlin wrote: > ...
4 years, 6 months ago (2016-06-13 14:46:00 UTC) #39
Devlin
I see "done"s, but no new patch set yet? https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.h File extensions/browser/api/runtime/runtime_api.h (left): https://codereview.chromium.org/1970613003/diff/340001/extensions/browser/api/runtime/runtime_api.h#oldcode109 extensions/browser/api/runtime/runtime_api.h:109: ...
4 years, 6 months ago (2016-06-13 15:54:57 UTC) #40
afakhry
Ooops sorry, I forgot to press enter!
4 years, 6 months ago (2016-06-13 16:16:00 UTC) #41
Pam (message me for reviews)
On 2016/06/13 16:16:00, afakhry wrote: > Ooops sorry, I forgot to press enter! chrome/browser/prefs/browser_prefs.cc LGTM
4 years, 6 months ago (2016-06-14 16:03:56 UTC) #42
Devlin
https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode23 extensions/browser/api/runtime/restart_after_delay_api_unittest.cc:23: // Takes ownership of the |real_api_delegate|. comment out of ...
4 years, 6 months ago (2016-06-14 16:27:22 UTC) #43
afakhry
https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode23 extensions/browser/api/runtime/restart_after_delay_api_unittest.cc:23: // Takes ownership of the |real_api_delegate|. On 2016/06/14 16:27:21, ...
4 years, 6 months ago (2016-06-14 18:00:05 UTC) #44
afakhry
On 2016/06/14 18:00:05, afakhry wrote: > https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc > File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): > > https://codereview.chromium.org/1970613003/diff/360001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode23 > ...
4 years, 6 months ago (2016-06-15 17:31:02 UTC) #45
Devlin
lgtm Again, thanks for bearing with me! https://codereview.chromium.org/1970613003/diff/380001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/380001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode109 extensions/browser/api/runtime/restart_after_delay_api_unittest.cc:109: // The ...
4 years, 6 months ago (2016-06-15 19:55:14 UTC) #46
afakhry
No worries. Thank you for the detailed and careful review! https://codereview.chromium.org/1970613003/diff/380001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc File extensions/browser/api/runtime/restart_after_delay_api_unittest.cc (right): https://codereview.chromium.org/1970613003/diff/380001/extensions/browser/api/runtime/restart_after_delay_api_unittest.cc#newcode109 ...
4 years, 6 months ago (2016-06-15 20:46:43 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1970613003/400001
4 years, 6 months ago (2016-06-15 20:48:37 UTC) #50
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years, 6 months ago (2016-06-15 22:16:56 UTC) #52
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-15 22:17:16 UTC) #53
commit-bot: I haz the power
4 years, 6 months ago (2016-06-15 22:20:09 UTC) #55
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/6c1c80d89c29b22117b13760643c7fd1734e2466
Cr-Commit-Position: refs/heads/master@{#400027}

Powered by Google App Engine
This is Rietveld 408576698