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

Unified Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 16267002: Re-fix http://crbug.com/87176, and add a test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Second round of creis comments Created 7 years, 6 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/browser/renderer_host/render_process_host_impl.h
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 5f528b1c491377884b78673a405e88c1fea24d69..6b8885c33c090cbaeb2da2b46806f816e672adb6 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -184,6 +184,21 @@ class CONTENT_EXPORT RenderProcessHostImpl
static base::MessageLoop* GetInProcessRendererThreadForTesting();
+ void SetChildProcessLauncherFactory(
+ const base::Callback<scoped_ptr<ChildProcessLauncher>(
+#if defined(OS_WIN)
+ SandboxedProcessLauncherDelegate* delegate,
+#elif defined(OS_POSIX)
+ bool use_zygote,
+ const base::EnvironmentVector& environ,
+ int ipcfd,
+#endif
+ CommandLine* cmd_line,
+ int child_process_id,
+ ChildProcessLauncher::Client* client)>& factory) {
+ child_process_launcher_factory_ = factory;
+ }
+
protected:
// A proxy for our IPC::Channel that lives on the IO thread (see
// browser_process.h)
@@ -278,6 +293,21 @@ class CONTENT_EXPORT RenderProcessHostImpl
// also reset that in the case of process termination.
bool is_initialized_;
+ // Used to mock out child_process_launcher_ in tests. See
+ // NewChildProcessLauncher() for the interface.
+ base::Callback<scoped_ptr<ChildProcessLauncher>(
+#if defined(OS_WIN)
+ SandboxedProcessLauncherDelegate* delegate,
+#elif defined(OS_POSIX)
+ bool use_zygote,
+ const base::EnvironmentVector& environ,
+ int ipcfd,
+#endif
+ CommandLine* cmd_line,
+ int child_process_id,
+ ChildProcessLauncher::Client* client)>
+ child_process_launcher_factory_;
+
// Used to launch and terminate the process without blocking the UI thread.
scoped_ptr<ChildProcessLauncher> child_process_launcher_;

Powered by Google App Engine
This is Rietveld 408576698