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

Issue 10875027: Restart running apps when chrome restarts. (Closed)

Created:
8 years, 4 months ago by koz (OOO until 15th September)
Modified:
8 years, 2 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, marja+watch_chromium.org, benwells
Visibility:
Public.

Description

Restart running apps when chrome restarts. This adds the event chrome.app.runtime.onRestarted, which apps can use to restore their state after a restart. BUG=138676 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=156659 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=161827

Patch Set 1 #

Total comments: 10

Patch Set 2 : fix indenting #

Patch Set 3 : respond to comments #

Total comments: 12

Patch Set 4 : respond to comments #

Patch Set 5 : split out app restore into its own class #

Patch Set 6 : only restore apps on restart #

Total comments: 1

Patch Set 7 : change to use preferences as the backend #

Patch Set 8 : clear kAppsRunningAtShutdown preference on restore #

Patch Set 9 : typo #

Total comments: 12

Patch Set 10 : respond to comments, rebase #

Patch Set 11 : respond to comments, rebase #

Patch Set 12 : respond to comments, rebase #

Total comments: 6

Patch Set 13 : respond to comments #

Total comments: 14

Patch Set 14 : respond to comments #

Total comments: 6

Patch Set 15 : respond to comments #

Patch Set 16 : fix compile error #

Patch Set 17 : rebase #

Patch Set 18 : move RestoreApps call later, after ExtensionSystem has been initialised #

Patch Set 19 : remove old #includes #

Patch Set 20 : move RestoreApps call further down ChromeBrowserMain #

