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

Side by Side Diff: chrome/browser/extensions/settings/syncable_settings_storage.h

Issue 9284013: Extension Storage API: expose storage quota information to extensions, via: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with use-after-free fixed Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/observer_list_threadsafe.h" 11 #include "base/observer_list_threadsafe.h"
(...skipping 12 matching lines...) Expand all
24 explicit SyncableSettingsStorage( 24 explicit SyncableSettingsStorage(
25 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& 25 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >&
26 observers, 26 observers,
27 const std::string& extension_id, 27 const std::string& extension_id,
28 // Ownership taken. 28 // Ownership taken.
29 SettingsStorage* delegate); 29 SettingsStorage* delegate);
30 30
31 virtual ~SyncableSettingsStorage(); 31 virtual ~SyncableSettingsStorage();
32 32
33 // SettingsStorage implementation. 33 // SettingsStorage implementation.
34 virtual size_t GetBytesInUse(const std::string& key) OVERRIDE;
35 virtual size_t GetBytesInUse(const std::vector<std::string>& keys) OVERRIDE;
36 virtual size_t GetBytesInUse() OVERRIDE;
34 virtual ReadResult Get(const std::string& key) OVERRIDE; 37 virtual ReadResult Get(const std::string& key) OVERRIDE;
35 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; 38 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE;
36 virtual ReadResult Get() OVERRIDE; 39 virtual ReadResult Get() OVERRIDE;
37 virtual WriteResult Set( 40 virtual WriteResult Set(
38 WriteOptions options, 41 WriteOptions options,
39 const std::string& key, 42 const std::string& key,
40 const Value& value) OVERRIDE; 43 const Value& value) OVERRIDE;
41 virtual WriteResult Set( 44 virtual WriteResult Set(
42 WriteOptions options, const DictionaryValue& values) OVERRIDE; 45 WriteOptions options, const DictionaryValue& values) OVERRIDE;
43 virtual WriteResult Remove(const std::string& key) OVERRIDE; 46 virtual WriteResult Remove(const std::string& key) OVERRIDE;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Keys of the settings that are currently being synced. Only used to decide 116 // Keys of the settings that are currently being synced. Only used to decide
114 // whether an ACTION_ADD or ACTION_UPDATE should be sent to sync on a Set(). 117 // whether an ACTION_ADD or ACTION_UPDATE should be sent to sync on a Set().
115 std::set<std::string> synced_keys_; 118 std::set<std::string> synced_keys_;
116 119
117 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage); 120 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage);
118 }; 121 };
119 122
120 } // namespace extensions 123 } // namespace extensions
121 124
122 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ 125 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698