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

Unified Diff: headless/public/headless_web_contents.h

Issue 2873283002: [Reland] Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: Fix GN Issue Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/renderer/headless_content_renderer_client.cc ('k') | headless/test/headless_browser_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/headless_web_contents.h
diff --git a/headless/public/headless_web_contents.h b/headless/public/headless_web_contents.h
index 9c1de12ecb254ff2cd1712e6a5c1c96580c55adb..899249c11a0e03f41f5207126e06bb1b404aef5b 100644
--- a/headless/public/headless_web_contents.h
+++ b/headless/public/headless_web_contents.h
@@ -112,9 +112,15 @@ class HEADLESS_EXPORT HeadlessWebContents::Builder {
// Specify the initial window size (default is configured in browser options).
Builder& SetWindowSize(const gfx::Size& size);
- // Whether or not a headless tab socket should be created, to allow JS -> C++
- // embedder communications.
- Builder& CreateTabSocket(bool create_tab_socket);
+ enum class TabSocketType {
+ NONE, // No TabSocket binds created (default).
+ MAIN_WORLD, // TabSocket bindings available only to the main world.
+ ISOLATED_WORLD // TabSocket bindings available only to isolated worlds
+ // created via DevTools protocol.
+ };
+
+ // Sets the type of TabSocket to be created, if any.
+ Builder& SetTabSocketType(TabSocketType type);
// The returned object is owned by HeadlessBrowser. Call
// HeadlessWebContents::Close() to dispose it.
@@ -154,7 +160,7 @@ class HEADLESS_EXPORT HeadlessWebContents::Builder {
GURL initial_url_ = GURL("about:blank");
gfx::Size window_size_;
std::list<MojoService> mojo_services_;
- bool create_tab_socket_ = false;
+ TabSocketType tab_socket_type_ = TabSocketType::NONE;
DISALLOW_COPY_AND_ASSIGN(Builder);
};
« no previous file with comments | « headless/lib/renderer/headless_content_renderer_client.cc ('k') | headless/test/headless_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698