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

Side by Side Diff: headless/public/headless_browser.cc

Issue 1461693003: [headless] Initial skeleton of headless/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes according to skyostil@'s comments Created 5 years 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
Sami 2015/12/01 17:48:27 I think this file should be headless/src/? (it use
altimin 2015/12/01 18:42:46 I followed example of content/public/, where publi
Sami 2015/12/01 18:53:53 I see. I wonder where we should draw the line. For
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "headless/public/headless_browser.h"
6
7 using Options = headless::HeadlessBrowser::Options;
8 using Builder = headless::HeadlessBrowser::Options::Builder;
9
10 namespace headless {
11
12 Options::Options(int argc, const char** argv)
13 : argc(argc), argv(argv), devtools_http_port(kInvalidPort) {}
14
15 Options::Options(Options&& options) {
16 *this = options;
Sami 2015/12/01 17:47:33 nit: the documentation seems to suggest that we do
altimin 2015/12/01 18:42:46 Done.
17 }
18
19 Options::~Options() {}
20
21 Builder::Builder(int argc, const char** argv) : options_(argc, argv) {}
22
23 Builder::~Builder() {}
24
25 Builder& Builder::SetUserAgent(const std::string& user_agent) {
26 options_.user_agent = user_agent;
27 return *this;
28 }
29
30 Builder& Builder::EnableDevToolsServer(int port) {
31 options_.devtools_http_port = port;
32 return *this;
33 }
34
35 Builder& Builder::SetURLRequestContextGetter(
36 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) {
37 options_.url_request_context_getter = url_request_context_getter;
38 return *this;
39 }
40
41 Options Builder::Build() {
42 return options_;
43 // return std::move(options_);
Sami 2015/12/01 17:47:33 Bad edit?
altimin 2015/12/01 18:42:46 Indeed, thanks.
44 }
45
46 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698