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

Side by Side Diff: ios/chrome/browser/suggestions/suggestions_service_factory.mm

Issue 1156003008: Decode ImageManager cached images on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use MessageLoop API Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « components/suggestions/image_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h" 5 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 base::FilePath database_dir( 61 base::FilePath database_dir(
62 chrome_browser_state->GetStatePath().Append(kThumbnailDirectory)); 62 chrome_browser_state->GetStatePath().Append(kThumbnailDirectory));
63 scoped_ptr<SuggestionsStore> suggestions_store( 63 scoped_ptr<SuggestionsStore> suggestions_store(
64 new SuggestionsStore(chrome_browser_state->GetPrefs())); 64 new SuggestionsStore(chrome_browser_state->GetPrefs()));
65 scoped_ptr<BlacklistStore> blacklist_store( 65 scoped_ptr<BlacklistStore> blacklist_store(
66 new BlacklistStore(chrome_browser_state->GetPrefs())); 66 new BlacklistStore(chrome_browser_state->GetPrefs()));
67 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData>> db( 67 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData>> db(
68 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); 68 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner));
69 scoped_ptr<ImageFetcher> image_fetcher(new ImageFetcherImpl( 69 scoped_ptr<ImageFetcher> image_fetcher(new ImageFetcherImpl(
70 browser_state->GetRequestContext(), sequenced_worker_pool)); 70 browser_state->GetRequestContext(), sequenced_worker_pool));
71 scoped_ptr<ImageManager> thumbnail_manager( 71 scoped_ptr<ImageManager> thumbnail_manager(new ImageManager(
72 new ImageManager(image_fetcher.Pass(), db.Pass(), database_dir)); 72 image_fetcher.Pass(), db.Pass(), database_dir,
73 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB)));
73 return new SuggestionsService( 74 return new SuggestionsService(
74 browser_state->GetRequestContext(), suggestions_store.Pass(), 75 browser_state->GetRequestContext(), suggestions_store.Pass(),
75 thumbnail_manager.Pass(), blacklist_store.Pass()); 76 thumbnail_manager.Pass(), blacklist_store.Pass());
76 } 77 }
77 78
78 void SuggestionsServiceFactory::RegisterBrowserStatePrefs( 79 void SuggestionsServiceFactory::RegisterBrowserStatePrefs(
79 user_prefs::PrefRegistrySyncable* registry) { 80 user_prefs::PrefRegistrySyncable* registry) {
80 SuggestionsService::RegisterProfilePrefs(registry); 81 SuggestionsService::RegisterProfilePrefs(registry);
81 } 82 }
82 83
83 } // namespace suggestions 84 } // namespace suggestions
OLDNEW
« no previous file with comments | « components/suggestions/image_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698