OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |