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

Side by Side Diff: ios/chrome/browser/bookmarks/bookmark_model_factory.cc

Issue 2256193002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 "ios/chrome/browser/bookmarks/bookmark_model_factory.h" 5 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 user_prefs::PrefRegistrySyncable* registry) { 57 user_prefs::PrefRegistrySyncable* registry) {
58 bookmarks::RegisterProfilePrefs(registry); 58 bookmarks::RegisterProfilePrefs(registry);
59 } 59 }
60 60
61 std::unique_ptr<KeyedService> BookmarkModelFactory::BuildServiceInstanceFor( 61 std::unique_ptr<KeyedService> BookmarkModelFactory::BuildServiceInstanceFor(
62 web::BrowserState* context) const { 62 web::BrowserState* context) const {
63 ios::ChromeBrowserState* browser_state = 63 ios::ChromeBrowserState* browser_state =
64 ios::ChromeBrowserState::FromBrowserState(context); 64 ios::ChromeBrowserState::FromBrowserState(context);
65 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model( 65 std::unique_ptr<bookmarks::BookmarkModel> bookmark_model(
66 new bookmarks::BookmarkModel( 66 new bookmarks::BookmarkModel(
67 base::WrapUnique(new BookmarkClientImpl(browser_state)))); 67 base::MakeUnique<BookmarkClientImpl>(browser_state)));
68 bookmark_model->Load( 68 bookmark_model->Load(
69 browser_state->GetPrefs(), 69 browser_state->GetPrefs(),
70 browser_state->GetStatePath(), 70 browser_state->GetStatePath(),
71 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state) 71 ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browser_state)
72 ->GetBookmarkTaskRunner(), 72 ->GetBookmarkTaskRunner(),
73 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); 73 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI));
74 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state) 74 ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state)
75 ->Start(bookmark_model.get()); 75 ->Start(bookmark_model.get());
76 return std::move(bookmark_model); 76 return std::move(bookmark_model);
77 } 77 }
78 78
79 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse( 79 web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse(
80 web::BrowserState* context) const { 80 web::BrowserState* context) const {
81 return GetBrowserStateRedirectedInIncognito(context); 81 return GetBrowserStateRedirectedInIncognito(context);
82 } 82 }
83 83
84 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { 84 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const {
85 return true; 85 return true;
86 } 86 }
87 87
88 } // namespace ios 88 } // namespace ios
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698