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

Side by Side Diff: chrome/browser/history/history_service_factory.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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/history/chrome_history_client.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/history/history_service_factory.h" 5 #include "chrome/browser/history/history_service_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
9 #include "chrome/browser/history/chrome_history_client.h" 9 #include "chrome/browser/history/chrome_history_client.h"
10 #include "chrome/browser/profiles/incognito_helpers.h" 10 #include "chrome/browser/profiles/incognito_helpers.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 DependsOn(BookmarkModelFactory::GetInstance()); 72 DependsOn(BookmarkModelFactory::GetInstance());
73 } 73 }
74 74
75 HistoryServiceFactory::~HistoryServiceFactory() { 75 HistoryServiceFactory::~HistoryServiceFactory() {
76 } 76 }
77 77
78 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor( 78 KeyedService* HistoryServiceFactory::BuildServiceInstanceFor(
79 content::BrowserContext* context) const { 79 content::BrowserContext* context) const {
80 std::unique_ptr<history::HistoryService> history_service( 80 std::unique_ptr<history::HistoryService> history_service(
81 new history::HistoryService( 81 new history::HistoryService(
82 base::WrapUnique(new ChromeHistoryClient( 82 base::MakeUnique<ChromeHistoryClient>(
83 BookmarkModelFactory::GetForBrowserContext(context))), 83 BookmarkModelFactory::GetForBrowserContext(context)),
84 base::WrapUnique(new history::ContentVisitDelegate(context)))); 84 base::MakeUnique<history::ContentVisitDelegate>(context)));
85 if (!history_service->Init( 85 if (!history_service->Init(
86 history::HistoryDatabaseParamsForPath(context->GetPath()))) { 86 history::HistoryDatabaseParamsForPath(context->GetPath()))) {
87 return nullptr; 87 return nullptr;
88 } 88 }
89 return history_service.release(); 89 return history_service.release();
90 } 90 }
91 91
92 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse( 92 content::BrowserContext* HistoryServiceFactory::GetBrowserContextToUse(
93 content::BrowserContext* context) const { 93 content::BrowserContext* context) const {
94 return chrome::GetBrowserContextRedirectedInIncognito(context); 94 return chrome::GetBrowserContextRedirectedInIncognito(context);
95 } 95 }
96 96
97 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const { 97 bool HistoryServiceFactory::ServiceIsNULLWhileTesting() const {
98 return true; 98 return true;
99 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/history/chrome_history_client.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698