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,17 +66,16 @@
{
"name": "details",
"$ref": "CookieDetails"
},
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie. This parameter is null if no such cookie was found."
}
]
}
]
],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie. This parameter is null if no such cookie was found."
}
]
}
},
{
"name": "getAll",
......@@ -96,17 +95,16 @@
"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."}
}
},
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookies", "type": "array", "items": {"$ref": "Cookie"}, "description": "All the existing, unexpired cookies that match the given cookie info."
}
]
}
]
],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "cookies", "type": "array", "items": {"$ref": "Cookie"}, "description": "All the existing, unexpired cookies that match the given cookie info."
}
]
}
},
{
"name": "set",
......@@ -129,19 +127,18 @@
"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."}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"min_version": "11.0.674.0",
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set."
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"min_version": "11.0.674.0",
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set."
}
]
}
},
{
"name": "remove",
......@@ -151,43 +148,40 @@
{
"name": "details",
"$ref": "CookieDetails"
},
{
"type": "function",
"name": "callback",
"optional": true,
"min_version": "11.0.674.0",
"parameters": [
{
"name": "details",
"type": "object",
"description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set.",
"optional": true,
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
"name": {"type": "string", "description": "The name of the cookie that's been removed."},
"storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."}
}
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"min_version": "11.0.674.0",
"parameters": [
{
"name": "details",
"type": "object",
"description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set.",
"optional": true,
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
"name": {"type": "string", "description": "The name of the cookie that's been removed."},
"storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."}
}
}
]
}
},
{
"name": "getAllCookieStores",
"type": "function",
"description": "Lists all existing cookie stores.",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookieStores", "type": "array", "items": {"$ref": "CookieStore"}, "description": "All the existing cookie stores."
}
]
}
]
"parameters": [],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "cookieStores", "type": "array", "items": {"$ref": "CookieStore"}, "description": "All the existing cookie stores."
}
]
}
}
],
"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