Commit cc2386ca authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert KeyedServiceFactory to base::Callback

As std::function<> is forbidden, convert KeyedServiceFactory
to use base::Callback<> instead; eventually this will allow
sub-classes to accept callbacks instead of function pointers.

Also convert KeyedServiceFactory to std::unique_ptr<> in the
std::map<> instead of raw pointers and delete.

Bug: 809610
Change-Id: I14dcae6f9086a8788942431f6f68ab294cf11745
Reviewed-on: https://chromium-review.googlesource.com/1233702Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592424}
parent 35837d99
......@@ -4,6 +4,7 @@
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
......@@ -15,25 +16,34 @@
void BrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
KeyedServiceFactory::TestingFactoryFunction func;
KeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<content::BrowserContext*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(
static_cast<content::BrowserContext*>(context));
},
testing_factory);
}
KeyedServiceFactory::SetTestingFactory(context, func);
KeyedServiceFactory::SetTestingFactory(context, std::move(wrapped_factory));
}
KeyedService* BrowserContextKeyedServiceFactory::SetTestingFactoryAndUse(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
KeyedServiceFactory::TestingFactoryFunction func;
KeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<content::BrowserContext*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(
static_cast<content::BrowserContext*>(context));
},
testing_factory);
}
return KeyedServiceFactory::SetTestingFactoryAndUse(context, func);
return KeyedServiceFactory::SetTestingFactoryAndUse(
context, std::move(wrapped_factory));
}
BrowserContextKeyedServiceFactory::BrowserContextKeyedServiceFactory(
......
......@@ -4,6 +4,7 @@
#include "components/keyed_service/content/refcounted_browser_context_keyed_service_factory.h"
#include "base/bind.h"
#include "base/logging.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/refcounted_keyed_service.h"
......@@ -12,26 +13,36 @@
void RefcountedBrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
RefcountedKeyedServiceFactory::TestingFactoryFunction func;
RefcountedKeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<content::BrowserContext*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(
static_cast<content::BrowserContext*>(context));
},
testing_factory);
}
RefcountedKeyedServiceFactory::SetTestingFactory(context, func);
RefcountedKeyedServiceFactory::SetTestingFactory(context,
std::move(wrapped_factory));
}
scoped_refptr<RefcountedKeyedService>
RefcountedBrowserContextKeyedServiceFactory::SetTestingFactoryAndUse(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
RefcountedKeyedServiceFactory::TestingFactoryFunction func;
RefcountedKeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<content::BrowserContext*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(
static_cast<content::BrowserContext*>(context));
},
testing_factory);
}
return RefcountedKeyedServiceFactory::SetTestingFactoryAndUse(context, func);
return RefcountedKeyedServiceFactory::SetTestingFactoryAndUse(
context, std::move(wrapped_factory));
}
RefcountedBrowserContextKeyedServiceFactory::
......
......@@ -33,7 +33,7 @@ class KEYED_SERVICE_EXPORT RefcountedBrowserContextKeyedServiceFactory
// A function that supplies the instance of a KeyedService for a given
// BrowserContext. This is used primarily for testing, where we want to feed
// a specific mock into the BCKSF system.
typedef scoped_refptr<RefcountedKeyedService>(*TestingFactoryFunction)(
using TestingFactoryFunction = scoped_refptr<RefcountedKeyedService> (*)(
content::BrowserContext* context);
// Associates |factory| with |context| so that |factory| is used to create
......
......@@ -21,9 +21,8 @@ KeyedServiceFactory::~KeyedServiceFactory() {
DCHECK(mapping_.empty());
}
void KeyedServiceFactory::SetTestingFactory(
base::SupportsUserData* context,
TestingFactoryFunction testing_factory) {
void KeyedServiceFactory::SetTestingFactory(base::SupportsUserData* context,
TestingFactory testing_factory) {
// Destroying the context may cause us to lose data about whether |context|
// has our preferences registered on it (since the context object itself
// isn't dead). See if we need to readd it once we've gone through normal
......@@ -45,14 +44,14 @@ void KeyedServiceFactory::SetTestingFactory(
if (add_context)
MarkPreferencesSetOn(context);
testing_factories_[context] = testing_factory;
testing_factories_.emplace(context, std::move(testing_factory));
}
KeyedService* KeyedServiceFactory::SetTestingFactoryAndUse(
base::SupportsUserData* context,
TestingFactoryFunction testing_factory) {
TestingFactory testing_factory) {
DCHECK(testing_factory);
SetTestingFactory(context, testing_factory);
SetTestingFactory(context, std::move(testing_factory));
return GetServiceForContext(context, true);
}
......@@ -66,9 +65,9 @@ KeyedService* KeyedServiceFactory::GetServiceForContext(
// NOTE: If you modify any of the logic below, make sure to update the
// refcounted version in refcounted_context_keyed_service_factory.cc!
const auto& it = mapping_.find(context);
if (it != mapping_.end())
return it->second;
auto iterator = mapping_.find(context);
if (iterator != mapping_.end())
return iterator->second.get();
// Object not found.
if (!create)
......@@ -78,39 +77,38 @@ KeyedService* KeyedServiceFactory::GetServiceForContext(
// Check to see if we have a per-context testing factory that we should use
// instead of default behavior.
std::unique_ptr<KeyedService> service;
const auto& jt = testing_factories_.find(context);
if (jt != testing_factories_.end()) {
if (jt->second) {
auto factory_iterator = testing_factories_.find(context);
if (factory_iterator != testing_factories_.end()) {
if (factory_iterator->second) {
if (!IsOffTheRecord(context))
RegisterUserPrefsOnContextForTest(context);
service = jt->second(context);
service = factory_iterator->second.Run(context);
}
} else {
service = BuildServiceInstanceFor(context);
}
Associate(context, std::move(service));
return mapping_[context];
return Associate(context, std::move(service));
}
void KeyedServiceFactory::Associate(base::SupportsUserData* context,
std::unique_ptr<KeyedService> service) {
KeyedService* KeyedServiceFactory::Associate(
base::SupportsUserData* context,
std::unique_ptr<KeyedService> service) {
DCHECK(!base::ContainsKey(mapping_, context));
mapping_.insert(std::make_pair(context, service.release()));
auto iterator = mapping_.emplace(context, std::move(service)).first;
return iterator->second.get();
}
void KeyedServiceFactory::Disassociate(base::SupportsUserData* context) {
const auto& it = mapping_.find(context);
if (it != mapping_.end()) {
delete it->second;
mapping_.erase(it);
}
auto iterator = mapping_.find(context);
if (iterator != mapping_.end())
mapping_.erase(iterator);
}
void KeyedServiceFactory::ContextShutdown(base::SupportsUserData* context) {
const auto& it = mapping_.find(context);
if (it != mapping_.end() && it->second)
it->second->Shutdown();
auto iterator = mapping_.find(context);
if (iterator != mapping_.end() && iterator->second)
iterator->second->Shutdown();
}
void KeyedServiceFactory::ContextDestroyed(base::SupportsUserData* context) {
......@@ -127,11 +125,11 @@ void KeyedServiceFactory::ContextDestroyed(base::SupportsUserData* context) {
void KeyedServiceFactory::SetEmptyTestingFactory(
base::SupportsUserData* context) {
SetTestingFactory(context, nullptr);
SetTestingFactory(context, TestingFactory());
}
bool KeyedServiceFactory::HasTestingFactory(base::SupportsUserData* context) {
return testing_factories_.find(context) != testing_factories_.end();
return base::ContainsKey(testing_factories_, context);
}
void KeyedServiceFactory::CreateServiceNow(base::SupportsUserData* context) {
......
......@@ -30,25 +30,24 @@ class KEYED_SERVICE_EXPORT KeyedServiceFactory
KeyedServiceFactory(const char* name, DependencyManager* manager);
~KeyedServiceFactory() override;
// A function that supplies the instance of a KeyedService for a given
// A callback that supplies the instance of a KeyedService for a given
// |context|. This is used primarily for testing, where we want to feed
// a specific mock into the KeyedServiceFactory system.
typedef std::function<std::unique_ptr<KeyedService>(
base::SupportsUserData* context)>
TestingFactoryFunction;
// Associates |factory| with |context| so that |factory| is used to create
// the KeyedService when requested. |factory| can be NULL to signal that
// KeyedService should be NULL. Multiple calls to SetTestingFactory() are
// allowed; previous services will be shut down.
// a specific test double into the KeyedServiceFactory system.
using TestingFactory = base::RepeatingCallback<std::unique_ptr<KeyedService>(
base::SupportsUserData* context)>;
// Associates |testing_factory| with |context| so that |testing_factory| is
// used to create the KeyedService when requested. |testing_factory| can be
// empty to signal that KeyedService should be null. Multiple calls to
// SetTestingFactory() are allowed; previous services will be shut down.
void SetTestingFactory(base::SupportsUserData* context,
TestingFactoryFunction factory);
TestingFactory testing_factory);
// Associates |factory| with |context| and immediately returns the created
// KeyedService. Since the factory will be used immediately, it may not be
// NULL.
// Associates |testing_factory| with |context| and immediately returns the
// created KeyedService. Since the factory will be used immediately, it may
// not be empty.
KeyedService* SetTestingFactoryAndUse(base::SupportsUserData* context,
TestingFactoryFunction factory);
TestingFactory testing_factory);
// Common implementation that maps |context| to some service object. Deals
// with incognito contexts per subclass instructions with GetContextToUse()
......@@ -57,9 +56,10 @@ class KEYED_SERVICE_EXPORT KeyedServiceFactory
KeyedService* GetServiceForContext(base::SupportsUserData* context,
bool create);
// Maps |context| to |service| with debug checks to prevent duplication.
void Associate(base::SupportsUserData* context,
std::unique_ptr<KeyedService> service);
// Maps |context| to |service| with debug checks to prevent duplication and
// returns a raw pointer to |service|.
KeyedService* Associate(base::SupportsUserData* context,
std::unique_ptr<KeyedService> service);
// Removes the mapping from |context| to a service.
void Disassociate(base::SupportsUserData* context);
......@@ -83,16 +83,11 @@ class KEYED_SERVICE_EXPORT KeyedServiceFactory
friend class DependencyManager;
friend class DependencyManagerUnittests;
typedef std::map<base::SupportsUserData*, KeyedService*> KeyedServices;
typedef std::map<base::SupportsUserData*, TestingFactoryFunction>
OverriddenTestingFunctions;
// The mapping between a context and its service.
KeyedServices mapping_;
std::map<base::SupportsUserData*, std::unique_ptr<KeyedService>> mapping_;
// The mapping between a context and its overridden
// TestingFactoryFunction.
OverriddenTestingFunctions testing_factories_;
// The mapping between a context and its overridden TestingFactory.
std::map<base::SupportsUserData*, TestingFactory> testing_factories_;
DISALLOW_COPY_AND_ASSIGN(KeyedServiceFactory);
};
......
......@@ -21,7 +21,7 @@ RefcountedKeyedServiceFactory::~RefcountedKeyedServiceFactory() {
void RefcountedKeyedServiceFactory::SetTestingFactory(
base::SupportsUserData* context,
TestingFactoryFunction testing_factory) {
TestingFactory testing_factory) {
// Destroying the context may cause us to lose data about whether |context|
// has our preferences registered on it (since the context object itself
// isn't dead). See if we need to readd it once we've gone through normal
......@@ -43,15 +43,15 @@ void RefcountedKeyedServiceFactory::SetTestingFactory(
if (add_context)
MarkPreferencesSetOn(context);
testing_factories_[context] = testing_factory;
testing_factories_.emplace(context, std::move(testing_factory));
}
scoped_refptr<RefcountedKeyedService>
RefcountedKeyedServiceFactory::SetTestingFactoryAndUse(
base::SupportsUserData* context,
TestingFactoryFunction testing_factory) {
TestingFactory testing_factory) {
DCHECK(testing_factory);
SetTestingFactory(context, testing_factory);
SetTestingFactory(context, std::move(testing_factory));
return GetServiceForContext(context, true);
}
......@@ -65,9 +65,9 @@ RefcountedKeyedServiceFactory::GetServiceForContext(
// NOTE: If you modify any of the logic below, make sure to update the
// non-refcounted version in context_keyed_service_factory.cc!
const auto& it = mapping_.find(context);
if (it != mapping_.end())
return it->second;
auto iterator = mapping_.find(context);
if (iterator != mapping_.end())
return iterator->second;
// Object not found.
if (!create)
......@@ -77,40 +77,47 @@ RefcountedKeyedServiceFactory::GetServiceForContext(
// Check to see if we have a per-BrowserContext testing factory that we should
// use instead of default behavior.
scoped_refptr<RefcountedKeyedService> service;
const auto& jt = testing_factories_.find(context);
if (jt != testing_factories_.end()) {
if (jt->second) {
auto factory_iterator = testing_factories_.find(context);
if (factory_iterator != testing_factories_.end()) {
if (factory_iterator->second) {
if (!IsOffTheRecord(context))
RegisterUserPrefsOnContextForTest(context);
service = jt->second(context);
service = factory_iterator->second.Run(context);
}
} else {
service = BuildServiceInstanceFor(context);
}
Associate(context, service);
return service;
return Associate(context, std::move(service));
}
void RefcountedKeyedServiceFactory::Associate(
scoped_refptr<RefcountedKeyedService> RefcountedKeyedServiceFactory::Associate(
base::SupportsUserData* context,
const scoped_refptr<RefcountedKeyedService>& service) {
scoped_refptr<RefcountedKeyedService> service) {
DCHECK(!base::ContainsKey(mapping_, context));
mapping_.insert(std::make_pair(context, service));
auto iterator = mapping_.emplace(context, std::move(service)).first;
return iterator->second;
}
void RefcountedKeyedServiceFactory::Disassociate(
base::SupportsUserData* context) {
// We "merely" drop our reference to the service. Hopefully this will cause
// the service to be destroyed. If not, oh well.
auto iterator = mapping_.find(context);
if (iterator != mapping_.end())
mapping_.erase(iterator);
}
void RefcountedKeyedServiceFactory::ContextShutdown(
base::SupportsUserData* context) {
const auto& it = mapping_.find(context);
if (it != mapping_.end() && it->second.get())
it->second->ShutdownOnUIThread();
auto iterator = mapping_.find(context);
if (iterator != mapping_.end() && iterator->second.get())
iterator->second->ShutdownOnUIThread();
}
void RefcountedKeyedServiceFactory::ContextDestroyed(
base::SupportsUserData* context) {
// We "merely" drop our reference to the service. Hopefully this will cause
// the service to be destroyed. If not, oh well.
mapping_.erase(context);
Disassociate(context);
// For unit tests, we also remove the factory function both so we don't
// maintain a big map of dead pointers, but also since we may have a second
......@@ -123,12 +130,12 @@ void RefcountedKeyedServiceFactory::ContextDestroyed(
void RefcountedKeyedServiceFactory::SetEmptyTestingFactory(
base::SupportsUserData* context) {
SetTestingFactory(context, nullptr);
SetTestingFactory(context, TestingFactory());
}
bool RefcountedKeyedServiceFactory::HasTestingFactory(
base::SupportsUserData* context) {
return testing_factories_.find(context) != testing_factories_.end();
return base::ContainsKey(testing_factories_, context);
}
void RefcountedKeyedServiceFactory::CreateServiceNow(
......
......@@ -29,26 +29,26 @@ class KEYED_SERVICE_EXPORT RefcountedKeyedServiceFactory
RefcountedKeyedServiceFactory(const char* name, DependencyManager* manager);
~RefcountedKeyedServiceFactory() override;
// A function that supplies the instance of a KeyedService for a given
// A callback that supplies the instance of a KeyedService for a given
// |context|. This is used primarily for testing, where we want to feed
// a specific mock into the KeyedServiceFactory system.
typedef std::function<scoped_refptr<RefcountedKeyedService>(
base::SupportsUserData* context)>
TestingFactoryFunction;
// Associates |factory| with |context| so that |factory| is used to create
// the KeyedService when requested. |factory| can be NULL to signal that
// KeyedService should be NULL. Multiple calls to SetTestingFactory() are
// allowed; previous services will be shut down.
// a specific test double into the KeyedServiceFactory system.
using TestingFactory =
base::RepeatingCallback<scoped_refptr<RefcountedKeyedService>(
base::SupportsUserData* context)>;
// Associates |testing_factory| with |context| so that |testing_factory| is
// used to create the KeyedService when requested. |testing_factory| can be
// empty to signal that KeyedService should be null. Multiple calls to
// SetTestingFactory() are allowed; previous services will be shut down.
void SetTestingFactory(base::SupportsUserData* context,
TestingFactoryFunction factory);
TestingFactory testing_factory);
// Associates |factory| with |context| and immediately returns the created
// KeyedService. Since the factory will be used immediately, it may not be
// NULL.
// Associates |testing_factory| with |context| and immediately returns the
// created KeyedService. Since the factory will be used immediately, it may
// not be empty.
scoped_refptr<RefcountedKeyedService> SetTestingFactoryAndUse(
base::SupportsUserData* context,
TestingFactoryFunction factory);
TestingFactory testing_factory);
// Common implementation that maps |context| to some service object. Deals
// with incognito contexts per subclass instructions with GetContextToUse()
......@@ -58,9 +58,14 @@ class KEYED_SERVICE_EXPORT RefcountedKeyedServiceFactory
base::SupportsUserData* context,
bool create);
// Maps |context| to |service| with debug checks to prevent duplication.
void Associate(base::SupportsUserData* context,
const scoped_refptr<RefcountedKeyedService>& service);
// Maps |context| to |service| with debug checks to prevent duplication and
// returns |service|.
scoped_refptr<RefcountedKeyedService> Associate(
base::SupportsUserData* context,
scoped_refptr<RefcountedKeyedService> service);
// Removes the mapping from |context| to a service.
void Disassociate(base::SupportsUserData* context);
// Returns a new RefcountedKeyedService that will be associated with
// |context|.
......@@ -79,17 +84,12 @@ class KEYED_SERVICE_EXPORT RefcountedKeyedServiceFactory
void CreateServiceNow(base::SupportsUserData* context) override;
private:
typedef std::map<base::SupportsUserData*,
scoped_refptr<RefcountedKeyedService>> KeyedServices;
typedef std::map<base::SupportsUserData*, TestingFactoryFunction>
OverriddenTestingFunctions;
// The mapping between a context and its refcounted service.
KeyedServices mapping_;
std::map<base::SupportsUserData*, scoped_refptr<RefcountedKeyedService>>
mapping_;
// The mapping between a context and its overridden
// TestingFactoryFunction.
OverriddenTestingFunctions testing_factories_;
// The mapping between a context and its overridden TestingFactory.
std::map<base::SupportsUserData*, TestingFactory> testing_factories_;
DISALLOW_COPY_AND_ASSIGN(RefcountedKeyedServiceFactory);
};
......
......@@ -4,6 +4,7 @@
#include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
#include "base/bind.h"
#include "base/logging.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
......@@ -12,25 +13,32 @@
void BrowserStateKeyedServiceFactory::SetTestingFactory(
web::BrowserState* context,
TestingFactoryFunction testing_factory) {
KeyedServiceFactory::TestingFactoryFunction func;
KeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
},
testing_factory);
}
KeyedServiceFactory::SetTestingFactory(context, func);
KeyedServiceFactory::SetTestingFactory(context, std::move(wrapped_factory));
}
KeyedService* BrowserStateKeyedServiceFactory::SetTestingFactoryAndUse(
web::BrowserState* context,
TestingFactoryFunction testing_factory) {
KeyedServiceFactory::TestingFactoryFunction func;
KeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
},
testing_factory);
}
return KeyedServiceFactory::SetTestingFactoryAndUse(context, func);
return KeyedServiceFactory::SetTestingFactoryAndUse(
context, std::move(wrapped_factory));
}
BrowserStateKeyedServiceFactory::BrowserStateKeyedServiceFactory(
......
......@@ -4,6 +4,7 @@
#include "components/keyed_service/ios/refcounted_browser_state_keyed_service_factory.h"
#include "base/bind.h"
#include "base/logging.h"
#include "components/keyed_service/core/refcounted_keyed_service.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
......@@ -12,26 +13,34 @@
void RefcountedBrowserStateKeyedServiceFactory::SetTestingFactory(
web::BrowserState* context,
TestingFactoryFunction testing_factory) {
RefcountedKeyedServiceFactory::TestingFactoryFunction func;
RefcountedKeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
},
testing_factory);
}
RefcountedKeyedServiceFactory::SetTestingFactory(context, func);
RefcountedKeyedServiceFactory::SetTestingFactory(context,
std::move(wrapped_factory));
}
scoped_refptr<RefcountedKeyedService>
RefcountedBrowserStateKeyedServiceFactory::SetTestingFactoryAndUse(
web::BrowserState* context,
TestingFactoryFunction testing_factory) {
RefcountedKeyedServiceFactory::TestingFactoryFunction func;
RefcountedKeyedServiceFactory::TestingFactory wrapped_factory;
if (testing_factory) {
func = [=](base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
};
wrapped_factory = base::BindRepeating(
[](TestingFactoryFunction testing_factory,
base::SupportsUserData* context) {
return testing_factory(static_cast<web::BrowserState*>(context));
},
testing_factory);
}
return RefcountedKeyedServiceFactory::SetTestingFactoryAndUse(context, func);
return RefcountedKeyedServiceFactory::SetTestingFactoryAndUse(
context, std::move(wrapped_factory));
}
RefcountedBrowserStateKeyedServiceFactory::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment