Skip to content
Commit 6a8c3531 authored by Tim Judkins's avatar Tim Judkins Committed by Commit Bot
Browse files

[Extensions Bindings] Support returns_async in extension schemas

(Based on previous work from https://crrev.com/c/2144684 )
This CL is a starting point for supporting a returns_async parameter in
Extension schemas, which is a step in supporting promise-based APIs. It
adds a new property to the Model in json_schema_compiler, returns_async,
which contains information about what the API function is expected to
return.

returns_async is used instead of Model.callback, and can be created
either from a callback specification or a specific "returns_async"
entry in the schema.

It also modifies the doc generation code to handle this new property,
displaying it as a callback at the end of the schema. This should
result in there being no visible difference to the docs when an API is
rolled over to using returns_async, other than previously required
callbacks being displayed as optional.

In order to do end-to-end tests, this CL also moves over tabs.create,
tabs.duplicate and tabs.query to use the new schema format, thereby
enabling promise support on them.


Bug: 978538
Change-Id: I43f5965eb8973f0d9fd25d46f1f1ae7ffa346357
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2430291


Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824488}
parent 99651bed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment