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

Side by Side Diff: extensions/renderer/api/display_source/wifi_display/wifi_display_session.cc

Issue 1899083003: Convert //extensions/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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 "extensions/renderer/api/display_source/wifi_display/wifi_display_sessi on.h" 5 #include "extensions/renderer/api/display_source/wifi_display/wifi_display_sessi on.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 int WiFiDisplaySession::GetNextCSeq(int* initial_peer_cseq) const { 134 int WiFiDisplaySession::GetNextCSeq(int* initial_peer_cseq) const {
135 return ++cseq_; 135 return ++cseq_;
136 } 136 }
137 137
138 void WiFiDisplaySession::SendRTSPData(const std::string& message) { 138 void WiFiDisplaySession::SendRTSPData(const std::string& message) {
139 service_->SendMessage(message); 139 service_->SendMessage(message);
140 } 140 }
141 141
142 unsigned WiFiDisplaySession::CreateTimer(int seconds) { 142 unsigned WiFiDisplaySession::CreateTimer(int seconds) {
143 scoped_ptr<base::Timer> timer(new base::Timer(true, true)); 143 std::unique_ptr<base::Timer> timer(new base::Timer(true, true));
144 auto insert_ret = timers_.insert( 144 auto insert_ret = timers_.insert(std::pair<int, std::unique_ptr<base::Timer>>(
145 std::pair<int, scoped_ptr<base::Timer>>( 145 ++timer_id_, std::move(timer)));
146 ++timer_id_, std::move(timer)));
147 DCHECK(insert_ret.second); 146 DCHECK(insert_ret.second);
148 insert_ret.first->second->Start(FROM_HERE, 147 insert_ret.first->second->Start(FROM_HERE,
149 base::TimeDelta::FromSeconds(seconds), 148 base::TimeDelta::FromSeconds(seconds),
150 base::Bind(&wds::Source::OnTimerEvent, 149 base::Bind(&wds::Source::OnTimerEvent,
151 base::Unretained(wfd_source_.get()), 150 base::Unretained(wfd_source_.get()),
152 timer_id_)); 151 timer_id_));
153 return static_cast<unsigned>(timer_id_); 152 return static_cast<unsigned>(timer_id_);
154 } 153 }
155 154
156 void WiFiDisplaySession::ReleaseTimer(unsigned timer_id) { 155 void WiFiDisplaySession::ReleaseTimer(unsigned timer_id) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } 218 }
220 219
221 void WiFiDisplaySession::RunTerminateCallback( 220 void WiFiDisplaySession::RunTerminateCallback(
222 bool success, 221 bool success,
223 const std::string& error_message) { 222 const std::string& error_message) {
224 if (!teminate_completion_callback_.is_null()) 223 if (!teminate_completion_callback_.is_null())
225 teminate_completion_callback_.Run(success, error_message); 224 teminate_completion_callback_.Run(success, error_message);
226 } 225 }
227 226
228 } // namespace extensions 227 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698