OLD | NEW |
---|---|
1 [ | 1 [ |
2 { | 2 { |
3 "namespace": "storage", | 3 "namespace": "storage", |
4 "types": [ | 4 "types": [ |
5 { | 5 { |
6 "id": "StorageChange", | 6 "id": "StorageChange", |
7 "type": "object", | 7 "type": "object", |
8 "properties": { | 8 "properties": { |
9 "oldValue": { | 9 "oldValue": { |
10 "type": "any", | 10 "type": "any", |
11 "description": "The old value of the item, if there was an old value .", | 11 "description": "The old value of the item, if there was an old value .", |
12 "optional": true | 12 "optional": true |
13 }, | 13 }, |
14 "newValue": { | 14 "newValue": { |
15 "type": "any", | 15 "type": "any", |
16 "description": "The new value of the item, if there is a new value." , | 16 "description": "The new value of the item, if there is a new value." , |
17 "optional": true | 17 "optional": true |
18 } | 18 } |
19 } | 19 } |
20 }, | 20 }, |
21 { | 21 { |
22 "id": "StorageNamespace", | 22 "id": "StorageArea", |
23 "type": "object", | 23 "type": "object", |
24 "functions": [ | 24 "functions": [ |
25 { | 25 { |
26 "name": "get", | 26 "name": "get", |
27 "unprivileged": true, | 27 "unprivileged": true, |
28 "type": "function", | 28 "type": "function", |
29 "description": "Gets one or more items from storage.", | 29 "description": "Gets one or more items from storage.", |
30 "parameters": [ | 30 "parameters": [ |
31 { | 31 { |
32 "name": "keys", | 32 "name": "keys", |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 "description": "Removes all items from storage.", | 111 "description": "Removes all items from storage.", |
112 "parameters": [ | 112 "parameters": [ |
113 { | 113 { |
114 "name": "callback", | 114 "name": "callback", |
115 "type": "function", | 115 "type": "function", |
116 "description": "Callback on success, or on failure (in which cas e lastError will be set).", | 116 "description": "Callback on success, or on failure (in which cas e lastError will be set).", |
117 "parameters": [], | 117 "parameters": [], |
118 "optional": true | 118 "optional": true |
119 } | 119 } |
120 ] | 120 ] |
121 }, | |
122 { | |
123 "name": "getBytesInUse", | |
124 "unprivileged": true, | |
125 "type": "function", | |
126 "description": "Get the amount of space being used in storage, in by tes.", | |
127 "parameters": [ | |
128 { | |
129 "name": "callback", | |
130 "type": "function", | |
131 "description": "Callback with the amount of space being used by storage, or on failure (in which case lastError will be set).", | |
132 "parameters": [ | |
133 { | |
134 "name": "bytesInUse", | |
135 "type": "integer", | |
136 "description": "Amount of space being used in storage, in by tes." | |
137 } | |
138 ] | |
139 } | |
140 ] | |
121 } | 141 } |
122 ] | 142 ] |
123 } | 143 } |
124 ], | 144 ], |
125 "events": [ | 145 "events": [ |
126 { | 146 { |
127 "name": "onChanged", | 147 "name": "onChanged", |
128 "unprivileged": true, | 148 "unprivileged": true, |
129 "type": "function", | 149 "type": "function", |
130 "description": "Fired when one or more items change.", | 150 "description": "Fired when one or more items change.", |
131 "parameters": [ | 151 "parameters": [ |
132 { | 152 { |
133 "name": "changes", | 153 "name": "changes", |
134 "type": "object", | 154 "type": "object", |
135 "properties": {}, | 155 "properties": {}, |
136 "additionalProperties": { "$ref": "StorageChange" }, | 156 "additionalProperties": { "$ref": "StorageChange" }, |
137 "description": "Object mapping each key that changed to its correspo nding <a href='#type-StorageChange'>StorageChange</a> for that item." | 157 "description": "Object mapping each key that changed to its correspo nding <a href='#type-StorageChange'>StorageChange</a> for that item." |
138 }, | 158 }, |
139 { | 159 { |
140 "name": "namespace", | 160 "name": "namespace", |
141 "type": "string", | 161 "type": "string", |
142 "description": "The namespace (\"sync\" or \"local\") of the storage area the changes are for." | 162 "description": "The namespace (\"sync\" or \"local\") of the storage area the changes are for." |
143 } | 163 } |
144 ] | 164 ] |
145 } | 165 } |
146 ], | 166 ], |
147 "properties": { | 167 "properties": { |
148 "sync": { | 168 "sync": { |
149 "$ref": "StorageNamespace", | 169 "$ref": "StorageArea", |
150 "description": "Items under the \"sync\" namespace are synced using Chro me Sync.", | 170 "description": "Items under the \"sync\" namespace are synced using Chro me Sync.", |
151 "unprivileged": true, | 171 "unprivileged": true, |
152 "value": [ "sync" ] | 172 "value": [ "sync" ], |
173 "properties": { | |
174 "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
| |
175 "type": "integer", | |
176 "value": "102400", | |
177 "unprivileged": true, | |
178 "description": "The maximum total amount (in bytes) of data that can be stored in sync storage." | |
179 }, | |
180 "QUOTA_BYTES_PER_ITEM": { | |
181 "type": "integer", | |
182 "value": "2048", | |
183 "unprivileged": true, | |
184 "description": "The maximum size (in bytes) of each individual item in sync storage." | |
185 }, | |
186 "MAX_ITEMS": { | |
187 "type": "integer", | |
188 "value": "512", | |
189 "unprivileged": true, | |
190 "description": "The maximum number of items that can be stored in sy nc storage." | |
191 } | |
192 } | |
153 }, | 193 }, |
154 "local": { | 194 "local": { |
155 "$ref": "StorageNamespace", | 195 "$ref": "StorageArea", |
156 "description": "Items under the \"local\" namespace are local to each ma chine.", | 196 "description": "Items under the \"local\" namespace are local to each ma chine.", |
157 "unprivileged": true, | 197 "unprivileged": true, |
158 "value": [ "local" ] | 198 "value": [ "local" ], |
199 "properties": { | |
200 "QUOTA_BYTES": { | |
201 "type": "integer", | |
202 "value": "5120000", | |
203 "unprivileged": true, | |
204 "description": "The maximum amount (in bytes) of data that can be st ored in local storage. This value may be ignored if the extension has the <tt>un limitedStorage</tt> permission." | |
205 } | |
206 } | |
159 } | 207 } |
160 } | 208 } |
161 } | 209 } |
162 ] | 210 ] |
OLD | NEW |