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

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

Issue 2324793002: Support WebP images in the IOSImageDecoderImpl (Closed)
Patch Set: noyau@ comments. Created 4 years, 2 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 27969f5f93f2af28482abe89320c403d606d467a..db07a948d0a911efe3fec4ecaaa28e989b5a35bf 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
@@ -9,6 +9,7 @@
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "components/bookmarks/browser/bookmark_model.h"
@@ -52,7 +53,7 @@ using ntp_snippets::NTPSnippetsScheduler;
using ntp_snippets::NTPSnippetsService;
using ntp_snippets::NTPSnippetsStatusService;
using suggestions::ImageFetcherImpl;
-using suggestions::IOSImageDecoderImpl;
+using suggestions::createIOSImageDecoder;
using suggestions::SuggestionsService;
using suggestions::SuggestionsServiceFactory;
@@ -155,6 +156,9 @@ IOSChromeContentSuggestionsServiceFactory::BuildServiceInstanceFor(
->GetSequencedTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::GetSequenceToken(),
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
+ scoped_refptr<base::SequencedWorkerPool> image_decoder_worker_pool(
sdefresne 2016/10/05 09:15:28 Creation of base::SequencePool directly is really
vitaliii 2016/10/06 06:35:08 Done, thanks for detailed explanation!
+ new base::SequencedWorkerPool(/*max_threads*/ 2, "ImageDecoding",
+ base::TaskPriority::USER_VISIBLE));
std::unique_ptr<NTPSnippetsService> ntp_snippets_service =
base::MakeUnique<NTPSnippetsService>(
service.get(), service->category_factory(), prefs,
@@ -168,7 +172,7 @@ IOSChromeContentSuggestionsServiceFactory::BuildServiceInstanceFor(
: google_apis::GetNonStableAPIKey()),
base::MakeUnique<ImageFetcherImpl>(
request_context.get(), web::WebThread::GetBlockingPool()),
- base::MakeUnique<IOSImageDecoderImpl>(),
+ createIOSImageDecoder(image_decoder_worker_pool),
base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner),
base::MakeUnique<NTPSnippetsStatusService>(signin_manager, prefs));
service->set_ntp_snippets_service(ntp_snippets_service.get());

Powered by Google App Engine
This is Rietveld 408576698