New issue
Advanced search Search tips

Issue 653596 link

Starred by 16 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocked on:
issue 678056

Blocking:
issue 636655



Sign in to add a comment

Re-implement extension bindings in C++

Project Member Reported by rdevlin....@chromium.org, Oct 6 2016

Issue description

Extension bindings are slow and fragile.  This is largely because they are implemented in JS which is run lazily in the same context as executing scripts.  We should migrate these to C++.

Small design doc here:
https://docs.google.com/document/d/10NCtBH2zARPLidzmB6mck6W3FVRl3DCAdz4G6rPhAh8/edit# (google.com)

Happy to add more detail if anyone wants it.
 
Showing comments 138 - 237 of 237 Older
Project Member

Comment 138 by bugdroid1@chromium.org, May 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3137d1a8be97dbc4fe14075d61458ce9a5e6219e

commit 3137d1a8be97dbc4fe14075d61458ce9a5e6219e
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu May 25 21:55:11 2017

[Extensions Bindings] Update declarativeContent CSS validation test

Update the declarativeContent CSS validation test to accept errors from
either the JS bindings system or the native bindings system.

BUG=653596

Review-Url: https://codereview.chromium.org/2909523003
Cr-Commit-Position: refs/heads/master@{#474817}

[modify] https://crrev.com/3137d1a8be97dbc4fe14075d61458ce9a5e6219e/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc

Project Member

Comment 139 by bugdroid1@chromium.org, May 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4ff9a598e54fadca6b3a28177982c9767055936a

commit 4ff9a598e54fadca6b3a28177982c9767055936a
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri May 26 03:30:08 2017

[Extensions Bindings] Update tabs tests to accept new error messages

Certain tabs API tests expect errors for passing invalid arguments.
Update the tests to accept the errors from the native bindings system.

BUG=653596
TEST=ExtensionApiTabTest.TabAudible --native-crx-bindings=1,
     ExtensionApiTabTest.TabMove --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2901403003
Cr-Commit-Position: refs/heads/master@{#474899}

[modify] https://crrev.com/4ff9a598e54fadca6b3a28177982c9767055936a/chrome/test/data/extensions/api_test/tabs/basics/audible.js
[modify] https://crrev.com/4ff9a598e54fadca6b3a28177982c9767055936a/chrome/test/data/extensions/api_test/tabs/basics/move.js

Project Member

Comment 140 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5620d9efdeb210b6d27b041783f173dae3e5e37b

commit 5620d9efdeb210b6d27b041783f173dae3e5e37b
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Tue May 30 20:57:37 2017

[Extensions Bindings] Include request id in a custom callback response

Include the request id in the args curried to the custom callback set
with custom bindings. This is only used in pageCapture.saveAsMHTML, but
including it is trivial. When we move pageCapture.saveAsMHTML to
fully-native bindings, it may make sense to remove this.

BUG=653596
TEST=APIRequestHandlerTest*,
     ExtensionPageCaptureApiTest.SaveAsMHTML --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2894923003
Cr-Commit-Position: refs/heads/master@{#475666}

[modify] https://crrev.com/5620d9efdeb210b6d27b041783f173dae3e5e37b/chrome/renderer/resources/extensions/page_capture_custom_bindings.js
[modify] https://crrev.com/5620d9efdeb210b6d27b041783f173dae3e5e37b/extensions/renderer/api_bindings_system_unittest.cc
[modify] https://crrev.com/5620d9efdeb210b6d27b041783f173dae3e5e37b/extensions/renderer/api_request_handler.cc
[modify] https://crrev.com/5620d9efdeb210b6d27b041783f173dae3e5e37b/extensions/renderer/api_request_handler_unittest.cc

Project Member

Comment 141 by bugdroid1@chromium.org, May 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00d8fa1c1d356a6e98bfffccf62463f1450d4432

commit 00d8fa1c1d356a6e98bfffccf62463f1450d4432
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Tue May 30 23:53:03 2017

[Extensions Bindings] Fix content settings validation

Fix two issues in content settings validation:
a) Properly validate the `set` value against the schema in JS bindings.
   This wasn't being done before, and could lead to validation failures
   on the browser side.
b) Move deprecated checks before `set` value validation in both native
   and JS bindings. This is necessary since the accepted values for
   the deprecated settings are restricted to a single value (the
   default setting).

BUG=653596

Review-Url: https://codereview.chromium.org/2903803004
Cr-Commit-Position: refs/heads/master@{#475696}

[modify] https://crrev.com/00d8fa1c1d356a6e98bfffccf62463f1450d4432/chrome/renderer/resources/extensions/content_setting.js
[modify] https://crrev.com/00d8fa1c1d356a6e98bfffccf62463f1450d4432/chrome/test/data/extensions/api_test/content_settings/standard/test.js
[modify] https://crrev.com/00d8fa1c1d356a6e98bfffccf62463f1450d4432/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
[modify] https://crrev.com/00d8fa1c1d356a6e98bfffccf62463f1450d4432/extensions/renderer/content_setting.cc

Project Member

Comment 142 by bugdroid1@chromium.org, May 31 2017

Project Member

Comment 143 by bugdroid1@chromium.org, Jun 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e5faa7dab8cb4257200a34d14dc58aab119f634

commit 9e5faa7dab8cb4257200a34d14dc58aab119f634
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 02 02:08:37 2017

[Extensions Bindings] Remove some modules with native bindings

Native bindings should replace many of the core modules used in
extension APIs. Don't include some of these when native bindings
are enabled.

Update custom bindings that are exercised in native binding tests to
behavior properly with either JS or native bindings.

BUG=653596

Review-Url: https://codereview.chromium.org/2908883002
Cr-Commit-Position: refs/heads/master@{#476521}

[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/page_action_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/chrome/renderer/resources/extensions/web_view/chrome_web_view_internal_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/extensions/renderer/resources/extension_custom_bindings.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js
[modify] https://crrev.com/9e5faa7dab8cb4257200a34d14dc58aab119f634/extensions/renderer/resources/guest_view/web_view/web_view_internal.js

Bug Link Mix-Up:

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e118f4d92ff6564c75fea95c07864a483cc42f29

commit e118f4d92ff6564c75fea95c07864a483cc42f29
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 09 20:32:21 2017

[Extensions Bindings] Accept null callbacks while ignoring schema

For legacy reasons, we have the method ConvertArgumentsIgnorningSchema,
which still needs to take into account the callback method as the final
parameter. Accept a null callback for these cases, and unittests for the
same. This fixes some of the context menus browser tests with native
bindings.

Also update the context menus handler bindings.

BUG=629431

Review-Url: https://codereview.chromium.org/2915813003
Cr-Commit-Position: refs/heads/master@{#478398}

[modify] https://crrev.com/e118f4d92ff6564c75fea95c07864a483cc42f29/extensions/renderer/api_signature.cc
[modify] https://crrev.com/e118f4d92ff6564c75fea95c07864a483cc42f29/extensions/renderer/api_signature_unittest.cc
[modify] https://crrev.com/e118f4d92ff6564c75fea95c07864a483cc42f29/extensions/renderer/resources/context_menus_handlers.js
Project Member

Comment 145 by bugdroid1@chromium.org, Jun 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07b2843ad74247b776c43ad7a21945813f05ac33

commit 07b2843ad74247b776c43ad7a21945813f05ac33
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 09 20:55:19 2017

[Extensions Bindings] Update test to not use idle

The chrome.idle test is flaky (because the result is unknown). Move to
a more stable API.

BUG=653596

Review-Url: https://codereview.chromium.org/2934573002
Cr-Commit-Position: refs/heads/master@{#478410}

[modify] https://crrev.com/07b2843ad74247b776c43ad7a21945813f05ac33/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
[modify] https://crrev.com/07b2843ad74247b776c43ad7a21945813f05ac33/chrome/test/data/extensions/api_test/native_bindings/extension/manifest.json

Project Member

Comment 146 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62

commit a3c4e75c6feb70b9af379067bf2daa7c9ef92b62
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Tue Jun 13 00:19:30 2017

[Extensions Bindings] Return result from event dispatch

The JS bindings return an array of results from a call to dispatch(),
containing the results returned by each listener. This is primarily
used, it seems, to detect whether or not a message port will be used
asynchronously through the onMessage event. Because of this, it is
(for now) necessary to also support in native bindings.

Add functionality to return the results from a JS dispatch() call on an
event. Since this is called directly from JS, we should know that
running JS synchronously from that point is safe.

Add tests for returning the result of dispatch() as well as end-to-end
tests for asynchronously responding to a message.

BUG=653596

Review-Url: https://codereview.chromium.org/2921013002
Cr-Commit-Position: refs/heads/master@{#478838}

[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/chrome/test/data/extensions/api_test/native_bindings/extension/content_script.js
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/BUILD.gn
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/api_binding_unittest.cc
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/api_bindings_system.cc
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/api_event_handler.cc
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/api_event_handler.h
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/api_event_handler_unittest.cc
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/event_emitter.cc
[modify] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/event_emitter.h
[add] https://crrev.com/a3c4e75c6feb70b9af379067bf2daa7c9ef92b62/extensions/renderer/event_emitter_unittest.cc

Project Member

Comment 147 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07

commit 3e46aa6ced2554cd07a7cc9aad1ec98b384dff07
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Tue Jun 13 22:38:23 2017

[Extensions Bindings] Don't allow `event` module with native bindings

With native bindings, events should be constructed with the through the
native hooks, rather than the JS event implementation. Don't include the
event JS module when native bindings are enabled.

This requires updating bindings code used in native bindings browser
tests that currently relies on the event module, most notably webviews.
Provide the native functionality to create a declarative event through
the JS hooks, and include a webview id with declarative events.

Also avoid subclassing the event class in the JS custom hooks for both
native and JS-based bindings.

Finally, remove some stale require()s where they were unnecessary.

BUG=653596

Review-Url: https://codereview.chromium.org/2912883004
Cr-Commit-Position: refs/heads/master@{#479183}

[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/api_binding.cc
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/api_binding_js_util.cc
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/api_binding_js_util.h
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/declarative_event.cc
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/declarative_event.h
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/declarative_event_unittest.cc
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/resources/app_runtime_custom_bindings.js
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/resources/app_window_custom_bindings.js
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/resources/guest_view/guest_view.js
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/resources/guest_view/guest_view_events.js
[modify] https://crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07/extensions/renderer/resources/guest_view/web_view/web_view_events.js

Project Member

Comment 148 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a090c7e903539a6efa8714926cf0a2ca0c9d1314

commit a090c7e903539a6efa8714926cf0a2ca0c9d1314
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 15 19:30:34 2017

[Extensions Bindings] Correctly create the sendMessage webview event

crrev.com/3e46aa6ced2554cd07a7cc9aad1ec98b384dff07 added logic for
web_view_events.js with native bindings, but created a declarative event
for the onMessage event, which should actually have been a vanilla
event. Update the bindings.

BUG=653596
TEST=browser_tests --gtest_filter=WebViewTests/WebViewTest.Shim_TestDeclarativeWebRequestAPISendMessage/0
                   --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2942023003
Cr-Commit-Position: refs/heads/master@{#479782}

[modify] https://crrev.com/a090c7e903539a6efa8714926cf0a2ca0c9d1314/extensions/renderer/resources/guest_view/web_view/web_view_events.js

Project Member

Comment 149 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df6434db4fb6f58af26c25696f19332853938288

commit df6434db4fb6f58af26c25696f19332853938288
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 15 21:35:09 2017

[Extensions] Update DeclarativeApiTest.DeclarativeApi

The DeclarativeApiTest.DeclarativeApi test exercises calling invalid
invocations of [declarativeEvent].getRules() and removeRules(). However,
the "invalid" invocations they have been using simply omit the first
parameter, which is a filter. In the documentation and the schema, this
first parameter is listed as *optional*, and in extension APIs, omitted
optional parameters are allowed. Thus, this is contradictory.

This happens because the get/removeRules functions are defined in
event.js and take two named parameters, using those for validation,
rather than validating on the `arguments` property. Native bindings
actually do the right thing here, and allow the invocation.

Update the test to use truly invalid invocations for the invalid
invocations tests, and add a (disabled) test for using getRules with an
omitted filter.

BUG=733764
BUG=653596

Review-Url: https://codereview.chromium.org/2940133002
Cr-Commit-Position: refs/heads/master@{#479846}

[modify] https://crrev.com/df6434db4fb6f58af26c25696f19332853938288/chrome/test/data/extensions/api_test/declarative/api/background.js

Project Member

Comment 150 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6ebcb95f8c4fadb29b69d2fbcbf8c964974e76aa

commit 6ebcb95f8c4fadb29b69d2fbcbf8c964974e76aa
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 15 22:58:36 2017

[Extensions Bindings] Update permissions_custom_bindings.js

Update permissions_custom_bindings.js for native bindings. This involves
the typical delegation to the native bindings for core functionality,
but also involves changing the unusual method of updating event
arguments to the more common argument massager pattern.

BUG=653596
TEST=browser_tests --gtest_filter=PermissionsApiTest.HostSubsets
                   --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2942933002
Cr-Commit-Position: refs/heads/master@{#479880}

[modify] https://crrev.com/6ebcb95f8c4fadb29b69d2fbcbf8c964974e76aa/extensions/renderer/resources/permissions_custom_bindings.js

Project Member

Comment 151 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ab6c2f591d66ceca9ff7901de4f632a6e1a3260b

commit ab6c2f591d66ceca9ff7901de4f632a6e1a3260b
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 16 02:02:23 2017

[Extensions Bindings] Update optional permissions tests

Update the expected errors in optional permissions-related tests to
accept the errors thrown by the native bindings system.
JS: 'bookmarks' requires a different Feature that is not present.
Native: 'bookmarks.getTree' is not available in this context.

BUG=653596
TEST=browser_tests --gtest_filter=PermissionsApiTest.OptionalPermissionsGranted
                   --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2937333002
Cr-Commit-Position: refs/heads/master@{#479918}

[modify] https://crrev.com/ab6c2f591d66ceca9ff7901de4f632a6e1a3260b/chrome/test/data/extensions/api_test/permissions/optional/background.js

Project Member

Comment 152 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/15b908ccd529a9ddab8dd9af94c0cdd72cb5b429

commit 15b908ccd529a9ddab8dd9af94c0cdd72cb5b429
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 16 23:41:18 2017

[Extensions Bindings] Update IME custom bindings

Update IME custom bindings to not rely on JS Event bindings.

BUG=653596
BUG=733825
TEST=browser_tests --gtest_filter=InputImeApiTest.BasicApiTest
                   --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2945493002
Cr-Commit-Position: refs/heads/master@{#480223}

[modify] https://crrev.com/15b908ccd529a9ddab8dd9af94c0cdd72cb5b429/chrome/renderer/resources/extensions/input.ime_custom_bindings.js

Project Member

Comment 153 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e0d1cc35ae732bd9dabc6393900c278dbb045245

commit e0d1cc35ae732bd9dabc6393900c278dbb045245
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 22 00:27:24 2017

[Extensions] Fix FeatureProvider::GetChildren()

FeatureProvider::GetChildren() was returning children that were
explicitly set as no_parent. Fix this, and add a unit test.

This also fixes PlatformAppBrowserTest.Restrictions with native
bindings.

BUG=653596

Review-Url: https://codereview.chromium.org/2945383002
Cr-Commit-Position: refs/heads/master@{#481373}

[modify] https://crrev.com/e0d1cc35ae732bd9dabc6393900c278dbb045245/extensions/common/features/feature_provider.cc
[modify] https://crrev.com/e0d1cc35ae732bd9dabc6393900c278dbb045245/extensions/common/features/feature_provider_unittest.cc

Project Member

Comment 154 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/406dff52dcdcd355988cbf2be9070d97bc45b633

commit 406dff52dcdcd355988cbf2be9070d97bc45b633
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 22 05:45:12 2017

[Extensions Bindings] Introduce BindingAccessChecker

Add a new class, BindingAccessChecker, to handle checking for access to
a given feature and optionally throwing an error if access is forbidden.
Currently, this is only used in APIBinding, but a followup will expand
its usage.

Add tests for the same.

BUG=653596

Review-Url: https://codereview.chromium.org/2947843004
Cr-Commit-Position: refs/heads/master@{#481453}

[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/BUILD.gn
[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/api_binding.cc
[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/api_binding.h
[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/api_binding_unittest.cc
[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/api_bindings_system.cc
[modify] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/api_bindings_system.h
[add] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/binding_access_checker.cc
[add] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/binding_access_checker.h
[add] https://crrev.com/406dff52dcdcd355988cbf2be9070d97bc45b633/extensions/renderer/binding_access_checker_unittest.cc

Project Member

Comment 155 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/72276223d2147fb370ec646329f01482e2056931

commit 72276223d2147fb370ec646329f01482e2056931
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 22 16:40:23 2017

[Extensions Bindings] Add access checks in custom types

Custom types (such as StorageArea and ChromeSetting/ContentSetting)
don't go through the typical sendRequest flow from APIBinding, and thus
avoid the access check that's there. Add an access check in these native
types.

BUG=653596

Review-Url: https://codereview.chromium.org/2953453002
Cr-Commit-Position: refs/heads/master@{#481559}

[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/chrome/test/data/extensions/api_test/bindings/unavailable_bindings_never_registered/background.js
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/api_bindings_system.cc
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/api_bindings_system.h
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/chrome_setting.cc
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/chrome_setting.h
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/content_setting.cc
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/content_setting.h
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/storage_area.cc
[modify] https://crrev.com/72276223d2147fb370ec646329f01482e2056931/extensions/renderer/storage_area.h

Project Member

Comment 156 by bugdroid1@chromium.org, Jun 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd

commit d4bcb1e2cf549030d85e0503c0d313f1c70be9cd
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 23 21:01:04 2017

[Extensions Bindings] Add a bindings/ subdirectory under renderer

The core bindings system has grown (55 files and 13,000 LOC). Move it to
a subdirectory at extensions/renderer/bindings. This also separates out
the core bindings system (which is actually extensions-agnostic) from
the native extensions binding implementation. Add a DEPS file to enforce
this distinction.

BUG=653596

Review-Url: https://codereview.chromium.org/2947463002
Cr-Commit-Position: refs/heads/master@{#482024}

[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/chrome/renderer/extensions/app_hooks_delegate.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/chrome/renderer/extensions/app_hooks_delegate.h
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/BUILD.gn
[add] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/DEPS
[add] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/OWNERS
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_bridge.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_bridge.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks_delegate.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks_delegate.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks_test_delegate.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_hooks_test_delegate.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_js_util.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_js_util.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_js_util_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_test.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_test.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_test_util.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_test_util.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_types.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_types.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_binding_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_bindings_system.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_bindings_system.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_bindings_system_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_bindings_system_unittest.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_handler.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_handler.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_handler_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_listeners.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_listeners.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_event_listeners_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_invocation_errors.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_invocation_errors.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_invocation_errors_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_last_error.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_last_error.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_last_error_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_request_handler.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_request_handler.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_request_handler_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_signature.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_signature.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_signature_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_type_reference_map.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/api_type_reference_map.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/argument_spec.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/argument_spec.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/argument_spec_builder.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/argument_spec_builder.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/argument_spec_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/binding_access_checker.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/binding_access_checker.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/binding_access_checker_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/declarative_event.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/declarative_event.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/declarative_event_unittest.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/event_emitter.cc
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/event_emitter.h
[rename] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/bindings/event_emitter_unittest.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/chrome_setting.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/chrome_setting.h
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/content_setting.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/content_setting.h
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/declarative_content_hooks_delegate.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/declarative_content_hooks_delegate.h
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/storage_area.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/web_request_hooks.cc
[modify] https://crrev.com/d4bcb1e2cf549030d85e0503c0d313f1c70be9cd/extensions/renderer/web_request_hooks.h

Project Member

Comment 157 by bugdroid1@chromium.org, Jun 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d701d8e63d28192afbdbe9d0d65569a4b994fd51

commit d701d8e63d28192afbdbe9d0d65569a4b994fd51
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Sat Jun 24 02:11:09 2017

[Extensions Bindings] Consider argument type more in signature parsing

Right now, when parsing arguments, we look at whether or not an argument
matches the expected argument, and, if it does not and the argument is
optional, we advance to the next argument. This results in strange
error messages when in certain circumstances. For instance, consider a
signature:
optional object<prop: string>, optional function

If we pass {prop: 2} to this signature, we'd first compare against
the object parameter, find it doesn't match, and then advance to
comparing against the function argument. This resulted in an error
message focusing on the function argument, rather than the object
argument.

To address this, check the types of the arguments first. If the type
matches the expected type, assume that the argument is meant to match.
This way, when we see the first argument is an object, we parse it
against the object parameter and give appropriate errors.

This can potentially cause issues when there is an ambiguous signature
based on argument types (e.g., optional object, optional object, and
provided a single argument - which object to match against?), but these
ambiguous signatures are already disallowed unless the API implements
custom handling.

BUG=653596

Review-Url: https://codereview.chromium.org/2947223003
Cr-Commit-Position: refs/heads/master@{#482118}

[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/chrome/test/data/extensions/api_test/window_open/argument_overflow/test.js
[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/extensions/renderer/bindings/api_signature.cc
[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/extensions/renderer/bindings/api_signature_unittest.cc
[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/extensions/renderer/bindings/argument_spec.cc
[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/extensions/renderer/bindings/argument_spec.h
[modify] https://crrev.com/d701d8e63d28192afbdbe9d0d65569a4b994fd51/extensions/renderer/bindings/argument_spec_unittest.cc

Project Member

Comment 158 by bugdroid1@chromium.org, Jun 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b35688d3937842851444f07370dfe09cb94dd1b9

commit b35688d3937842851444f07370dfe09cb94dd1b9
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Sat Jun 24 02:14:18 2017

[Extensions Bindings] Support ArrayBufferView in idl files

Currently, to specify an ArrayBufferView in an IDL file, we use
`[instanceOf=Uint8Array] object view`

Change this to
`[instanceOf=Uint8Array] ArrayBufferView view`

Update the schema compiler to consider the type of ArrayBufferView to
be `binary`, rather than `object`, so that these values are properly
converted in native bindings.

BUG=653596
TEST=browser_tests --gtest_filter=ExtensionIdltestApiTest.IdlCompiler

Review-Url: https://codereview.chromium.org/2949143002
Cr-Commit-Position: refs/heads/master@{#482120}

[modify] https://crrev.com/b35688d3937842851444f07370dfe09cb94dd1b9/chrome/common/extensions/api/idltest.idl
[modify] https://crrev.com/b35688d3937842851444f07370dfe09cb94dd1b9/extensions/renderer/bindings/api_bindings_system.cc
[modify] https://crrev.com/b35688d3937842851444f07370dfe09cb94dd1b9/extensions/renderer/bindings/argument_spec.cc
[modify] https://crrev.com/b35688d3937842851444f07370dfe09cb94dd1b9/extensions/renderer/v8_schema_registry.cc
[modify] https://crrev.com/b35688d3937842851444f07370dfe09cb94dd1b9/tools/json_schema_compiler/idl_schema.py

Project Member

Comment 159 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63bbcde542abb20fbadae32ddf2008811a3068ed

commit 63bbcde542abb20fbadae32ddf2008811a3068ed
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Wed Jun 28 17:55:37 2017

[Extensions Bindings] Support chrome.extension.lastError

For legacy reasons, we surface errors through both
chrome.runtime.lastError and chrome.extension.lastError (though the
latter is both less fancy [it doesn't check for access] and also not
available in all contexts). Allow for providing a "secondary parent"
object to the APILastError object to support this.

Add unittests and end-to-end tests for the same.

BUG=653596

Review-Url: https://codereview.chromium.org/2953133002
Cr-Commit-Position: refs/heads/master@{#483055}

[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_binding_js_util_unittest.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_bindings_system_unittest.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_bindings_system_unittest.h
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_last_error.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_last_error.h
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_last_error_unittest.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/bindings/api_request_handler_unittest.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/63bbcde542abb20fbadae32ddf2008811a3068ed/extensions/renderer/native_extension_bindings_system.h

Project Member

Comment 160 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d634344803d84d26a14cb72df62c3c7182b385f0

commit d634344803d84d26a14cb72df62c3c7182b385f0
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Wed Jun 28 18:05:44 2017

[Extensions Bindings] Move loadTypeSchema from utils to json_schema

loadTypeSchema is used in binding.js and json_schema.js, and is
currently defined in utils.js. However, it seems like a better fit in
json_schema itself, since it only deals with schema type loading.
Additionally, we'll likely want to avoid including json_schema et al
with native bindings, so this makes utils safe to include.

BUG=653596

Review-Url: https://codereview.chromium.org/2953073004
Cr-Commit-Position: refs/heads/master@{#483058}

[modify] https://crrev.com/d634344803d84d26a14cb72df62c3c7182b385f0/extensions/renderer/resources/binding.js
[modify] https://crrev.com/d634344803d84d26a14cb72df62c3c7182b385f0/extensions/renderer/resources/json_schema.js
[modify] https://crrev.com/d634344803d84d26a14cb72df62c3c7182b385f0/extensions/renderer/resources/utils.js

Project Member

Comment 161 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a96b1c50789ce0f63946137b7c8f1a223699add

commit 6a96b1c50789ce0f63946137b7c8f1a223699add
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Wed Jun 28 18:32:05 2017

[Extensions Bindings] Don't load sendRequest module with native bindings

Sending an extension request is implemented natively with native
bindings, and the JS version should never be used. Don't load the
sendRequest module when native bindings are enabled to enforce this.

BUG=653596

Review-Url: https://codereview.chromium.org/2960523002
Cr-Commit-Position: refs/heads/master@{#483074}

[modify] https://crrev.com/6a96b1c50789ce0f63946137b7c8f1a223699add/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/6a96b1c50789ce0f63946137b7c8f1a223699add/extensions/renderer/resources/set_icon.js

Project Member

Comment 162 by bugdroid1@chromium.org, Jun 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f

commit e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Thu Jun 29 18:25:52 2017

[Extensions Bindings] Move setHandleRequestWithPromise to util

The JS bindings provides a setHandleRequestWithUtil() method in addition
to setHandleRequest(). This is currently used only in one location, and
is already implemented in terms of setHandleRequest (which has a native
equivalent). Move this to the common util file to avoid dependencies on
binding.js.

BUG=653596
TEST=browser_tests --gtest_filter=PDFExtensionTest.BlockDirectAccess
                   --native-crx-bindings=1

Review-Url: https://codereview.chromium.org/2952893002
Cr-Commit-Position: refs/heads/master@{#483430}

[modify] https://crrev.com/e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f/extensions/renderer/resources/binding.js
[modify] https://crrev.com/e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f/extensions/renderer/resources/mime_handler_private_custom_bindings.js
[modify] https://crrev.com/e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f/extensions/renderer/resources/utils.js
[modify] https://crrev.com/e5e0e9ee896c6e6ce80549d6ef2fcbd96589532f/extensions/test/data/keep_alive_client_unittest.js

Project Member

Comment 163 by bugdroid1@chromium.org, Jul 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7918e9f775cd1a68345bd755af75939e8f282194

commit 7918e9f775cd1a68345bd755af75939e8f282194
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 07 00:12:44 2017

[Extensions Bindings] Check availability of custom API properties

Check whether custom API properties are available to a context before
returning them on an API. Since these objects can be multiple layers
deep (e.g., privacy.websites.protectedContentEnabled), we perform
this check when returning the object, rather than when we instantiate
the API. This has the drawbacks of leaving the key in the API object
as well as only applying to custom-typed properties (as opposed to
POD-style properties), but this is sufficient for our use cases, given
their rarity.

Add tests for the same.

BUG=653596

Review-Url: https://codereview.chromium.org/2950353004
Cr-Commit-Position: refs/heads/master@{#484776}

[modify] https://crrev.com/7918e9f775cd1a68345bd755af75939e8f282194/extensions/renderer/bindings/api_binding.cc
[modify] https://crrev.com/7918e9f775cd1a68345bd755af75939e8f282194/extensions/renderer/bindings/api_binding_unittest.cc

Project Member

Comment 164 by bugdroid1@chromium.org, Jul 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca

commit 2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 07 22:24:19 2017

[Extensions Bindings] Don't load lastError module with native bindings

Setting the lastError property is implemented natively with native
bindings, and the JS version should never be used. Don't load the
lastError module when native bindings are enabled to enforce this.

BUG=653596

Review-Url: https://codereview.chromium.org/2959583002
Cr-Commit-Position: refs/heads/master@{#485073}

[modify] https://crrev.com/2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca/chrome/renderer/resources/extensions/browser_action_custom_bindings.js
[modify] https://crrev.com/2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca/extensions/renderer/resources/file_entry_binding_util.js
[modify] https://crrev.com/2a53188b33dfeb1efeb6bf961b8c67b82f5de2ca/extensions/renderer/resources/messaging.js

Project Member

Comment 165 by bugdroid1@chromium.org, Jul 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ab1596cf4cde44bfc15f6ba2c74f694f130b608

commit 7ab1596cf4cde44bfc15f6ba2c74f694f130b608
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Tue Jul 11 00:17:28 2017

[Extensions Bindings] Add activity logging of custom handling

If a method is handled by a custom hook, we won't notify the browser
(where we normally would with an API request), and so the activity log
won't be updated. Add support for activity logging with native binding.

If a request is handled by a custom hook and a request is not sent to
the browser, notify the activity logger (which will send the information
along to the browser process).  This matches the logic we currently have
in the JS bindings.

Add unit tests for the same.  In addition to the unit tests, this fixes
ActivityLogApiTest.TriggerEvent with native bindings enabled.

BUG=653596

Review-Url: https://codereview.chromium.org/2962093002
Cr-Commit-Position: refs/heads/master@{#485457}

[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/chrome/renderer/extensions/app_hooks_delegate.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/chrome/test/data/extensions/api_test/activity_log_private/PRESUBMIT.py
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/api_activity_logger.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/api_activity_logger.h
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_binding.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_binding.h
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_bindings_system.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_bindings_system.h
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_bindings_system_unittest.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_request_handler.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/7ab1596cf4cde44bfc15f6ba2c74f694f130b608/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 166 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0

commit e5e2cb9ce72dd22be2685f08cf881d6141cb21b0
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Wed Jul 12 02:31:04 2017

[Extensions Bindings] Add an ExceptionHandler class

There are a number of times we need to handle exceptions from untrusted
code running in the bindings system; two of the main ones include when
running a callback to an asynchronous extension function and when
dispatching events to listeners. In both of these cases, we want to log
the exception (so the developer knows something went wrong), but we
don't want to allow the exception to interrupt the flow of running JS.

Introduce an ExceptionHandler class to handle these cases and log the
caught exceptions to either the console (default) or a custom-set
handler (used in testing). Wire it up to the APIRequestHandler (with
more uses coming in later patch sets).

Add unit tests for both the ExceptionHandler and the APIRequestHandler's
use of it.

BUG=653596

Review-Url: https://codereview.chromium.org/2961103002
Cr-Commit-Position: refs/heads/master@{#485807}

[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/BUILD.gn
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_binding_types.h
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_bindings_system.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_bindings_system.h
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_bindings_system_unittest.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_last_error.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_last_error.h
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_request_handler.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/api_request_handler_unittest.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/declarative_event_unittest.cc
[add] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/exception_handler.cc
[add] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/exception_handler.h
[add] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/bindings/exception_handler_unittest.cc
[modify] https://crrev.com/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0/extensions/renderer/native_extension_bindings_system.cc

Project Member

Comment 167 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b7282fd66f1f6d3f1be30519740b96872a1cf46

commit 8b7282fd66f1f6d3f1be30519740b96872a1cf46
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 14 03:34:14 2017

[Extensions Bindings] Use ExceptionHandler in event dispatching

Use the ExceptionHandler when dispatching events to listeners, rather
than a verbose TryCatch. Add unit tests for the same.

Bug: 653596
Change-Id: Id510d9d3d406c68ef051d1a616d5f8e3586c6303
Reviewed-on: https://chromium-review.googlesource.com/568408
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486664}
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/api_bindings_system.cc
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/api_event_handler.cc
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/api_event_handler.h
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/api_event_handler_unittest.cc
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/8b7282fd66f1f6d3f1be30519740b96872a1cf46/extensions/renderer/bindings/event_emitter_unittest.cc

Project Member

Comment 168 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b9a8c3215b99f7885fcf8194eb5d6815af8548f2

commit b9a8c3215b99f7885fcf8194eb5d6815af8548f2
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 14 04:02:22 2017

[Extensions Bindings] Add JS hooks for the exception handler

There are two JS hooks we used in handling exceptions in extensions
bindings:
- There is an exposed "handleException" method, which handles exceptions
  encountered in running untrusted code.
- The test API allows us to set custom handlers for uncaught exceptions
  (so we can fail a test or verify expected errors).

Implement each of these in the utilities exposed to the JS bindings, and
add unittests for the same.

Bug: 653596
Change-Id: I246308c78b0760f5176949c2b1d88da07dca337a
Reviewed-on: https://chromium-review.googlesource.com/568692
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486667}
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/api_binding_js_util.cc
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/api_binding_js_util.h
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/api_binding_js_util_unittest.cc
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/api_bindings_system_unittest.cc
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/api_bindings_system_unittest.h
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/exception_handler.cc
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/bindings/exception_handler.h
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/b9a8c3215b99f7885fcf8194eb5d6815af8548f2/extensions/renderer/resources/test_custom_bindings.js

Project Member

Comment 169 by bugdroid1@chromium.org, Jul 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab

commit 377a7a9633c60a792b5d82c7f52f7a32baa4b3ab
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Sat Jul 15 02:07:20 2017

[Extensions Bindings] Update feature initialization

Make two changes to how we initialize features for contexts in extension
native bindings:
- Treat runtime specially. This is necessary because certain runtime
  methods should be exposed only if there exists an extension that can
  connect to the given context (e.g., an extension that cooperates with
  a given website).  Simply checking the fature availability is
  insufficient. Update unittests to match.
- Treat web contexts specially.  Web contexts only ever have a handful
  (3) APIs that are potentially available to them, and are by far the
  most commonly created context. As such, add a fast path for them by
  only checking those possible features. (This matches logic in the
  JS bindings system).

Bug: 653596
Change-Id: I57f50b6f762f578679771c5e07a1b3ce31da3e0c
Reviewed-on: https://chromium-review.googlesource.com/571962
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486965}
[modify] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/BUILD.gn
[add] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/extension_bindings_system.cc
[modify] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/extension_bindings_system.h
[modify] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/js_extension_bindings_system.cc
[modify] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/377a7a9633c60a792b5d82c7f52f7a32baa4b3ab/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 170 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4607e3217b447e49f57957e725354864c6a45e99

commit 4607e3217b447e49f57957e725354864c6a45e99
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Mon Jul 17 16:17:18 2017

[Extensions Bindings] Introduce an IPCMessageSender class

IPC messages related to extension bindings (such as API method calls or
event listener changes) sent by the renderer differ depending on if it's
a call for a main thread context or a service worker context. The call
sites differ based the context type as well as whether or not native
bindings are enabled. This makes these messages confusing, and causes
duplicate logic.

Introduce an IPCMessageSender class to handle sending the IPC messages
to the browser. There are two flavors of IPCMessageSender - one for the
main thread, and one for the worker thread. This message sender can be
used from both the native bindings implementation as well as the js
implementation, allowing us to abstract out more of the details.

In this first patch, introduce the IPCMessageSender class (in its two
flavors) and use it for API method request dispatching. This allows us
to perform a couple of cleanups:
- We get rid of the SendRequestIPC method we curried into the
  NativeExtensionBindingsSystem, and
- We get rid of the ServiceWorkerRequestSender (instead of subclassing
  the RequestSender, we can pass in the IPCMessageSender, which can be
  either for the main thread or a worker thread).

Bug: 653596
Change-Id: I406aba07945f6da4b7a8ab0b9d1788aa21385f96
Reviewed-on: https://chromium-review.googlesource.com/570947
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487102}
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/BUILD.gn
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/dispatcher.h
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/event_bindings.cc
[add] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/ipc_message_sender.cc
[add] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/ipc_message_sender.h
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/request_sender.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/request_sender.h
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/service_worker_data.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/service_worker_data.h
[delete] https://crrev.com/8a8892f7f86a82d1562f2b2325a304df632ddaff/extensions/renderer/service_worker_request_sender.cc
[delete] https://crrev.com/8a8892f7f86a82d1562f2b2325a304df632ddaff/extensions/renderer/service_worker_request_sender.h
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/worker_thread_dispatcher.cc
[modify] https://crrev.com/4607e3217b447e49f57957e725354864c6a45e99/extensions/renderer/worker_thread_dispatcher.h

Project Member

Comment 171 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/946720ebebdf76c96cb860c744a69fb12f937eac

commit 946720ebebdf76c96cb860c744a69fb12f937eac
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Mon Jul 17 23:58:08 2017

[Extensions Bindings] Have the bindings system own the IPCMessageSender

Move ownership of the ICPMessageSender to the bindings system. This
internalizes a bit more of the logic into the ExtensionBindingsSystem,
and moves a bit more out of the overly-busy Dispatcher classes.

Bug: 653596
Change-Id: I321afadb64c8351ca95cb0953a0148c71ad7f005
Reviewed-on: https://chromium-review.googlesource.com/570932
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487291}
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/dispatcher.h
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/extension_bindings_system.h
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/js_extension_bindings_system.cc
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/js_extension_bindings_system.h
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/service_worker_data.cc
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/service_worker_data.h
[modify] https://crrev.com/946720ebebdf76c96cb860c744a69fb12f937eac/extensions/renderer/worker_thread_dispatcher.cc

Project Member

Comment 172 by bugdroid1@chromium.org, Jul 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2b2180c5aad63abe2359430c7212bc68444592d7

commit 2b2180c5aad63abe2359430c7212bc68444592d7
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Jul 19 00:04:01 2017

[Extensions Bindings] Add event IPC dispatching to IPCMessageSender

Add logic for event-related IPC dispatching to the IPCMessageSender.
Remove the remaining hooks for Send*IPC from the
NativeExtensionMessageBindingsSystem, and use the IPCMessageSender
directly instead for all IPC-related activity. Update the unittests to
match.

Also wire up JS-based event bindings to use the IPCMessageSender, so
that we only have a single instance of sending the bindings-related
IPC messages (per context type between main thread and worker thread).

This also ensures that the NativeExtensionBindingsSystem has the correct
IPC-related logic for service worker contexts, unblocking the service
worker related API tests.

Bug: 653596
Change-Id: I497598aee3ce0997a5c96162eee361fbefaa87ec
Reviewed-on: https://chromium-review.googlesource.com/570805
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487675}
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/event_bindings.cc
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/event_bindings.h
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/ipc_message_sender.cc
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/ipc_message_sender.h
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/2b2180c5aad63abe2359430c7212bc68444592d7/extensions/renderer/worker_thread_dispatcher.cc

Project Member

Comment 173 by bugdroid1@chromium.org, Jul 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f02ff0bbf7d268a1b956739d3419bf46a4ef5a3

commit 4f02ff0bbf7d268a1b956739d3419bf46a4ef5a3
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Jul 19 17:46:10 2017

[Extensions Bindings] Finish wiring up native bindings for SW contexts

Finish wiring up native extension bindings for service-worker based
contexts. Following the IPC refactoring, the only missing piece is
adding logic for getting the service worker contexts (which aren't in
the normal ScriptContextSet).

This makes ServiceWorkerTest.Events, ServiceWorkerTest.TabsCreate, and
ServiceWorkerAppTest.RegisterAndPostMessage pass with native bindings
enabled.

Bug: 653596
Change-Id: Ic09745caab760084a94d85b79f11add5d94d7a74
Reviewed-on: https://chromium-review.googlesource.com/570992
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487907}
[modify] https://crrev.com/4f02ff0bbf7d268a1b956739d3419bf46a4ef5a3/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/4f02ff0bbf7d268a1b956739d3419bf46a4ef5a3/extensions/renderer/worker_thread_dispatcher.cc
[modify] https://crrev.com/4f02ff0bbf7d268a1b956739d3419bf46a4ef5a3/extensions/renderer/worker_thread_dispatcher.h

Project Member

Comment 174 by bugdroid1@chromium.org, Jul 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8cade484cef7479bfca3fe3ea51baa2f390c63e0

commit 8cade484cef7479bfca3fe3ea51baa2f390c63e0
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Jul 20 03:09:31 2017

[Extensions Bindings] Update extensions_unittests for native bindings

Update a few of the extensions unittests for native bindings. In
particular, create a NativeBindingsExtensionSystem in the
ModuleSystemTest in order to allow for catching and reporting
errors, and update a few of the JS files to handle either
native or JS-based bindings.

Bug: 653596
Change-Id: I0bfc04ef01887422fb87c050da9aec056b00d0c9
Reviewed-on: https://chromium-review.googlesource.com/574692
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488118}
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/api_test_base.cc
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/module_system_test.cc
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/module_system_test.h
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/mojo/keep_alive_client_unittest.cc
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/resources/file_entry_binding_util.js
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/resources/mojo_private_custom_bindings.js
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/renderer/utils_unittest.cc
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/test/data/api_test_base_unittest.js
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/test/data/keep_alive_client_unittest.js
[modify] https://crrev.com/8cade484cef7479bfca3fe3ea51baa2f390c63e0/extensions/test/data/mojo_private_unittest.js

Project Member

Comment 175 by bugdroid1@chromium.org, Aug 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d8b910868da66ce4dfba38ff809aaf9704ab0d22

commit d8b910868da66ce4dfba38ff809aaf9704ab0d22
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Aug 02 02:21:57 2017

[Extensions Bindings] Handle a null script context for message logging

Custom bindings can sometimes run after a context is destroyed. This is
almost certainly undesirable, but tracing down each instance when it
happens might be tricky. One guaranteed instance is messaging bindings
performing port cleanup. If a port is cleaned up after the context is
destroyed, an exception will be thrown, which is caught and then logged
to the console. Console logging itself normally expects a script
context, but in this case there is none.

Gracefully handle this by allowing a null script context in console
logging, rather than CHECKing the result (console::AddMessage already
handles a null script context).  Ideally, we should fix these to not
have any JS code running after the script context is removed; add a
TODO to that effect.

Note: the null script context behavior happens in both native and JS
bindings; the native bindings just CHECK'd the result.

This makes MessagingApiTest.MessagingBackgroundOnly pass with
native bindings.

          --gtest_filter=MessagingApiTest.MessagingBackgroundOnly \
          --native-crx-bindings=1

Bug: 653596
Test: browser_tests \
Change-Id: Ie80da8f95cdee9dafe768b101116d116d2931404
Reviewed-on: https://chromium-review.googlesource.com/592390
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491226}
[modify] https://crrev.com/d8b910868da66ce4dfba38ff809aaf9704ab0d22/extensions/renderer/native_extension_bindings_system.cc

Project Member

Comment 176 by bugdroid1@chromium.org, Aug 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7ba924c07b824f8bb7aa67f219a9eb820325d966

commit 7ba924c07b824f8bb7aa67f219a9eb820325d966
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Aug 03 23:54:31 2017

[Extensions Bindings] Call WillReleaseScriptContext for SW contexts

Call ExtensionBindingsSystem::WillReleaseScriptContext() for extension
service-worker contexts. This fixes
ServiceWorkerTest.EventsToStoppedWorker with extension native bindings.

          --gtest_filter=ServiceWorkerTest.EventsToStoppedWorker
          --native-crx-bindings=1

Bug: 653596
Test: browser_tests \
Change-Id: I97db2bce738f35cd8ca5909017c6c9f48f95b76e
Reviewed-on: https://chromium-review.googlesource.com/596912
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491882}
[modify] https://crrev.com/7ba924c07b824f8bb7aa67f219a9eb820325d966/extensions/renderer/dispatcher.cc

Project Member

Comment 177 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/25e65f0db2194e169ef68a5daa346eb9c27a5088

commit 25e65f0db2194e169ef68a5daa346eb9c27a5088
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Aug 09 15:40:34 2017

[Extensions Bindings] Include the stack in caught exceptions

Use v8::TryCatch::StackTrace instead of v8::TryCatch::Message when
logging exceptions with the ExceptionHandler. This includes the
message, but also the stack trace.

Add unit tests for the same.

Also update the error message in
ErrorConsoleBrowserTest.BrowserActionRuntimeError (that test now passes
with native bindings).

Bug: 653596

Change-Id: I2174c3f376efb956c798de8d45021ca63a5c65f3
Reviewed-on: https://chromium-review.googlesource.com/604388
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492998}
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/chrome/browser/extensions/error_console/error_console_browsertest.cc
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/extensions/renderer/bindings/api_event_handler_unittest.cc
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/extensions/renderer/bindings/api_request_handler_unittest.cc
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/extensions/renderer/bindings/event_emitter_unittest.cc
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/extensions/renderer/bindings/exception_handler.cc
[modify] https://crrev.com/25e65f0db2194e169ef68a5daa346eb9c27a5088/extensions/renderer/bindings/exception_handler_unittest.cc

Project Member

Comment 178 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e500e8f5ad371ef3cf548422915112d29aaf006

commit 2e500e8f5ad371ef3cf548422915112d29aaf006
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Aug 10 18:56:25 2017

[Extensions Bindings] Update platformKeys API to clear last error

The platformKeys API doesn't follow the normal extension API paradigm
(grr) and exposes errors through a rejected promise. However, it doesn't
then clear the last error, which makes tests fail when they expect
chrome.runtime.lastError to be null.

          --native-crx-bindnigs=1 \
          --gtest_filter=*ManagedWithPermissionPlatformKeysTest*

Bug: 653596
Test: browser_tests \
Change-Id: I64164146cf04efd1c6225d00db9a4fc767e934b5
Reviewed-on: https://chromium-review.googlesource.com/602597
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493481}
[modify] https://crrev.com/2e500e8f5ad371ef3cf548422915112d29aaf006/chrome/renderer/resources/extensions/platform_keys/internal_api.js
[modify] https://crrev.com/2e500e8f5ad371ef3cf548422915112d29aaf006/chrome/renderer/resources/extensions/platform_keys/subtle_crypto.js
[modify] https://crrev.com/2e500e8f5ad371ef3cf548422915112d29aaf006/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js

Project Member

Comment 179 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c030784456a1753c094940b73fe6b272f6fe31a

commit 4c030784456a1753c094940b73fe6b272f6fe31a
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Aug 10 21:12:13 2017

[Extensions Bindings] Introduce a FeatureCache object

Introduce a FeatureCache object to cache the sets of available features
for certain contexts in the renderer. This prevents us from having to
recalculate bindings available to certain context types in many cases;
this is particularly useful for content scripts, where the bindings
have to be injected on potentially every page (blocking page load), but
are always the same set for a extension (modulo updated permissions).

The FeatureCache caches based on a pair of <ExtensionId, ContextType>.
With this, it's not a guarantee that the exact same features will be
available in all contexts that match the key type, since certain
features may be restricted based on URL. However, this does maximize the
likelihood of a cache hit, which is more important (since most contexts
and features are *not* restricted by URL).

Note: for reviewability, this copy-pastes much of the code and only
makes note of further optimizations, rather than implementing them
directly.

In local testing, this (plus a few small followup patches) reduces the
time spent determining available features by >20x in a run that creates
100 iframes.

Bug: 653596

Change-Id: I3dcef3ec0474a86bfc05baf7fb6efaa496e75a2c
Reviewed-on: https://chromium-review.googlesource.com/607530
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493548}
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/BUILD.gn
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/extension_bindings_system.h
[add] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/feature_cache.cc
[add] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/feature_cache.h
[add] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/feature_cache_unittest.cc
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/4c030784456a1753c094940b73fe6b272f6fe31a/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 180 by bugdroid1@chromium.org, Aug 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17945d485f6ab5946ffc7d5a7e55ec5d49aa1c08

commit 17945d485f6ab5946ffc7d5a7e55ec5d49aa1c08
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Aug 11 21:48:59 2017

[Extensions Bindings] Convert -0 to 0 in argument parsing

-0 is internally stored as a double. Account for this in argument
parsing, and allow it to be passed as an integer (with value 0).
This fixes AppWindowAPITest.TestInitialBounds with native bindings.

Bug: 653596
Change-Id: Ifca5f7347effcb5570d4222e7fffff3955582140
Reviewed-on: https://chromium-review.googlesource.com/604352
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493863}
[modify] https://crrev.com/17945d485f6ab5946ffc7d5a7e55ec5d49aa1c08/extensions/renderer/bindings/argument_spec.cc
[modify] https://crrev.com/17945d485f6ab5946ffc7d5a7e55ec5d49aa1c08/extensions/renderer/bindings/argument_spec_unittest.cc

Project Member

Comment 181 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc33eb4090734246ec7c6d62d613970695587abd

commit bc33eb4090734246ec7c6d62d613970695587abd
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Aug 15 17:38:57 2017

[Extensions Bindings] Update FeatureCache for WebUI

The FeatureCache object wasn't correct for WebUI, since WebUI wouldn't
have an associated extension. This resulted in evaluating the first
WebUI context, caching those available features, and then treating that
as the superset of all available features, breaking most WebUI (with the
feature enabled, which isn't unless the flag is passed).

Adjust the FeatureCache to also cache WebUI features. Cache WebUI
features based on origin, in order to similarly maximize cache hits with
WebUI contexts (and because, unlike websites, we have a relatively
limited number of possible WebUI origins).

Also tweak FeatureCache to make it testable for WebUI contexts in order
to add a regression unittest, and additionally add a regression
end-to-end browsertest.

Bug: 653596

Change-Id: I68a8aefe513b945015f312bd4b75337b967e88fc
Reviewed-on: https://chromium-review.googlesource.com/613680
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494433}
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/chrome/browser/extensions/native_bindings_apitest.cc
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/chrome/renderer/resources/extensions/developer_private_custom_bindings.js
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/extensions/renderer/feature_cache.cc
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/extensions/renderer/feature_cache.h
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/extensions/renderer/feature_cache_unittest.cc
[modify] https://crrev.com/bc33eb4090734246ec7c6d62d613970695587abd/extensions/renderer/native_extension_bindings_system.cc

Project Member

Comment 182 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2db58e300c7fbfc0a42ddce344aa16dbb4574315

commit 2db58e300c7fbfc0a42ddce344aa16dbb4574315
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Aug 15 21:29:29 2017

[Extensions] Add an extension to ModuleSystemTest's ScriptContext

The ModuleSystemTestEnvironment constructs a ScriptContext to be used
in tests. Unfortunately, it creates it as a blessed extension context,
but without any associated extension. This used to work because of
crbug.com/755442, but fails with native bindings.

Update extensions unittests to create an appropriate extension to use
with the script context.

Bug: 755442
Bug: 653596

Change-Id: I91f70b274aae5544a73a459eff99e18f787bef6d
Reviewed-on: https://chromium-review.googlesource.com/614793
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494555}
[modify] https://crrev.com/2db58e300c7fbfc0a42ddce344aa16dbb4574315/extensions/renderer/api/mojo_private/mojo_private_unittest.cc
[modify] https://crrev.com/2db58e300c7fbfc0a42ddce344aa16dbb4574315/extensions/renderer/module_system_test.cc
[modify] https://crrev.com/2db58e300c7fbfc0a42ddce344aa16dbb4574315/extensions/renderer/module_system_test.h
[modify] https://crrev.com/2db58e300c7fbfc0a42ddce344aa16dbb4574315/extensions/renderer/mojo/keep_alive_client_unittest.cc

Project Member

Comment 183 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa16000cc2ae79fe877dec97aed133bd9edd8058

commit fa16000cc2ae79fe877dec97aed133bd9edd8058
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Aug 15 21:57:24 2017

[Extensions Bindings] Support aliased features

Support aliased features in native extension bindings. Aliased features
are features that are exposed under one name, but point to a separate
feature. Currently, the only real example is networking.onc (which
points to networkingPrivate).

Add unittests for the same.

Bug: 653596
Test: browser_tests \
          --gtest_filter=NetworkingPrivateChromeOSApiTest.Alias \
          --native-crx-bindings=1
      extensions_unittests \
          --gtest_filter=NativeExtensionBindingsSystemUnittest*Alias*

Change-Id: Id27bc5906587878c25b8c5df3c596a823c88ab30
Reviewed-on: https://chromium-review.googlesource.com/611791
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494564}
[modify] https://crrev.com/fa16000cc2ae79fe877dec97aed133bd9edd8058/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/fa16000cc2ae79fe877dec97aed133bd9edd8058/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 184 by bugdroid1@chromium.org, Aug 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/275ca18259e6a7a57cb47078304c8b7fb73fe7a7

commit 275ca18259e6a7a57cb47078304c8b7fb73fe7a7
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Aug 16 21:39:16 2017

[Extensions Bindings] Add a finch experiment for native bindings

Add a finch experiment, currently not enabled, for native bindings.

Bug: 653596
Change-Id: Ib87d3648b5af6cd6a146b70f0fa5d5179a55f948
Reviewed-on: https://chromium-review.googlesource.com/617581
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494958}
[modify] https://crrev.com/275ca18259e6a7a57cb47078304c8b7fb73fe7a7/extensions/common/feature_switch.cc

Project Member

Comment 185 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f

commit 3e91d7d3da5cbe49b18e6216065f3ef584d62b2f
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Aug 17 00:52:06 2017

[Extensions Bindings] Bulk update of JS files

Update all extension API JS files to work with both JS-based and native
bindings in one fell swoop.

Bug: 653596

Change-Id: Id3b97d09dfea4017499c4f4749113f616c734bd5
Reviewed-on: https://chromium-review.googlesource.com/616176
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495017}
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/automation/automation_node.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/automation_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/certificate_provider_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/desktop_capture_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/downloads_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/enterprise_platform_keys/internal_api.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/enterprise_platform_keys_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/feedback_private_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/file_browser_handler_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/file_manager_private_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/file_system_provider_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/gcm_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/identity_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/image_writer_private_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/media_galleries_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/notifications_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/notifications_test_util.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/omnibox_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/page_action_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/system_indicator_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/tab_capture_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/terminal_private_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/tts_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/renderer/resources/extensions/webrtc_desktop_capture_private_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/app_runtime_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/declarative_webrequest_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/display_source_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/file_system_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/extension_view/extension_view.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/extension_view/extension_view_api_methods.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/extension_view/extension_view_attributes.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/extension_view/extension_view_internal.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/web_view/web_view.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/web_view/web_view_api_methods.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/web_view/web_view_attributes.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/guest_view/web_view/web_view_request_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/i18n_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/printer_provider_custom_bindings.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/renderer/resources/utils.js
[modify] https://crrev.com/3e91d7d3da5cbe49b18e6216065f3ef584d62b2f/extensions/test/data/web_view/apitest/main.js

Project Member

Comment 186 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3a1e507c5ecd4c3dfcd550d6e884873222e6d10

commit c3a1e507c5ecd4c3dfcd550d6e884873222e6d10
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Aug 17 17:02:49 2017

[Extensions Bindings] Parameterize ExtensionBindingsApiTest

Parameterize ExtensionBindingsApiTest to test both JS-based and native
bindings. This ensures some minimum coverage of both bindings systems,
which will be useful while experimenting with native bindings (since
native bindings may be enabled on trunk, but not launched to 100%).

Bug: 653596

Change-Id: I6ac70cc991bb16f9ebaf314443ac4f1190712292
Reviewed-on: https://chromium-review.googlesource.com/617500
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495200}
[modify] https://crrev.com/c3a1e507c5ecd4c3dfcd550d6e884873222e6d10/chrome/browser/extensions/extension_bindings_apitest.cc
[rename] https://crrev.com/c3a1e507c5ecd4c3dfcd550d6e884873222e6d10/chrome/test/data/extensions/api_test/bindings/last_error/bg.html
[rename] https://crrev.com/c3a1e507c5ecd4c3dfcd550d6e884873222e6d10/chrome/test/data/extensions/api_test/bindings/last_error/bg.js
[rename] https://crrev.com/c3a1e507c5ecd4c3dfcd550d6e884873222e6d10/chrome/test/data/extensions/api_test/bindings/last_error/manifest.json

Project Member

Comment 187 by bugdroid1@chromium.org, Aug 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c77b104f84b8b4db0b375795d7a4a2e770a12233

commit c77b104f84b8b4db0b375795d7a4a2e770a12233
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Mon Aug 28 20:34:09 2017

[Extensions Bindings] Add more histograms

Add histograms for the amount of time taken to update bindings for a
given context (split by context type) and for the amount of time taken
to instantiate a new full API binding natively (which is mostly matched
by Extensions.ApiBindingGenerationTime for JS bindings).

Bug: 653596
Change-Id: Id20229c2b972ef75db5c4dac8fe39fe0b09af49d
Reviewed-on: https://chromium-review.googlesource.com/617606
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497861}
[modify] https://crrev.com/c77b104f84b8b4db0b375795d7a4a2e770a12233/extensions/renderer/extension_bindings_system.cc
[modify] https://crrev.com/c77b104f84b8b4db0b375795d7a4a2e770a12233/extensions/renderer/extension_bindings_system.h
[modify] https://crrev.com/c77b104f84b8b4db0b375795d7a4a2e770a12233/extensions/renderer/js_extension_bindings_system.cc
[modify] https://crrev.com/c77b104f84b8b4db0b375795d7a4a2e770a12233/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/c77b104f84b8b4db0b375795d7a4a2e770a12233/tools/metrics/histograms/histograms.xml

Project Member

Comment 188 by bugdroid1@chromium.org, Sep 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/525e2fd74d713739ca2e2f30f07619a850a93852

commit 525e2fd74d713739ca2e2f30f07619a850a93852
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Sep 12 01:19:55 2017

[Extensions Bindings] Split up MessagingBindings

MessagingBindings currently handles both the native helpers for the
messaging bindings JavaScript code as well as the entry points for
dispatching messages and message-related events to extension contexts.

Split this into two objects; one to handle the the native helpers (still
called MessagingBindings) and the other to handle the message
dispatching (JSRendererMessagingService). This is in preparation for
creating a native alternative, which will still need to provide much of
the same functionality for dispatching, but won't rely on any JS
innards.

This CL is moving code and updating names only.

Bug: 653596
Change-Id: I9b1fa4961434e9cba092c29d3514f147f2dac064
Reviewed-on: https://chromium-review.googlesource.com/658397
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501140}
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/BUILD.gn
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/dispatcher.h
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/extension_frame_helper.cc
[add] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/js_renderer_messaging_service.cc
[add] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/js_renderer_messaging_service.h
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/messaging_bindings.cc
[modify] https://crrev.com/525e2fd74d713739ca2e2f30f07619a850a93852/extensions/renderer/messaging_bindings.h

Project Member

Comment 189 by bugdroid1@chromium.org, Sep 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d72e9b4a93dca498feffce95d61f738012db219f

commit d72e9b4a93dca498feffce95d61f738012db219f
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Sep 12 16:11:54 2017

[Extensions Bindings] Extract out a RendererMessagingService base class

Extract a RendererMessagingService base class that can be used with both
JS-based and native extension bindings. Pull out the logic that will be
common to both implementations and put it in the base class, and have
JSRendererMessagingService retain the JS-specific implementation logic.

Bug: 653596

Change-Id: I6ccc81f45a32b4f83d75b34941fed73d9ee857de
Reviewed-on: https://chromium-review.googlesource.com/658496
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501294}
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/BUILD.gn
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/dispatcher.h
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/extension_frame_helper.cc
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/js_renderer_messaging_service.cc
[modify] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/js_renderer_messaging_service.h
[add] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/renderer_messaging_service.cc
[add] https://crrev.com/d72e9b4a93dca498feffce95d61f738012db219f/extensions/renderer/renderer_messaging_service.h

Project Member

Comment 190 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8d53189dd33152bf8c993afcb2faf721f1edec81

commit 8d53189dd33152bf8c993afcb2faf721f1edec81
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 14:39:17 2017

[Extensions Bindings] Remove unneeded InitEventChangeHandler test method

NativeExtensionBindingsSystemTest::InitEventChangeHandler() used to do
something. It doesn't anymore. Remove it.

Bug: 653596
Change-Id: I871fc2de473c432891cc950695a66a64faaa61c6
Reviewed-on: https://chromium-review.googlesource.com/668198
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502247}
[modify] https://crrev.com/8d53189dd33152bf8c993afcb2faf721f1edec81/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 191 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/282ea833bef8dbf11acfa618d06568a910242c4d

commit 282ea833bef8dbf11acfa618d06568a910242c4d
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 14:41:26 2017

[Extensions Bindings] Remove unused test member event_change_handler_

NativeExtensionBindingsSystemTest::event_change_handler_ used to be
needed, but isn't anymore. Remove it.

Bug: 653596
Change-Id: I6664b8ab6c624caf0870c6c26e91bff504be2432
Reviewed-on: https://chromium-review.googlesource.com/668097
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502250}
[modify] https://crrev.com/282ea833bef8dbf11acfa618d06568a910242c4d/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 192 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/282ea833bef8dbf11acfa618d06568a910242c4d

commit 282ea833bef8dbf11acfa618d06568a910242c4d
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 14:41:26 2017

[Extensions Bindings] Remove unused test member event_change_handler_

NativeExtensionBindingsSystemTest::event_change_handler_ used to be
needed, but isn't anymore. Remove it.

Bug: 653596
Change-Id: I6664b8ab6c624caf0870c6c26e91bff504be2432
Reviewed-on: https://chromium-review.googlesource.com/668097
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502250}
[modify] https://crrev.com/282ea833bef8dbf11acfa618d06568a910242c4d/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 193 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/282ea833bef8dbf11acfa618d06568a910242c4d

commit 282ea833bef8dbf11acfa618d06568a910242c4d
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 14:41:26 2017

[Extensions Bindings] Remove unused test member event_change_handler_

NativeExtensionBindingsSystemTest::event_change_handler_ used to be
needed, but isn't anymore. Remove it.

Bug: 653596
Change-Id: I6664b8ab6c624caf0870c6c26e91bff504be2432
Reviewed-on: https://chromium-review.googlesource.com/668097
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502250}
[modify] https://crrev.com/282ea833bef8dbf11acfa618d06568a910242c4d/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 194 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fe480ed7d1e571110b13bb9ed68c0b8738209e35

commit fe480ed7d1e571110b13bb9ed68c0b8738209e35
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 20:51:11 2017

[Extensions Bindings] Add a ScriptContext::context_id

Add a context_id (and accessor) to ScriptContext that uniquely
identifies that script context (globally, across all renderer
processes) using UnguessableToken. This is already needed in messaging
bindings, but could be useful other places as well (event bookkeeping).
This also avoids the need to redefine logic to uniquely identify a
context for native messaging bindings.

Bug: 653596
Change-Id: Iffd11f97a6e645a6f31cddead4e06eeb964bb258
Reviewed-on: https://chromium-review.googlesource.com/668678
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502361}
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/js_renderer_messaging_service.cc
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/js_renderer_messaging_service.h
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/messaging_bindings.cc
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/messaging_bindings.h
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/renderer_messaging_service.cc
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/renderer_messaging_service.h
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/script_context.cc
[modify] https://crrev.com/fe480ed7d1e571110b13bb9ed68c0b8738209e35/extensions/renderer/script_context.h

Project Member

Comment 195 by bugdroid1@chromium.org, Sep 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37961725b11922c66a189ba6a039b75f3306f0e1

commit 37961725b11922c66a189ba6a039b75f3306f0e1
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 15 21:09:54 2017

[Extensions Bindings] Extract NativeExtensionBindingsSystemTest

Make NativeExtensionBindingsSystemTest a reusable test interface in
order to allow other modules to be tested with a functional bindings
system. This will be important going forward for testing custom
bindings that rely on extensions knowledge.

Bug: 653596
Change-Id: I68dfb3ef7e5453adbda3134aa0bc7401a89c0ef9
Reviewed-on: https://chromium-review.googlesource.com/668035
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502372}
[modify] https://crrev.com/37961725b11922c66a189ba6a039b75f3306f0e1/extensions/renderer/BUILD.gn
[modify] https://crrev.com/37961725b11922c66a189ba6a039b75f3306f0e1/extensions/renderer/native_extension_bindings_system_unittest.cc
[add] https://crrev.com/37961725b11922c66a189ba6a039b75f3306f0e1/extensions/renderer/native_extension_bindings_system_unittest.h

Project Member

Comment 196 by bugdroid1@chromium.org, Sep 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd

commit c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Sat Sep 16 03:36:43 2017

[Extensions Bindings] Introduce a GinPort for migrating messaging bindings

Extension messaging is one of the few APIs that's exposed to content
scripts, web pages, and extension contexts alike. It also has a bunch
of custom JS bindings and has led to various bugs and leaks. This makes
it a great target for converting to native bindings.

Introduce a GinPort object to represent the JS-exposed interface of a
runtime.Port object (i.e., the two-way communication extensions use to
message themselves and each other).

Add unittests for the same.

Bug: 653596

Change-Id: I9e4c3c5465a63307ca8c13d26742800f866bf74c
Reviewed-on: https://chromium-review.googlesource.com/657919
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502482}
[modify] https://crrev.com/c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd/extensions/renderer/BUILD.gn
[add] https://crrev.com/c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd/extensions/renderer/gin_port.cc
[add] https://crrev.com/c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd/extensions/renderer/gin_port.h
[add] https://crrev.com/c7d8fd066c4b45e79ba3fbefd84e1bf8ae25e2bd/extensions/renderer/gin_port_unittest.cc

Project Member

Comment 197 by bugdroid1@chromium.org, Sep 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea5ed504beffa20651dc6c03a249fc0ab5eb2dbc

commit ea5ed504beffa20651dc6c03a249fc0ab5eb2dbc
Author: Istiaque Ahmed <lazyboy@chromium.org>
Date: Mon Sep 25 19:00:16 2017

Run Extensions service worker tests with native bindings as well.

Native bindings is not launched and worker scripts correctly work
with native bindings. Until it launches, make sure we do not regress
the behavior, by running extension service worker tests with both
native and JS bindings.

Bug: 653596
Change-Id: I3fb824705242e97fb33c6985c85befa52ec9f11b
Reviewed-on: https://chromium-review.googlesource.com/676260
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504116}
[modify] https://crrev.com/ea5ed504beffa20651dc6c03a249fc0ab5eb2dbc/chrome/browser/extensions/service_worker_apitest.cc

Project Member

Comment 198 by bugdroid1@chromium.org, Sep 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/60b72963433f4a3780e44c748e1397bb01a97d31

commit 60b72963433f4a3780e44c748e1397bb01a97d31
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Sep 29 00:11:41 2017

[Extensions Bindings] Introduce a NativeRendererMessagingService

Introduce a NativeRendererMessagingService to handle extension message
passing with native bindings enabled. Add tests for the same.

To start, only handle port-based messages (i.e., runtime.connect);
subsequent patches will address runtime.sendMessage et al.

The new service is not yet being used, since it is not fully functional
and would break bindings tests.

Bug: 653596
Change-Id: Ibcf1b06552e6097d2494ad3704b8a15bc3c32b7e
Reviewed-on: https://chromium-review.googlesource.com/669862
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505223}
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/common/api/messaging/message.h
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/BUILD.gn
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/bindings/api_event_handler.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/bindings/api_event_handler.h
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/gin_port.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/gin_port.h
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/gin_port_unittest.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/ipc_message_sender.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/ipc_message_sender.h
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/native_extension_bindings_system_unittest.h
[add] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/native_renderer_messaging_service.cc
[add] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/native_renderer_messaging_service.h
[add] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/native_renderer_messaging_service_unittest.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/renderer_messaging_service.cc
[modify] https://crrev.com/60b72963433f4a3780e44c748e1397bb01a97d31/extensions/renderer/script_context_set.cc

Project Member

Comment 199 by bugdroid1@chromium.org, Oct 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43

commit 42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Oct 03 04:48:35 2017

[Extensions Bindings] Have the bindings system own the messaging service

Move ownership of the RendererMessagingService from the dispatcher to
the ExtensionBindingsSystem. This will be useful both when the native
hooks for messaging are ready as well as for use in service worker
contexts (since the bindings system is already created for use in
worker contexts).

For now, since the native hooks aren't ready, both the 
JSExtensionBindingsSystem and the NativeExtensionBindingsSystem create
a JSRendererMessagingService. Once the native hooks are finished, we
can change it so the NativeExtensionBindingsSystem creates a
NativeRendererMessagingService.

Bug: 653596
Change-Id: Ibe23d8c10e3e2320edc49ca67e2a6c489c68b1ad
Reviewed-on: https://chromium-review.googlesource.com/696483
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505945}
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/dispatcher.h
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/extension_bindings_system.h
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/extension_frame_helper.cc
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/js_extension_bindings_system.cc
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/js_extension_bindings_system.h
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/42e22f3f4a577d8bd35f7e0bcb0dc462382c7a43/extensions/renderer/native_extension_bindings_system.h

Project Member

Comment 200 by bugdroid1@chromium.org, Oct 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4fc14c2031959e3b0689ee37617b7d88b41944e

commit c4fc14c2031959e3b0689ee37617b7d88b41944e
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Oct 05 00:28:47 2017

[Extensions Bindings] Run messaging tests with JS and native bindings

Run extension messaging tests with both JS-based and native extension
bindings. This will be useful in detecting any regressions (in either
version) as we develope native extension messaging bindings.

Bug: 653596
Change-Id: I19e58d385da9c134142c39465358d7bbfed7bef0
Reviewed-on: https://chromium-review.googlesource.com/699751
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506582}
[modify] https://crrev.com/c4fc14c2031959e3b0689ee37617b7d88b41944e/chrome/browser/extensions/extension_messages_apitest.cc

Project Member

Comment 201 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b87567692896a58f4b7b5a757052e4497a116f7

commit 0b87567692896a58f4b7b5a757052e4497a116f7
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Oct 06 00:49:21 2017

[Extensions Bindings] Add a OneTimeMessagingHandler

Add a OneTimeMessagingHandler to handle sending one-time messages (such
as those from chrome.runtime.sendMessage) with native bindings. These
messages open a message channel, similar to the long-lived connections
of chrome.runtime.connect(), but the channel is only open for a single
message-and-response cycle.

The OneTimeMessagingHandler is responsible for creating and maintaining
these message channels, and cleaning them up when complete.

Add tests for the same.

Note: currently, these constructs are still only used in tests. A later
CL will hook them up to the bindings system.

Bug: 653596
Change-Id: Ibeae3bda73b66306a85b13749f1cab1a1edfb33b
Reviewed-on: https://chromium-review.googlesource.com/675305
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506932}
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/BUILD.gn
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/bindings/api_request_handler.cc
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/gin_port.cc
[add] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/messaging_util.cc
[add] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/messaging_util.h
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/native_extension_bindings_system_unittest.h
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/native_renderer_messaging_service.cc
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/native_renderer_messaging_service.h
[modify] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/native_renderer_messaging_service_unittest.cc
[add] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/one_time_message_handler.cc
[add] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/one_time_message_handler.h
[add] https://crrev.com/0b87567692896a58f4b7b5a757052e4497a116f7/extensions/renderer/one_time_message_handler_unittest.cc

Project Member

Comment 202 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4532eb0d0c1d3fdef4a0f0b270798668272d105

commit d4532eb0d0c1d3fdef4a0f0b270798668272d105
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Oct 06 20:26:16 2017

[Extensions Bindings] Add a MessageTarget struct

Extension messages can be directed to either an extension, a content
script (a tab), or a native application. These all have the same basic
methods (connect() to return a Port, or sendMessage() for a one-time
communication), but they result in different IPCs being sent to the
browser.

Introduce a MessageTarget struct to differentiate between these three
target types, and accept it as a paremeter in the renderer messaging
services. Have the IPCMessageSender use the struct to determine which
type of message to send to the browser.

Bug: 653596

Change-Id: I67b14195e965ededc995896c78a8f205d42c7915
Reviewed-on: https://chromium-review.googlesource.com/699576
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507164}
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/BUILD.gn
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/ipc_message_sender.cc
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/ipc_message_sender.h
[add] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/message_target.cc
[add] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/message_target.h
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/native_extension_bindings_system_unittest.h
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/native_renderer_messaging_service.cc
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/native_renderer_messaging_service.h
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/native_renderer_messaging_service_unittest.cc
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/one_time_message_handler.h
[modify] https://crrev.com/d4532eb0d0c1d3fdef4a0f0b270798668272d105/extensions/renderer/one_time_message_handler_unittest.cc

Project Member

Comment 203 by bugdroid1@chromium.org, Oct 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/909d1059f65fd64f51d60d926be7762a76f07491

commit 909d1059f65fd64f51d60d926be7762a76f07491
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Oct 10 13:42:43 2017

[Extensions Bindings] Make bindings unittests //chrome-usable

Some of the extensions renderer code is at the //chrome level (i.e., in
//chrome/renderer/extensions, rather than //extensions/renderer). As we
migrate to native bindings, it will be important to test this code, but
currently unittests are all specified in //extensions/renderer.

Make a new GN target for extensions/renderer/unit_test_support that
includes the base classes and structures for unittesting binding code
so that they are usable in //chrome. As part of this, break up the tests
and class definition of NativeExtensionBindingsSystemUnittest into two
files:
- native_extension_bindings_system_test_base.h/cc (the test fixture)
- native_extension_bindings_system_unittest.cc (the tests themselves)

Also add the first //chrome layer bindings unittest (mostly as a
proof-of-concept), which checks that chrome-layer APIs are available.

Bug: 653596
Change-Id: I07f5c3c4cfd6d78fe64ef3b5b275185e02310846
Reviewed-on: https://chromium-review.googlesource.com/706591
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507654}
[add] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/chrome/renderer/extensions/chrome_native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/chrome/test/BUILD.gn
[modify] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/BUILD.gn
[add] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/native_extension_bindings_system_test_base.cc
[rename] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/native_extension_bindings_system_test_base.h
[modify] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/native_renderer_messaging_service_unittest.cc
[modify] https://crrev.com/909d1059f65fd64f51d60d926be7762a76f07491/extensions/renderer/one_time_message_handler_unittest.cc

Project Member

Comment 204 by bugdroid1@chromium.org, Oct 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dbbb47c1eddf26ba2149cd11975cc96dfd5b7694

commit dbbb47c1eddf26ba2149cd11975cc96dfd5b7694
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Oct 13 00:50:16 2017

[Extensions Bindings] Add custom hooks for the runtime API

Add custom hooks for the runtime API to handle extension message passing
and retrieving the manifest, URLs, and extension id. A separate CL will
add support for native messaging, retrieving the background page, and
the package directory entry callback.

Add unittests for the newly added hooks.

Note: these are not yet hooked up in production.

Bug: 653596
Change-Id: I1177c083e8dd72f794d3c28342905d4c170fa61c
Reviewed-on: https://chromium-review.googlesource.com/693394
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508573}
[modify] https://crrev.com/dbbb47c1eddf26ba2149cd11975cc96dfd5b7694/extensions/renderer/BUILD.gn
[add] https://crrev.com/dbbb47c1eddf26ba2149cd11975cc96dfd5b7694/extensions/renderer/runtime_hooks_delegate.cc
[add] https://crrev.com/dbbb47c1eddf26ba2149cd11975cc96dfd5b7694/extensions/renderer/runtime_hooks_delegate.h
[add] https://crrev.com/dbbb47c1eddf26ba2149cd11975cc96dfd5b7694/extensions/renderer/runtime_hooks_delegate_unittest.cc

Project Member

Comment 205 by bugdroid1@chromium.org, Oct 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/63aa35e9929cd269fe7051734ccadc800c836994

commit 63aa35e9929cd269fe7051734ccadc800c836994
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Sat Oct 21 01:27:34 2017

[Extensions Bindings] Add nativeMessaging support to runtime bindings

Add support for native messaging to native runtime bindings. This
includes adding handlers for connect and connectNative, as well as
updating the IPC message sender. Add unittests for the new handlers.

Bug: 653596
Change-Id: Icdf54ab625841220d226a6bf60d0999943ba0ebe
Reviewed-on: https://chromium-review.googlesource.com/710223
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510633}
[modify] https://crrev.com/63aa35e9929cd269fe7051734ccadc800c836994/extensions/renderer/ipc_message_sender.cc
[modify] https://crrev.com/63aa35e9929cd269fe7051734ccadc800c836994/extensions/renderer/runtime_hooks_delegate.cc
[modify] https://crrev.com/63aa35e9929cd269fe7051734ccadc800c836994/extensions/renderer/runtime_hooks_delegate.h
[modify] https://crrev.com/63aa35e9929cd269fe7051734ccadc800c836994/extensions/renderer/runtime_hooks_delegate_unittest.cc

Project Member

Comment 206 by bugdroid1@chromium.org, Nov 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37198937665a497a8fa2ecb854a684cfb6285824

commit 37198937665a497a8fa2ecb854a684cfb6285824
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Nov 07 20:15:23 2017

[Extensions Bindings] Add native tabs hooks

Add native hooks for the tabs API to use with sendRequest, sendMessage,
and connect. Refactor a bit to pull out common code into
messaging_util. Add tests for the new API hooks.

Currently, the TabsHooksDelegate is only used in testing, and is not
enabled (pending the rest of messaging being hooked up with native
bindings).

Bug: 653596
Change-Id: I985ac774b2ad52ec08261ff31a90cf5e97e343a5
Reviewed-on: https://chromium-review.googlesource.com/734720
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514566}
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/chrome/renderer/BUILD.gn
[add] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/chrome/renderer/extensions/tabs_hooks_delegate.cc
[add] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/chrome/renderer/extensions/tabs_hooks_delegate.h
[add] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/chrome/renderer/extensions/tabs_hooks_delegate_unittest.cc
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/chrome/test/BUILD.gn
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/BUILD.gn
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/messaging_util.h
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/one_time_message_handler_unittest.cc
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/runtime_hooks_delegate.cc
[modify] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/runtime_hooks_delegate_unittest.cc
[add] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/send_message_tester.cc
[add] https://crrev.com/37198937665a497a8fa2ecb854a684cfb6285824/extensions/renderer/send_message_tester.h

Project Member

Comment 207 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/84b6fd03c45c6279a0d213b1323116f88b8557f1

commit 84b6fd03c45c6279a0d213b1323116f88b8557f1
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Nov 09 14:13:37 2017

[Extensions] Allow native hooks to only specify a custom callback

Native hooks might want to set a custom callback for a request, but not
fully handle the request. Ensure this works, and add a unittest.

Bug: 653596

Change-Id: I7ed152b33af7266b73f7db26489dd946016e9936
Reviewed-on: https://chromium-review.googlesource.com/759147
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515165}
[modify] https://crrev.com/84b6fd03c45c6279a0d213b1323116f88b8557f1/extensions/renderer/bindings/api_binding_hooks.cc
[modify] https://crrev.com/84b6fd03c45c6279a0d213b1323116f88b8557f1/extensions/renderer/bindings/api_binding_unittest.cc

Project Member

Comment 208 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/be3421dd36e991fdd4e90417c9febd5b323982e5

commit be3421dd36e991fdd4e90417c9febd5b323982e5
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Nov 10 20:32:07 2017

[Extensions Bindings] Pull out view type parsing

Move extension view type parsing from RuntimeCustomBindings to
extensions/common/view_type.* (the same file where the view types are
defined). This both keeps the logic centralized and makes it feasible
to reuse across multiple classes (which will be necessary for native
bindings work).

Bug: 653596
Change-Id: Ie68842cb9e76281c4f45bd9bfa679cdfc873be6b
Reviewed-on: https://chromium-review.googlesource.com/762135
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515661}
[modify] https://crrev.com/be3421dd36e991fdd4e90417c9febd5b323982e5/extensions/common/view_type.cc
[modify] https://crrev.com/be3421dd36e991fdd4e90417c9febd5b323982e5/extensions/common/view_type.h
[modify] https://crrev.com/be3421dd36e991fdd4e90417c9febd5b323982e5/extensions/renderer/runtime_custom_bindings.cc

Project Member

Comment 209 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/182b089fe3b8d29e18ad0ce912ac466d02e491b8

commit 182b089fe3b8d29e18ad0ce912ac466d02e491b8
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Nov 10 22:22:16 2017

[Extensions Bindings] Fix one-time external messaging

External messages are routed to a different event (onMessageExternal vs
onMessage). The OneTimeMessageHandler didn't work with this. Fix this,
and add tests for the same.

Bug: 653596
Change-Id: I181d64f631cbda57c803d6ee159f5dae15c82b1c
Reviewed-on: https://chromium-review.googlesource.com/761482
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515712}
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/messaging_util.h
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/native_renderer_messaging_service.cc
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/native_renderer_messaging_service_unittest.cc
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/one_time_message_handler.h
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/one_time_message_handler_unittest.cc
[modify] https://crrev.com/182b089fe3b8d29e18ad0ce912ac466d02e491b8/extensions/renderer/renderer_messaging_service.cc

Project Member

Comment 210 by bugdroid1@chromium.org, Nov 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da

commit c4b07fbb49bf1a9cff0a8b8793487c69c35d65da
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Nov 14 20:26:34 2017

[Extensions Bindings] Add messaging hooks for the chrome.extension API

Add native bindings to handle messaging for the chrome.extension API.
All of these messaging methods are, in fact, deprecated, but still have
significant usage, and thus need to be supported.

For most of these attributes (sendMessage, connect, and related events),
the chrome.extension instances are actually just aliases for the
chrome.runtime versions. This is a very simple method that has many
potential issues (e.g., setting chrome.runtime.sendMessage would change
chrome.extension.sendMessage, too) - but it's the technique used in
JS-based bindings today. Consider it sufficient for the deprecated
methods.

Add tests for the newly-added hooks.

Note: these hooks are currently not used in production; only in tests.
A later CL will enable them with native bindings.

Bug: 653596

Change-Id: I61b5c17ef0f01c0530263b0855920994e179e017
Reviewed-on: https://chromium-review.googlesource.com/752505
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516406}
[modify] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/chrome/renderer/BUILD.gn
[add] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/chrome/renderer/extensions/extension_hooks_delegate.cc
[add] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/chrome/renderer/extensions/extension_hooks_delegate.h
[add] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/chrome/renderer/extensions/extension_hooks_delegate_unittest.cc
[modify] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/chrome/test/BUILD.gn
[modify] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/extensions/renderer/messaging_util.h
[modify] https://crrev.com/c4b07fbb49bf1a9cff0a8b8793487c69c35d65da/extensions/renderer/runtime_hooks_delegate.cc

Project Member

Comment 211 by bugdroid1@chromium.org, Nov 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3be918d043c41fe5c4a26a49aa49a1f83b19e076

commit 3be918d043c41fe5c4a26a49aa49a1f83b19e076
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Nov 15 23:16:04 2017

[Extensions Bindings] Update conversion code

Update APISignature::ConvertArgumentsIgnoringSchema() and
ArgumentSpec::ParseArgumentToAny() to configure the V8ValueConverter
to strip null from objects and convert negative 0 to an integer. In
addition to being necessary in the long-term, this is a speculative fix
for a crash found in the native bindings experiment.

Bug: 781674
Bug: 653596

Change-Id: I4ad30f955cf434fc8788d4a6fa605059eb9c20f1
Reviewed-on: https://chromium-review.googlesource.com/769788
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516881}
[modify] https://crrev.com/3be918d043c41fe5c4a26a49aa49a1f83b19e076/extensions/renderer/bindings/api_signature.cc
[modify] https://crrev.com/3be918d043c41fe5c4a26a49aa49a1f83b19e076/extensions/renderer/bindings/api_signature_unittest.cc
[modify] https://crrev.com/3be918d043c41fe5c4a26a49aa49a1f83b19e076/extensions/renderer/bindings/argument_spec.cc

Project Member

Comment 212 by bugdroid1@chromium.org, Nov 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048

commit fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Nov 16 03:49:55 2017

[Extensions Bindings] Enforce a max size for passed messages

Update native bindings message passing to enforce the same max-size
constraints that JS bindings do. Add unittests for the same.

Bug: 653596
Change-Id: I0ae97ba4f9a77e1aed6da1530865ba3963fc9b74
Reviewed-on: https://chromium-review.googlesource.com/770551
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516976}
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/chrome/renderer/extensions/extension_hooks_delegate.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/chrome/renderer/extensions/tabs_hooks_delegate.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/BUILD.gn
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/gin_port.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/gin_port_unittest.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/messaging_bindings.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/messaging_util.h
[add] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/messaging_util_unittest.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/fe7aae6ce84cfa5d7a2bed2f188d3e0b515b0048/extensions/renderer/runtime_hooks_delegate.cc

Project Member

Comment 213 by bugdroid1@chromium.org, Nov 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/16cb0e7be171ec2f63e6deb72b10f646ed31b0bf

commit 16cb0e7be171ec2f63e6deb72b10f646ed31b0bf
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Nov 16 19:31:05 2017

[Extensions Bindings] Pull v8 frame fetching in ExtensionFrameHelper

The ExtensionFrameHelper already has logic to find extension frames
matching certain criteria, which is used by custom bindings to return
the global objects for those frames. Move the logic to get the v8
global objects from the custom bindings to the ExtensionFrameHelper in
order to allow re-use with other bindings.