Patch Set 21 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -3 lines) Patch
M chrome/browser/extensions/api/app_runtime/app_runtime_api.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/app_runtime/app_runtime_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -0 lines 0 comments Download
A chrome/browser/extensions/app_restore_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +46 lines, -0 lines 0 comments Download
A chrome/browser/extensions/app_restore_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +97 lines, -0 lines 0 comments Download
A chrome/browser/extensions/app_restore_service_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +42 lines, -0 lines 0 comments Download
chrome/browser/extensions/app_restore_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 18 19 20 1 chunk +48 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_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 +18 lines, -0 lines 0 comments Download
M chrome/browser/extensions/platform_app_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +36 lines, -0 lines 0 comments Download
M chrome/browser/extensions/platform_app_browsertest_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.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
M chrome/browser/ui/startup/startup_browser_creator_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/app_runtime.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/restart_test/manifest.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -1 line 0 comments Download
A + chrome/test/data/extensions/platform_apps/restart_test/test.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
koz (OOO until 15th September)
8 years, 4 months ago (2012-08-23 06:01:15 UTC) #1
benwells
Quick comments from someone unwise in the way of session restore - would it make ...
8 years, 4 months ago (2012-08-23 06:54:53 UTC) #2
koz (OOO until 15th September)
Changed reviewer to sky, who I think knows about session restore stuff.
8 years, 4 months ago (2012-08-23 07:27:18 UTC) #3
koz (OOO until 15th September)
https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc File chrome/browser/sessions/session_restore.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc#newcode743 chrome/browser/sessions/session_restore.cc:743: extensions::AppEventRouter::DispatchOnRestartEvent(profile_, extension); On 2012/08/23 06:54:53, benwells wrote: > Indenting ...
8 years, 4 months ago (2012-08-23 07:30:12 UTC) #4
marja
Drive-by: https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc File chrome/browser/sessions/session_restore.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc#newcode738 chrome/browser/sessions/session_restore.cc:738: for (std::set<std::string>::const_iterator it = apps->begin(); Is there a ...
8 years, 4 months ago (2012-08-23 07:31:18 UTC) #5
koz (OOO until 15th September)
Thanks marja! https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc File chrome/browser/sessions/session_restore.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/1/chrome/browser/sessions/session_restore.cc#newcode738 chrome/browser/sessions/session_restore.cc:738: for (std::set<std::string>::const_iterator it = apps->begin(); On 2012/08/23 ...
8 years, 4 months ago (2012-08-23 07:59:04 UTC) #6
sky
I'm not sure this is going to work correctly. In particular when you close the ...
8 years, 4 months ago (2012-08-23 16:23:52 UTC) #7
koz (OOO until 15th September)
On 2012/08/23 16:23:52, sky wrote: > I'm not sure this is going to work correctly. ...
8 years, 4 months ago (2012-08-24 02:08:35 UTC) #8
koz (OOO until 15th September)
https://chromiumcodereview.appspot.com/10875027/diff/8001/chrome/browser/sessions/session_restore.cc File chrome/browser/sessions/session_restore.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/8001/chrome/browser/sessions/session_restore.cc#newcode1056 chrome/browser/sessions/session_restore.cc:1056: std::set<std::string> apps_; On 2012/08/23 16:23:52, sky wrote: > newline ...
8 years, 4 months ago (2012-08-24 02:08:57 UTC) #9
sky
On Thu, Aug 23, 2012 at 7:08 PM, <koz@chromium.org> wrote: > On 2012/08/23 16:23:52, sky ...
8 years, 4 months ago (2012-08-24 17:16:58 UTC) #10
sky
On Thu, Aug 23, 2012 at 7:08 PM, <koz@chromium.org> wrote: > > https://chromiumcodereview.appspot.com/10875027/diff/8001/chrome/browser/sessions/session_restore.cc > File ...
8 years, 4 months ago (2012-08-24 17:17:24 UTC) #11
koz (OOO until 15th September)
On 2012/08/24 17:16:58, sky wrote: > On Thu, Aug 23, 2012 at 7:08 PM, <mailto:koz@chromium.org> ...
8 years, 3 months ago (2012-08-27 08:43:41 UTC) #12
koz (OOO until 15th September)
On 2012/08/24 17:17:24, sky wrote: > On Thu, Aug 23, 2012 at 7:08 PM, <mailto:koz@chromium.org> ...
8 years, 3 months ago (2012-08-27 08:46:10 UTC) #13
koz (OOO until 15th September)
I've made a new class AppRestoreService which maintains the list of running apps separately to ...
8 years, 3 months ago (2012-08-28 05:47:29 UTC) #14
sky
https://chromiumcodereview.appspot.com/10875027/diff/13001/chrome/browser/sessions/app_restore_service.h File chrome/browser/sessions/app_restore_service.h (right): https://chromiumcodereview.appspot.com/10875027/diff/13001/chrome/browser/sessions/app_restore_service.h#newcode24 chrome/browser/sessions/app_restore_service.h:24: class AppRestoreService : public BaseSessionService, The list of apps ...
8 years, 3 months ago (2012-08-28 16:56:12 UTC) #15
Mihai Parparita -not on Chrome
On Tue, Aug 28, 2012 at 9:56 AM, <sky@chromium.org> wrote: > The list of apps ...
8 years, 3 months ago (2012-08-28 17:47:11 UTC) #16
koz (OOO until 15th September)
I opted to store the list in preferences, just so we don't need to iterate ...
8 years, 3 months ago (2012-08-29 09:27:14 UTC) #17
koz (OOO until 15th September)
On 2012/08/29 09:27:14, koz wrote: > I opted to store the list in preferences, just ...
8 years, 3 months ago (2012-09-02 23:34:46 UTC) #18
Mihai Parparita -not on Chrome
https://chromiumcodereview.appspot.com/10875027/diff/18018/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc File chrome/browser/extensions/api/app_runtime/app_runtime_api.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/18018/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc#newcode36 chrome/browser/extensions/api/app_runtime/app_runtime_api.cc:36: void AppEventRouter::DispatchOnRestartEvent( Nit: should be called DispatchOnRestartedEvent. https://chromiumcodereview.appspot.com/10875027/diff/18018/chrome/browser/sessions/app_restore_service.h File ...
8 years, 3 months ago (2012-09-04 04:14:48 UTC) #19
koz (OOO until 15th September)
https://chromiumcodereview.appspot.com/10875027/diff/18018/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc File chrome/browser/extensions/api/app_runtime/app_runtime_api.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/18018/chrome/browser/extensions/api/app_runtime/app_runtime_api.cc#newcode36 chrome/browser/extensions/api/app_runtime/app_runtime_api.cc:36: void AppEventRouter::DispatchOnRestartEvent( On 2012/09/04 04:14:48, Mihai Parparita wrote: > ...
8 years, 3 months ago (2012-09-04 07:10:20 UTC) #20
sky
LGTM
8 years, 3 months ago (2012-09-04 15:37:42 UTC) #21
Mihai Parparita -not on Chrome
https://chromiumcodereview.appspot.com/10875027/diff/23017/chrome/browser/extensions/app_restore_service.cc File chrome/browser/extensions/app_restore_service.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/23017/chrome/browser/extensions/app_restore_service.cc#newcode36 chrome/browser/extensions/app_restore_service.cc:36: profile_->GetPrefs()->GetUserPrefValue(prefs::kAppsRunningAtShutdown); Is there a reason why this pref isn't ...
8 years, 3 months ago (2012-09-04 17:47:14 UTC) #22
koz (OOO until 15th September)
Cheers, Mihai. https://chromiumcodereview.appspot.com/10875027/diff/23017/chrome/browser/extensions/app_restore_service.cc File chrome/browser/extensions/app_restore_service.cc (right): https://chromiumcodereview.appspot.com/10875027/diff/23017/chrome/browser/extensions/app_restore_service.cc#newcode36 chrome/browser/extensions/app_restore_service.cc:36: profile_->GetPrefs()->GetUserPrefValue(prefs::kAppsRunningAtShutdown); On 2012/09/04 17:47:14, Mihai Parparita wrote: ...
8 years, 3 months ago (2012-09-05 06:21:33 UTC) #23
Mihai Parparita -not on Chrome
It should be possible to test these, now that we have the PRE_ mechanism for ...
8 years, 3 months ago (2012-09-05 20:54:06 UTC) #24
koz (OOO until 15th September)
I would have uploaded a better test than the one here, but when I simulate ...
8 years, 3 months ago (2012-09-06 07:50:43 UTC) #25
Mihai Parparita -not on Chrome
LGTM What kind of crash were you getting in the test? https://chromiumcodereview.appspot.com/10875027/diff/32002/chrome/browser/extensions/app_restore_service.cc File chrome/browser/extensions/app_restore_service.cc (right): ...
8 years, 3 months ago (2012-09-06 23:07:09 UTC) #26
koz (OOO until 15th September)
The exception looked like this: ASSERTION FAILED: m_key != PTHREAD_KEYS_MAX ../../third_party/WebKit/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp(65) : static WTF::ThreadIdentifier WTF::ThreadIdentifierData::identifier() ...
8 years, 3 months ago (2012-09-10 04:51:57 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/koz@chromium.org/10875027/34011
8 years, 3 months ago (2012-09-10 04:53:27 UTC) #28
commit-bot: I haz the power
Try job failure for 10875027-34011 (retry) on mac for step "compile" (clobber build). It's a ...
8 years, 3 months ago (2012-09-10 05:15:28 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/koz@chromium.org/10875027/32022
8 years, 3 months ago (2012-09-10 06:22:14 UTC) #30
commit-bot: I haz the power
Try job failure for 10875027-32022 (retry) on linux_rel for step "interactive_ui_tests". It's a second try, ...
8 years, 3 months ago (2012-09-10 08:17:50 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/koz@chromium.org/10875027/30002
8 years, 3 months ago (2012-09-13 20:44:03 UTC) #32
commit-bot: I haz the power
Change committed as 156659
8 years, 3 months ago (2012-09-13 22:38:28 UTC) #33
koz (OOO until 15th September)
Scott, As discussed I've moved the call to RestoreApps() further down in ChromeBrowserMain, after PostBrowserStart(). ...
8 years, 3 months ago (2012-09-19 04:10:38 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/koz@chromium.org/10875027/44001
8 years, 2 months ago (2012-10-15 03:34:09 UTC) #35
commit-bot: I haz the power
8 years, 2 months ago (2012-10-15 05:47:56 UTC) #36
Change committed as 161827

Powered by Google App Engine
This is Rietveld 408576698