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

Side by Side Diff: components/sync_sessions/revisit/typed_url_page_revisit_observer.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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 "components/sync_sessions/revisit/typed_url_page_revisit_observer.h" 5 #include "components/sync_sessions/revisit/typed_url_page_revisit_observer.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "components/history/core/browser/history_service.h" 8 #include "components/history/core/browser/history_service.h"
9 #include "components/sync_sessions/revisit/typed_url_page_revisit_task.h" 9 #include "components/sync_sessions/revisit/typed_url_page_revisit_task.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
11 11
12 namespace sync_sessions { 12 namespace sync_sessions {
13 13
14 TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver( 14 TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver(
15 history::HistoryService* history) 15 history::HistoryService* history)
16 : history_(base::AsWeakPtr(history)) {} 16 : history_(base::AsWeakPtr(history)) {}
17 17
18 TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {} 18 TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {}
19 19
20 void TypedUrlPageRevisitObserver::OnPageVisit( 20 void TypedUrlPageRevisitObserver::OnPageVisit(
21 const GURL& url, 21 const GURL& url,
22 const PageVisitObserver::TransitionType transition) { 22 const PageVisitObserver::TransitionType transition) {
23 if (history_) { 23 if (history_) {
24 history_->ScheduleDBTask( 24 history_->ScheduleDBTask(
25 base::WrapUnique(new TypedUrlPageRevisitTask(url, transition)), 25 base::MakeUnique<TypedUrlPageRevisitTask>(url, transition),
26 &task_tracker_); 26 &task_tracker_);
27 } 27 }
28 } 28 }
29 29
30 } // namespace sync_sessions 30 } // namespace sync_sessions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698