Commit 726227d8 authored by Tim Judkins's avatar Tim Judkins Committed by Commit Bot

[Extensions] Enable promise support on the cookies API

This CL changes over the json schema to use the new returns_async format
to define callbacks, enabling promise support on those APIs.

Bug: 328932
Change-Id: I6b2f545c3b3b92e30a1a355256a17083e12c2e3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515141Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826840}
parent 1b981ad6
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
{ {
"name": "details", "name": "details",
"$ref": "CookieDetails" "$ref": "CookieDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "getAll", "name": "getAll",
...@@ -96,9 +95,9 @@ ...@@ -96,9 +95,9 @@
"session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."}, "session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."},
"storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."} "storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."}
} }
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -106,7 +105,6 @@ ...@@ -106,7 +105,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "set", "name": "set",
...@@ -129,9 +127,9 @@ ...@@ -129,9 +127,9 @@
"expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."}, "expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."},
"storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."} "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."}
} }
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"optional": true, "optional": true,
"min_version": "11.0.674.0", "min_version": "11.0.674.0",
...@@ -141,7 +139,6 @@ ...@@ -141,7 +139,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "remove", "name": "remove",
...@@ -151,9 +148,9 @@ ...@@ -151,9 +148,9 @@
{ {
"name": "details", "name": "details",
"$ref": "CookieDetails" "$ref": "CookieDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"optional": true, "optional": true,
"min_version": "11.0.674.0", "min_version": "11.0.674.0",
...@@ -171,15 +168,13 @@ ...@@ -171,15 +168,13 @@
} }
] ]
} }
]
}, },
{ {
"name": "getAllCookieStores", "name": "getAllCookieStores",
"type": "function", "type": "function",
"description": "Lists all existing cookie stores.", "description": "Lists all existing cookie stores.",
"parameters": [ "parameters": [],
{ "returns_async": {
"type": "function",
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -187,7 +182,6 @@ ...@@ -187,7 +182,6 @@
} }
] ]
} }
]
} }
], ],
"events": [ "events": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment