Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java

Issue 2526873002: aw: Fix mStarted assert (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 TraceEvent.setATraceEnabled(mWebViewDelegate.isTraceTagEnabled()); 411 TraceEvent.setATraceEnabled(mWebViewDelegate.isTraceTagEnabled());
412 mWebViewDelegate.setOnTraceEnabledChangeListener( 412 mWebViewDelegate.setOnTraceEnabledChangeListener(
413 new WebViewDelegate.OnTraceEnabledChangeListener() { 413 new WebViewDelegate.OnTraceEnabledChangeListener() {
414 @Override 414 @Override
415 public void onTraceEnabledChange(boolean enabled) { 415 public void onTraceEnabledChange(boolean enabled) {
416 TraceEvent.setATraceEnabled(enabled); 416 TraceEvent.setATraceEnabled(enabled);
417 } 417 }
418 }); 418 });
419 419
420 mStarted = true;
421
420 // Initialize thread-unsafe singletons. 422 // Initialize thread-unsafe singletons.
421 AwBrowserContext awBrowserContext = getBrowserContextOnUiThread(); 423 AwBrowserContext awBrowserContext = getBrowserContextOnUiThread();
422 mGeolocationPermissions = new GeolocationPermissionsAdapter( 424 mGeolocationPermissions = new GeolocationPermissionsAdapter(
423 this, awBrowserContext.getGeolocationPermissions()); 425 this, awBrowserContext.getGeolocationPermissions());
424 mWebStorage = new WebStorageAdapter(this, AwQuotaManagerBridge.getInstan ce()); 426 mWebStorage = new WebStorageAdapter(this, AwQuotaManagerBridge.getInstan ce());
425 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { 427 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
426 mServiceWorkerController = new ServiceWorkerControllerAdapter( 428 mServiceWorkerController = new ServiceWorkerControllerAdapter(
427 awBrowserContext.getServiceWorkerController()); 429 awBrowserContext.getServiceWorkerController());
428 } 430 }
429 431
430 mStarted = true;
431 mRunQueue.drainQueue(); 432 mRunQueue.drainQueue();
432 } 433 }
433 434
434 boolean hasStarted() { 435 boolean hasStarted() {
435 return mStarted; 436 return mStarted;
436 } 437 }
437 438
438 void startYourEngines(boolean onMainThread) { 439 void startYourEngines(boolean onMainThread) {
439 synchronized (mLock) { 440 synchronized (mLock) {
440 ensureChromiumStartedLocked(onMainThread); 441 ensureChromiumStartedLocked(onMainThread);
441 } 442 }
442 } 443 }
443 444
444 // Only on UI thread. 445 // Only on UI thread.
445 AwBrowserContext getBrowserContextOnUiThread() { 446 AwBrowserContext getBrowserContextOnUiThread() {
446 // TODO(crbug.com/667337) 447 assert mStarted;
447 // assert mStarted;
448 448
449 if (BuildConfig.DCHECK_IS_ON && !ThreadUtils.runningOnUiThread()) { 449 if (BuildConfig.DCHECK_IS_ON && !ThreadUtils.runningOnUiThread()) {
450 throw new RuntimeException( 450 throw new RuntimeException(
451 "getBrowserContextOnUiThread called on " + Thread.currentThr ead()); 451 "getBrowserContextOnUiThread called on " + Thread.currentThr ead());
452 } 452 }
453 453
454 if (mBrowserContext == null) { 454 if (mBrowserContext == null) {
455 mBrowserContext = 455 mBrowserContext =
456 new AwBrowserContext(mWebViewPrefs, ContextUtils.getApplicat ionContext()); 456 new AwBrowserContext(mWebViewPrefs, ContextUtils.getApplicat ionContext());
457 } 457 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA TABASE_FILE)); 651 this, HttpAuthDatabase.newInstance(context, HTTP_AUTH_DA TABASE_FILE));
652 } 652 }
653 } 653 }
654 return mWebViewDatabase; 654 return mWebViewDatabase;
655 } 655 }
656 656
657 WebViewDelegate getWebViewDelegate() { 657 WebViewDelegate getWebViewDelegate() {
658 return mWebViewDelegate; 658 return mWebViewDelegate;
659 } 659 }
660 } 660 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698