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

Unified Diff: apps/app_keep_alive_service.cc

Issue 172313004: Remove unused AppKeepAliveService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (keep_alive_service) Created 6 years, 10 months 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_factory.h » ('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
deleted file mode 100644
index 6c9bf7befe11eaba112939b5a55875e04d44b929..0000000000000000000000000000000000000000
--- a/apps/app_keep_alive_service.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "apps/app_keep_alive_service.h"
-
-#include "apps/app_lifetime_monitor.h"
-#include "apps/app_lifetime_monitor_factory.h"
-#include "base/message_loop/message_loop.h"
-#include "chrome/browser/lifetime/application_lifetime.h"
-#include "chrome/browser/profiles/profile.h"
-
-namespace apps {
-
-AppKeepAliveService::AppKeepAliveService(content::BrowserContext* context)
- : context_(context), shut_down_(false) {
- AppLifetimeMonitor* app_lifetime_monitor =
- AppLifetimeMonitorFactory::GetForProfile(static_cast<Profile*>(context));
- app_lifetime_monitor->AddObserver(this);
-}
-
-AppKeepAliveService::~AppKeepAliveService() {}
-
-void AppKeepAliveService::Shutdown() {
- AppLifetimeMonitor* app_lifetime_monitor =
- AppLifetimeMonitorFactory::GetForProfile(static_cast<Profile*>(context_));
- app_lifetime_monitor->RemoveObserver(this);
- OnChromeTerminating();
-}
-
-void AppKeepAliveService::OnAppStart(Profile* profile,
- const std::string& app_id) {
- if (profile != context_ || shut_down_)
- return;
-
- if (running_apps_.insert(app_id).second)
- chrome::IncrementKeepAliveCount();
-}
-
-void AppKeepAliveService::OnAppStop(Profile* profile,
- const std::string& app_id) {
- if (profile != context_)
- return;
-
- if (running_apps_.erase(app_id))
- chrome::DecrementKeepAliveCount();
-}
-
-void AppKeepAliveService::OnAppActivated(Profile* profile,
- const std::string& app_id) {}
-
-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();
-
- // In some tests, the message loop isn't running during shutdown and ending
- // the last keep alive in that case CHECKs.
- if (!base::MessageLoop::current() ||
- base::MessageLoop::current()->is_running()) {
- while (keep_alives--)
- chrome::DecrementKeepAliveCount();
- }
-}
-
-} // namespace apps
« no previous file with comments | « apps/app_keep_alive_service.h ('k') | apps/app_keep_alive_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698