Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Issue 2813953002: Add HeadlessTabSocket (Closed)

Created:
3 years, 8 months ago by alex clarke (OOO till 29th)
Modified:
3 years, 8 months ago
Reviewers:
Mike West, Sami
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add HeadlessTabSocket This lets a C++ embedder send messages to and from JS on a HeadlessWebContents. Note for this to work the headless browser context must have been created with AddTabSocketMojoBindings and the headless web contents must have been created with CreateTabSocket(true). This will not affect chrome.exe --headless because only a C++ embedder can set the above options. Note that C++ embedders can already do this and more with the current headless API. At a later date we will remove the more general headless mojo interface in favor of TabSockets, unless it turns out somebody is actually using them. BUG=546953 Review-Url: https://codereview.chromium.org/2813953002 Cr-Commit-Position: refs/heads/master@{#464327} Committed: https://chromium.googlesource.com/chromium/src/+/8196d431989e75a2fdbf19ddb42822b5d080da0e

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Add missing file #

Patch Set 4 : Fix release build test #

Total comments: 24

Patch Set 5 : Changes for Sami #

Patch Set 6 : Change HeadlessTabSocketImpl::SetListener #

Unified diffs Side-by-side diffs Delta from patch set Stats (+377 lines, -9 lines) Patch
M headless/BUILD.gn View 1 3 chunks +16 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.cc View 3 chunks +12 lines, -0 lines 0 comments Download
A headless/lib/browser/headless_tab_socket_impl.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A headless/lib/browser/headless_tab_socket_impl.cc View 1 2 3 4 5 1 chunk +85 lines, -0 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.h View 4 chunks +3 lines, -1 line 0 comments Download
M headless/lib/browser/headless_web_contents_impl.cc View 1 4 chunks +19 lines, -0 lines 0 comments Download
M headless/lib/headless_web_contents_browsertest.cc View 1 2 3 4 2 chunks +31 lines, -0 lines 0 comments Download
M headless/lib/renderer/headless_content_renderer_client.h View 1 chunk +1 line, -0 lines 0 comments Download
M headless/lib/renderer/headless_content_renderer_client.cc View 1 2 3 4 2 chunks +68 lines, -0 lines 0 comments Download
M headless/lib/resources/headless_lib_resources.grd View 1 chunk +1 line, -0 lines 0 comments Download
A headless/lib/tab_socket.mojom View 1 chunk +14 lines, -0 lines 0 comments Download
M headless/public/headless_browser_context.h View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download
A headless/public/headless_tab_socket.h View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
M headless/public/headless_web_contents.h View 1 2 3 4 5 chunks +11 lines, -1 line 0 comments Download
M headless/test/headless_browser_test.h View 1 chunk +3 lines, -0 lines 0 comments Download
M headless/test/headless_browser_test.cc View 2 chunks +16 lines, -5 lines 0 comments Download

Messages

Total messages: 41 (32 generated)
alex clarke (OOO till 29th)
mkwst@ please review headless/lib/tab_socket.mojom This is only for use by C++ embedders (they can do ...
3 years, 8 months ago (2017-04-11 18:52:24 UTC) #6
Sami
Looks great! A couple of comments below. https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc File headless/lib/browser/headless_tab_socket_impl.cc (right): https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc#newcode18 headless/lib/browser/headless_tab_socket_impl.cc:18: waiting_for_message_cb_.Run(message); Ditto ...
3 years, 8 months ago (2017-04-12 14:18:46 UTC) #22
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc File headless/lib/browser/headless_tab_socket_impl.cc (right): https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc#newcode18 headless/lib/browser/headless_tab_socket_impl.cc:18: waiting_for_message_cb_.Run(message); On 2017/04/12 14:18:45, Sami wrote: > Ditto ...
3 years, 8 months ago (2017-04-12 15:47:46 UTC) #24
Sami
lgtm, thanks! https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc File headless/lib/browser/headless_tab_socket_impl.cc (right): https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc#newcode31 headless/lib/browser/headless_tab_socket_impl.cc:31: listener_->OnMessageFromTab(message); On 2017/04/12 15:47:46, alex clarke wrote: ...
3 years, 8 months ago (2017-04-12 16:09:06 UTC) #26
alex clarke (OOO till 29th)
Mike can you tae a look please? :) https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc File headless/lib/browser/headless_tab_socket_impl.cc (right): https://codereview.chromium.org/2813953002/diff/60001/headless/lib/browser/headless_tab_socket_impl.cc#newcode31 headless/lib/browser/headless_tab_socket_impl.cc:31: listener_->OnMessageFromTab(message); ...
3 years, 8 months ago (2017-04-12 19:41:48 UTC) #29
Mike West
LGTM.
3 years, 8 months ago (2017-04-13 06:29:16 UTC) #34
alex clarke (OOO till 29th)
Thanks!
3 years, 8 months ago (2017-04-13 07:05:42 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2813953002/100001
3 years, 8 months ago (2017-04-13 07:06:18 UTC) #38
commit-bot: I haz the power
3 years, 8 months ago (2017-04-13 07:12:42 UTC) #41
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/8196d431989e75a2fdbf19ddb428...

Powered by Google App Engine
This is Rietveld 408576698