Bug: 653596

Change-Id: Ibb7d57e90bdb83cd574a95eb80db222456dd3e79
Reviewed-on: https://chromium-review.googlesource.com/763572
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517151}
[modify] https://crrev.com/16cb0e7be171ec2f63e6deb72b10f646ed31b0bf/extensions/renderer/extension_frame_helper.cc
[modify] https://crrev.com/16cb0e7be171ec2f63e6deb72b10f646ed31b0bf/extensions/renderer/extension_frame_helper.h
[modify] https://crrev.com/16cb0e7be171ec2f63e6deb72b10f646ed31b0bf/extensions/renderer/runtime_custom_bindings.cc

Project Member

Comment 214 by bugdroid1@chromium.org, Nov 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26

commit 37b1fa8a7333442ae6391f9709fbc3a5f8efcb26
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Nov 22 04:48:44 2017

[Extensions Bindings] Add a v8_out_value to ArgumentSpec::ParseArgument

Add a |v8_out_value| parameter to ArgumentSpec::ParseArgument in order
to allow for populating a v8 value as an out parameter. This is
advantageous over just copying the input value directly for two reasons:
- defined object parameters become data objects without any tricky
  getters. i.e., if we have a params argument with a string property
  'foo', if we don't construct a "clean" object, we'll have to check the
  value of 'foo' for validity at each access. With creating a new
  object, we can ensure that the value is valid once, and remains
  constant throughout the calls.
