| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "base/command_line.h" | |
| 12 #include "base/process/process.h" | |
| 13 #include "content/public/browser/file_descriptor_info.h" | |
| 14 | |
| 15 // Contains the methods either being called from or calling to | |
| 16 // ChildProcessLauncher.java. | |
| 17 namespace content { | |
| 18 | |
| 19 | |
| 20 typedef base::Callback<void(base::ProcessHandle, int /* launch result */)> | |
| 21 StartChildProcessCallback; | |
| 22 | |
| 23 // Starts a process as a child process spawned by the Android ActivityManager. | |
| 24 // The created process handle is returned to the |callback| on success, 0 is | |
| 25 // returned if the process could not be created. | |
| 26 void StartChildProcess( | |
| 27 const base::CommandLine::StringVector& argv, | |
| 28 int child_process_id, | |
| 29 FileDescriptorInfo* files_to_register, | |
| 30 const StartChildProcessCallback& callback); | |
| 31 | |
| 32 // Stops a child process based on the handle returned from StartChildProcess. | |
| 33 void StopChildProcess(base::ProcessHandle handle); | |
| 34 | |
| 35 bool IsChildProcessOomProtected(base::ProcessHandle handle); | |
| 36 | |
| 37 void SetChildProcessInForeground(base::ProcessHandle handle, | |
| 38 bool in_foreground); | |
| 39 | |
| 40 bool RegisterChildProcessLauncher(JNIEnv* env); | |
| 41 | |
| 42 } // namespace content | |
| 43 | |
| 44 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | |
| OLD | NEW |