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

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

Issue 2611843004: Implement throttling behavior for LocalStorage mojo messages.
Patch Set: Created 3 years, 11 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_ 5 #ifndef CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_
6 #define CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_ 6 #define CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Common helper for KeyAdded() and KeyChanged() 80 // Common helper for KeyAdded() and KeyChanged()
81 void KeyAddedOrChanged(const std::vector<uint8_t>& key, 81 void KeyAddedOrChanged(const std::vector<uint8_t>& key,
82 const std::vector<uint8_t>& new_value, 82 const std::vector<uint8_t>& new_value,
83 const base::NullableString16& old_value, 83 const base::NullableString16& old_value,
84 const std::string& source); 84 const std::string& source);
85 85
86 // Synchronously fetches the origin's local storage data if it hasn't been 86 // Synchronously fetches the origin's local storage data if it hasn't been
87 // fetched already. 87 // fetched already.
88 void EnsureLoaded(); 88 void EnsureLoaded();
89 89
90 void FlushIfNeeded();
91
90 void OnSetItemComplete(const base::string16& key, bool success); 92 void OnSetItemComplete(const base::string16& key, bool success);
91 void OnRemoveItemComplete(const base::string16& key, bool success); 93 void OnRemoveItemComplete(const base::string16& key, bool success);
92 void OnClearComplete(bool success); 94 void OnClearComplete(bool success);
93 void OnGetAllComplete(bool success); 95 void OnGetAllComplete(bool success);
94 96
95 // Resets the object back to its newly constructed state. 97 // Resets the object back to its newly constructed state.
96 void Reset(); 98 void Reset();
97 99
98 url::Origin origin_; 100 url::Origin origin_;
99 scoped_refptr<DOMStorageMap> map_; 101 scoped_refptr<DOMStorageMap> map_;
100 std::map<base::string16, int> ignore_key_mutations_; 102 std::map<base::string16, int> ignore_key_mutations_;
101 bool ignore_all_mutations_ = false; 103 bool ignore_all_mutations_ = false;
102 mojom::LevelDBWrapperPtr leveldb_; 104 mojom::LevelDBWrapperPtr leveldb_;
103 mojo::AssociatedBinding<mojom::LevelDBObserver> binding_; 105 mojo::AssociatedBinding<mojom::LevelDBObserver> binding_;
104 LocalStorageCachedAreas* cached_areas_; 106 LocalStorageCachedAreas* cached_areas_;
105 std::map<std::string, LocalStorageArea*> areas_; 107 std::map<std::string, LocalStorageArea*> areas_;
106 base::WeakPtrFactory<LocalStorageCachedArea> weak_factory_; 108 base::WeakPtrFactory<LocalStorageCachedArea> weak_factory_;
107 109
108 DISALLOW_COPY_AND_ASSIGN(LocalStorageCachedArea); 110 DISALLOW_COPY_AND_ASSIGN(LocalStorageCachedArea);
109 }; 111 };
110 112
111 } // namespace content 113 } // namespace content
112 114
113 #endif // CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_ 115 #endif // CONTENT_RENDERER_DOM_STORAGE_LOCAL_STORAGE_CACHED_AREA_H_
OLDNEW
« no previous file with comments | « content/common/leveldb_wrapper.mojom ('k') | content/renderer/dom_storage/local_storage_cached_area.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698