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