Add long running gmail memory benchmark for background tab.
[chromium-blink-merge.git] / content / browser / android / child_process_launcher_android.h
blobea806ac557132af9ac39f842ff92bbc8ac9323fa
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>
9 #include <map>
11 #include "base/callback.h"
12 #include "base/command_line.h"
13 #include "base/files/memory_mapped_file.h"
14 #include "base/process/process.h"
15 #include "content/public/browser/file_descriptor_info.h"
16 #include "ui/gl/android/scoped_java_surface.h"
18 namespace content {
20 typedef base::Callback<void(base::ProcessHandle)> StartChildProcessCallback;
21 // Starts a process as a child process spawned by the Android
22 // ActivityManager.
23 // The created process handle is returned to the |callback| on success, 0 is
24 // returned if the process could not be created.
25 void StartChildProcess(
26 const base::CommandLine::StringVector& argv,
27 int child_process_id,
28 const scoped_ptr<FileDescriptorInfo> files_to_register,
29 const std::map<int, base::MemoryMappedFile::Region>& regions,
30 const StartChildProcessCallback& callback);
32 // Stops a child process based on the handle returned form
33 // StartChildProcess.
34 void StopChildProcess(base::ProcessHandle handle);
36 bool IsChildProcessOomProtected(base::ProcessHandle handle);
38 void SetChildProcessInForeground(base::ProcessHandle handle,
39 bool in_foreground);
41 void RegisterViewSurface(int surface_id, jobject j_surface);
43 void UnregisterViewSurface(int surface_id);
45 void CreateSurfaceTextureSurface(int surface_texture_id,
46 int client_id,
47 gfx::SurfaceTexture* surface_texture);
49 void DestroySurfaceTextureSurface(int surface_texture_id, int client_id);
51 gfx::ScopedJavaSurface GetSurfaceTextureSurface(int surface_texture_id,
52 int client_id);
54 bool RegisterChildProcessLauncher(JNIEnv* env);
56 } // namespace content
58 #endif // CONTENT_BROWSER_ANDROID_CHILD_PROCESS_LAUNCHER_ANDROID_H_