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

Side by Side Diff: content/renderer/dom_storage/local_storage_cached_areas.h

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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREAS_H_
6 #define CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREAS_H_
7
8 #include <map>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "url/origin.h"
13
14 namespace content {
15 class LocalStorageCachedArea;
16 class StoragePartitionService;
17
18 // Owns all the LocalStorageCachedArea objects in a renderer. This is needed
19 // because we can have n LocalStorageArea objects for the same origin but we
20 // want just one LocalStorageCachedArea to service them (no point in having
21 // multiple caches of the same data in the same process).
22 class LocalStorageCachedAreas {
23 public:
24 explicit LocalStorageCachedAreas(
25 StoragePartitionService* storage_partition_service);
26 ~LocalStorageCachedAreas();
27
28 scoped_refptr<LocalStorageCachedArea> GetLocalStorageCachedArea(
29 const url::Origin& origin);
30
31 // Called by LocalStorageCachedArea on destruction.
32 void LocalStorageCacheAreaClosed(LocalStorageCachedArea* cached_area);
33
34 private:
35 StoragePartitionService* const storage_partition_service_;
36
37 // Maps from an origin to its LocalStorageCachedArea object. The object owns
38 // itself.
39 std::map<url::Origin, LocalStorageCachedArea*> cached_areas_;
40
41 DISALLOW_COPY_AND_ASSIGN(LocalStorageCachedAreas);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREAS_H_
OLDNEW
« no previous file with comments | « content/renderer/dom_storage/local_storage_cached_area.cc ('k') | content/renderer/dom_storage/local_storage_cached_areas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698