| 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 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv
ice_factory.h" | 5 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv
ice_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 9 #include "components/keyed_service/core/refcounted_keyed_service.h" | 9 #include "components/keyed_service/core/refcounted_keyed_service.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 RefcountedBrowserContextKeyedServiceFactory::GetServiceForBrowserContext( | 43 RefcountedBrowserContextKeyedServiceFactory::GetServiceForBrowserContext( |
| 44 content::BrowserContext* context, | 44 content::BrowserContext* context, |
| 45 bool create) { | 45 bool create) { |
| 46 return RefcountedKeyedServiceFactory::GetServiceForContext(context, create); | 46 return RefcountedKeyedServiceFactory::GetServiceForContext(context, create); |
| 47 } | 47 } |
| 48 | 48 |
| 49 content::BrowserContext* | 49 content::BrowserContext* |
| 50 RefcountedBrowserContextKeyedServiceFactory::GetBrowserContextToUse( | 50 RefcountedBrowserContextKeyedServiceFactory::GetBrowserContextToUse( |
| 51 content::BrowserContext* context) const { | 51 content::BrowserContext* context) const { |
| 52 // TODO(crbug.com/701326): This DCHECK should be moved to GetContextToUse(). | 52 // TODO(crbug.com/701326): This DCHECK should be moved to GetContextToUse(). |
| 53 DCHECK(CalledOnValidThread()); | 53 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 54 | 54 |
| 55 // Safe default for Incognito mode: no service. | 55 // Safe default for Incognito mode: no service. |
| 56 if (context->IsOffTheRecord()) | 56 if (context->IsOffTheRecord()) |
| 57 return nullptr; | 57 return nullptr; |
| 58 | 58 |
| 59 return context; | 59 return context; |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool RefcountedBrowserContextKeyedServiceFactory:: | 62 bool RefcountedBrowserContextKeyedServiceFactory:: |
| 63 ServiceIsCreatedWithBrowserContext() const { | 63 ServiceIsCreatedWithBrowserContext() const { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 void RefcountedBrowserContextKeyedServiceFactory::ContextDestroyed( | 111 void RefcountedBrowserContextKeyedServiceFactory::ContextDestroyed( |
| 112 base::SupportsUserData* context) { | 112 base::SupportsUserData* context) { |
| 113 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); | 113 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void RefcountedBrowserContextKeyedServiceFactory::RegisterPrefs( | 116 void RefcountedBrowserContextKeyedServiceFactory::RegisterPrefs( |
| 117 user_prefs::PrefRegistrySyncable* registry) { | 117 user_prefs::PrefRegistrySyncable* registry) { |
| 118 RegisterProfilePrefs(registry); | 118 RegisterProfilePrefs(registry); |
| 119 } | 119 } |
| OLD | NEW |