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

Side by Side Diff: chrome/browser/enhanced_bookmarks/android/bookmark_image_service_factory.cc

Issue 916783003: Restrict salient image size before storing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_andro id.h" 5 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_andro id.h"
6 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_facto ry.h" 6 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_facto ry.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h" 7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/browser_thread.h"
9 10
10 namespace enhanced_bookmarks { 11 namespace enhanced_bookmarks {
11 12
12 // static 13 // static
13 BookmarkImageServiceFactory* BookmarkImageServiceFactory::GetInstance() { 14 BookmarkImageServiceFactory* BookmarkImageServiceFactory::GetInstance() {
14 return Singleton<BookmarkImageServiceFactory>::get(); 15 return Singleton<BookmarkImageServiceFactory>::get();
15 } 16 }
16 17
17 // static 18 // static
18 BookmarkImageService* BookmarkImageServiceFactory::GetForBrowserContext( 19 BookmarkImageService* BookmarkImageServiceFactory::GetForBrowserContext(
19 content::BrowserContext* context) { 20 content::BrowserContext* context) {
20 return static_cast<BookmarkImageService*>( 21 return static_cast<BookmarkImageService*>(
21 GetInstance()->GetServiceForBrowserContext(context, true)); 22 GetInstance()->GetServiceForBrowserContext(context, true));
22 } 23 }
23 24
24 BookmarkImageServiceFactory::BookmarkImageServiceFactory() 25 BookmarkImageServiceFactory::BookmarkImageServiceFactory()
25 : BrowserContextKeyedServiceFactory( 26 : BrowserContextKeyedServiceFactory(
26 "BookmarkExtendedStorageService", 27 "BookmarkExtendedStorageService",
27 BrowserContextDependencyManager::GetInstance()) {} 28 BrowserContextDependencyManager::GetInstance()) {}
28 29
29 BookmarkImageServiceFactory::~BookmarkImageServiceFactory() {} 30 BookmarkImageServiceFactory::~BookmarkImageServiceFactory() {}
30 31
31 content::BrowserContext* BookmarkImageServiceFactory::GetBrowserContextToUse( 32 content::BrowserContext* BookmarkImageServiceFactory::GetBrowserContextToUse(
32 content::BrowserContext* context) const { 33 content::BrowserContext* context) const {
33 return context; 34 return context;
34 } 35 }
35 36
36 BookmarkImageService* BookmarkImageServiceFactory::BuildServiceInstanceFor( 37 BookmarkImageService* BookmarkImageServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* browser_context) const { 38 content::BrowserContext* browser_context) const {
38 return new BookmarkImageServiceAndroid(browser_context); 39 return new BookmarkImageServiceAndroid(
40 browser_context,
41 make_scoped_refptr(content::BrowserThread::GetBlockingPool()));
39 } 42 }
40 43
41 } // namespace enhanced_bookmarks 44 } // namespace enhanced_bookmarks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698