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

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

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN 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..d68016278a1d6c7f4ead89f48e362d4371187fc4 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,12 +238,15 @@ 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_;
+ // If true changes to UpgradeObserver are applied, if false they are ignored.
+ bool apply_changes_from_upgrade_observer_;
+
base::WeakPtrFactory<ServiceProcessControl> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceProcessControl);
};
#endif // CHROME_BROWSER_SERVICE_PROCESS_SERVICE_PROCESS_CONTROL_H_
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/service_process/service_process_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698