- We can handle subtle conversions (such as -0, which is stored as a
  number in v8, to 0, an integer) once, and not need to worry about them
  again.

Update ArgumentSpec and add unittests for the same.

Bug: 653596

Change-Id: Ic2622e3d1c802dea2fa0522efde8ef236e96e6a3
Reviewed-on: https://chromium-review.googlesource.com/749105
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518530}
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/api_signature.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/api_signature_unittest.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/argument_spec.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/argument_spec.h
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/argument_spec_builder.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/argument_spec_builder.h
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/bindings/argument_spec_unittest.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/chrome_setting.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/content_setting.cc
[modify] https://crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26/extensions/renderer/declarative_content_hooks_delegate.cc

Project Member

Comment 215 by bugdroid1@chromium.org, Nov 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/75bd3602b5a264c8bb375e532a643ae04496971f

commit 75bd3602b5a264c8bb375e532a643ae04496971f
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Nov 22 19:03:07 2017

[Extensions Bindings] Watch for onMessage reply destruction

Listeners to the onMessage event are provided a `reply` callback they
can use to reply back to the sender. Until the listener replies, we
keep the channel open. However, the listener may not ever reply. In
order to avoid keeping the channel open indefinitely in all of these
cases, monitor the `reply` callback's lifetime in V8. When it's
garbage collected (and thus we know the listener won't reply), close
the channel.

Bug: 653596

Change-Id: Ib5de5cd98453c17f965b603914106b7dbb6c3024
Reviewed-on: https://chromium-review.googlesource.com/773465
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518699}
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/bindings/api_binding_test.cc
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/bindings/api_binding_test.h
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/gc_callback.cc
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/gc_callback.h
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/gc_callback_unittest.cc
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/one_time_message_handler.h
[modify] https://crrev.com/75bd3602b5a264c8bb375e532a643ae04496971f/extensions/renderer/one_time_message_handler_unittest.cc

