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.ParcelFileDescriptor; | 8 import android.os.ParcelFileDescriptor; |
9 | 9 |
10 import org.chromium.base.ContextUtils; | 10 import org.chromium.base.ContextUtils; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 // Called on UI thread. | 95 // Called on UI thread. |
96 @CalledByNative | 96 @CalledByNative |
97 private static int getNumberOfRendererSlots() { | 97 private static int getNumberOfRendererSlots() { |
98 final ChildProcessCreationParams params = ChildProcessCreationParams.get
Default(); | 98 final ChildProcessCreationParams params = ChildProcessCreationParams.get
Default(); |
99 final Context context = ContextUtils.getApplicationContext(); | 99 final Context context = ContextUtils.getApplicationContext(); |
100 final boolean inSandbox = true; | 100 final boolean inSandbox = true; |
101 final String packageName = | 101 final String packageName = |
102 params == null ? context.getPackageName() : params.getPackageNam
e(); | 102 params == null ? context.getPackageName() : params.getPackageNam
e(); |
103 try { | 103 try { |
104 return ChildProcessLauncher.getNumberOfServices(context, inSandbox,
packageName); | 104 return ChildConnectionAllocator.getNumberOfServices(context, inSandb
ox, packageName); |
105 } catch (RuntimeException e) { | 105 } catch (RuntimeException e) { |
106 // Unittest packages do not declare services. Some tests require a r
ealistic number | 106 // Unittest packages do not declare services. Some tests require a r
ealistic number |
107 // to test child process policies, so pick a high-ish number here. | 107 // to test child process policies, so pick a high-ish number here. |
108 return 65535; | 108 return 65535; |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 // Can be called on a number of threads, including launcher, and binder. | 112 // Can be called on a number of threads, including launcher, and binder. |
113 private static native void nativeOnChildProcessStarted( | 113 private static native void nativeOnChildProcessStarted( |
114 long nativeChildProcessLauncherHelper, int pid); | 114 long nativeChildProcessLauncherHelper, int pid); |
115 } | 115 } |
OLD | NEW |