| 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.base.process_launcher; | 5 package org.chromium.base.process_launcher; |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 assert id >= 0; | 66 assert id >= 0; |
| 67 synchronized (sLock) { | 67 synchronized (sLock) { |
| 68 return sParamMap.get(id); | 68 return sParamMap.get(id); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Members should all be immutable to avoid worrying about thread safety. | 72 // Members should all be immutable to avoid worrying about thread safety. |
| 73 private final String mPackageName; | 73 private final String mPackageName; |
| 74 private final boolean mIsExternalService; | 74 private final boolean mIsExternalService; |
| 75 private final int mLibraryProcessType; | 75 private final int mLibraryProcessType; |
| 76 private final boolean mBindToCallerCheck; |
| 76 | 77 |
| 77 public ChildProcessCreationParams( | 78 public ChildProcessCreationParams(String packageName, boolean isExternalServ
ice, |
| 78 String packageName, boolean isExternalService, int libraryProcessTyp
e) { | 79 int libraryProcessType, boolean bindToCallerCheck) { |
| 79 mPackageName = packageName; | 80 mPackageName = packageName; |
| 80 mIsExternalService = isExternalService; | 81 mIsExternalService = isExternalService; |
| 81 mLibraryProcessType = libraryProcessType; | 82 mLibraryProcessType = libraryProcessType; |
| 83 mBindToCallerCheck = bindToCallerCheck; |
| 82 } | 84 } |
| 83 | 85 |
| 84 public String getPackageName() { | 86 public String getPackageName() { |
| 85 return mPackageName; | 87 return mPackageName; |
| 86 } | 88 } |
| 87 | 89 |
| 88 public boolean getIsExternalService() { | 90 public boolean getIsExternalService() { |
| 89 return mIsExternalService; | 91 return mIsExternalService; |
| 90 } | 92 } |
| 91 | 93 |
| 92 public int getLibraryProcessType() { | 94 public int getLibraryProcessType() { |
| 93 return mLibraryProcessType; | 95 return mLibraryProcessType; |
| 94 } | 96 } |
| 95 | 97 |
| 98 public boolean getBindToCallerCheck() { |
| 99 return mBindToCallerCheck; |
| 100 } |
| 101 |
| 96 public void addIntentExtras(Intent intent) { | 102 public void addIntentExtras(Intent intent) { |
| 97 intent.putExtra(EXTRA_LIBRARY_PROCESS_TYPE, mLibraryProcessType); | 103 intent.putExtra(EXTRA_LIBRARY_PROCESS_TYPE, mLibraryProcessType); |
| 98 } | 104 } |
| 99 | 105 |
| 100 public static int getLibraryProcessType(Intent intent) { | 106 public static int getLibraryProcessType(Intent intent) { |
| 101 return intent.getIntExtra(EXTRA_LIBRARY_PROCESS_TYPE, LibraryProcessType
.PROCESS_CHILD); | 107 return intent.getIntExtra(EXTRA_LIBRARY_PROCESS_TYPE, LibraryProcessType
.PROCESS_CHILD); |
| 102 } | 108 } |
| 103 } | 109 } |
| OLD | NEW |