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

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: . 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..fbf45f0fd27b6629dcaf121a6d5f6c800e47fe4e 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": [
{
@@ -118,6 +118,26 @@
"optional": true
}
]
+ },
+ {
+ "name": "getBytesInUse",
+ "unprivileged": true,
+ "type": "function",
+ "description": "Get the amount of space being used in storage, in bytes.",
+ "parameters": [
+ {
+ "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."
+ }
+ ]
+ }
+ ]
}
]
}
@@ -146,16 +166,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": {
Matt Perry 2012/01/24 21:54:59 What's our style for API constants? I don't think
not at google - send to devlin 2012/01/24 21:56:48 Ah, I was basing it off that WINDOW_ID_NONE variab
Matt Perry 2012/01/24 22:02:19 Oh OK, sounds like there's precedent. Carry on, th
+ "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 <tt>unlimitedStorage</tt> 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