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

Unified Diff: ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc

Issue 2697043005: Use component ImageFetcher instead of iOS one. (Closed)
Patch Set: Created 3 years, 10 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: ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
diff --git a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
index 2c6a3d1a360a1d039174c0dbba3002a4c474c054..1b1765a480fcd2d48fb5b3afe34eb062dcff326c 100644
--- a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
+++ b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
@@ -16,6 +16,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/image_fetcher/image_decoder.h"
#include "components/image_fetcher/image_fetcher.h"
+#include "components/image_fetcher/image_fetcher_impl.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h"
@@ -40,7 +41,6 @@
#include "ios/chrome/browser/history/history_service_factory.h"
#include "ios/chrome/browser/signin/oauth2_token_service_factory.h"
#include "ios/chrome/browser/signin/signin_manager_factory.h"
-#include "ios/chrome/browser/suggestions/image_fetcher_impl.h"
#include "ios/chrome/browser/suggestions/ios_image_decoder_impl.h"
#include "ios/chrome/common/channel_info.h"
#include "ios/web/public/browser_state.h"
@@ -49,6 +49,7 @@
using bookmarks::BookmarkModel;
using history::HistoryService;
+using image_fetcher::ImageFetcherImpl;
using ios::BookmarkModelFactory;
using ntp_snippets::BookmarkSuggestionsProvider;
using ntp_snippets::ContentSuggestionsService;
@@ -59,7 +60,6 @@ using ntp_snippets::RemoteSuggestionsProviderImpl;
using ntp_snippets::RemoteSuggestionsStatusService;
using ntp_snippets::SchedulingRemoteSuggestionsProvider;
using suggestions::CreateIOSImageDecoder;
-using suggestions::ImageFetcherImpl;
namespace {
@@ -154,17 +154,20 @@ IOSChromeContentSuggestionsServiceFactory::BuildServiceInstanceFor(
->GetSequencedTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::GetSequenceToken(),
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
+
auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcher>(
signin_manager, token_service, request_context, prefs, nullptr,
base::Bind(&ParseJson), GetChannel() == version_info::Channel::STABLE
? google_apis::GetAPIKey()
: google_apis::GetNonStableAPIKey(),
service->user_classifier());
+
auto provider = base::MakeUnique<RemoteSuggestionsProviderImpl>(
service.get(), prefs, GetApplicationContext()->GetApplicationLocale(),
service->category_ranker(), std::move(suggestions_fetcher),
- base::MakeUnique<ImageFetcherImpl>(request_context.get(),
- web::WebThread::GetBlockingPool()),
+ base::MakeUnique<ImageFetcherImpl>(
+ CreateIOSImageDecoder(web::WebThread::GetBlockingPool()),
gambard 2017/02/17 08:16:09 I have used the same pool as the one used by the t
noyau (Ping after 24h) 2017/02/17 10:04:18 Probably historical. The taskrunner is createed on
Marc Treib 2017/02/17 10:10:31 Yup, transient - in fact, we have the same problem
gambard 2017/02/17 10:11:16 No, the RemoteSuggestionsProviderImpl (living in c
Marc Treib 2017/02/17 10:13:19 Concurrent comments ftw :D Some more detail: Once
+ request_context.get()),
CreateIOSImageDecoder(task_runner),
base::MakeUnique<RemoteSuggestionsDatabase>(database_dir, task_runner),
base::MakeUnique<RemoteSuggestionsStatusService>(signin_manager,
« no previous file with comments | « no previous file | ios/chrome/browser/suggestions/BUILD.gn » ('j') | ios/chrome/browser/suggestions/suggestions_service_factory.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698