| 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 | 8 |
| 9 import org.chromium.base.library_loader.LibraryProcessType; | 9 import org.chromium.base.library_loader.LibraryProcessType; |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 return sChildProcessCreationParams; | 31 return sChildProcessCreationParams; |
| 32 } | 32 } |
| 33 | 33 |
| 34 public ChildProcessCreationParams(String packageName, int extraBindFlags, | 34 public ChildProcessCreationParams(String packageName, int extraBindFlags, |
| 35 int libraryProcessType) { | 35 int libraryProcessType) { |
| 36 mPackageName = packageName; | 36 mPackageName = packageName; |
| 37 mExtraBindFlags = extraBindFlags; | 37 mExtraBindFlags = extraBindFlags; |
| 38 mLibraryProcessType = libraryProcessType; | 38 mLibraryProcessType = libraryProcessType; |
| 39 } | 39 } |
| 40 | 40 |
| 41 public ChildProcessCreationParams copy() { |
| 42 return new ChildProcessCreationParams(mPackageName, mExtraBindFlags, mLi
braryProcessType); |
| 43 } |
| 44 |
| 41 public String getPackageName() { | 45 public String getPackageName() { |
| 42 return mPackageName; | 46 return mPackageName; |
| 43 } | 47 } |
| 44 | 48 |
| 49 public int getExtraBindFlags() { |
| 50 return mExtraBindFlags; |
| 51 } |
| 52 |
| 45 /** | 53 /** |
| 46 * Adds required extra flags to the given child service binding flags and re
turns them. | 54 * Adds required extra flags to the given child service binding flags and re
turns them. |
| 47 * Does not modify the state of the ChildProcessCreationParams instance. | 55 * Does not modify the state of the ChildProcessCreationParams instance. |
| 48 * | 56 * |
| 49 * @param bindFlags Source bind flags to modify. | 57 * @param bindFlags Source bind flags to modify. |
| 50 * @return Bind flags with extra flags added. | 58 * @return Bind flags with extra flags added. |
| 51 */ | 59 */ |
| 52 public int addExtraBindFlags(int bindFlags) { | 60 public int addExtraBindFlags(int bindFlags) { |
| 53 return bindFlags | mExtraBindFlags; | 61 return bindFlags | mExtraBindFlags; |
| 54 } | 62 } |
| 55 | 63 |
| 56 public void addIntentExtras(Intent intent) { | 64 public void addIntentExtras(Intent intent) { |
| 57 intent.putExtra(EXTRA_LIBRARY_PROCESS_TYPE, mLibraryProcessType); | 65 intent.putExtra(EXTRA_LIBRARY_PROCESS_TYPE, mLibraryProcessType); |
| 58 } | 66 } |
| 59 | 67 |
| 60 public static int getLibraryProcessType(Intent intent) { | 68 public static int getLibraryProcessType(Intent intent) { |
| 61 return intent.getIntExtra(EXTRA_LIBRARY_PROCESS_TYPE, | 69 return intent.getIntExtra(EXTRA_LIBRARY_PROCESS_TYPE, |
| 62 LibraryProcessType.PROCESS_CHILD); | 70 LibraryProcessType.PROCESS_CHILD); |
| 63 } | 71 } |
| 64 } | 72 } |
| OLD | NEW |