Headless: Support Multiple tabsockets (reland)

Desktop / Chromium - Alex Clarke [chromium.org] - 12 July 2017 07:04 EDT

TabSockets are intended to either be installed into the main world or a isolated world created by Page.createIsolatedWorld. Previously we only supported a single TabSocket per WebContents but that's unfortunate with OOPIF. This patch lets us support multiple TabSockets up to one per world per frame.

The mojoms have changed a bit with TabSocket::AwaitNextMessageFromEmbedder moving to HeadlessRenderFrameController::SendMessageToTabSocket which simplifies recieveing a message from the embedder since a hanging IPC is no longer needed.

Original patch: https://chromium-review.googlesource.com/c/543160/

Bug: 546953 Change-Id: Iab134b78d3cbfcbdb00ada15a6ae6d3b253727a8 TBR: jochen@chromium.org, mkwst@chromium.org Reviewed-on: https://chromium-review.googlesource.com/565404

51a354a Headless: Support Multiple tabsockets (reland)
headless/BUILD.gn | 11 +
headless/lib/browser/headless_tab_socket_impl.cc | 202 +++++++--
headless/lib/browser/headless_tab_socket_impl.h | 55 ++-
headless/lib/browser/headless_web_contents_impl.cc | 59 +--
headless/lib/browser/headless_web_contents_impl.h | 10 +-
.../lib/headless_render_frame_controller.mojom | 25 +-
headless/lib/headless_web_contents_browsertest.cc | 485 +++++++++++++--------
headless/lib/renderer/DEPS | 1 +
.../renderer/headless_content_renderer_client.cc | 232 +---------
.../headless_render_frame_controller_impl.cc | 119 +++++
.../headless_render_frame_controller_impl.h | 60 +++
.../lib/renderer/headless_tab_socket_bindings.cc | 101 +++++
.../lib/renderer/headless_tab_socket_bindings.h | 63 +++
headless/lib/tab_socket.mojom | 7 +-
headless/public/headless_tab_socket.h | 28 +-
headless/public/headless_web_contents.h | 16 +-
headless/test/data/iframe2.html | 5 +
headless/test/data/tabsocket.html | 21 +
headless/test/data/two_iframes.html | 6 +
headless/test/headless_browser_test.cc | 9 +-
headless/test/headless_browser_test.h | 4 +-
headless/test/headless_js_bindings_browsertest.cc | 55 +--
headless/test/tab_socket_test.cc | 160 +++++++
headless/test/tab_socket_test.h | 91 ++++
24 files changed, 1249 insertions(+), 576 deletions(-)

Upstream: git.chromium.org


  • Share