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

Unified Diff: chrome/browser/service_process/service_process_control.h

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Clean up code Created 3 years, 6 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
Index: chrome/browser/service_process/service_process_control.h
diff --git a/chrome/browser/service_process/service_process_control.h b/chrome/browser/service_process/service_process_control.h
index 80210d0a64945793fb7200634191d5324074001e..181371604addb8f1d4faaee4d081c9e3fd26220b 100644
--- a/chrome/browser/service_process/service_process_control.h
+++ b/chrome/browser/service_process/service_process_control.h
@@ -20,8 +20,7 @@
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "build/build_config.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "chrome/browser/upgrade_observer.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
@@ -52,7 +51,7 @@ class PeerConnection;
// talks to the IPC channel on the IO thread.
class ServiceProcessControl : public IPC::Sender,
public IPC::Listener,
- public content::NotificationObserver {
+ public UpgradeObserver {
public:
enum ServiceProcessEvent {
SERVICE_EVENT_INITIALIZE,
@@ -114,10 +113,8 @@ class ServiceProcessControl : public IPC::Sender,
// IPC::Sender implementation
bool Send(IPC::Message* message) override;
- // content::NotificationObserver implementation.
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ // UpgradeObserver implementation.
+ void OnUpgradeRecommended() override;
// Send a shutdown message to the service process. IPC channel will be
// destroyed after calling this method.
@@ -241,11 +238,12 @@ class ServiceProcessControl : public IPC::Sender,
// the service process.
base::Closure histograms_callback_;
- content::NotificationRegistrar registrar_;
-
// Callback that gets invoked if service didn't reply in time.
base::CancelableClosure histograms_timeout_callback_;
+ // Whether to start listening to upgrade detector.
+ bool enable_upgrade_observer_;
+
base::WeakPtrFactory<ServiceProcessControl> weak_factory_;
};
sky 2017/06/08 18:09:52 DISALLOW... (while you are here).
weidongg 2017/06/08 18:58:07 https://engdoc.corp.google.com/eng/doc/devguide/cp
sky 2017/06/08 21:28:00 See chromium-dev discussions. I don't see this cod
weidongg 2017/06/08 22:18:25 Added. Thanks.

Powered by Google App Engine
This is Rietveld 408576698