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", |
Aaron Boodman
2012/01/24 23:40:53
Bummer to duplicate these values with the C++ impl
not at google - send to devlin
2012/01/25 00:00:14
Rather not make them functions, they're semantical
|
+ "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." |
+ } |
+ } |
} |
} |
} |