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

Side by Side Diff: android_webview/browser/aw_browser_context.cc

Issue 337473004: aw: Use comparison DCHECKs where appropriate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/browser/aw_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "android_webview/browser/aw_browser_context.h" 5 #include "android_webview/browser/aw_browser_context.h"
6 6
7 #include "android_webview/browser/aw_form_database_service.h" 7 #include "android_webview/browser/aw_form_database_service.h"
8 #include "android_webview/browser/aw_pref_store.h" 8 #include "android_webview/browser/aw_pref_store.h"
9 #include "android_webview/browser/aw_quota_manager_bridge.h" 9 #include "android_webview/browser/aw_quota_manager_bridge.h"
10 #include "android_webview/browser/aw_resource_context.h" 10 #include "android_webview/browser/aw_resource_context.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } // namespace 45 } // namespace
46 46
47 // Data reduction proxy is disabled by default. 47 // Data reduction proxy is disabled by default.
48 bool AwBrowserContext::data_reduction_proxy_enabled_ = false; 48 bool AwBrowserContext::data_reduction_proxy_enabled_ = false;
49 49
50 AwBrowserContext::AwBrowserContext( 50 AwBrowserContext::AwBrowserContext(
51 const FilePath path, 51 const FilePath path,
52 JniDependencyFactory* native_factory) 52 JniDependencyFactory* native_factory)
53 : context_storage_path_(path), 53 : context_storage_path_(path),
54 native_factory_(native_factory) { 54 native_factory_(native_factory) {
55 DCHECK(g_browser_context == NULL); 55 DCHECK(!g_browser_context);
56 g_browser_context = this; 56 g_browser_context = this;
57 57
58 // This constructor is entered during the creation of ContentBrowserClient, 58 // This constructor is entered during the creation of ContentBrowserClient,
59 // before browser threads are created. Therefore any checks to enforce 59 // before browser threads are created. Therefore any checks to enforce
60 // threading (such as BrowserThread::CurrentlyOn()) will fail here. 60 // threading (such as BrowserThread::CurrentlyOn()) will fail here.
61 } 61 }
62 62
63 AwBrowserContext::~AwBrowserContext() { 63 AwBrowserContext::~AwBrowserContext() {
64 DCHECK(g_browser_context == this); 64 DCHECK_EQ(this, g_browser_context);
65 g_browser_context = NULL; 65 g_browser_context = NULL;
66 } 66 }
67 67
68 // static 68 // static
69 AwBrowserContext* AwBrowserContext::GetDefault() { 69 AwBrowserContext* AwBrowserContext::GetDefault() {
70 // TODO(joth): rather than store in a global here, lookup this instance 70 // TODO(joth): rather than store in a global here, lookup this instance
71 // from the Java-side peer. 71 // from the Java-side peer.
72 return g_browser_context; 72 return g_browser_context;
73 } 73 }
74 74
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 void AwBrowserContext::RebuildTable( 277 void AwBrowserContext::RebuildTable(
278 const scoped_refptr<URLEnumerator>& enumerator) { 278 const scoped_refptr<URLEnumerator>& enumerator) {
279 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 279 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
280 // can change in the lifetime of this WebView and may not yet be set here. 280 // can change in the lifetime of this WebView and may not yet be set here.
281 // Therefore this initialization path is not used. 281 // Therefore this initialization path is not used.
282 enumerator->OnComplete(true); 282 enumerator->OnComplete(true);
283 } 283 }
284 284
285 } // namespace android_webview 285 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/aw_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698