| 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 com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 6 | 6 |
| 7 import android.Manifest; | 7 import android.Manifest; |
| 8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 } | 436 } |
| 437 | 437 |
| 438 void startYourEngines(boolean onMainThread) { | 438 void startYourEngines(boolean onMainThread) { |
| 439 synchronized (mLock) { | 439 synchronized (mLock) { |
| 440 ensureChromiumStartedLocked(onMainThread); | 440 ensureChromiumStartedLocked(onMainThread); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 // Only on UI thread. | 444 // Only on UI thread. |
| 445 AwBrowserContext getBrowserContextOnUiThread() { | 445 AwBrowserContext getBrowserContextOnUiThread() { |
| 446 assert mStarted; | 446 // TODO(crbug.com/667337) |
| 447 // assert mStarted; |
| 448 |
| 447 if (BuildConfig.DCHECK_IS_ON && !ThreadUtils.runningOnUiThread()) { | 449 if (BuildConfig.DCHECK_IS_ON && !ThreadUtils.runningOnUiThread()) { |
| 448 throw new RuntimeException( | 450 throw new RuntimeException( |
| 449 "getBrowserContextOnUiThread called on " + Thread.currentThr
ead()); | 451 "getBrowserContextOnUiThread called on " + Thread.currentThr
ead()); |
| 450 } | 452 } |
| 451 | 453 |
| 452 if (mBrowserContext == null) { | 454 if (mBrowserContext == null) { |
| 453 mBrowserContext = | 455 mBrowserContext = |
| 454 new AwBrowserContext(mWebViewPrefs, ContextUtils.getApplicat
ionContext()); | 456 new AwBrowserContext(mWebViewPrefs, ContextUtils.getApplicat
ionContext()); |
| 455 } | 457 } |
| 456 return mBrowserContext; | 458 return mBrowserContext; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA
TABASE_FILE)); | 651 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA
TABASE_FILE)); |
| 650 } | 652 } |
| 651 } | 653 } |
| 652 return mWebViewDatabase; | 654 return mWebViewDatabase; |
| 653 } | 655 } |
| 654 | 656 |
| 655 WebViewDelegate getWebViewDelegate() { | 657 WebViewDelegate getWebViewDelegate() { |
| 656 return mWebViewDelegate; | 658 return mWebViewDelegate; |
| 657 } | 659 } |
| 658 } | 660 } |
| OLD | NEW |