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

Unified Diff: content/child/child_thread_impl.cc

Issue 974933002: content: Refactor ChildThreadImpl::Options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. Created 5 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
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 5df66318d42a5cc76c8f9307976153f4f4f72691..18b15c27ff605f6aba4abfee448d9ebf37e3c2a3 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -210,18 +210,33 @@ ChildThreadImpl::Options::Options()
in_browser_process(false) {
}
-ChildThreadImpl::Options::Options(bool mojo)
- : channel_name(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessChannelID)),
- use_mojo_channel(mojo),
- in_browser_process(true) {
+ChildThreadImpl::Options::~Options() {
}
-ChildThreadImpl::Options::Options(std::string name, bool mojo)
- : channel_name(name), use_mojo_channel(mojo), in_browser_process(true) {
+ChildThreadImpl::Options::Builder::Builder() {
}
-ChildThreadImpl::Options::~Options() {
+ChildThreadImpl::Options::Builder&
+ChildThreadImpl::Options::Builder::InBrowserProcess(bool in_browser_process) {
+ options_.in_browser_process = in_browser_process;
+ return *this;
+}
+
+ChildThreadImpl::Options::Builder& ChildThreadImpl::Options::Builder::WithMojo(
+ bool mojo) {
+ options_.use_mojo_channel = mojo;
+ return *this;
+}
+
+ChildThreadImpl::Options::Builder&
+ChildThreadImpl::Options::Builder::WithChannelName(
+ const std::string& channel_name) {
+ options_.channel_name = channel_name;
+ return *this;
+}
+
+ChildThreadImpl::Options ChildThreadImpl::Options::Builder::Build() {
+ return options_;
}
ChildThreadImpl::ChildThreadMessageRouter::ChildThreadMessageRouter(

Powered by Google App Engine
This is Rietveld 408576698