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

Side by Side Diff: content/browser/android/child_process_launcher_android_jni.h

Issue 2594203004: Unifying ChildProcessLauncher across platforms. (Closed)
Patch Set: Fixed Mac tests. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1
boliu 2017/01/12 02:00:07 nit: empty line
Jay Civelli 2017/01/12 23:05:40 Done.
2 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
boliu 2017/01/12 02:00:07 cc file didn't have year updated, but header did?
Jay Civelli 2017/01/12 23:05:40 Keeping year as is, the file has been renamed with
2 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 4 // found in the LICENSE file.
4 5
5 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ 6 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_JNI_H_
6 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ 7 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_JNI_H_
7 8
8 #include <jni.h> 9 #include <jni.h>
9 10
10 #include <map>
11 #include <memory>
12
13 #include "base/android/scoped_java_ref.h"
14 #include "base/callback.h" 11 #include "base/callback.h"
15 #include "base/command_line.h" 12 #include "base/command_line.h"
16 #include "base/files/memory_mapped_file.h"
17 #include "base/process/process.h" 13 #include "base/process/process.h"
18 #include "content/public/browser/file_descriptor_info.h" 14 #include "content/public/browser/file_descriptor_info.h"
19 #include "ui/gl/android/scoped_java_surface.h"
20 15
16 // Contains the methods either being called from or calling to
17 // ChildProcessLauncher.java.
21 namespace content { 18 namespace content {
22 19
23 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback; 20
24 // Starts a process as a child process spawned by the Android 21 typedef base::Callback<void(base::ProcessHandle, int /* launch result */)>
25 // ActivityManager. 22 StartChildProcessCallback;
23
24 // Starts a process as a child process spawned by the Android ActivityManager.
26 // 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
27 // returned if the process could not be created. 26 // returned if the process could not be created.
28 void StartChildProcess( 27 void StartChildProcess(
29 const base::CommandLine::StringVector& argv, 28 const base::CommandLine::StringVector& argv,
30 int child_process_id, 29 int child_process_id,
31 const std::unique_ptr<FileDescriptorInfo> files_to_register, 30 FileDescriptorInfo* files_to_register,
32 const StartChildProcessCallback& callback); 31 const StartChildProcessCallback& callback);
33 32
34 // Stops a child process based on the handle returned form 33 // Stops a child process based on the handle returned from StartChildProcess.
35 // StartChildProcess.
36 void StopChildProcess(base::ProcessHandle handle); 34 void StopChildProcess(base::ProcessHandle handle);
37 35
38 bool IsChildProcessOomProtected(base::ProcessHandle handle); 36 bool IsChildProcessOomProtected(base::ProcessHandle handle);
39 37
40 void SetChildProcessInForeground(base::ProcessHandle handle, 38 void SetChildProcessInForeground(base::ProcessHandle handle,
41 bool in_foreground); 39 bool in_foreground);
40
42 bool RegisterChildProcessLauncher(JNIEnv* env); 41 bool RegisterChildProcessLauncher(JNIEnv* env);
43 42
44 } // namespace content 43 } // namespace content
45 44
46 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_ 45 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_JNI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698