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

Unified Diff: apps/app_keep_alive_service.cc

Issue 60193005: Don't add keep-alives for apps after the app keep-alive service has shut down. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_keep_alive_service.h ('k') | apps/app_keep_alive_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_keep_alive_service.cc
diff --git a/apps/app_keep_alive_service.cc b/apps/app_keep_alive_service.cc
index 825e0bb3f213e672fa67b81bc248f6bffeb95c45..73bd63acf390d84bed655192a3f355e3949edb8e 100644
--- a/apps/app_keep_alive_service.cc
+++ b/apps/app_keep_alive_service.cc
@@ -13,7 +13,7 @@
namespace apps {
AppKeepAliveService::AppKeepAliveService(content::BrowserContext* context)
- : context_(context) {
+ : context_(context), shut_down_(false) {
AppLifetimeMonitor* app_lifetime_monitor =
AppLifetimeMonitorFactory::GetForProfile(static_cast<Profile*>(context));
app_lifetime_monitor->AddObserver(this);
@@ -30,7 +30,7 @@ void AppKeepAliveService::Shutdown() {
void AppKeepAliveService::OnAppStart(Profile* profile,
const std::string& app_id) {
- if (profile != context_)
+ if (profile != context_ || shut_down_)
return;
if (running_apps_.insert(app_id).second)
@@ -53,6 +53,7 @@ void AppKeepAliveService::OnAppDeactivated(Profile* profile,
const std::string& app_id) {}
void AppKeepAliveService::OnChromeTerminating() {
+ shut_down_ = true;
size_t keep_alives = running_apps_.size();
running_apps_.clear();
« no previous file with comments | « apps/app_keep_alive_service.h ('k') | apps/app_keep_alive_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698