OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.init; | 5 package org.chromium.chrome.browser.init; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // setContentView inflating the decorView and the basic UI hierarhcy as
stubs. | 102 // setContentView inflating the decorView and the basic UI hierarhcy as
stubs. |
103 // This is done here before kicking long running I/O because inflation i
ncludes accessing | 103 // This is done here before kicking long running I/O because inflation i
ncludes accessing |
104 // resource files(xmls etc) even if we are inflating views defined by th
e framework. If this | 104 // resource files(xmls etc) even if we are inflating views defined by th
e framework. If this |
105 // operation gets blocked because other long running I/O are running, we
delay onCreate(), | 105 // operation gets blocked because other long running I/O are running, we
delay onCreate(), |
106 // onStart() and first draw consequently. | 106 // onStart() and first draw consequently. |
107 | 107 |
108 setContentView(); | 108 setContentView(); |
109 if (mLaunchBehindWorkaround != null) mLaunchBehindWorkaround.onSetConten
tView(); | 109 if (mLaunchBehindWorkaround != null) mLaunchBehindWorkaround.onSetConten
tView(); |
110 | 110 |
111 // Kick off long running IO tasks that can be done in parallel. | 111 // Kick off long running IO tasks that can be done in parallel. |
112 mNativeInitializationController = new NativeInitializationController(thi
s, this); | 112 mNativeInitializationController = new NativeInitializationController(thi
s); |
113 initializeChildProcessCreationParams(); | 113 initializeChildProcessCreationParams(); |
114 mNativeInitializationController.startBackgroundTasks(shouldAllocateChild
Connection()); | 114 mNativeInitializationController.startBackgroundTasks(shouldAllocateChild
Connection()); |
115 } | 115 } |
116 | 116 |
117 /** Controls the parameter of {@link NativeInitializationController#startBac
kgroundTasks()}.*/ | 117 /** Controls the parameter of {@link NativeInitializationController#startBac
kgroundTasks()}.*/ |
118 @VisibleForTesting | 118 @VisibleForTesting |
119 public boolean shouldAllocateChildConnection() { | 119 public boolean shouldAllocateChildConnection() { |
120 return true; | 120 return true; |
121 } | 121 } |
122 | 122 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 getDecorView().setVisibility(View.GONE); | 508 getDecorView().setVisibility(View.GONE); |
509 } | 509 } |
510 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); | 510 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); |
511 } | 511 } |
512 }); | 512 }); |
513 return true; | 513 return true; |
514 } | 514 } |
515 }; | 515 }; |
516 } | 516 } |
517 } | 517 } |
OLD | NEW |