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

Side by Side Diff: media/blink/webmediaplayer_util.cc

Issue 1904253002: Convert //media/blink 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 | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/blink/websourcebuffer_impl.h » ('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 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
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
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
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/blink/websourcebuffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698