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

Unified Diff: chrome/browser/extensions/updater/extension_updater.h

Issue 456063002: ExtensionUpdater: Abstract ExtensionDownloader creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and some cleanup Created 6 years, 4 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/extensions/updater/extension_updater.h
diff --git a/chrome/browser/extensions/updater/extension_updater.h b/chrome/browser/extensions/updater/extension_updater.h
index 4f887b940375114e410976fdcf5d6087f8947489..29faf71a6e1255fe9ade272d0abb185008779f70 100644
--- a/chrome/browser/extensions/updater/extension_updater.h
+++ b/chrome/browser/extensions/updater/extension_updater.h
@@ -20,12 +20,12 @@
#include "base/scoped_observer.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "chrome/browser/extensions/updater/extension_downloader.h"
#include "chrome/browser/extensions/updater/extension_downloader_delegate.h"
#include "chrome/browser/extensions/updater/manifest_fetch_data.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/extension_registry_observer.h"
-#include "google_apis/gaia/identity_provider.h"
#include "url/gurl.h"
class ExtensionServiceInterface;
@@ -39,7 +39,6 @@ class BrowserContext;
namespace extensions {
class ExtensionCache;
-class ExtensionDownloader;
class ExtensionPrefs;
class ExtensionRegistry;
class ExtensionSet;
@@ -51,7 +50,8 @@ class ExtensionUpdaterTest;
// extension_prefs,
// pref_service,
// profile,
-// update_frequency_secs);
+// update_frequency_secs,
+// downloader_factory);
// updater->Start();
// ....
// updater->Stop();
@@ -89,7 +89,7 @@ class ExtensionUpdater : public ExtensionDownloaderDelegate,
Profile* profile,
int frequency_seconds,
ExtensionCache* cache,
- scoped_ptr<IdentityProvider> identity_provider);
+ const ExtensionDownloader::Factory& downloader_factory);
virtual ~ExtensionUpdater();
@@ -157,6 +157,10 @@ class ExtensionUpdater : public ExtensionDownloaderDelegate,
struct ThrottleInfo;
+ // Ensure that we have a valid ExtensionDownloader instance referenced by
+ // |downloader|.
+ void EnsureDownloaderCreated();
+
// Computes when to schedule the first update check.
base::TimeDelta DetermineFirstCheckDelay();
@@ -240,6 +244,10 @@ class ExtensionUpdater : public ExtensionDownloaderDelegate,
// Pointer back to the service that owns this ExtensionUpdater.
ExtensionServiceInterface* service_;
+ // A closure passed into the ExtensionUpdater to teach it how to construct
+ // new ExtensionDownloader instances.
+ const ExtensionDownloader::Factory downloader_factory_;
+
// Fetches the crx files for the extensions that have an available update.
scoped_ptr<ExtensionDownloader> downloader_;
@@ -272,9 +280,6 @@ class ExtensionUpdater : public ExtensionDownloaderDelegate,
ExtensionCache* extension_cache_;
- // Provided to the ExtensionDownloader to enable OAuth2 support.
- scoped_ptr<IdentityProvider> webstore_identity_provider_;
-
// Keeps track of when an extension tried to update itself, so we can throttle
// checks to prevent too many requests from being made.
std::map<std::string, ThrottleInfo> throttle_info_;
« no previous file with comments | « chrome/browser/extensions/updater/extension_downloader.cc ('k') | chrome/browser/extensions/updater/extension_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698