OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ |
6 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | 6 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/memory_mapped_file.h" |
12 #include "base/process/process.h" | 14 #include "base/process/process.h" |
13 #include "content/public/browser/file_descriptor_info.h" | 15 #include "content/public/browser/file_descriptor_info.h" |
14 #include "ui/gl/android/scoped_java_surface.h" | 16 #include "ui/gl/android/scoped_java_surface.h" |
15 | 17 |
16 namespace content { | 18 namespace content { |
17 | 19 |
18 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; | 20 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; |
19 // Starts a process as a child process spawned by the Android | 21 // Starts a process as a child process spawned by the Android |
20 // ActivityManager. | 22 // ActivityManager. |
21 // The created process handle is returned to the |callback| on success, 0 is | 23 // The created process handle is returned to the |callback| on success, 0 is |
22 // retuned if the process could not be created. | 24 // returned if the process could not be created. |
23 void StartChildProcess(const base::CommandLine::StringVector& argv, | 25 void StartChildProcess( |
24 int child_process_id, | 26 const base::CommandLine::StringVector& argv, |
25 const scoped_ptr<FileDescriptorInfo> files_to_register, | 27 int child_process_id, |
26 const StartChildProcessCallback& callback); | 28 const scoped_ptr<FileDescriptorInfo> files_to_register, |
| 29 const std::map<int, base::MemoryMappedFile::Region>& regions, |
| 30 const StartChildProcessCallback& callback); |
27 | 31 |
28 // Stops a child process based on the handle returned form | 32 // Stops a child process based on the handle returned form |
29 // StartChildProcess. | 33 // StartChildProcess. |
30 void StopChildProcess(base::ProcessHandle handle); | 34 void StopChildProcess(base::ProcessHandle handle); |
31 | 35 |
32 bool IsChildProcessOomProtected(base::ProcessHandle handle); | 36 bool IsChildProcessOomProtected(base::ProcessHandle handle); |
33 | 37 |
34 void SetChildProcessInForeground(base::ProcessHandle handle, | 38 void SetChildProcessInForeground(base::ProcessHandle handle, |
35 bool in_foreground); | 39 bool in_foreground); |
36 | 40 |
37 void RegisterViewSurface(int surface_id, jobject j_surface); | 41 void RegisterViewSurface(int surface_id, jobject j_surface); |
38 | 42 |
39 void UnregisterViewSurface(int surface_id); | 43 void UnregisterViewSurface(int surface_id); |
40 | 44 |
41 void CreateSurfaceTextureSurface(int surface_texture_id, | 45 void CreateSurfaceTextureSurface(int surface_texture_id, |
42 int client_id, | 46 int client_id, |
43 gfx::SurfaceTexture* surface_texture); | 47 gfx::SurfaceTexture* surface_texture); |
44 | 48 |
45 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id); | 49 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id); |
46 | 50 |
47 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, | 51 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, |
48 int client_id); | 52 int client_id); |
49 | 53 |
50 bool RegisterChildProcessLauncher(JNIEnv* env); | 54 bool RegisterChildProcessLauncher(JNIEnv* env); |
51 | 55 |
52 } // namespace content | 56 } // namespace content |
53 | 57 |
54 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | 58 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ |
OLD | NEW |