New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 726943 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
please use my google.com address
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 734210



Sign in to add a comment

Streamline Mojo JS usage in Chrome

Project Member Reported by roc...@chromium.org, May 26 2017

Issue description

There's a lot of accumulated cruft around Mojo usage in JavaScript code. We have two (or more!) ways of doing many things and it's confusing.

This is a tracking bug to cover a few goals:

 - Remove old core native bindings and use web IDL MojoJS exclusively
 - Remove AMD modules for interface providers and connector
 - Introduce more MojoJS IDL for a simple document-scoped
   InterfaceProvider-like thing
 - Figure out InterfaceProvider-like thing for workers
   (and other contexts if applicable?)

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 7 2017

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

commit 6f2ba28da2225847e4769fb89aad0522d53a7f41
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 07 02:30:44 2017

Introduce Mojo.bindInterface IDL and related test API

Adds Mojo.bindInterface() to the MojoJS IDL as a means of sending
arbitrary, frame-scoped interface requests to the browser.

Also adds MojoInterfaceInterceptor under a new MojoJSTest RuntimeEnabled
feature, giving layout tests the ability to intercept outgoing
frame-scoped interface requests before they reach the browser. This
includes requests initiated by native Blink code. Useful for defining
interface mocks etc alongside test code.

These APIs are intended to replace the various asynchronously loaded AMD
modules currently injected by content in some environments (e.g. WebUI
and layout tests.)

BUG= 726943 

Change-Id: I9966a6e07cb4160e4e27205a1aeaa80706fd57f6
Reviewed-on: https://chromium-review.googlesource.com/517357
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477520}
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/renderer/render_frame_impl.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/shell/BUILD.gn
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/shell/browser/content_shell_browser_manifest_overlay.json
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/shell/browser/shell_content_browser_client.cc
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/shell/browser/shell_content_browser_client.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/test/BUILD.gn
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/test/data/OWNERS
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/content/test/data/mojo_layouttest_test.mojom
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/services/service_manager/public/cpp/interface_provider.cc
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/services/service_manager/public/cpp/interface_provider.h
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/LayoutTests/mojo/bind-interface.html
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/DEPS
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/events/EventTargetFactory.json5
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/events/EventTypeNames.json5
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/frame/LocalFrameClient.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/BUILD.gn
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/DEPS
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/Mojo.cpp
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/Mojo.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/Mojo.idl
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/MojoHandle.cpp
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/MojoHandle.h
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceInterceptor.cpp
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceInterceptor.h
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceInterceptor.idl
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceRequestEvent.cpp
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceRequestEvent.h
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceRequestEvent.idl
[add] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/core/mojo/testing/MojoInterfaceRequestEventInit.idl
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/web/LocalFrameClientImpl.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/web/tests/FrameTestHelpers.h
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp
[modify] https://crrev.com/6f2ba28da2225847e4769fb89aad0522d53a7f41/third_party/WebKit/public/web/WebFrameClient.h

Project Member

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

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

commit 62fe5d8c4bcaf6e5670fff8447aecfa38b07653d
Author: Ken Rockot <rockot@chromium.org>
Date: Thu Jun 08 05:39:11 2017

Convert WebUSB WPT polyfill to new Mojo JS bindings

Switches USB mojom to use new Mojo JS bindings and adapts the WPT
polyfill to work with them.

This also requires the native USB impl to go through the new
InterfaceProvider on the LocalFrameClient.

BUG= 726943 

Change-Id: I362ff408eb03a4ab33ded144ed5af472bb63d1b9
Reviewed-on: https://chromium-review.googlesource.com/517983
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477903}
[modify] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/device/usb/public/interfaces/BUILD.gn
[add] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/third_party/WebKit/LayoutTests/usb/resources/webusb-test-impl.js
[modify] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/third_party/WebKit/LayoutTests/usb/resources/webusb-test.js
[modify] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/third_party/WebKit/LayoutTests/usb/usbDevice-iframe.html
[modify] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/third_party/WebKit/Source/modules/webusb/DEPS
[modify] https://crrev.com/62fe5d8c4bcaf6e5670fff8447aecfa38b07653d/third_party/WebKit/Source/modules/webusb/USB.cpp

Blockedon: 734210
Project Member

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

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

commit f791eeeca58c648ee7b55e439e0368129a7db990
Author: Reilly Grant <reillyg@chromium.org>
Date: Fri Jul 07 22:10:35 2017

Remove blink::InterfaceProvider from LocalFrame

The blink::InterfaceProvider class is deprecated in favor of
service_manager::InterfaceProvider. This patch makes
LocalFrame::GetInterfaceProvider() a wrapper around
LocalFrameClient::GetInterfaceProvider() instead and updates call
callers.

Bug:  726943 
Change-Id: I1c1c59b62ecd824fe3bed31279b758ffed64ae85
Reviewed-on: https://chromium-review.googlesource.com/538911
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485067}
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/content/renderer/mojo/blink_interface_provider_impl.cc
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/content/renderer/mojo/blink_interface_provider_impl.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/content/renderer/render_frame_impl.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/DEPS
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/DEPS
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/dom/ElementVisibilityObserverTest.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/exported/WebFactory.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/frame/FrameTestHelpers.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/frame/FrameTestHelpers.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/frame/LocalFrame.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/loader/EmptyClients.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/mojo/DEPS
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/testing/DummyPageHolder.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/core/testing/DummyPageHolder.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/installedapp/InstalledAppController.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/nfc/NFC.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/payments/PaymentManager.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/permissions/PermissionUtils.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/shapedetection/TextDetector.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/vr/VRController.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/webauth/WebAuthentication.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/webusb/DEPS
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/modules/webusb/USB.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/platform/DEPS
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/platform/instrumentation/resource_coordinator/FrameResourceCoordinator.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/web/WebFactoryImpl.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/web/WebFactoryImpl.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/Source/web/WebLocalFrameImpl.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/public/web/WebFrameClient.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/public/web/WebLocalFrame.h
[modify] https://crrev.com/f791eeeca58c648ee7b55e439e0368129a7db990/third_party/WebKit/public/web/WebRemoteFrame.h

Comment 5 by roc...@chromium.org, Jul 11 2017

Status: Fixed (was: Assigned)
Calling this done since  issue 699569  is tracking new JS bindings conversions.

Comment 6 by roc...@chromium.org, Jul 11 2017

Cc: reillyg@chromium.org
Unless of course you were planning to use this to track ongoing worker-related CLs, in which case please feel free to reopen and reassign

Sign in to add a comment