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

Unified Diff: base/mp/mp_child_process_context.h

Issue 1625015: Refactor ChildProcess and related classes to create a framework outside of br... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 8 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 | « base/mp/mp_child_process.cc ('k') | base/mp/mp_child_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mp/mp_child_process_context.h
===================================================================
--- base/mp/mp_child_process_context.h (revision 0)
+++ base/mp/mp_child_process_context.h (revision 0)
@@ -0,0 +1,73 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MP_CHILD_PROCESS_CONTEXT_H_
+#define BASE_MP_CHILD_PROCESS_CONTEXT_H_
+
+#include "base/basictypes.h"
+#include "base/file_path.h"
+#include "base/process.h"
+#include "base/ref_counted.h"
+#include "base/task.h"
+#include "base/tracked.h"
+#include <string>
+
+class CommandLine;
+class MessageLoop;
+
+namespace base {
+
+class MpChildProcessContext {
+ public:
+ // Return the bad message received application exit code.
+ virtual int GetBadMessageResultCode() = 0;
+
+ // Return the normal application exit code.
+ virtual int GetNormalExitResultCode() = 0;
+
+ // Generate a randome channel ID value.
+ virtual std::string GenerateRandomChannelID(void* instance) = 0;
+
+ // Return the identifier for the current thread.
+ virtual bool GetCurrentThreadIdentifier(int* identifier) = 0;
+
+ // Return true if currently on the specified thread.
+ virtual bool CurrentlyOnThread(int identifier) = 0;
+
+ // Post a task to the specified thread.
+ virtual bool PostTask(int identifier,
+ const tracked_objects::Location& from_here,
+ Task* task) = 0;
+
+ // Post a task to the thread responsible for launching processes.
+ virtual bool PostProcessLauncherTask(
+ const tracked_objects::Location& from_here,
+ Task* task) = 0;
+
+ // Derived classes implement this method to create the process.
+ virtual base::ProcessHandle StartProcess(
+#if defined(OS_WIN)
+ const FilePath& exposed_dir,
+#elif defined(OS_POSIX)
+ bool use_zygote,
+ const base::environment_vector& environ,
+ int ipcfd,
+#endif
+ CommandLine* cmd_line) = 0;
+
+ // Derived classes implement this method to ensure that the process is
+ // terminated.
+ virtual void EnsureProcessTerminated(base::ProcessHandle) = 0;
+
+ // Derived classes implement this method to check if a process has crashed.
+ virtual bool CheckProcessCrash(bool* child_exited,
+#if defined(OS_POSIX)
+ bool use_zygote,
+#endif
+ base::ProcessHandle handle) = 0;
+};
+
+} // namespace base
+
+#endif // BASE_MP_CHILD_PROCESS_CONTEXT_H_
« no previous file with comments | « base/mp/mp_child_process.cc ('k') | base/mp/mp_child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698