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

Unified Diff: content/child/child_thread_impl.h

Issue 974933002: content: Refactor ChildThreadImpl::Options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. 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
« no previous file with comments | « no previous file | content/child/child_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.h
diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h
index 4016861820ae15b4ca009ca52a801256fe642471..f614f0263e5aebfe0a409d148bd40af9a7defacd 100644
--- a/content/child/child_thread_impl.h
+++ b/content/child/child_thread_impl.h
@@ -61,17 +61,7 @@ class CONTENT_EXPORT ChildThreadImpl
: public IPC::Listener,
virtual public ChildThread {
public:
- struct CONTENT_EXPORT Options {
- Options();
- explicit Options(bool mojo);
- Options(std::string name, bool mojo);
- ~Options();
-
- std::string channel_name;
- bool use_mojo_channel;
- bool in_browser_process;
- std::vector<IPC::MessageFilter*> startup_filters;
- };
+ struct CONTENT_EXPORT Options;
// Creates the thread.
ChildThreadImpl();
@@ -305,6 +295,37 @@ class CONTENT_EXPORT ChildThreadImpl
DISALLOW_COPY_AND_ASSIGN(ChildThreadImpl);
};
+struct ChildThreadImpl::Options {
+ ~Options();
+
+ class Builder;
+
+ std::string channel_name;
+ bool use_mojo_channel;
+ bool in_browser_process;
+ std::vector<IPC::MessageFilter*> startup_filters;
+
+ private:
+ Options();
+};
+
+class ChildThreadImpl::Options::Builder {
+ public:
+ Builder();
+
+ Builder& InBrowserProcess(bool in_browser_process);
+ Builder& UseMojoChannel(bool use_mojo_channel);
+ Builder& WithChannelName(const std::string& channel_name);
+ Builder& AddStartupFilter(IPC::MessageFilter* filter);
+
+ Options Build();
+
+ private:
+ struct Options options_;
+
+ DISALLOW_COPY_AND_ASSIGN(Builder);
+};
+
} // namespace content
#endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_
« no previous file with comments | « no previous file | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698