DescriptionAllow headless TabSocket in isolated worlds & remove obsolete logic
This patch only affects C++ Embedders of headless_lib and should have
no effect on normal chrome even with the --headless flag.
Recently we decided to no longer allow arbitrary mojo bindings, instead
relying on the headless::TabSocket API for js<-->C++ communications.
The public headless API for registering a mojo module has already been
removed and this patch finishes the job by removing the code from
MojoBindingsController which injected js mojo bindings for
BINDINGS_POLICY_HEADLESS.
In this patch we are replacing BINDINGS_POLICY_HEADLESS with
BINDINGS_POLICY_HEADLESS_MAIN_WORLD and
BINDINGS_POLICY_HEADLESS_ISOLATED_WORLD which provide access to the
headless::TabSocket API to either the main world or for isolated worlds
created by the Page.CreateIsolatedWorld DevTools command.
For a security point of view this patch hopefully reduces the attack
surface for the main world because js now only has access to the
headless::TabSocket API rather than arbitrary mojo modules. Providing
the headless::TabSocket API into isolated worlds is new but hopefully
non-controversial. I note that ContentScripts have access to similar
APIs for communication with the owning extension. I did investigate
reusing that code but it didn't seem feasible.
BUG=546953
Review-Url: https://codereview.chromium.org/2873283002
Cr-Original-Commit-Position: refs/heads/master@{#474238}
Committed: https://chromium.googlesource.com/chromium/src/+/07ee7c399295b210c5338dfeb543f2d30f748340
Review-Url: https://codereview.chromium.org/2873283002
Cr-Commit-Position: refs/heads/master@{#474311}
Committed: https://chromium.googlesource.com/chromium/src/+/1a4a3bab489e96546385236195be3d9b449a10e0
Patch Set 1 #Patch Set 2 : Make main world and isolated world use the same injection method. Plus remove some obsolete stuff. #Patch Set 3 : More tests #
Total comments: 22
Patch Set 4 : Responding to feedback #Patch Set 5 : Forgot to save a file #Patch Set 6 : Try and fix build with a dep #
Total comments: 8
Patch Set 7 : Changes for Sami #
Total comments: 4
Patch Set 8 : Moved the definitions into public/web #Patch Set 9 : Used RequestExecuteV8Function #Patch Set 10 : Simplify OnNextMessageFromEmbedder #Patch Set 11 : Rebased #
Total comments: 2
Patch Set 12 : Moved the header to public/platform as requested #Patch Set 13 : Fix MSVC nonsense #Patch Set 14 : Fix GN Issue #Messages
Total messages: 77 (49 generated)
|