| OLD | NEW |
| 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_BROWSER_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 Options(Options&& options); | 101 Options(Options&& options); |
| 102 ~Options(); | 102 ~Options(); |
| 103 | 103 |
| 104 Options& operator=(Options&& options); | 104 Options& operator=(Options&& options); |
| 105 | 105 |
| 106 // Command line options to be passed to browser. | 106 // Command line options to be passed to browser. |
| 107 int argc; | 107 int argc; |
| 108 const char** argv; | 108 const char** argv; |
| 109 | 109 |
| 110 // Address at which DevTools should listen for connections. Disabled by | 110 // Address at which DevTools should listen for connections. Disabled by |
| 111 // default. | 111 // default. Mutually exclusive with devtools_socket_fd. |
| 112 net::IPEndPoint devtools_endpoint; | 112 net::IPEndPoint devtools_endpoint; |
| 113 | 113 |
| 114 // The fd of an already-open socket inherited from a parent process. Disabled |
| 115 // by default. Mutually exclusive with devtools_endpoint. |
| 116 size_t devtools_socket_fd; |
| 117 |
| 118 // A single way to test whether the devtools server has been requested. |
| 119 bool DevtoolsServerEnabled(); |
| 120 |
| 114 // Optional message pump that overrides the default. Must outlive the browser. | 121 // Optional message pump that overrides the default. Must outlive the browser. |
| 115 base::MessagePump* message_pump; | 122 base::MessagePump* message_pump; |
| 116 | 123 |
| 117 // Run the browser in single process mode instead of using separate renderer | 124 // Run the browser in single process mode instead of using separate renderer |
| 118 // processes as per default. Note that this also disables any sandboxing of | 125 // processes as per default. Note that this also disables any sandboxing of |
| 119 // web content, which can be a security risk. | 126 // web content, which can be a security risk. |
| 120 bool single_process_mode; | 127 bool single_process_mode; |
| 121 | 128 |
| 122 // Run the browser without renderer sandbox. This option can be | 129 // Run the browser without renderer sandbox. This option can be |
| 123 // a security risk and should be used with caution. | 130 // a security risk and should be used with caution. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 187 |
| 181 class HeadlessBrowser::Options::Builder { | 188 class HeadlessBrowser::Options::Builder { |
| 182 public: | 189 public: |
| 183 Builder(int argc, const char** argv); | 190 Builder(int argc, const char** argv); |
| 184 Builder(); | 191 Builder(); |
| 185 ~Builder(); | 192 ~Builder(); |
| 186 | 193 |
| 187 // Browser-wide settings. | 194 // Browser-wide settings. |
| 188 | 195 |
| 189 Builder& EnableDevToolsServer(const net::IPEndPoint& endpoint); | 196 Builder& EnableDevToolsServer(const net::IPEndPoint& endpoint); |
| 197 Builder& EnableDevToolsServer(const size_t socket_fd); |
| 190 Builder& SetMessagePump(base::MessagePump* message_pump); | 198 Builder& SetMessagePump(base::MessagePump* message_pump); |
| 191 Builder& SetSingleProcessMode(bool single_process_mode); | 199 Builder& SetSingleProcessMode(bool single_process_mode); |
| 192 Builder& SetDisableSandbox(bool disable_sandbox); | 200 Builder& SetDisableSandbox(bool disable_sandbox); |
| 193 Builder& SetGLImplementation(const std::string& gl_implementation); | 201 Builder& SetGLImplementation(const std::string& gl_implementation); |
| 194 Builder& AddMojoServiceName(const std::string& mojo_service_name); | 202 Builder& AddMojoServiceName(const std::string& mojo_service_name); |
| 195 | 203 |
| 196 // Per-context settings. | 204 // Per-context settings. |
| 197 | 205 |
| 198 Builder& SetProductNameAndVersion( | 206 Builder& SetProductNameAndVersion( |
| 199 const std::string& product_name_and_version); | 207 const std::string& product_name_and_version); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // the main loop, it will only return after HeadlessBrowser::Shutdown() is | 251 // the main loop, it will only return after HeadlessBrowser::Shutdown() is |
| 244 // called, returning the exit code for the process. It is not possible to | 252 // called, returning the exit code for the process. It is not possible to |
| 245 // initialize the browser again after it has been torn down. | 253 // initialize the browser again after it has been torn down. |
| 246 int HeadlessBrowserMain( | 254 int HeadlessBrowserMain( |
| 247 HeadlessBrowser::Options options, | 255 HeadlessBrowser::Options options, |
| 248 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); | 256 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); |
| 249 | 257 |
| 250 } // namespace headless | 258 } // namespace headless |
| 251 | 259 |
| 252 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 260 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| OLD | NEW |