Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / android / child_process_launcher_android.h
blobd1de985a8f9691b471e3f6c3e9568c61f3836a8e
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.
5 #ifndef CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_
8 #include <jni.h>
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 #include "ui/gl/android/scoped_java_surface.h"
16 namespace content {
18 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback;
19 // Starts a process as a child process spawned by the Android
20 // ActivityManager.
21 // The created process handle is returned to the |callback| on success, 0 is
22 // retuned if the process could not be created.
23 void StartChildProcess(const base::CommandLine::StringVector& argv,
24 int child_process_id,
25 const scoped_ptr<FileDescriptorInfo> files_to_register,
26 const StartChildProcessCallback& callback);
28 // Stops a child process based on the handle returned form
29 // StartChildProcess.
30 void StopChildProcess(base::ProcessHandle handle);
32 bool IsChildProcessOomProtected(base::ProcessHandle handle);
34 void SetChildProcessInForeground(base::ProcessHandle handle,
35 bool in_foreground);
37 void RegisterViewSurface(int surface_id, jobject j_surface);
39 void UnregisterViewSurface(int surface_id);
41 void CreateSurfaceTextureSurface(int surface_texture_id,
42 int client_id,
43 gfx::SurfaceTexture* surface_texture);
45 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id);
47 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id,
48 int client_id);
50 bool RegisterChildProcessLauncher(JNIEnv* env);
52 } // namespace content
54 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_