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

Unified Diff: ios/chrome/browser/favicon/large_icon_cache_factory.mm

Issue 1413903008: Add LargeIconCache and LargeIconServiceFactory for iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using wrong thread pool Created 5 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/favicon/large_icon_cache_factory.mm
diff --git a/ios/chrome/browser/favicon/large_icon_cache_factory.mm b/ios/chrome/browser/favicon/large_icon_cache_factory.mm
new file mode 100644
index 0000000000000000000000000000000000000000..9d8a1ec2c2c0fb78cd5f95e7befdc11527910a31
--- /dev/null
+++ b/ios/chrome/browser/favicon/large_icon_cache_factory.mm
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/favicon/large_icon_cache_factory.h"
+
+#include "base/memory/singleton.h"
+#include "components/keyed_service/ios/browser_state_dependency_manager.h"
+#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
+#include "ios/chrome/browser/favicon/large_icon_cache.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+
+// static
+LargeIconCache* LargeIconCacheFactory::GetForBrowserState(
+ ios::ChromeBrowserState* browser_state) {
+ return static_cast<LargeIconCache*>(
+ GetInstance()->GetServiceForBrowserState(browser_state, true));
+}
+
+// static
+LargeIconCacheFactory* LargeIconCacheFactory::GetInstance() {
+ return base::Singleton<LargeIconCacheFactory>::get();
sdefresne 2015/10/30 09:27:19 Please put a call to this method in ios/chrome/bro
justincohen 2015/10/30 11:59:21 Done.
+}
+
+LargeIconCacheFactory::LargeIconCacheFactory()
+ : BrowserStateKeyedServiceFactory(
+ "LargeIconCache",
+ BrowserStateDependencyManager::GetInstance()) {}
+
+LargeIconCacheFactory::~LargeIconCacheFactory() {}
+
+scoped_ptr<KeyedService> LargeIconCacheFactory::BuildServiceInstanceFor(
+ web::BrowserState* context) const {
+ return make_scoped_ptr(new LargeIconCache());
sdefresne 2015/10/30 09:27:19 nit: return make_scoped_ptr(new LargeIconCache);
justincohen 2015/10/30 11:59:21 Done.
+}
+
+web::BrowserState* LargeIconCacheFactory::GetBrowserStateToUse(
+ web::BrowserState* context) const {
+ return GetBrowserStateOwnInstanceInIncognito(context);
+}

Powered by Google App Engine
This is Rietveld 408576698