OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Bundle; |
8 import android.os.IBinder; | 9 import android.os.IBinder; |
9 | 10 |
10 import org.chromium.base.process_launcher.ChildProcessCreationParams; | 11 import org.chromium.base.process_launcher.ChildProcessCreationParams; |
11 import org.chromium.base.process_launcher.FileDescriptorInfo; | |
12 import org.chromium.content.browser.ChildProcessLauncher.LaunchCallback; | 12 import org.chromium.content.browser.ChildProcessLauncher.LaunchCallback; |
13 | 13 |
14 /** Contains the information necessary to start a child process. */ | 14 /** Contains the information necessary to start a child process. */ |
15 class ChildSpawnData { | 15 class ChildSpawnData { |
16 private final Context mContext; | 16 private final Context mContext; |
17 private final String[] mCommandLine; | 17 private final Bundle mServiceBundle; |
18 private final FileDescriptorInfo[] mFilesToBeMapped; | 18 private final Bundle mConnectionBundle; |
19 private final LaunchCallback mLaunchCallback; | 19 private final LaunchCallback mLaunchCallback; |
20 private final IBinder mChildProcessCallback; | 20 private final IBinder mChildProcessCallback; |
21 private final boolean mInSandbox; | 21 private final boolean mInSandbox; |
22 private final boolean mAlwaysInForeground; | 22 private final boolean mAlwaysInForeground; |
23 private final ChildProcessCreationParams mCreationParams; | 23 private final ChildProcessCreationParams mCreationParams; |
24 | 24 |
25 ChildSpawnData(Context context, String[] commandLine, FileDescriptorInfo[] f
ilesToBeMapped, | 25 ChildSpawnData(Context context, Bundle serviceBundle, Bundle connectionBundl
e, |
26 LaunchCallback launchCallback, IBinder childProcessCallback, boolean
inSandbox, | 26 LaunchCallback launchCallback, IBinder childProcessCallback, boolean
inSandbox, |
27 boolean alwaysInForeground, ChildProcessCreationParams creationParam
s) { | 27 boolean alwaysInForeground, ChildProcessCreationParams creationParam
s) { |
28 mContext = context; | 28 mContext = context; |
29 mCommandLine = commandLine; | 29 mServiceBundle = serviceBundle; |
30 mFilesToBeMapped = filesToBeMapped; | 30 mConnectionBundle = connectionBundle; |
31 mLaunchCallback = launchCallback; | 31 mLaunchCallback = launchCallback; |
32 mChildProcessCallback = childProcessCallback; | 32 mChildProcessCallback = childProcessCallback; |
33 mInSandbox = inSandbox; | 33 mInSandbox = inSandbox; |
34 mAlwaysInForeground = alwaysInForeground; | 34 mAlwaysInForeground = alwaysInForeground; |
35 mCreationParams = creationParams; | 35 mCreationParams = creationParams; |
36 } | 36 } |
37 | 37 |
38 Context getContext() { | 38 Context getContext() { |
39 return mContext; | 39 return mContext; |
40 } | 40 } |
41 | 41 |
42 String[] getCommandLine() { | 42 Bundle getServiceBundle() { |
43 return mCommandLine; | 43 return mServiceBundle; |
44 } | 44 } |
45 | 45 |
46 FileDescriptorInfo[] getFilesToBeMapped() { | 46 Bundle getConnectionBundle() { |
47 return mFilesToBeMapped; | 47 return mConnectionBundle; |
48 } | 48 } |
49 | 49 |
50 LaunchCallback getLaunchCallback() { | 50 LaunchCallback getLaunchCallback() { |
51 return mLaunchCallback; | 51 return mLaunchCallback; |
52 } | 52 } |
53 | 53 |
54 IBinder getChildProcessCallback() { | 54 IBinder getChildProcessCallback() { |
55 return mChildProcessCallback; | 55 return mChildProcessCallback; |
56 } | 56 } |
57 | 57 |
58 boolean isInSandbox() { | 58 boolean isInSandbox() { |
59 return mInSandbox; | 59 return mInSandbox; |
60 } | 60 } |
61 | 61 |
62 boolean isAlwaysInForeground() { | 62 boolean isAlwaysInForeground() { |
63 return mAlwaysInForeground; | 63 return mAlwaysInForeground; |
64 } | 64 } |
65 | 65 |
66 ChildProcessCreationParams getCreationParams() { | 66 ChildProcessCreationParams getCreationParams() { |
67 return mCreationParams; | 67 return mCreationParams; |
68 } | 68 } |
69 } | 69 } |
OLD | NEW |