OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/blink/webmediaplayer_util.h" | 5 #include "media/blink/webmediaplayer_util.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 : web_callback_(web_callback) {} | 198 : web_callback_(web_callback) {} |
199 SetSinkIdCallback(const SetSinkIdCallback& other) | 199 SetSinkIdCallback(const SetSinkIdCallback& other) |
200 : web_callback_(std::move(other.web_callback_)) {} | 200 : web_callback_(std::move(other.web_callback_)) {} |
201 ~SetSinkIdCallback() {} | 201 ~SetSinkIdCallback() {} |
202 friend void RunSetSinkIdCallback(const SetSinkIdCallback& callback, | 202 friend void RunSetSinkIdCallback(const SetSinkIdCallback& callback, |
203 OutputDeviceStatus result); | 203 OutputDeviceStatus result); |
204 | 204 |
205 private: | 205 private: |
206 // Mutable is required so that Pass() can be called in the copy | 206 // Mutable is required so that Pass() can be called in the copy |
207 // constructor. | 207 // constructor. |
208 mutable scoped_ptr<blink::WebSetSinkIdCallbacks> web_callback_; | 208 mutable std::unique_ptr<blink::WebSetSinkIdCallbacks> web_callback_; |
209 }; | 209 }; |
210 | 210 |
211 void RunSetSinkIdCallback(const SetSinkIdCallback& callback, | 211 void RunSetSinkIdCallback(const SetSinkIdCallback& callback, |
212 OutputDeviceStatus result) { | 212 OutputDeviceStatus result) { |
213 if (!callback.web_callback_) | 213 if (!callback.web_callback_) |
214 return; | 214 return; |
215 | 215 |
216 switch (result) { | 216 switch (result) { |
217 case OUTPUT_DEVICE_STATUS_OK: | 217 case OUTPUT_DEVICE_STATUS_OK: |
218 callback.web_callback_->onSuccess(); | 218 callback.web_callback_->onSuccess(); |
(...skipping 16 matching lines...) Expand all Loading... |
235 | 235 |
236 } // namespace | 236 } // namespace |
237 | 237 |
238 OutputDeviceStatusCB ConvertToOutputDeviceStatusCB( | 238 OutputDeviceStatusCB ConvertToOutputDeviceStatusCB( |
239 blink::WebSetSinkIdCallbacks* web_callbacks) { | 239 blink::WebSetSinkIdCallbacks* web_callbacks) { |
240 return media::BindToCurrentLoop( | 240 return media::BindToCurrentLoop( |
241 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); | 241 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); |
242 } | 242 } |
243 | 243 |
244 } // namespace media | 244 } // namespace media |
OLD | NEW |