1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 "namespace": "storage",
8 "description": "Use the <code>chrome.storage</code> API to store, retrieve, and track changes to user data.",
12 "id": "StorageChange",
17 "description": "The old value of the item, if there was an old value.",
22 "description": "The new value of the item, if there is a new value.",
30 "js_module": "StorageArea",
35 "description": "Gets one or more items from storage.",
41 { "type": "array", "items": { "type": "string" } },
44 "description": "Storage items to return in the callback, where the values are replaced with those from storage if they exist.",
45 "additionalProperties": { "type": "any" }
48 "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.",
54 "description": "Callback with storage items, or on failure (in which case $(ref:runtime.lastError) will be set).",
59 "additionalProperties": { "type": "any" },
60 "description": "Object with items in their key-value mappings."
67 "name": "getBytesInUse",
69 "description": "Gets the amount of space (in bytes) being used by one or more items.",
75 { "type": "array", "items": { "type": "string" } }
77 "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.",
83 "description": "Callback with the amount of space being used by storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
88 "description": "Amount of space being used in storage, in bytes."
97 "description": "Sets multiple items.",
102 "additionalProperties": { "type": "any" },
103 "description": "<p>An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.</p><p>Primitive values such as numbers will serialize as expected. Values with a <code>typeof</code> <code>\"object\"</code> and <code>\"function\"</code> will typically serialize to <code>{}</code>, with the exception of <code>Array</code> (serializes as expected), <code>Date</code>, and <code>Regex</code> (serialize using their <code>String</code> representation).</p>"
108 "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
117 "description": "Removes one or more items from storage.",
123 {"type": "array", "items": {"type": "string"}}
125 "description": "A single key or a list of keys for items to remove."
130 "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
139 "description": "Removes all items from storage.",
144 "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
157 "description": "Fired when one or more items change.",
162 "additionalProperties": { "$ref": "StorageChange" },
163 "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
168 "description": "The name of the storage area (<code>\"sync\"</code>, <code>\"local\"</code> or <code>\"managed\"</code>) the changes are for."
175 "$ref": "StorageArea",
176 "description": "Items in the <code>sync</code> storage area are synced using Chrome Sync.",
181 "description": "The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
183 "QUOTA_BYTES_PER_ITEM": {
185 "description": "The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set $(ref:runtime.lastError)."
189 "description": "The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set $(ref:runtime.lastError)."
191 "MAX_WRITE_OPERATIONS_PER_HOUR": {
193 "description": "<p>The maximum number of <code>set</code>, <code>remove</code>, or <code>clear</code> operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.</p><p>Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).</p>"
195 "MAX_WRITE_OPERATIONS_PER_MINUTE": {
197 "description": "<p>The maximum number of <code>set</code>, <code>remove</code>, or <code>clear</code> operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.</p><p>Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).</p>"
199 "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE": {
201 "deprecated": "The storage.sync API no longer has a sustained write operation quota.",
207 "$ref": "StorageArea",
208 "description": "Items in the <code>local</code> storage area are local to each machine.",
209 "value": [ "local" ],
213 "description": "The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the <code>unlimitedStorage</code> permission. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
218 "$ref": "StorageArea",
219 "description": "Items in the <code>managed</code> storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error.",
220 "value": [ "managed" ]