OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.Intent; | 7 import android.content.Intent; |
8 import android.util.SparseArray; | 8 import android.util.SparseArray; |
9 | 9 |
10 import org.chromium.base.library_loader.LibraryProcessType; | 10 import org.chromium.base.library_loader.LibraryProcessType; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 assert id >= 0; | 60 assert id >= 0; |
61 synchronized (sLock) { | 61 synchronized (sLock) { |
62 return sParamMap.get(id); | 62 return sParamMap.get(id); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 // Members should all be immutable to avoid worrying about thread safety. | 66 // Members should all be immutable to avoid worrying about thread safety. |
67 private final String mPackageName; | 67 private final String mPackageName; |
68 private final boolean mIsExternalService; | 68 private final boolean mIsExternalService; |
69 private final int mLibraryProcessType; | 69 private final int mLibraryProcessType; |
| 70 private final boolean mBindToCallerCheck; |
70 | 71 |
71 public ChildProcessCreationParams(String packageName, boolean isExternalServ
ice, | 72 public ChildProcessCreationParams(String packageName, boolean isExternalServ
ice, |
72 int libraryProcessType) { | 73 int libraryProcessType, boolean bindToCallerCheck) { |
73 mPackageName = packageName; | 74 mPackageName = packageName; |
74 mIsExternalService = isExternalService; | 75 mIsExternalService = isExternalService; |
75 mLibraryProcessType = libraryProcessType; | 76 mLibraryProcessType = libraryProcessType; |
| 77 mBindToCallerCheck = bindToCallerCheck; |
76 } | 78 } |
77 | 79 |
78 String getPackageName() { | 80 String getPackageName() { |
79 return mPackageName; | 81 return mPackageName; |
80 } | 82 } |
81 | 83 |
82 boolean getIsExternalService() { | 84 boolean getIsExternalService() { |
83 return mIsExternalService; | 85 return mIsExternalService; |
84 } | 86 } |
85 | 87 |
86 int getLibraryProcessType() { | 88 int getLibraryProcessType() { |
87 return mLibraryProcessType; | 89 return mLibraryProcessType; |
88 } | 90 } |
89 | 91 |
| 92 public boolean getBindToCallerCheck() { |
| 93 return mBindToCallerCheck; |
| 94 } |
| 95 |
90 void addIntentExtras(Intent intent) { | 96 void addIntentExtras(Intent intent) { |
91 intent.putExtra(ChildProcessConstants.EXTRA_LIBRARY_PROCESS_TYPE, mLibra
ryProcessType); | 97 intent.putExtra(ChildProcessConstants.EXTRA_LIBRARY_PROCESS_TYPE, mLibra
ryProcessType); |
92 } | 98 } |
93 | 99 |
94 public static int getLibraryProcessType(Intent intent) { | 100 public static int getLibraryProcessType(Intent intent) { |
95 return intent.getIntExtra( | 101 return intent.getIntExtra( |
96 ChildProcessConstants.EXTRA_LIBRARY_PROCESS_TYPE, LibraryProcess
Type.PROCESS_CHILD); | 102 ChildProcessConstants.EXTRA_LIBRARY_PROCESS_TYPE, LibraryProcess
Type.PROCESS_CHILD); |
97 } | 103 } |
98 } | 104 } |
OLD | NEW |