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

Unified Diff: headless/public/headless_browser.cc

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fine, no console logging Mr. Presubmit. Created 4 years, 10 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/public/headless_browser.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/headless_browser.cc
diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc
index cb8a855243a2a1314c7db517e502de2cd4491d57..550d7169c4cb87af19c017449a9679b7a4911fac 100644
--- a/headless/public/headless_browser.cc
+++ b/headless/public/headless_browser.cc
@@ -2,15 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/public/common/user_agent.h"
#include "headless/public/headless_browser.h"
+#include "net/url_request/url_request_context_getter.h"
using Options = headless::HeadlessBrowser::Options;
using Builder = headless::HeadlessBrowser::Options::Builder;
namespace headless {
+// Product name for building the default user agent string.
+namespace {
+const char kProductName[] = "HeadlessChrome";
+}
+
Options::Options(int argc, const char** argv)
- : argc(argc), argv(argv), devtools_http_port(kInvalidPort) {}
+ : argc(argc),
+ argv(argv),
+ user_agent(content::BuildUserAgentFromProduct(kProductName)),
+ message_pump(nullptr) {}
Options::~Options() {}
@@ -23,14 +33,13 @@ Builder& Builder::SetUserAgent(const std::string& user_agent) {
return *this;
}
-Builder& Builder::EnableDevToolsServer(int port) {
- options_.devtools_http_port = port;
+Builder& Builder::EnableDevToolsServer(const net::IPEndPoint& endpoint) {
+ options_.devtools_endpoint = endpoint;
return *this;
}
-Builder& Builder::SetURLRequestContextGetter(
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) {
- options_.url_request_context_getter = url_request_context_getter;
+Builder& Builder::SetMessagePump(base::MessagePump* message_pump) {
+ options_.message_pump = message_pump;
return *this;
}
« no previous file with comments | « headless/public/headless_browser.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698