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

Side by Side Diff: chrome/browser/extensions/settings/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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 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_SETTINGS_STORAGE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_H_
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 enum WriteOptions { 93 enum WriteOptions {
94 // Callers should usually use this. 94 // Callers should usually use this.
95 DEFAULTS, 95 DEFAULTS,
96 96
97 // Ignore any quota restrictions. 97 // Ignore any quota restrictions.
98 IGNORE_QUOTA, 98 IGNORE_QUOTA,
99 }; 99 };
100 100
101 virtual ~SettingsStorage() {} 101 virtual ~SettingsStorage() {}
102 102
103 // Gets the amount of space being used by a single value, in bytes.
104 virtual size_t GetBytesInUse(const std::string& key) = 0;
105
106 // Gets the total amount of space being used by multiple values, in bytes.
107 virtual size_t GetBytesInUse(const std::vector<std::string>& keys) = 0;
108
109 // Gets the total amount of space being used by this storage area, in bytes.
110 virtual size_t GetBytesInUse() = 0;
111
103 // Gets a single value from storage. 112 // Gets a single value from storage.
104 virtual ReadResult Get(const std::string& key) = 0; 113 virtual ReadResult Get(const std::string& key) = 0;
105 114
106 // Gets multiple values from storage. 115 // Gets multiple values from storage.
107 virtual ReadResult Get(const std::vector<std::string>& keys) = 0; 116 virtual ReadResult Get(const std::vector<std::string>& keys) = 0;
108 117
109 // Gets all values from storage. 118 // Gets all values from storage.
110 virtual ReadResult Get() = 0; 119 virtual ReadResult Get() = 0;
111 120
112 // Sets a single key to a new value. 121 // Sets a single key to a new value.
(...skipping 10 matching lines...) Expand all
123 // Removes multiple keys from the storage. 132 // Removes multiple keys from the storage.
124 virtual WriteResult Remove(const std::vector<std::string>& keys) = 0; 133 virtual WriteResult Remove(const std::vector<std::string>& keys) = 0;
125 134
126 // Clears the storage. 135 // Clears the storage.
127 virtual WriteResult Clear() = 0; 136 virtual WriteResult Clear() = 0;
128 }; 137 };
129 138
130 } // namespace extensions 139 } // namespace extensions
131 140
132 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_H_ 141 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698