Project Member

Comment 216 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1bf4474305b02a262eccdb0cfe09650bcedfffbd

commit 1bf4474305b02a262eccdb0cfe09650bcedfffbd
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Nov 28 23:26:26 2017

[Extensions Bindings] Correctly use a StrictMock for the IPC Sender

We have a UseStrictIPCMessageSender() method in
NativeExtensionBindingsSystemUnittest, but it wasn't being checked
when we instantiated the IPCMessageSender. Correctly check it so that
tests that want strict mocking get it.

Bug: 653596

Change-Id: Ib18945a14e0a88788bcfe9e56c530ff0ae2b36ca
Reviewed-on: https://chromium-review.googlesource.com/786900
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519896}
[modify] https://crrev.com/1bf4474305b02a262eccdb0cfe09650bcedfffbd/extensions/renderer/native_extension_bindings_system_test_base.cc

Project Member

Comment 217 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e72ffcc852d47d9203e037af834d3c4a64d8e21

commit 2e72ffcc852d47d9203e037af834d3c4a64d8e21
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Nov 29 01:36:03 2017

[Extensions Bindings] Introduce a JSRunner class

Introduce a JSRunner class to handle safely running JS functions in the
renderer. We abstract this out for testing purposes, since in a real
build we have to worry about things like JS being suspended, while in a
testing in environment we don't. Prior to this, we curried around
callbacks throughout the binding system. This led to nearly every object
taking a "run_js" member, and makes expanding (e.g. to have a
run_js_sync version) painful.

