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

Unified Diff: content/browser/service_worker/service_worker_cache_storage_manager.h

Issue 1020413002: Use "database identifier" rather than raw origin as directory hash input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure we're not keeping an object reference around Created 5 years, 9 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_storage_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_cache_storage_manager.h
diff --git a/content/browser/service_worker/service_worker_cache_storage_manager.h b/content/browser/service_worker/service_worker_cache_storage_manager.h
index a3e2e2bef21f15b6d9f2d07f2a102b15876bf2f7..b43c35f1f8108f8b0a4e1e09ffb5448cf9b7bea7 100644
--- a/content/browser/service_worker/service_worker_cache_storage_manager.h
+++ b/content/browser/service_worker/service_worker_cache_storage_manager.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/gtest_prod_util.h"
#include "content/browser/service_worker/service_worker_cache_storage.h"
#include "content/common/content_export.h"
#include "storage/browser/quota/quota_client.h"
@@ -31,7 +32,6 @@ class QuotaManagerProxy;
namespace content {
class ServiceWorkerCacheQuotaClient;
-class ServiceWorkerCacheStorageManagerTest;
// Keeps track of a ServiceWorkerCacheStorage per origin. There is one
// ServiceWorkerCacheStorageManager per ServiceWorkerContextCore.
@@ -87,6 +87,7 @@ class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
private:
friend class ServiceWorkerCacheQuotaClient;
friend class ServiceWorkerCacheStorageManagerTest;
+ friend class ServiceWorkerCacheStorageMigrationTest;
typedef std::map<GURL, ServiceWorkerCacheStorage*>
ServiceWorkerCacheStorageMap;
@@ -129,6 +130,21 @@ class CONTENT_EXPORT ServiceWorkerCacheStorageManager {
bool IsMemoryBacked() const { return root_path_.empty(); }
+ // Map a origin to the path. Exposed for testing.
+ static base::FilePath ConstructLegacyOriginPath(
+ const base::FilePath& root_path,
+ const GURL& origin);
+ // Map a database identifier (computed from an origin) to the path. Exposed
+ // for testing.
+ static base::FilePath ConstructOriginPath(const base::FilePath& root_path,
+ const GURL& origin);
+
+ // Migrate from old origin-based path to storage identifier-based path.
+ // TODO(jsbell); Remove method and all calls after a few releases.
+ void MigrateOrigin(const GURL& origin);
+ static void MigrateOriginOnTaskRunner(const base::FilePath& old_path,
+ const base::FilePath& new_path);
+
base::FilePath root_path_;
scoped_refptr<base::SequencedTaskRunner> cache_task_runner_;
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_storage_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698