| Index: headless/public/headless_browser.h
|
| diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h
|
| index 0393f7c1125f04ccc66bf66fbbec69d296becdce..f34eef5d35989efb85d421654ebf15e7ffecd313 100644
|
| --- a/headless/public/headless_browser.h
|
| +++ b/headless/public/headless_browser.h
|
| @@ -11,6 +11,7 @@
|
| #include <vector>
|
|
|
| #include "base/callback.h"
|
| +#include "base/files/file_path.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "headless/public/headless_browser_context.h"
|
| @@ -37,15 +38,6 @@ namespace headless {
|
| class HEADLESS_EXPORT HeadlessBrowser {
|
| public:
|
| struct Options;
|
| -
|
| - // Open a new tab. Returns a builder object which can be used to set
|
| - // properties for the new tab.
|
| - virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0;
|
| -
|
| - // Deprecated. Use CreateWebContentsBuilder() instead.
|
| - virtual HeadlessWebContents* CreateWebContents(const GURL& initial_url,
|
| - const gfx::Size& size) = 0;
|
| -
|
| virtual std::vector<HeadlessWebContents*> GetAllWebContents() = 0;
|
|
|
| // Returns the HeadlessWebContents associated with the
|
| @@ -91,23 +83,14 @@ struct HeadlessBrowser::Options {
|
| const char** argv;
|
|
|
| std::string user_agent;
|
| - std::string navigator_platform;
|
|
|
| // Address at which DevTools should listen for connections. Disabled by
|
| // default.
|
| net::IPEndPoint devtools_endpoint;
|
|
|
| - // Address of the HTTP/HTTPS proxy server to use. The system proxy settings
|
| - // are used by default.
|
| - net::HostPortPair proxy_server;
|
| -
|
| // Optional message pump that overrides the default. Must outlive the browser.
|
| base::MessagePump* message_pump;
|
|
|
| - // Comma-separated list of rules that control how hostnames are mapped. See
|
| - // chrome::switches::kHostRules for a description for the format.
|
| - std::string host_resolver_rules;
|
| -
|
| // Run the browser in single process mode instead of using separate renderer
|
| // processes as per default. Note that this also disables any sandboxing of
|
| // web content, which can be a security risk.
|
| @@ -117,15 +100,27 @@ struct HeadlessBrowser::Options {
|
| // a security risk and should be used with caution.
|
| bool disable_sandbox;
|
|
|
| - // Custom network protocol handlers. These can be used to override URL
|
| - // fetching for different network schemes.
|
| - ProtocolHandlerMap protocol_handlers;
|
| + // Default per-context options, can be specialized on per-context basis.
|
| +
|
| + // Address of the HTTP/HTTPS proxy server to use. The system proxy settings
|
| + // are used by default.
|
| + net::HostPortPair proxy_server;
|
| +
|
| + // Comma-separated list of rules that control how hostnames are mapped. See
|
| + // chrome::switches::kHostRules for a description for the format.
|
| + std::string host_resolver_rules;
|
|
|
| // Choose the GL implementation to use for rendering. A suitable
|
| // implementantion is selected by default. Setting this to an empty
|
| // string can be used to disable GL rendering (e.g., WebGL support).
|
| std::string gl_implementation;
|
|
|
| + // Directory for browser context to store data in.
|
| + // If empty, default directory (the one where the binary is located) is used.
|
| + base::FilePath user_data_dir;
|
| +
|
| + // Reminder: when adding a new field here, do not forget to add it to
|
| + // HeadlessBrowserContextOptions (where appropriate).
|
| private:
|
| Options(int argc, const char** argv);
|
|
|
| @@ -145,8 +140,8 @@ class HeadlessBrowser::Options::Builder {
|
| Builder& SetHostResolverRules(const std::string& host_resolver_rules);
|
| Builder& SetSingleProcessMode(bool single_process_mode);
|
| Builder& SetDisableSandbox(bool disable_sandbox);
|
| - Builder& SetProtocolHandlers(ProtocolHandlerMap protocol_handlers);
|
| Builder& SetGLImplementation(const std::string& gl_implementation);
|
| + Builder& SetUserDataDir(const base::FilePath& user_data_dir);
|
|
|
| Options Build();
|
|
|
|
|