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

Unified Diff: content/renderer/dom_storage/local_storage_cached_areas.cc

Issue 1745603002: Switch LevelDBWrapper::GetAll to use the new Mojo sync IPC mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 4 years, 10 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: content/renderer/dom_storage/local_storage_cached_areas.cc
diff --git a/content/renderer/dom_storage/local_storage_cached_areas.cc b/content/renderer/dom_storage/local_storage_cached_areas.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5918e5aa2cf1ff864efb1e667525552cd9cee99f
--- /dev/null
+++ b/content/renderer/dom_storage/local_storage_cached_areas.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/dom_storage/local_storage_cached_areas.h"
+
+#include "content/renderer/dom_storage/local_storage_cached_area.h"
+
+namespace content {
+
+LocalStorageCachedAreas::LocalStorageCachedAreas(
+ StoragePartitionService* storage_partition_service)
+ : storage_partition_service_(storage_partition_service) {
+}
+
+LocalStorageCachedAreas::~LocalStorageCachedAreas() {
+}
+
+scoped_refptr<LocalStorageCachedArea>
+LocalStorageCachedAreas::GetLocalStorageCachedArea(
+ const url::Origin& origin) {
+ if (cached_areas_.find(origin) == cached_areas_.end()) {
+ cached_areas_[origin] = new LocalStorageCachedArea(
+ origin, storage_partition_service_, this);
+ }
+
+ return make_scoped_refptr(cached_areas_[origin]);
+}
+
+void LocalStorageCachedAreas::LocalStorageCacheAreaClosed(
+ LocalStorageCachedArea* cached_area) {
+ DCHECK(cached_areas_.find(cached_area->origin()) != cached_areas_.end());
+ cached_areas_.erase(cached_area->origin());
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/dom_storage/local_storage_cached_areas.h ('k') | content/renderer/dom_storage/local_storage_namespace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698