summaryrefslogtreecommitdiffstats
path: root/components/component_updater/component_updater_service.h
diff options
context:
space:
mode:
authorsorin <sorin@chromium.org>2015-04-17 10:15:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-17 17:15:46 +0000
commit9797abaa5b60464ee061ef0b55237e6f7a13d3dd (patch)
treecf43abf0ef5720ec2390f9dbe967145a1fed2a5b /components/component_updater/component_updater_service.h
parent18131163ea9d46318299081666150a2c26442009 (diff)
downloadchromium_src-9797abaa5b60464ee061ef0b55237e6f7a13d3dd.zip
chromium_src-9797abaa5b60464ee061ef0b55237e6f7a13d3dd.tar.gz
chromium_src-9797abaa5b60464ee061ef0b55237e6f7a13d3dd.tar.bz2
Implement common code for component and extension updaters.
The changes not under update_client are mechanical. This change creates a working UpdateClient updater client, which can be reused by both component and extension updaters. This code is not hooked up yet with any of the updaters above. Those changes will be committed in the near future by other CLs. R=waffles,erikwright,agl,dgarrett,jhawkins,brettw BUG=450337 Committed: https://crrev.com/ba6742df55de47568e3aa438378d844a7439c391 Cr-Commit-Position: refs/heads/master@{#325006} Review URL: https://codereview.chromium.org/1055903003 Cr-Commit-Position: refs/heads/master@{#325658}
Diffstat (limited to 'components/component_updater/component_updater_service.h')
-rw-r--r--components/component_updater/component_updater_service.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/components/component_updater/component_updater_service.h b/components/component_updater/component_updater_service.h
index ac60a7f..450508a 100644
--- a/components/component_updater/component_updater_service.h
+++ b/components/component_updater/component_updater_service.h
@@ -6,12 +6,14 @@
#define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_
#include <stdint.h>
+
#include <string>
#include <vector>
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/version.h"
#include "url/gurl.h"
@@ -61,14 +63,14 @@ class OnDemandUpdater;
// All methods are safe to call ONLY from the browser's main thread.
class ComponentUpdateService {
public:
- enum Status { kOk, kReplaced, kInProgress, kError };
+ enum class Status { kOk, kReplaced, kInProgress, kError };
// Defines an interface to observe ComponentUpdateService. It provides
// notifications when state changes occur for the service or for the
// registered components.
class Observer {
public:
- enum Events {
+ enum class Events {
// Sent when the component updater starts doing update checks.
COMPONENT_UPDATER_STARTED,
@@ -169,7 +171,7 @@ class ComponentUpdateService {
friend class ::ComponentsUI;
};
-typedef ComponentUpdateService::Observer ServiceObserver;
+using ServiceObserver = ComponentUpdateService::Observer;
class OnDemandUpdater {
public:
@@ -190,10 +192,9 @@ class OnDemandUpdater {
const std::string& component_id) = 0;
};
-// Creates the component updater. You must pass a valid |config| allocated on
-// the heap which the component updater will own.
-ComponentUpdateService* ComponentUpdateServiceFactory(
- update_client::Configurator* config);
+// Creates the component updater.
+scoped_ptr<ComponentUpdateService> ComponentUpdateServiceFactory(
+ const scoped_refptr<update_client::Configurator>& config);
} // namespace component_updater