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

Unified Diff: content/browser/browser_context.cc

Issue 10764015: Ensure static BrowserContext methods only get called on the UI thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unittests Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_context.cc
===================================================================
--- content/browser/browser_context.cc (revision 145676)
+++ content/browser/browser_context.cc (working copy)
@@ -44,6 +44,10 @@
namespace {
void CreateQuotaManagerAndClients(BrowserContext* context) {
+ // Ensure that these methods are called on the UI thread, except for unittests
+ // where a UI thread might not have been created.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
+ !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
if (context->GetUserData(kQuotaManagerKeyName)) {
DCHECK(context->GetUserData(kDatabaseTrackerKeyName));
DCHECK(context->GetUserData(kDOMStorageContextKeyName));
@@ -143,6 +147,7 @@
DownloadManager* BrowserContext::GetDownloadManager(
BrowserContext* context) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!context->GetUserData(kDownloadManagerKeyName)) {
ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
DCHECK(rdh);
« no previous file with comments | « chrome/browser/browsing_data_file_system_helper_unittest.cc ('k') | content/browser/resource_context_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698