| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.app; | 5 package org.chromium.content.app; |
| 6 | 6 |
| 7 import android.os.Looper; | 7 import android.os.Looper; |
| 8 import android.os.MessageQueue; | 8 import android.os.MessageQueue; |
| 9 | 9 |
| 10 import org.chromium.base.BaseChromiumApplication; | 10 import org.chromium.base.BaseChromiumApplication; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 try { | 49 try { |
| 50 getTracingController().registerReceiver(ContentApplication.t
his); | 50 getTracingController().registerReceiver(ContentApplication.t
his); |
| 51 } catch (SecurityException e) { | 51 } catch (SecurityException e) { |
| 52 // Happens if the process is isolated. Ignore. | 52 // Happens if the process is isolated. Ignore. |
| 53 } | 53 } |
| 54 // Remove the idle handler. | 54 // Remove the idle handler. |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 }); | 57 }); |
| 58 | 58 |
| 59 initializeLibraryDependencies(); | |
| 60 mLibraryDependenciesInitialized = true; | 59 mLibraryDependenciesInitialized = true; |
| 61 } | 60 } |
| 62 | 61 |
| 63 /** | 62 /** |
| 64 * Initialize all the dependencies that need to be setup before library load
ing can be | |
| 65 * kicked off. | |
| 66 */ | |
| 67 protected void initializeLibraryDependencies() { | |
| 68 } | |
| 69 | |
| 70 /** | |
| 71 * @return Whether the library dependencies have been initialized and it is
safe to issue | 63 * @return Whether the library dependencies have been initialized and it is
safe to issue |
| 72 * requests to load the native library. | 64 * requests to load the native library. |
| 73 */ | 65 */ |
| 74 @VisibleForTesting | 66 @VisibleForTesting |
| 75 public boolean areLibraryDependenciesInitialized() { | 67 public boolean areLibraryDependenciesInitialized() { |
| 76 return mLibraryDependenciesInitialized; | 68 return mLibraryDependenciesInitialized; |
| 77 } | 69 } |
| 78 | 70 |
| 79 /** | 71 /** |
| 80 * For emulated process environment only. On a production device, the applic
ation process is | 72 * For emulated process environment only. On a production device, the applic
ation process is |
| 81 * simply killed without calling this method. We don't need to unregister th
e broadcast | 73 * simply killed without calling this method. We don't need to unregister th
e broadcast |
| 82 * receiver in the latter case. | 74 * receiver in the latter case. |
| 83 */ | 75 */ |
| 84 @Override | 76 @Override |
| 85 public void onTerminate() { | 77 public void onTerminate() { |
| 86 try { | 78 try { |
| 87 getTracingController().unregisterReceiver(this); | 79 getTracingController().unregisterReceiver(this); |
| 88 getTracingController().destroy(); | 80 getTracingController().destroy(); |
| 89 } catch (SecurityException e) { | 81 } catch (SecurityException e) { |
| 90 // Happens if the process is isolated. Ignore. | 82 // Happens if the process is isolated. Ignore. |
| 91 } | 83 } |
| 92 | 84 |
| 93 super.onTerminate(); | 85 super.onTerminate(); |
| 94 } | 86 } |
| 95 } | 87 } |
| OLD | NEW |