Instead, create a common JSRunner class that can handle running JS
functions in different manners. This class is a per-thread singleton,
and can be overridden for testing.

The test versions also allow us to have more granularity around when we
allow/expect errors in JS execution, vs before where we had to either
allow all errors or none.

Bug: 653596
Change-Id: Ic5d16faaf3757cae60033850580f13689fa5b9a1
Reviewed-on: https://chromium-review.googlesource.com/776650
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519946}
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/BUILD.gn
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_bridge.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_bridge.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks_delegate.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks_delegate.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks_test_delegate.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_hooks_test_delegate.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_js_util.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_js_util.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_js_util_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_test.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_test.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_types.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_bindings_system.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_bindings_system.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_bindings_system_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_event_handler.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_event_handler.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_event_handler_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_request_handler.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/api_request_handler_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/declarative_event_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/event_emitter_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/exception_handler.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/exception_handler.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/exception_handler_unittest.cc
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/js_runner.cc
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/js_runner.h
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/test_js_runner.cc
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/bindings/test_js_runner.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/content_setting.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/content_setting.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/declarative_content_hooks_delegate.h
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/extension_js_runner.cc
[add] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/extension_js_runner.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/gin_port_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/native_extension_bindings_system_test_base.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/native_extension_bindings_system_test_base.h
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/native_extension_bindings_system_unittest.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/web_request_hooks.cc
[modify] https://crrev.com/2e72ffcc852d47d9203e037af834d3c4a64d8e21/extensions/renderer/web_request_hooks.h

