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

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

Issue 2187473002: [headless] Add option to disable sandbox from API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable sandbox by default Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « headless/public/headless_browser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "content/public/common/user_agent.h" 5 #include "content/public/common/user_agent.h"
6 #include "headless/public/headless_browser.h" 6 #include "headless/public/headless_browser.h"
7 7
8 using Options = headless::HeadlessBrowser::Options; 8 using Options = headless::HeadlessBrowser::Options;
9 using Builder = headless::HeadlessBrowser::Options::Builder; 9 using Builder = headless::HeadlessBrowser::Options::Builder;
10 10
11 namespace headless { 11 namespace headless {
12 12
13 // Product name for building the default user agent string. 13 // Product name for building the default user agent string.
14 namespace { 14 namespace {
15 const char kProductName[] = "HeadlessChrome"; 15 const char kProductName[] = "HeadlessChrome";
16 } 16 }
17 17
18 Options::Options(int argc, const char** argv) 18 Options::Options(int argc, const char** argv)
19 : argc(argc), 19 : argc(argc),
20 argv(argv), 20 argv(argv),
21 user_agent(content::BuildUserAgentFromProduct(kProductName)), 21 user_agent(content::BuildUserAgentFromProduct(kProductName)),
22 message_pump(nullptr), 22 message_pump(nullptr),
23 single_process_mode(false) {} 23 single_process_mode(false),
24 disable_sandbox(false) {}
24 25
25 Options::Options(Options&& options) = default; 26 Options::Options(Options&& options) = default;
26 27
27 Options::~Options() {} 28 Options::~Options() {}
28 29
29 Options& Options::operator=(Options&& options) = default; 30 Options& Options::operator=(Options&& options) = default;
30 31
31 Builder::Builder(int argc, const char** argv) : options_(argc, argv) {} 32 Builder::Builder(int argc, const char** argv) : options_(argc, argv) {}
32 33
33 Builder::Builder() : options_(0, nullptr) {} 34 Builder::Builder() : options_(0, nullptr) {}
(...skipping 23 matching lines...) Expand all
57 Builder& Builder::SetHostResolverRules(const std::string& host_resolver_rules) { 58 Builder& Builder::SetHostResolverRules(const std::string& host_resolver_rules) {
58 options_.host_resolver_rules = host_resolver_rules; 59 options_.host_resolver_rules = host_resolver_rules;
59 return *this; 60 return *this;
60 } 61 }
61 62
62 Builder& Builder::SetSingleProcessMode(bool single_process_mode) { 63 Builder& Builder::SetSingleProcessMode(bool single_process_mode) {
63 options_.single_process_mode = single_process_mode; 64 options_.single_process_mode = single_process_mode;
64 return *this; 65 return *this;
65 } 66 }
66 67
68 Builder& Builder::SetDisableSandbox(bool disable_sandbox) {
69 options_.disable_sandbox = disable_sandbox;
70 return *this;
71 }
72
67 Builder& Builder::SetProtocolHandlers(ProtocolHandlerMap protocol_handlers) { 73 Builder& Builder::SetProtocolHandlers(ProtocolHandlerMap protocol_handlers) {
68 options_.protocol_handlers = std::move(protocol_handlers); 74 options_.protocol_handlers = std::move(protocol_handlers);
69 return *this; 75 return *this;
70 } 76 }
71 77
72 Options Builder::Build() { 78 Options Builder::Build() {
73 return std::move(options_); 79 return std::move(options_);
74 } 80 }
75 81
76 } // namespace headless 82 } // namespace headless
OLDNEW
« no previous file with comments | « headless/public/headless_browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698