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

Side by Side Diff: components/rlz/rlz_tracker.cc

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « components/rlz/rlz_tracker.h ('k') | components/rlz/rlz_tracker_unittest.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 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work 5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work
6 // with or without the DLL being present. If the DLL is not present the 6 // with or without the DLL being present. If the DLL is not present the
7 // functions do nothing and just return false. 7 // functions do nothing and just return false.
8 8
9 #include "components/rlz/rlz_tracker.h" 9 #include "components/rlz/rlz_tracker.h"
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 omnibox_used_(false), 165 omnibox_used_(false),
166 homepage_used_(false), 166 homepage_used_(false),
167 app_list_used_(false), 167 app_list_used_(false),
168 min_init_delay_(kMinInitDelay) { 168 min_init_delay_(kMinInitDelay) {
169 } 169 }
170 170
171 RLZTracker::~RLZTracker() { 171 RLZTracker::~RLZTracker() {
172 } 172 }
173 173
174 // static 174 // static
175 void RLZTracker::SetRlzDelegate(scoped_ptr<RLZTrackerDelegate> delegate) { 175 void RLZTracker::SetRlzDelegate(std::unique_ptr<RLZTrackerDelegate> delegate) {
176 RLZTracker* tracker = GetInstance(); 176 RLZTracker* tracker = GetInstance();
177 if (!tracker->delegate_) { 177 if (!tracker->delegate_) {
178 // RLZTracker::SetRlzDelegate is called at Profile creation time which can 178 // RLZTracker::SetRlzDelegate is called at Profile creation time which can
179 // happens multiple time on ChromeOS, so do nothing if the delegate already 179 // happens multiple time on ChromeOS, so do nothing if the delegate already
180 // exists. 180 // exists.
181 tracker->SetDelegate(std::move(delegate)); 181 tracker->SetDelegate(std::move(delegate));
182 } 182 }
183 } 183 }
184 184
185 void RLZTracker::SetDelegate(scoped_ptr<RLZTrackerDelegate> delegate) { 185 void RLZTracker::SetDelegate(std::unique_ptr<RLZTrackerDelegate> delegate) {
186 DCHECK(delegate); 186 DCHECK(delegate);
187 DCHECK(!delegate_); 187 DCHECK(!delegate_);
188 delegate_ = std::move(delegate); 188 delegate_ = std::move(delegate);
189 worker_pool_token_ = delegate_->GetBlockingPool()->GetSequenceToken(); 189 worker_pool_token_ = delegate_->GetBlockingPool()->GetSequenceToken();
190 } 190 }
191 191
192 // static 192 // static
193 bool RLZTracker::InitRlzDelayed(bool first_run, 193 bool RLZTracker::InitRlzDelayed(bool first_run,
194 bool send_ping_immediately, 194 bool send_ping_immediately,
195 base::TimeDelta delay, 195 base::TimeDelta delay,
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // This method is called during unit tests while the RLZTracker has not been 558 // This method is called during unit tests while the RLZTracker has not been
559 // initialized, so check for the presence of a delegate and exit if there is 559 // initialized, so check for the presence of a delegate and exit if there is
560 // none registered. 560 // none registered.
561 RLZTracker* tracker = GetInstance(); 561 RLZTracker* tracker = GetInstance();
562 if (tracker->delegate_) 562 if (tracker->delegate_)
563 tracker->RecordFirstSearch(RLZTracker::ChromeAppList()); 563 tracker->RecordFirstSearch(RLZTracker::ChromeAppList());
564 } 564 }
565 #endif 565 #endif
566 566
567 } // namespace rlz 567 } // namespace rlz
OLDNEW
« no previous file with comments | « components/rlz/rlz_tracker.h ('k') | components/rlz/rlz_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698