Project Member

Comment 218 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1344729fa54d49a6ca98690e857d97378f99c3c

commit b1344729fa54d49a6ca98690e857d97378f99c3c
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Nov 29 02:04:17 2017

[Extensions Bindings] Throw access errors on restricted sendRequest

We throw errors when certain extensions (unpacked with an event page)
try to use the deprecated sendRequest-related properties of the
chrome.extension API. Implement this for native bindings. In order to
do this, add an InitializeInstance() method on native binding hooks
that allows hooks to modify the newly-created instance of an API for a
specific context.

Add unittests for both InitializeInstance and the restriction of
sendRequest properties.

Bug: 653596

Change-Id: I22be1f0f9d4f299e127b21084649000bab63ddfa
Reviewed-on: https://chromium-review.googlesource.com/775516
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519957}
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/chrome/renderer/extensions/extension_hooks_delegate.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/chrome/renderer/extensions/extension_hooks_delegate.h
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/chrome/renderer/extensions/extension_hooks_delegate_unittest.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_hooks.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_hooks.h
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_hooks_delegate.h
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_hooks_test_delegate.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_hooks_test_delegate.h
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/b1344729fa54d49a6ca98690e857d97378f99c3c/extensions/renderer/messaging_util.h

Project Member

Comment 219 by bugdroid1@chromium.org, Nov 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bba3c45394e092bb649b6dffed4405a8569e550a

commit bba3c45394e092bb649b6dffed4405a8569e550a
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Nov 30 18:49:07 2017

[Extensions Bindings] Change how we run synchronous JS functions

Currently, native extension bindings use the same method to execute
script whether or not JS is suspended at the time. The difference
instead is that we expect JS to finish synchronously in the sync case.
This is nice, because it means that we never circumvent script
suspension.

Unfortunately, this is insufficient. We need to execute script
synchronously in order to respond to certain JS calls, and script can
be running at multiple times even though JS is suspended (though it
perhaps shouldn't be).

Instead, change RunJSFunctionSync() to use APIs that guarantee script
execution (WebLocalFrame::CallFunctionEvenIfScriptDisabled and
v8::Function::Call). Since these should only be used in response to
direct JS entry points, this shouldn't introduce any new areas of
running script while suspended.

Bug: 786957, 653596

Change-Id: Ibc2f066bd562ab071dbd7cb2bd7de7b46d9d6892
Reviewed-on: https://chromium-review.googlesource.com/786894
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520623}
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/api_binding_hooks.cc
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/js_runner.h
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/test_js_runner.cc
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/bindings/test_js_runner.h
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/extension_js_runner.cc
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/extension_js_runner.h
[modify] https://crrev.com/bba3c45394e092bb649b6dffed4405a8569e550a/extensions/renderer/web_request_hooks.cc

Project Member

Comment 220 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a2402253b0256188e8bcc26a12ba8c079491f9a

commit 0a2402253b0256188e8bcc26a12ba8c079491f9a
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Dec 01 23:17:51 2017

[Extensions Bindings] Call InitializeBindingsSystem for worker bindings

Ensure that we call DispatcherDelegate::InitializeBindingsSystem for
the bindings system created for worker-thread bindings in order to
allow adding custom bindings.

Bug: 653596
Change-Id: I4e5a71d13d27738098daf281ff49400f533b716d
Reviewed-on: https://chromium-review.googlesource.com/759720
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521108}
[modify] https://crrev.com/0a2402253b0256188e8bcc26a12ba8c079491f9a/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/0a2402253b0256188e8bcc26a12ba8c079491f9a/extensions/renderer/dispatcher.h
[modify] https://crrev.com/0a2402253b0256188e8bcc26a12ba8c079491f9a/extensions/renderer/worker_thread_dispatcher.cc
[modify] https://crrev.com/0a2402253b0256188e8bcc26a12ba8c079491f9a/extensions/renderer/worker_thread_dispatcher.h

Project Member

Comment 221 by bugdroid1@chromium.org, Dec 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e700ab58ce3ce745c39dbf5893a3b6576aec53a2

commit e700ab58ce3ce745c39dbf5893a3b6576aec53a2
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Dec 05 02:17:20 2017

[Extensions Bindings] Restructure event dispatching during JS suspension

JS can be suspended when the renderer receives the IPC to dispatch an
event. In this case, the JS shouldn't immediately run, but rather
respect the JS state. Currently, the EventEmitter does this by using
JSRunner::RunJSFunction() (which does respect JS suspension) with each
of the listeners for the event.

This mostly works, but has a couple of problems. For one, it makes it
difficult to catch exceptions thrown from a JS listener (since the
listener isn't notified when we queue it up through the JSRunner). It
also doesn't account for the possibility of listeners being removed
between a event comes in, and when it is actually disptached. Finally,
it makes creating a single result for the dispatch difficult, which is
problematic for messaging bindings.

Rework the way event dispatching works to instead use a v8::Function
wrapper around the EventEmitter to trigger the event being dispatched
to listeners. Once that function is triggered, it's safe to use
synchronous JS execution, since JS is already running at that point.
This addresses the concerns with the current approach.

Also add a Suspension utility to the TestJSRunner to simulate JS being
suspended in testing, and add unit tests for dispatching events while
JS is suspended.

Bug: 653596

Change-Id: I7899e1946e8fe750fa2a1f53d62a04e5bd075664
Reviewed-on: https://chromium-review.googlesource.com/792033
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521592}
[modify] https://crrev.com/e700ab58ce3ce745c39dbf5893a3b6576aec53a2/extensions/renderer/bindings/api_event_handler_unittest.cc
[modify] https://crrev.com/e700ab58ce3ce745c39dbf5893a3b6576aec53a2/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/e700ab58ce3ce745c39dbf5893a3b6576aec53a2/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/e700ab58ce3ce745c39dbf5893a3b6576aec53a2/extensions/renderer/bindings/test_js_runner.cc
[modify] https://crrev.com/e700ab58ce3ce745c39dbf5893a3b6576aec53a2/extensions/renderer/bindings/test_js_runner.h

Project Member

Comment 222 by bugdroid1@chromium.org, Dec 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/85efd624f1acb1aa2ec39a774a4d54d063bb7765

commit 85efd624f1acb1aa2ec39a774a4d54d063bb7765
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Tue Dec 05 19:31:57 2017

[Extensions Bindings] Simplify message option parsing

Now that we create a new V8 object when parsing an argument to V8 (see
crrev.com/37b1fa8a7333442ae6391f9709fbc3a5f8efcb26), we don't need to
do all the double-checking for validity and script throwing errors in
messaging_util::ParseMessageOptions. Instead, we can just know that the
value is safe to use.

Update messaging_util::ParseMessageOptions and all its callsites to be
simpler.

Additionally, set the prototype of the parsed object in ArgumentSpec to
null to avoid tricky getters/setters on the Object.prototype, which
could be hit if the argument was missing an optional property.

Bug: 653596

Change-Id: I3f53a3973d9c5a833799248b50832b55bac2792c
Reviewed-on: https://chromium-review.googlesource.com/794451
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521782}
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/chrome/renderer/extensions/tabs_hooks_delegate.cc
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/bindings/argument_spec.cc
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/bindings/argument_spec_unittest.cc
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/messaging_util.h
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/runtime_hooks_delegate.cc
[modify] https://crrev.com/85efd624f1acb1aa2ec39a774a4d54d063bb7765/extensions/renderer/runtime_hooks_delegate_unittest.cc

Project Member

Comment 223 by bugdroid1@chromium.org, Dec 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0

commit 9ff5b9c5887d6f7784dadbd10330501e9e27e5d0
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Dec 06 23:18:21 2017

[Extensions Bindings] Add a thread-friendly ScriptContext getter

Add a common ScriptContext getter to retrieve a ScriptContext from a
given v8::Context that works across threads. This previously existed,
but only in native_extension_bindings_system.cc. Pull it out to a common
file to a) make it reusable from other consumers (custom hooks will need
to use this) and b) remove (direct) threading knowledge from the bindings
system.

Bug: 653596

Change-Id: I09a0e4ea76bb891ab1871ca1deb0d315e6e9789d
Reviewed-on: https://chromium-review.googlesource.com/812173
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522243}
[modify] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/chrome/renderer/extensions/extension_hooks_delegate.cc
[modify] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/chrome/renderer/extensions/tabs_hooks_delegate.cc
[modify] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/extensions/renderer/BUILD.gn
[add] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/extensions/renderer/get_script_context.cc
[add] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/extensions/renderer/get_script_context.h
[modify] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/9ff5b9c5887d6f7784dadbd10330501e9e27e5d0/extensions/renderer/runtime_hooks_delegate.cc

Project Member

Comment 224 by bugdroid1@chromium.org, Dec 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6

commit b15c4f4e03aee9e5651d99b7bcf3506287cb71b6
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Dec 15 21:20:11 2017

[Extensions Bindings] Account for listeners destroying the context

An event listener could destroy the context when it's notified (e.g.,
if it does window.close()). We need to account for this case. Check
after each listener is executed whether the context is still valid.

Add native bindings-specific unittests and a JS/Native bindings
browsertest.

Bug: 653596

Change-Id: I47e789800ca90935457781695d3e8c3de7aae317
Reviewed-on: https://chromium-review.googlesource.com/818528
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524466}
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/chrome/browser/extensions/extension_bindings_apitest.cc
[add] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/chrome/test/data/extensions/api_test/bindings/listeners_destroy_context/content_script.js
[add] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/chrome/test/data/extensions/api_test/bindings/listeners_destroy_context/manifest.json
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/extensions/renderer/bindings/api_event_handler.h
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/extensions/renderer/bindings/api_request_handler.h
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/b15c4f4e03aee9e5651d99b7bcf3506287cb71b6/extensions/renderer/bindings/event_emitter_unittest.cc

