Commit 986844d1 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert indirect uses of TestingFactoryFunction

TestingFactoryFunction is a simple function pointer. It is
deprecated in favor of TestingFactory which is a Callback<>.
Convert indirect uses by using base::BindRepeating() in all
invocation of SetTestingFactory/AddTestingFactory.

This converts uses in src//chrome/browser/thumbnails.

This CL was uploaded by git cl split.

R=treib@chromium.org

Bug: 809610
Change-Id: If593d807b93661db5414e15acb5efb46c93e99a2
Reviewed-on: https://chromium-review.googlesource.com/c/1259026
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596545}
parent 74ac297f
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
...@@ -178,7 +179,7 @@ class ThumbnailTest : public InProcessBrowserTest { ...@@ -178,7 +179,7 @@ class ThumbnailTest : public InProcessBrowserTest {
void OnWillCreateBrowserContextServices(content::BrowserContext* context) { void OnWillCreateBrowserContextServices(content::BrowserContext* context) {
ThumbnailServiceFactory::GetInstance()->SetTestingFactory( ThumbnailServiceFactory::GetInstance()->SetTestingFactory(
context, &ThumbnailTest::CreateThumbnailService); context, base::BindRepeating(&ThumbnailTest::CreateThumbnailService));
} }
std::unique_ptr< std::unique_ptr<
......
...@@ -80,7 +80,8 @@ scoped_refptr<RefcountedKeyedService> BuildMockTopSites( ...@@ -80,7 +80,8 @@ scoped_refptr<RefcountedKeyedService> BuildMockTopSites(
class MockProfile : public TestingProfile { class MockProfile : public TestingProfile {
public: public:
MockProfile() { MockProfile() {
TopSitesFactory::GetInstance()->SetTestingFactory(this, BuildMockTopSites); TopSitesFactory::GetInstance()->SetTestingFactory(
this, base::BindRepeating(&BuildMockTopSites));
} }
void AddKnownURL(const GURL& url, const history::ThumbnailScore& score) { void AddKnownURL(const GURL& url, const history::ThumbnailScore& score) {
......
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