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

Unified Diff: chrome/common/extensions/api/storage.json

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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/storage.json
diff --git a/chrome/common/extensions/api/storage.json b/chrome/common/extensions/api/storage.json
index a52e2171aec1ceba0c6de7d35adca4b0c0954dee..63309bb13d5e9bc202cd71c0e20b4753a8629b43 100644
--- a/chrome/common/extensions/api/storage.json
+++ b/chrome/common/extensions/api/storage.json
@@ -19,7 +19,7 @@
}
},
{
- "id": "StorageNamespace",
+ "id": "StorageArea",
"type": "object",
"functions": [
{
@@ -40,7 +40,7 @@
"additionalProperties": { "type": "any" }
}
],
- "description": "A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in null or undefined to get the entire contents of storage; this should only be used for debugging.",
+ "description": "A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in <code>null</code> to get the entire contents of storage.",
"optional": true
},
{
@@ -60,6 +60,35 @@
]
},
{
+ "name": "getBytesInUse",
+ "unprivileged": true,
+ "type": "function",
+ "description": "Gets the amount of space (in bytes) being used by one or more items.",
+ "parameters": [
+ {
+ "name": "keys",
+ "choices": [
+ { "type": "string" },
+ { "type": "array", "items": { "type": "string" } }
+ ],
+ "description": "A single key or list of keys to get the total usage for. An empty list will return 0. Pass in <code>null</code> to get the total usage of all of storage.",
+ "optional": true
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Callback with the amount of space being used by storage, or on failure (in which case lastError will be set).",
+ "parameters": [
+ {
+ "name": "bytesInUse",
+ "type": "integer",
+ "description": "Amount of space being used in storage, in bytes."
+ }
+ ]
+ }
+ ]
+ },
+ {
"name": "set",
"unprivileged": true,
"type": "function",
@@ -146,16 +175,44 @@
],
"properties": {
"sync": {
- "$ref": "StorageNamespace",
+ "$ref": "StorageArea",
"description": "Items under the \"sync\" namespace are synced using Chrome Sync.",
"unprivileged": true,
- "value": [ "sync" ]
+ "value": [ "sync" ],
+ "properties": {
+ "QUOTA_BYTES": {
+ "type": "integer",
+ "value": "102400",
+ "unprivileged": true,
+ "description": "The maximum total amount (in bytes) of data that can be stored in sync storage."
+ },
+ "QUOTA_BYTES_PER_ITEM": {
+ "type": "integer",
+ "value": "2048",
+ "unprivileged": true,
+ "description": "The maximum size (in bytes) of each individual item in sync storage."
+ },
+ "MAX_ITEMS": {
+ "type": "integer",
+ "value": "512",
+ "unprivileged": true,
+ "description": "The maximum number of items that can be stored in sync storage."
+ }
+ }
},
"local": {
- "$ref": "StorageNamespace",
+ "$ref": "StorageArea",
"description": "Items under the \"local\" namespace are local to each machine.",
"unprivileged": true,
- "value": [ "local" ]
+ "value": [ "local" ],
+ "properties": {
+ "QUOTA_BYTES": {
+ "type": "integer",
+ "value": "5120000",
+ "unprivileged": true,
+ "description": "The maximum amount (in bytes) of data that can be stored in local storage. This value may be ignored if the extension has the <code>unlimitedStorage</code> permission."
+ }
+ }
}
}
}
« no previous file with comments | « chrome/browser/extensions/settings/weak_unlimited_settings_storage.cc ('k') | chrome/common/extensions/docs/storage.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698