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

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

Issue 653623002: Revert "Move ExtensionCache to //extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable AutoEnrollmentClientTest.* and DeviceLocalAccountExternalPolicyLoaderTest.CacheNotStarted te… Created 6 years, 2 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_cache.h
diff --git a/extensions/browser/updater/extension_cache.h b/chrome/browser/extensions/updater/extension_cache.h
similarity index 82%
rename from extensions/browser/updater/extension_cache.h
rename to chrome/browser/extensions/updater/extension_cache.h
index f6bdb02ca554f6e9b60cbf6118029ee6348786c5..edcc1fa3d3ec91f75993859578c0f9f6f8b11100 100644
--- a/extensions/browser/updater/extension_cache.h
+++ b/chrome/browser/extensions/updater/extension_cache.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef EXTENSIONS_BROWSER_UPDATER_EXTENSION_CACHE_H_
-#define EXTENSIONS_BROWSER_UPDATER_EXTENSION_CACHE_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_CACHE_H_
+#define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_CACHE_H_
#include <string>
@@ -16,13 +16,13 @@ namespace extensions {
// between multiple users and profiles on the machine.
class ExtensionCache {
public:
+ // Return global singleton instance of ExtensionCache.
+ static ExtensionCache* GetInstance();
+
// Callback that is invoked when the file placed when PutExtension done.
typedef base::Callback<void(const base::FilePath& file_path,
bool file_ownership_passed)> PutExtensionCallback;
- ExtensionCache() {}
- virtual ~ExtensionCache() {}
-
// Initialize cache in background. The |callback| is called when cache ready.
// Can be called multiple times. The |callback| can be called immediately if
// cache is ready.
@@ -54,10 +54,14 @@ class ExtensionCache {
const std::string& version,
const PutExtensionCallback& callback) = 0;
- private:
- DISALLOW_COPY_AND_ASSIGN(ExtensionCache);
+ protected:
+ virtual ~ExtensionCache() {}
+
+ // Sets the singleton to the given |cache|. Returns the previous value of
+ // the singleton. Ownership is not transferred.
+ static ExtensionCache* SetForTesting(ExtensionCache* cache);
};
} // namespace extensions
-#endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_CACHE_H_
+#endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_CACHE_H_
« no previous file with comments | « chrome/browser/extensions/external_provider_impl_unittest.cc ('k') | chrome/browser/extensions/updater/extension_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698