Project Member

Comment 225 by bugdroid1@chromium.org, Dec 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e086c76103caed62d85a61e4e42c8240f20f2b64

commit e086c76103caed62d85a61e4e42c8240f20f2b64
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Thu Dec 21 17:47:14 2017

[Extensions Bindings] Close the message port if no listeners return true

chrome.runtime.sendMessage requires listeners that will reply
asynchronously to return `true` - this allows the bindings to close the
message port if no listeners intend to respond (protecting against
leakage).

Implement this for native bindings. This takes two steps:
- introduce a callback to JSRunner in order to return the result from
  an asynchronous run of JS. This is necessary in order to see the
  result from dispatching the event to listeners, since the event may
  arrive when JS is disabled.
- look at the returned result from dispatching the runtime.onMessage
  event, and close the port if no listener returned `true`.

Add tests for the same.

Bug: 653596

Change-Id: Ifc9fdd376ae6568d1e4382eed0913c5b9d4c65b8
Reviewed-on: https://chromium-review.googlesource.com/786549
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525732}
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/chrome/renderer/extensions/extension_hooks_delegate_unittest.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/api_event_handler.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/api_event_handler.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/event_emitter.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/event_emitter_unittest.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/js_runner.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/js_runner.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/test_js_runner.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/bindings/test_js_runner.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/extension_js_runner.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/extension_js_runner.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/gin_port.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/native_renderer_messaging_service.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/native_renderer_messaging_service_unittest.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/one_time_message_handler.h
[modify] https://crrev.com/e086c76103caed62d85a61e4e42c8240f20f2b64/extensions/renderer/one_time_message_handler_unittest.cc

Project Member

Comment 226 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/194f8057ef72d82156c394bd6235904ed4d2cfd6

commit 194f8057ef72d82156c394bd6235904ed4d2cfd6
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jan 12 22:56:28 2018

[Extensions Bindings] Allow bindings to be overwritten

Author script should be able to overwrite the value of extension
bindings. This doesn't currently work because SetAccessor() takes
priority and doesn't allow for value setting.

Introduce a custom setter that stores a new value as a private property,
and check for this before returning the value from the accessor.

Add unittests for the same, and update the browser test to cover this as
well. This also makes PDFExtensionTest.Metrics pass with native bindings
enabled.

Bug: 653596
Change-Id: Ic92e30b0634ddcb90d74b7933e17ce5cd642ea99
Reviewed-on: https://chromium-review.googlesource.com/860734
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529096}
[modify] https://crrev.com/194f8057ef72d82156c394bd6235904ed4d2cfd6/chrome/test/data/extensions/api_test/native_bindings/extension/background.js
[modify] https://crrev.com/194f8057ef72d82156c394bd6235904ed4d2cfd6/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/194f8057ef72d82156c394bd6235904ed4d2cfd6/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 227 by bugdroid1@chromium.org, Jan 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b48b6f91d6bf9db36290277779152e4d081a387d

commit b48b6f91d6bf9db36290277779152e4d081a387d
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jan 12 23:17:59 2018

[Extensions Bindings] Add context validity checks in StorageArea

chrome.storage.[sync|local|managed] are implemented as StorageArea
objects, which handle the calls for storage API methods. These need to
check the validity of the context before continuing, since it's possible
the context is invalidated at some point in the past (e.g., if a parent
frame kept around a reference to a child frame's chrome.storage.local
object).

Check the validity of the context before handling the call, and add unit
and browser tests to cover this case.

Bug: 800836
Bug: 653596
Change-Id: I0ae8ba33d52b335f4a1bc18f23058c1ef8c72843
Reviewed-on: https://chromium-review.googlesource.com/861949
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529101}
[modify] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/chrome/browser/extensions/extension_bindings_apitest.cc
[add] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/chrome/test/data/extensions/api_test/bindings/invalidate_context/background.js
[add] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/chrome/test/data/extensions/api_test/bindings/invalidate_context/frame.html
[add] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/chrome/test/data/extensions/api_test/bindings/invalidate_context/manifest.json
[modify] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/extensions/renderer/BUILD.gn
[modify] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/extensions/renderer/storage_area.cc
[add] https://crrev.com/b48b6f91d6bf9db36290277779152e4d081a387d/extensions/renderer/storage_area_unittest.cc

Project Member

Comment 228 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/13fb66839f94e702291ad79d749ca21e14c47d98

commit 13fb66839f94e702291ad79d749ca21e14c47d98
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jan 19 03:00:37 2018

[Extensions Bindings] Expand context validity checks and add errors

Extension APIs and API objects can potentially be accessed after the
context is invalidated (e.g., if a parent frame stores a reference to a
child frame's API object, then removes the child frame, then tries to
use the API object). We don't support this because we require a valid
ScriptContext.

Expand the checks we have in place for this to include all the custom
API types (StorageArea was previously handled, but expand to
ContentSetting, ChromeSetting, and EasyUnlockPrivate), and add a common
method to check context validity and throw an error if the context is
invalid.

Update the checks in APIBinding when we are accessing an API method or
retrieving an event as well.

Add tests for all of these instances - custom chrome API objects,
API methods, and API events.

Bug: 653596

Change-Id: Ifca7694fbd6c78260a015231f19fc241e5a39b8a
Reviewed-on: https://chromium-review.googlesource.com/869375
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530408}
[add] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/chrome/renderer/extensions/custom_types_unittest.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/chrome/test/BUILD.gn
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/bindings/api_binding.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/bindings/api_binding_unittest.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/bindings/api_binding_util.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/bindings/api_binding_util.h
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/chrome_setting.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/content_setting.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/easy_unlock_proximity_required_stub.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/storage_area.cc
[modify] https://crrev.com/13fb66839f94e702291ad79d749ca21e14c47d98/extensions/renderer/storage_area_unittest.cc

Project Member

Comment 229 by bugdroid1@chromium.org, Jan 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f9e10f5f5c0d96154173612dc2c1e2d923452e7b

commit f9e10f5f5c0d96154173612dc2c1e2d923452e7b
Author: Jeremy Roman <jbroman@chromium.org>
Date: Sat Jan 27 07:23:43 2018

[Extension Bindings] Use v8::Object::SetLazyDataProperty for replaceable API properties.

This removes the custom workaround to emulate this behavior.

A unit test is adjusted to reflect the fact that a previously generated API binding
will continue to be returned.

Bug: 653596
Change-Id: Ib158164234e111180a00750ba736cd303be391c0
Reviewed-on: https://chromium-review.googlesource.com/867517
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532186}
[modify] https://crrev.com/f9e10f5f5c0d96154173612dc2c1e2d923452e7b/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/f9e10f5f5c0d96154173612dc2c1e2d923452e7b/extensions/renderer/native_extension_bindings_system_unittest.cc

Project Member

Comment 230 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b15f7f04de19b4e835f7be615a1d488876f8d086

commit b15f7f04de19b4e835f7be615a1d488876f8d086
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Jan 31 19:37:32 2018

[Extensions Bindings] Finish messaging-related implementations

Add the remaining functionality for messaging-related bindings to the
native bindings implementaiton. This includes odds and ends for the
extension and runtime APIs, such as getBackgroundPage() or
inIncognitoContext().

Also update tests to accept either outcome when there are different
behaviors for native and JS-based bindings. This happens significantly
in the following areas:
- We don't clobber JSON methods with native bindings, because it's
  unhelpful and would be painful to accommodate. See also
  https://crbug.com/792602.
- Native bindings throw an error with unserializable messages, whereas
  JS bindings only log an error (which seems less helpful).
- Native bindings validate that an extension ID is valid when it is
  provided for message passing, rather than just verifying it is a
  string.
- Calling chrome.runtime.sendMessage no longer implicitly calls
  chrome.runtime.connect with native bindings, which adjusts our
  expectations in activity logging (to be more accurate).

Also update WebViewInteractiveTest.TextSelection test to address a race
condition where a test body could finish before a context menu was properly
dismissed, resulting in a timeout.

Additionally, add a nativeCrxBindingsEnabled flag to the test config
exposed to extension tests so they can detect which expectation to use.

Finally, hook up native bindings with messaging so that they are used in
production (if and only if native bindings are enabled on the whole). This
allows us to avoid registering JS bindings for 'messaging',
'messaging_utils', 'runtime', 'extension', and 'tabs'.

Bug: 653596
Bug: 792602

Change-Id: If09f607fe5c9f30578f84248173848b30c7bbf21
Reviewed-on: https://chromium-review.googlesource.com/860755
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533360}
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/browser/extensions/extension_apitest.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/browser/extensions/extension_messages_apitest.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/renderer/extensions/extension_hooks_delegate.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/renderer/extensions/extension_hooks_delegate.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/test/data/extensions/api_test/activity_log_private/test/test.js
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/test/data/extensions/api_test/messaging/connect/page.js
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/test/data/extensions/api_test/messaging/connect/test.js
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/chrome/test/data/extensions/api_test/messaging/large_messages/background.js
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/common/api/test.json
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/api_activity_logger.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/api_activity_logger.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/bindings/api_event_handler.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/bindings/event_emitter.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/bindings/test_js_runner.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/dispatcher_delegate.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/extension_frame_helper.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/extension_frame_helper.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/gin_port.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/ipc_message_sender.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/messaging_util.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/native_extension_bindings_system.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/native_extension_bindings_system.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/native_renderer_messaging_service.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/one_time_message_handler.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/one_time_message_handler_unittest.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/runtime_hooks_delegate.cc
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/runtime_hooks_delegate.h
[modify] https://crrev.com/b15f7f04de19b4e835f7be615a1d488876f8d086/extensions/renderer/runtime_hooks_delegate_unittest.cc

Project Member

Comment 231 by bugdroid1@chromium.org, Feb 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bdc3989380c365c2e8808cc4fa65126a8f8b72dd

commit bdc3989380c365c2e8808cc4fa65126a8f8b72dd
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Feb 02 15:50:50 2018

[Extensions Bindings] Fix GetPackageDirectoryEntry

GetPackageDirectoryEntry has a ModuleSystem::NativesEnabledScope that
wasn't quite long enough. We need to ensure that the scope allows the
function to generate the callback
(fileEntryBindingUtil.getBindDirectoryEntryCallback) to run with
natives, since it may require modules in the background page.

Expand the natives enabled scope by just enough to make this work.

Bug: 653596
Test: browser_tests --enable-features=NativeCrxBindings
                    --gtest_filter=*GetPackageDirectoryEntryApp*

Change-Id: I209c4e8f92d0b10955d1ecafe489b68a2b18af88
Reviewed-on: https://chromium-review.googlesource.com/898399
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534060}
[modify] https://crrev.com/bdc3989380c365c2e8808cc4fa65126a8f8b72dd/extensions/renderer/runtime_hooks_delegate.cc

Project Member

Comment 232 by bugdroid1@chromium.org, Feb 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/47e79040d9e835070242551b3547502a954e557f

commit 47e79040d9e835070242551b3547502a954e557f
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Feb 02 18:32:26 2018

[Extensions Bindings] Move CrazyExtensionTest.Crazy to bindings apitests

CrazyExtensionTest.Crazy tests the result of calling into the app API
of a removed context. Conceptually, this is very similar to other
extension bindings API tests, and would benefit from constant tree
coverage with both JS and native bindings. Move the test to the
ExtensionBindingsApiTest suite, and have it run with both JS and native
bindings.

Additionally, the behavior for native and JS bindings is slightly
different when accessing invalidated contexts' APIs: Native bindings
throw an error, whereas JS bindings do not. Adjust the test expectations
accordingly.

Also rename the test to something slightly more descriptive
(s/Crazy/UseAppAPIAfterFrameRemoval).

Bug: 653596
Test: browser_tests --gtest_filter=*UseAppAPIAfterFrameRemoval*

Change-Id: Ic9c1615eda03320262d04c9760bc7879b2af78c5
Reviewed-on: https://chromium-review.googlesource.com/898397
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534103}
[delete] https://crrev.com/dc0c2db86845231486f3493c850751f7e638fbe8/chrome/browser/extensions/crazy_extension_browsertest.cc
[modify] https://crrev.com/47e79040d9e835070242551b3547502a954e557f/chrome/browser/extensions/extension_bindings_apitest.cc
[modify] https://crrev.com/47e79040d9e835070242551b3547502a954e557f/chrome/test/BUILD.gn
[modify] https://crrev.com/47e79040d9e835070242551b3547502a954e557f/chrome/test/data/extensions/api_test/crazy_extension/background.js

Project Member

Comment 233 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/edf9d95aa61923672da1259415e628cf45f20dd8

commit edf9d95aa61923672da1259415e628cf45f20dd8
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Wed Feb 07 17:59:49 2018

[Extensions Bindings] Add native bindings for the i18n API

Add native bindings for the i18n API. This is the last API that's
exposed to content scripts that hasn't been converted to support native
bindings; with this, content scripts shouldn't require any JS binding
support.

Extract out common functionality between i18n_custom_bindings.cc and
the new i18n_hooks_delegate into a shared i18n_hooks_util file. Add
unittests for the new hooks delegate, which also exercises the
shared methods.

Finally, update the GetMessage handling to not crash if an error is
thrown in string conversions.

Bug: 653596, 807771

Change-Id: I8b9fd5e746298699d589b3aa4d3ef7364488eac7
Reviewed-on: https://chromium-review.googlesource.com/896303
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535054}
[add] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/chrome/renderer/extensions/i18n_hooks_delegate_unittest.cc
[modify] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/chrome/test/BUILD.gn
[modify] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/BUILD.gn
[modify] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/dispatcher.cc
[modify] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/i18n_custom_bindings.cc
[add] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/i18n_hooks_delegate.cc
[add] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/i18n_hooks_delegate.h
[add] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/i18n_hooks_util.cc
[add] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/i18n_hooks_util.h
[modify] https://crrev.com/edf9d95aa61923672da1259415e628cf45f20dd8/extensions/renderer/native_extension_bindings_system.cc

Status: Fixed (was: Assigned)
The new system is fully functional and has been in finch for awhile now.  I'm closing this out in favor of the launch bug (to track stable launch) and smaller bugs to track conversion for the long tail of files and any new issues that crop up.
#234 - congratulations!

Comment 236 by rob@robwu.nl, May 14 2018

Devlin, where is the launch bug that tracks enabling NativeCrxBindings / --native-crx-bindings=1 by default?
Probably bug 763564.
Showing comments 138 - 237 of 237 Older

Sign in to add a comment