| 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 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 14 #include "base/files/memory_mapped_file.h" | 15 #include "base/files/memory_mapped_file.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 17 #include "content/public/browser/file_descriptor_info.h" | 17 #include "content/public/browser/file_descriptor_info.h" |
| 18 #include "ui/gl/android/scoped_java_surface.h" | 18 #include "ui/gl/android/scoped_java_surface.h" |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; | 22 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; |
| 23 // Starts a process as a child process spawned by the Android | 23 // Starts a process as a child process spawned by the Android |
| 24 // ActivityManager. | 24 // ActivityManager. |
| 25 // The created process handle is returned to the |callback| on success, 0 is | 25 // The created process handle is returned to the |callback| on success, 0 is |
| 26 // returned if the process could not be created. | 26 // returned if the process could not be created. |
| 27 void StartChildProcess( | 27 void StartChildProcess( |
| 28 const base::CommandLine::StringVector& argv, | 28 const base::CommandLine::StringVector& argv, |
| 29 int child_process_id, | 29 int child_process_id, |
| 30 const scoped_ptr<FileDescriptorInfo> files_to_register, | 30 const std::unique_ptr<FileDescriptorInfo> files_to_register, |
| 31 const std::map<int, base::MemoryMappedFile::Region>& regions, | 31 const std::map<int, base::MemoryMappedFile::Region>& regions, |
| 32 const StartChildProcessCallback& callback); | 32 const StartChildProcessCallback& callback); |
| 33 | 33 |
| 34 // Starts the background download process if it hasn't been started. | 34 // Starts the background download process if it hasn't been started. |
| 35 // TODO(qinmin): pass the download parameters here and pass it to java side. | 35 // TODO(qinmin): pass the download parameters here and pass it to java side. |
| 36 void StartDownloadProcessIfNecessary(); | 36 void StartDownloadProcessIfNecessary(); |
| 37 | 37 |
| 38 // Stops a child process based on the handle returned form | 38 // Stops a child process based on the handle returned form |
| 39 // StartChildProcess. | 39 // StartChildProcess. |
| 40 void StopChildProcess(base::ProcessHandle handle); | 40 void StopChildProcess(base::ProcessHandle handle); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 55 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id); | 55 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id); |
| 56 | 56 |
| 57 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, | 57 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id, |
| 58 int client_id); | 58 int client_id); |
| 59 | 59 |
| 60 bool RegisterChildProcessLauncher(JNIEnv* env); | 60 bool RegisterChildProcessLauncher(JNIEnv* env); |
| 61 | 61 |
| 62 } // namespace content | 62 } // namespace content |
| 63 | 63 |
| 64 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ | 64 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ |
| OLD | NEW |