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

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

Issue 10949027: Close leaking FDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed last comments and synced. Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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_SANDBOXED_PROCESS_LAUNCHER_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
6 #define CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ 6 #define CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/global_descriptors_posix.h"
13 #include "base/platform_file.h" 12 #include "base/platform_file.h"
14 #include "base/process.h" 13 #include "base/process.h"
14 #include "content/public/browser/file_descriptor_info.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 typedef base::Callback<void(base::ProcessHandle)> StartSandboxedProcessCallback; 18 typedef base::Callback<void(base::ProcessHandle)> StartSandboxedProcessCallback;
19 // Starts a process as a sandboxed process spawned by the Android 19 // Starts a process as a sandboxed process spawned by the Android
20 // ActivityManager. 20 // ActivityManager.
21 // The created process handle is returned to the |callback| on success, 0 is 21 // The created process handle is returned to the |callback| on success, 0 is
22 // retuned if the process could not be created. 22 // retuned if the process could not be created.
23 void StartSandboxedProcess( 23 void StartSandboxedProcess(
24 const CommandLine::StringVector& argv, 24 const CommandLine::StringVector& argv,
25 int ipc_fd, 25 const std::vector<FileDescriptorInfo>& files_to_register,
26 const base::GlobalDescriptors::Mapping& files_to_register,
27 const StartSandboxedProcessCallback& callback); 26 const StartSandboxedProcessCallback& callback);
28 27
29 // Stops a sandboxed process based on the handle returned form 28 // Stops a sandboxed process based on the handle returned form
30 // StartSandboxedProcess. 29 // StartSandboxedProcess.
31 void StopSandboxedProcess(base::ProcessHandle handle); 30 void StopSandboxedProcess(base::ProcessHandle handle);
32 31
33 // Registers JNI methods, this must be called before any other methods in this 32 // Registers JNI methods, this must be called before any other methods in this
34 // file. 33 // file.
35 bool RegisterSandboxedProcessLauncher(JNIEnv* env); 34 bool RegisterSandboxedProcessLauncher(JNIEnv* env);
36 35
37 } // namespace content 36 } // namespace content
38 37
39 #endif // CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_ 38 #endif // CONTENT_BROWSER_ANDROID_SANDBOXED_PROCESS_LAUNCHER_H_
40 39
OLDNEW
« no previous file with comments | « content/app/android/sandboxed_process_service.cc ('k') | content/browser/android/sandboxed_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698