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

Remove deprecated method of BCKSF

All clients of BCKSF uses the new API taking a base::Callback<>
instead of the deprecated API that was using a raw function
pointer.

Remove the now obsolete deprecated API.

Bug: 809610
Change-Id: I18359b2f91a1a6d9445affcf4720eed528d74af3
Reviewed-on: https://chromium-review.googlesource.com/c/1297354Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603106}
parent ee201890
...@@ -1056,15 +1056,6 @@ void TestingProfile::Builder::SetProfileName(const std::string& profile_name) { ...@@ -1056,15 +1056,6 @@ void TestingProfile::Builder::SetProfileName(const std::string& profile_name) {
profile_name_ = profile_name; profile_name_ = profile_name;
} }
void TestingProfile::Builder::AddTestingFactory(
BrowserContextKeyedServiceFactory* service_factory,
BrowserContextKeyedServiceFactory::TestingFactoryFunction function) {
BrowserContextKeyedServiceFactory::TestingFactory testing_factory;
if (function)
testing_factory = base::BindRepeating(function);
AddTestingFactory(service_factory, std::move(testing_factory));
}
void TestingProfile::Builder::AddTestingFactory( void TestingProfile::Builder::AddTestingFactory(
BrowserContextKeyedServiceFactory* service_factory, BrowserContextKeyedServiceFactory* service_factory,
BrowserContextKeyedServiceFactory::TestingFactory testing_factory) { BrowserContextKeyedServiceFactory::TestingFactory testing_factory) {
......
...@@ -91,14 +91,6 @@ class TestingProfile : public Profile { ...@@ -91,14 +91,6 @@ class TestingProfile : public Profile {
// initialization is complete. // initialization is complete.
void SetDelegate(Delegate* delegate); void SetDelegate(Delegate* delegate);
// Adds a testing factory to the TestingProfile. These testing factories
// are applied before the ProfileKeyedServices are created.
// DEPRECATED: use TestingFactory version instead, see
// http://crbug.com/809610
void AddTestingFactory(
BrowserContextKeyedServiceFactory* service_factory,
BrowserContextKeyedServiceFactory::TestingFactoryFunction function);
// Adds a testing factory to the TestingProfile. These testing factories // Adds a testing factory to the TestingProfile. These testing factories
// are applied before the ProfileKeyedServices are created. // are applied before the ProfileKeyedServices are created.
void AddTestingFactory( void AddTestingFactory(
......
...@@ -13,23 +13,6 @@ ...@@ -13,23 +13,6 @@
#include "components/user_prefs/user_prefs.h" #include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
void BrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
TestingFactory wrapped_factory;
if (testing_factory) {
wrapped_factory = base::BindRepeating(testing_factory);
}
SetTestingFactory(context, std::move(wrapped_factory));
}
KeyedService* BrowserContextKeyedServiceFactory::SetTestingFactoryAndUse(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
DCHECK(testing_factory);
return SetTestingFactoryAndUse(context, base::BindRepeating(testing_factory));
}
void BrowserContextKeyedServiceFactory::SetTestingFactory( void BrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context, content::BrowserContext* context,
TestingFactory testing_factory) { TestingFactory testing_factory) {
......
...@@ -39,28 +39,6 @@ class KEYED_SERVICE_EXPORT BrowserContextKeyedServiceFactory ...@@ -39,28 +39,6 @@ class KEYED_SERVICE_EXPORT BrowserContextKeyedServiceFactory
void RegisterUserPrefsOnBrowserContextForTest( void RegisterUserPrefsOnBrowserContextForTest(
content::BrowserContext* context); content::BrowserContext* context);
// 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.
// DEPRECATED: use TestingFactory instead, see http://crbug.com/809610
using TestingFactoryFunction =
std::unique_ptr<KeyedService> (*)(content::BrowserContext* context);
// 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.
// DEPRECATED: use TestingFactory version instead, see http://crbug.com/809610
void SetTestingFactory(content::BrowserContext* context,
TestingFactoryFunction factory);
// Associates |factory| with |context| and immediately returns the created
// KeyedService. Since the factory will be used immediately, it may not be
// NULL.
// DEPRECATED: use TestingFactory version instead, see http://crbug.com/809610
KeyedService* SetTestingFactoryAndUse(content::BrowserContext* context,
TestingFactoryFunction factory);
// A callback that supplies the instance of a KeyedService for a given // A callback that supplies the instance of a KeyedService for a given
// BrowserContext. This is used primarily for testing, where we want to feed // BrowserContext. This is used primarily for testing, where we want to feed
// a specific test double into the BCKSF system. // a specific test double into the BCKSF system.
......
...@@ -10,24 +10,6 @@ ...@@ -10,24 +10,6 @@
#include "components/keyed_service/core/refcounted_keyed_service.h" #include "components/keyed_service/core/refcounted_keyed_service.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
void RefcountedBrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
TestingFactory wrapped_factory;
if (testing_factory) {
wrapped_factory = base::BindRepeating(testing_factory);
}
SetTestingFactory(context, std::move(wrapped_factory));
}
scoped_refptr<RefcountedKeyedService>
RefcountedBrowserContextKeyedServiceFactory::SetTestingFactoryAndUse(
content::BrowserContext* context,
TestingFactoryFunction testing_factory) {
DCHECK(testing_factory);
return SetTestingFactoryAndUse(context, base::BindRepeating(testing_factory));
}
void RefcountedBrowserContextKeyedServiceFactory::SetTestingFactory( void RefcountedBrowserContextKeyedServiceFactory::SetTestingFactory(
content::BrowserContext* context, content::BrowserContext* context,
TestingFactory testing_factory) { TestingFactory testing_factory) {
......
...@@ -30,29 +30,6 @@ class BrowserContext; ...@@ -30,29 +30,6 @@ class BrowserContext;
class KEYED_SERVICE_EXPORT RefcountedBrowserContextKeyedServiceFactory class KEYED_SERVICE_EXPORT RefcountedBrowserContextKeyedServiceFactory
: public RefcountedKeyedServiceFactory { : public RefcountedKeyedServiceFactory {
public: public:
// 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.
// DEPRECATED: use TestingFactory instead, see http://crbug.com/809610
using TestingFactoryFunction = scoped_refptr<RefcountedKeyedService> (*)(
content::BrowserContext* context);
// 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.
// DEPRECATED: use TestingFactory version instead, see http://crbug.com/809610
void SetTestingFactory(content::BrowserContext* context,
TestingFactoryFunction factory);
// Associates |factory| with |context| and immediately returns the created
// KeyedService. Since the factory will be used immediately, it may not be
// NULL.
// DEPRECATED: use TestingFactory version instead, see http://crbug.com/809610
scoped_refptr<RefcountedKeyedService> SetTestingFactoryAndUse(
content::BrowserContext* context,
TestingFactoryFunction factory);
// A callback that supplies the instance of a KeyedService for a given // A callback that supplies the instance of a KeyedService for a given
// BrowserContext. This is used primarily for testing, where we want to feed // BrowserContext. This is used primarily for testing, where we want to feed
// a specific test double into the BCKSF system. // a specific test double into the BCKSF system.
......
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