| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.os.AsyncTask; | 9 import android.os.AsyncTask; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 initQueue.add(new NativeInitTask() { | 306 initQueue.add(new NativeInitTask() { |
| 307 @Override | 307 @Override |
| 308 public void initFunction() { | 308 public void initFunction() { |
| 309 if (delegate.isActivityDestroyed()) return; | 309 if (delegate.isActivityDestroyed()) return; |
| 310 delegate.finishNativeInitialization(); | 310 delegate.finishNativeInitialization(); |
| 311 } | 311 } |
| 312 }); | 312 }); |
| 313 | 313 |
| 314 // See crbug.com/593250. This can be removed after N SDK is released, cr
bug.com/592722. | 314 // See crbug.com/593250. This can be removed after N SDK is released, cr
bug.com/592722. |
| 315 ChildProcessCreationParams.set(mApplication.getChildProcessCreationParam
s()); | 315 ChildProcessCreationParams creationParams = mApplication.getChildProcess
CreationParams(); |
| 316 // WebAPK uses this code path to initialize Chrome's native code, and th
e |
| 317 // ChildProcessCreationParams has been set in {@link WebApkActivity}. We
have to prevent |
| 318 // resetting with a wrong parameter here. TODO(hanxi): Remove the entire
if block after |
| 319 // N SDK is released. |
| 320 if (creationParams != null) { |
| 321 ChildProcessCreationParams.set(creationParams); |
| 322 } |
| 316 if (isAsync) { | 323 if (isAsync) { |
| 317 // We want to start this queue once the C++ startup tasks have run;
allow the | 324 // We want to start this queue once the C++ startup tasks have run;
allow the |
| 318 // C++ startup to run asynchonously, and set it up to start the Java
queue once | 325 // C++ startup to run asynchonously, and set it up to start the Java
queue once |
| 319 // it has finished. | 326 // it has finished. |
| 320 startChromeBrowserProcessesAsync( | 327 startChromeBrowserProcessesAsync( |
| 321 delegate.shouldStartGpuProcess(), | 328 delegate.shouldStartGpuProcess(), |
| 322 new BrowserStartupController.StartupCallback() { | 329 new BrowserStartupController.StartupCallback() { |
| 323 @Override | 330 @Override |
| 324 public void onFailure() { | 331 public void onFailure() { |
| 325 delegate.onStartupFailure(); | 332 delegate.onStartupFailure(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 Log.e(TAG, "Killing process because of locale change."); | 438 Log.e(TAG, "Killing process because of locale change."); |
| 432 Process.killProcess(Process.myPid()); | 439 Process.killProcess(Process.myPid()); |
| 433 } | 440 } |
| 434 | 441 |
| 435 DeviceFormFactor.resetValuesIfNeeded(mApplication); | 442 DeviceFormFactor.resetValuesIfNeeded(mApplication); |
| 436 } | 443 } |
| 437 } | 444 } |
| 438 }; | 445 }; |
| 439 } | 446 } |
| 440 } | 447 } |
| OLD | NEW |