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

Side by Side Diff: chrome/browser/win/jumplist_factory.cc

Issue 2931573003: Fix stability and data racing issues, coalesce more updates for JumpList (Closed)
Patch Set: Remove null check Created 3 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 | « chrome/browser/win/jumplist_factory.h ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/win/jumplist_factory.h" 5 #include "chrome/browser/win/jumplist_factory.h"
6 6
7 #include "chrome/browser/favicon/favicon_service_factory.h" 7 #include "chrome/browser/favicon/favicon_service_factory.h"
8 #include "chrome/browser/history/top_sites_factory.h" 8 #include "chrome/browser/history/top_sites_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sessions/tab_restore_service_factory.h" 10 #include "chrome/browser/sessions/tab_restore_service_factory.h"
11 #include "chrome/browser/win/jumplist.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" 12 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 13
13 // static 14 // static
14 scoped_refptr<JumpList> JumpListFactory::GetForProfile(Profile* profile) { 15 JumpList* JumpListFactory::GetForProfile(Profile* profile) {
15 return static_cast<JumpList*>( 16 return static_cast<JumpList*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true).get()); 17 GetInstance()->GetServiceForBrowserContext(profile, true));
17 } 18 }
18 19
19 // static 20 // static
20 JumpListFactory* JumpListFactory::GetInstance() { 21 JumpListFactory* JumpListFactory::GetInstance() {
21 return base::Singleton<JumpListFactory>::get(); 22 return base::Singleton<JumpListFactory>::get();
22 } 23 }
23 24
24 JumpListFactory::JumpListFactory() 25 JumpListFactory::JumpListFactory()
25 : RefcountedBrowserContextKeyedServiceFactory( 26 : BrowserContextKeyedServiceFactory(
26 "JumpList", 27 "JumpList",
27 BrowserContextDependencyManager::GetInstance()) { 28 BrowserContextDependencyManager::GetInstance()) {
28 DependsOn(TabRestoreServiceFactory::GetInstance()); 29 DependsOn(TabRestoreServiceFactory::GetInstance());
29 DependsOn(TopSitesFactory::GetInstance()); 30 DependsOn(TopSitesFactory::GetInstance());
30 DependsOn(FaviconServiceFactory::GetInstance()); 31 DependsOn(FaviconServiceFactory::GetInstance());
31 } 32 }
32 33
33 JumpListFactory::~JumpListFactory() = default; 34 JumpListFactory::~JumpListFactory() = default;
34 35
35 scoped_refptr<RefcountedKeyedService> JumpListFactory::BuildServiceInstanceFor( 36 KeyedService* JumpListFactory::BuildServiceInstanceFor(
36 content::BrowserContext* context) const { 37 content::BrowserContext* context) const {
37 return new JumpList(Profile::FromBrowserContext(context)); 38 return new JumpList(Profile::FromBrowserContext(context));
38 } 39 }
OLDNEW
« no previous file with comments | « chrome/browser/win/jumplist_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698