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

Side by Side Diff: headless/public/headless_web_contents.h

Issue 2873283002: [Reland] Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: More tests 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Set an initial URL to ensure that the renderer gets initialized and 106 // Set an initial URL to ensure that the renderer gets initialized and
107 // eventually becomes ready to be inspected. See 107 // eventually becomes ready to be inspected. See
108 // HeadlessWebContents::Observer::DevToolsTargetReady. The default URL is 108 // HeadlessWebContents::Observer::DevToolsTargetReady. The default URL is
109 // about:blank. 109 // about:blank.
110 Builder& SetInitialURL(const GURL& initial_url); 110 Builder& SetInitialURL(const GURL& initial_url);
111 111
112 // Specify the initial window size (default is configured in browser options). 112 // Specify the initial window size (default is configured in browser options).
113 Builder& SetWindowSize(const gfx::Size& size); 113 Builder& SetWindowSize(const gfx::Size& size);
114 114
115 // Whether or not a headless tab socket should be created, to allow JS -> C++ 115 // Whether or not a headless tab socket should be created, to allow JS -> C++
116 // embedder communications. 116 // embedder communications. If |in_isolated_worlds| is true the bindings will
117 Builder& CreateTabSocket(bool create_tab_socket); 117 // will be available only in isolated worlds, otherwise they will be available
118 // only in the main world.
119 Builder& CreateTabSocket(bool create_tab_socket, bool in_isolated_worlds);
Sami 2017/05/12 17:18:02 Maybe it would be good to be explicit at this leve
alex clarke (OOO till 29th) 2017/05/15 09:50:57 Done.
118 120
119 // The returned object is owned by HeadlessBrowser. Call 121 // The returned object is owned by HeadlessBrowser. Call
120 // HeadlessWebContents::Close() to dispose it. 122 // HeadlessWebContents::Close() to dispose it.
121 HeadlessWebContents* Build(); 123 HeadlessWebContents* Build();
122 124
123 private: 125 private:
124 friend class HeadlessBrowserImpl; 126 friend class HeadlessBrowserImpl;
125 friend class HeadlessBrowserContextImpl; 127 friend class HeadlessBrowserContextImpl;
126 friend class HeadlessWebContentsImpl; 128 friend class HeadlessWebContentsImpl;
127 129
(...skipping 20 matching lines...) Expand all
148 private: 150 private:
149 DISALLOW_COPY_AND_ASSIGN(MojoService); 151 DISALLOW_COPY_AND_ASSIGN(MojoService);
150 }; 152 };
151 153
152 HeadlessBrowserContextImpl* browser_context_; 154 HeadlessBrowserContextImpl* browser_context_;
153 155
154 GURL initial_url_ = GURL("about:blank"); 156 GURL initial_url_ = GURL("about:blank");
155 gfx::Size window_size_; 157 gfx::Size window_size_;
156 std::list<MojoService> mojo_services_; 158 std::list<MojoService> mojo_services_;
157 bool create_tab_socket_ = false; 159 bool create_tab_socket_ = false;
160 bool create_tab_socket_in_isolated_worlds_ = false;
158 161
159 DISALLOW_COPY_AND_ASSIGN(Builder); 162 DISALLOW_COPY_AND_ASSIGN(Builder);
160 }; 163 };
161 164
162 } // namespace headless 165 } // namespace headless
163 166
164 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 167 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698