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

Unified Diff: components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc

Issue 2775753002: Restore thread check in KeyedService factories.
Patch Set: Created 3 years, 9 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: components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc
diff --git a/components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc b/components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc
index 7778de8abeec12788420809f63bc2abe467f9326..264fb3635f90243720f6f60698d8fa4a125d7dd8 100644
--- a/components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc
+++ b/components/keyed_service/content/refcounted_browser_context_keyed_service_factory.cc
@@ -49,9 +49,6 @@ RefcountedBrowserContextKeyedServiceFactory::GetServiceForBrowserContext(
content::BrowserContext*
RefcountedBrowserContextKeyedServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
- // TODO(crbug.com/701326): This DCHECK should be moved to GetContextToUse().
- DCHECK(CalledOnValidThread());
-
// Safe default for Incognito mode: no service.
if (context->IsOffTheRecord())
return nullptr;
@@ -94,6 +91,7 @@ bool RefcountedBrowserContextKeyedServiceFactory::IsOffTheRecord(
base::SupportsUserData*
RefcountedBrowserContextKeyedServiceFactory::GetContextToUse(
base::SupportsUserData* context) const {
+ DCHECK(CalledOnValidThread());
AssertContextWasntDestroyed(context);
return GetBrowserContextToUse(static_cast<content::BrowserContext*>(context));
}

Powered by Google App Engine
This is Rietveld 408576698