Commit 978b5a5c authored by dcheng's avatar dcheng Committed by Commit bot

Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>.

BUG=423621

Review URL: https://codereview.chromium.org/643093003

Cr-Commit-Position: refs/heads/master@{#300154}
parent 71f71a0d
...@@ -47,7 +47,7 @@ scoped_ptr<BrowserCdm> CreateBrowserCdm( ...@@ -47,7 +47,7 @@ scoped_ptr<BrowserCdm> CreateBrowserCdm(
return scoped_ptr<BrowserCdm>(); return scoped_ptr<BrowserCdm>();
} }
return cdm.PassAs<BrowserCdm>(); return cdm.Pass();
} }
} // namespace media } // namespace media
...@@ -184,7 +184,7 @@ class PipelineTest : public ::testing::Test { ...@@ -184,7 +184,7 @@ class PipelineTest : public ::testing::Test {
void StartPipeline() { void StartPipeline() {
pipeline_->Start( pipeline_->Start(
demuxer_.get(), demuxer_.get(),
scoped_renderer_.PassAs<Renderer>(), scoped_renderer_.Pass(),
base::Bind(&CallbackHelper::OnEnded, base::Unretained(&callbacks_)), base::Bind(&CallbackHelper::OnEnded, base::Unretained(&callbacks_)),
base::Bind(&CallbackHelper::OnError, base::Unretained(&callbacks_)), base::Bind(&CallbackHelper::OnError, base::Unretained(&callbacks_)),
base::Bind(&CallbackHelper::OnStart, base::Unretained(&callbacks_)), base::Bind(&CallbackHelper::OnStart, base::Unretained(&callbacks_)),
......
...@@ -451,7 +451,7 @@ scoped_ptr<PacketPipe> InterruptedPoissonProcess::NewBuffer(size_t size) { ...@@ -451,7 +451,7 @@ scoped_ptr<PacketPipe> InterruptedPoissonProcess::NewBuffer(size_t size) {
scoped_ptr<InternalBuffer> buffer( scoped_ptr<InternalBuffer> buffer(
new InternalBuffer(weak_factory_.GetWeakPtr(), size)); new InternalBuffer(weak_factory_.GetWeakPtr(), size));
send_buffers_.push_back(buffer->GetWeakPtr()); send_buffers_.push_back(buffer->GetWeakPtr());
return buffer.PassAs<PacketPipe>(); return buffer.Pass();
} }
base::TimeDelta InterruptedPoissonProcess::NextEvent(double rate) { base::TimeDelta InterruptedPoissonProcess::NextEvent(double rate) {
......
...@@ -303,7 +303,7 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer( ...@@ -303,7 +303,7 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer(
if (clockless_playback_) if (clockless_playback_)
renderer_impl->EnableClocklessVideoPlaybackForTesting(); renderer_impl->EnableClocklessVideoPlaybackForTesting();
return renderer_impl.PassAs<Renderer>(); return renderer_impl.Pass();
} }
void PipelineIntegrationTestBase::SetDecryptor( void PipelineIntegrationTestBase::SetDecryptor(
......
...@@ -130,7 +130,7 @@ class MidiManagerUsbForTesting : public MidiManagerUsb { ...@@ -130,7 +130,7 @@ class MidiManagerUsbForTesting : public MidiManagerUsb {
public: public:
explicit MidiManagerUsbForTesting( explicit MidiManagerUsbForTesting(
scoped_ptr<UsbMidiDevice::Factory> device_factory) scoped_ptr<UsbMidiDevice::Factory> device_factory)
: MidiManagerUsb(device_factory.PassAs<UsbMidiDevice::Factory>()) {} : MidiManagerUsb(device_factory.Pass()) {}
virtual ~MidiManagerUsbForTesting() {} virtual ~MidiManagerUsbForTesting() {}
void CallCompleteInitialization(MidiResult result) { void CallCompleteInitialization(MidiResult result) {
...@@ -148,8 +148,7 @@ class MidiManagerUsbTest : public ::testing::Test { ...@@ -148,8 +148,7 @@ class MidiManagerUsbTest : public ::testing::Test {
MidiManagerUsbTest() : message_loop_(new base::MessageLoop) { MidiManagerUsbTest() : message_loop_(new base::MessageLoop) {
scoped_ptr<TestUsbMidiDeviceFactory> factory(new TestUsbMidiDeviceFactory); scoped_ptr<TestUsbMidiDeviceFactory> factory(new TestUsbMidiDeviceFactory);
factory_ = factory.get(); factory_ = factory.get();
manager_.reset( manager_.reset(new MidiManagerUsbForTesting(factory.Pass()));
new MidiManagerUsbForTesting(factory.PassAs<UsbMidiDevice::Factory>()));
} }
virtual ~MidiManagerUsbTest() { virtual ~MidiManagerUsbTest() {
std::string leftover_logs = logger_.TakeLog(); std::string leftover_logs = logger_.TakeLog();
......
...@@ -134,7 +134,7 @@ TEST_F(FakeVideoCaptureDeviceTest, Capture) { ...@@ -134,7 +134,7 @@ TEST_F(FakeVideoCaptureDeviceTest, Capture) {
capture_params.requested_format.frame_size.SetSize(640, 480); capture_params.requested_format.frame_size.SetSize(640, 480);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
WaitForCapturedFrame(); WaitForCapturedFrame();
EXPECT_EQ(last_format().frame_size.width(), 640); EXPECT_EQ(last_format().frame_size.width(), 640);
EXPECT_EQ(last_format().frame_size.height(), 480); EXPECT_EQ(last_format().frame_size.height(), 480);
...@@ -196,7 +196,7 @@ TEST_F(FakeVideoCaptureDeviceTest, DISABLED_CaptureVariableResolution) { ...@@ -196,7 +196,7 @@ TEST_F(FakeVideoCaptureDeviceTest, DISABLED_CaptureVariableResolution) {
.Times(0); .Times(0);
int action_count = 200; int action_count = 200;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
// We set TimeWait to 200 action timeouts and this should be enough for at // We set TimeWait to 200 action timeouts and this should be enough for at
// least action_count/kFakeCaptureCapabilityChangePeriod calls. // least action_count/kFakeCaptureCapabilityChangePeriod calls.
......
...@@ -239,7 +239,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_OpenInvalidDevice) { ...@@ -239,7 +239,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_OpenInvalidDevice) {
capture_params.requested_format.frame_size.SetSize(640, 480); capture_params.requested_format.frame_size.SetSize(640, 480);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
device->StopAndDeAllocate(); device->StopAndDeAllocate();
} }
#endif #endif
...@@ -264,7 +264,7 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) { ...@@ -264,7 +264,7 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) {
capture_params.requested_format.frame_size.SetSize(640, 480); capture_params.requested_format.frame_size.SetSize(640, 480);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
// Get captured video frames. // Get captured video frames.
WaitForCapturedFrame(); WaitForCapturedFrame();
EXPECT_EQ(last_format().frame_size.width(), 640); EXPECT_EQ(last_format().frame_size.width(), 640);
...@@ -290,7 +290,7 @@ TEST_F(VideoCaptureDeviceTest, Capture720p) { ...@@ -290,7 +290,7 @@ TEST_F(VideoCaptureDeviceTest, Capture720p) {
capture_params.requested_format.frame_size.SetSize(1280, 720); capture_params.requested_format.frame_size.SetSize(1280, 720);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
// Get captured video frames. // Get captured video frames.
WaitForCapturedFrame(); WaitForCapturedFrame();
device->StopAndDeAllocate(); device->StopAndDeAllocate();
...@@ -313,7 +313,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_AllocateBadSize) { ...@@ -313,7 +313,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_AllocateBadSize) {
capture_params.requested_format.frame_size.SetSize(637, 472); capture_params.requested_format.frame_size.SetSize(637, 472);
capture_params.requested_format.frame_rate = 35; capture_params.requested_format.frame_rate = 35;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
WaitForCapturedFrame(); WaitForCapturedFrame();
device->StopAndDeAllocate(); device->StopAndDeAllocate();
EXPECT_EQ(last_format().frame_size.width(), 640); EXPECT_EQ(last_format().frame_size.width(), 640);
...@@ -349,7 +349,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_ReAllocateCamera) { ...@@ -349,7 +349,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_ReAllocateCamera) {
capture_params.requested_format.frame_size = resolution; capture_params.requested_format.frame_size = resolution;
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
device->StopAndDeAllocate(); device->StopAndDeAllocate();
} }
...@@ -363,7 +363,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_ReAllocateCamera) { ...@@ -363,7 +363,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_ReAllocateCamera) {
scoped_ptr<VideoCaptureDevice> device( scoped_ptr<VideoCaptureDevice> device(
video_capture_device_factory_->Create(names_->front())); video_capture_device_factory_->Create(names_->front()));
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
WaitForCapturedFrame(); WaitForCapturedFrame();
device->StopAndDeAllocate(); device->StopAndDeAllocate();
device.reset(); device.reset();
...@@ -388,7 +388,7 @@ TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) { ...@@ -388,7 +388,7 @@ TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) {
capture_params.requested_format.frame_size.SetSize(640, 480); capture_params.requested_format.frame_size.SetSize(640, 480);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
// Get captured video frames. // Get captured video frames.
WaitForCapturedFrame(); WaitForCapturedFrame();
EXPECT_EQ(last_format().frame_size.width(), 640); EXPECT_EQ(last_format().frame_size.width(), 640);
...@@ -416,7 +416,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_CaptureMjpeg) { ...@@ -416,7 +416,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_CaptureMjpeg) {
capture_params.requested_format.frame_size.SetSize(1280, 720); capture_params.requested_format.frame_size.SetSize(1280, 720);
capture_params.requested_format.frame_rate = 30; capture_params.requested_format.frame_rate = 30;
capture_params.requested_format.pixel_format = PIXEL_FORMAT_MJPEG; capture_params.requested_format.pixel_format = PIXEL_FORMAT_MJPEG;
device->AllocateAndStart(capture_params, client_.PassAs<Client>()); device->AllocateAndStart(capture_params, client_.Pass());
// Get captured video frames. // Get captured video frames.
WaitForCapturedFrame(); WaitForCapturedFrame();
// Verify we get MJPEG from the device. Not all devices can capture 1280x720 // Verify we get MJPEG from the device. Not all devices can capture 1280x720
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment