diff options
author | dcheng <dcheng@chromium.org> | 2014-11-12 16:50:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-13 00:52:05 +0000 |
commit | b933848d698a7b3b4d2022ac1e4cd07acdf0b948 (patch) | |
tree | d986671585ce23c2ca95916c1319c07b02003b9d /content | |
parent | 409765ac7530f4f3422e7c282ae072f2e749ef7b (diff) | |
download | chromium_src-b933848d698a7b3b4d2022ac1e4cd07acdf0b948.zip chromium_src-b933848d698a7b3b4d2022ac1e4cd07acdf0b948.tar.gz chromium_src-b933848d698a7b3b4d2022ac1e4cd07acdf0b948.tar.bz2 |
Remove implicit conversions from scoped_refptr to T* in content/
This patch was generated by running the rewrite_scoped_refptr clang tool
on a Windows build.
BUG=110610
Review URL: https://codereview.chromium.org/719343002
Cr-Commit-Position: refs/heads/master@{#303943}
Diffstat (limited to 'content')
5 files changed, 28 insertions, 27 deletions
diff --git a/content/browser/accessibility/accessibility_win_browsertest.cc b/content/browser/accessibility/accessibility_win_browsertest.cc index 058e033..4c0359b 100644 --- a/content/browser/accessibility/accessibility_win_browsertest.cc +++ b/content/browser/accessibility/accessibility_win_browsertest.cc @@ -49,7 +49,7 @@ base::win::ScopedComPtr<IAccessible> GetAccessibleFromResultVariant( base::win::ScopedComPtr<IDispatch> dispatch; HRESULT hr = parent->get_accChild(*var, dispatch.Receive()); EXPECT_TRUE(SUCCEEDED(hr)); - if (dispatch) + if (dispatch.get()) dispatch.QueryInterface(ptr.Receive()); break; } @@ -109,7 +109,7 @@ void RecursiveFindNodeInAccessibilityTree(IAccessible* node, for (int index = 0; index < obtained_count; index++) { base::win::ScopedComPtr<IAccessible> child_accessible( GetAccessibleFromResultVariant(node, &child_array.get()[index])); - if (child_accessible) { + if (child_accessible.get()) { RecursiveFindNodeInAccessibilityTree( child_accessible.get(), expected_role, expected_name, depth + 1, found); @@ -380,7 +380,7 @@ void AccessibleChecker::CheckAccessibleChildren(IAccessible* parent) { base::win::ScopedComPtr<IAccessible> child_accessible( GetAccessibleFromResultVariant(parent, child)); ASSERT_TRUE(child_accessible.get()); - (*child_checker)->CheckAccessible(child_accessible); + (*child_checker)->CheckAccessible(child_accessible.get()); } } @@ -684,15 +684,16 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, // Get the ISimpleDOM object for the document. base::win::ScopedComPtr<IServiceProvider> service_provider; - HRESULT hr = static_cast<IAccessible*>(document_accessible)->QueryInterface( - service_provider.Receive()); + HRESULT hr = static_cast<IAccessible*>(document_accessible.get()) + ->QueryInterface(service_provider.Receive()); ASSERT_EQ(S_OK, hr); const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 0xb6, 0x61, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8}; base::win::ScopedComPtr<ISimpleDOMNode> document_isimpledomnode; - hr = static_cast<IServiceProvider *>(service_provider)->QueryService( - refguid, IID_ISimpleDOMNode, - reinterpret_cast<void**>(document_isimpledomnode.Receive())); + hr = static_cast<IServiceProvider*>(service_provider.get()) + ->QueryService( + refguid, IID_ISimpleDOMNode, + reinterpret_cast<void**>(document_isimpledomnode.Receive())); ASSERT_EQ(S_OK, hr); base::win::ScopedBstr node_name; diff --git a/content/child/child_shared_bitmap_manager.cc b/content/child/child_shared_bitmap_manager.cc index 41c2261..3d82dd5 100644 --- a/content/child/child_shared_bitmap_manager.cc +++ b/content/child/child_shared_bitmap_manager.cc @@ -54,7 +54,7 @@ scoped_ptr<cc::SharedBitmap> ChildSharedBitmapManager::AllocateSharedBitmap( memory = make_scoped_ptr(new base::SharedMemory(handle, false)); CHECK(memory->Map(memory_size)); #else - memory.reset(ChildThread::AllocateSharedMemory(memory_size, sender_)); + memory.reset(ChildThread::AllocateSharedMemory(memory_size, sender_.get())); CHECK(memory); base::SharedMemoryHandle handle_to_send = memory->handle(); sender_->Send(new ChildProcessHostMsg_AllocatedSharedBitmap( diff --git a/content/child/npapi/webplugin_delegate_impl_win.cc b/content/child/npapi/webplugin_delegate_impl_win.cc index f570c7c2..1ada5c7 100644 --- a/content/child/npapi/webplugin_delegate_impl_win.cc +++ b/content/child/npapi/webplugin_delegate_impl_win.cc @@ -796,7 +796,7 @@ bool WebPluginDelegateImpl::WindowedReposition( } void WebPluginDelegateImpl::WindowedSetWindow() { - if (!instance_) + if (!instance_.get()) return; if (!windowed_handle_) { diff --git a/content/common/gpu/image_transport_surface_win.cc b/content/common/gpu/image_transport_surface_win.cc index efa64dd..597a472 100644 --- a/content/common/gpu/image_transport_surface_win.cc +++ b/content/common/gpu/image_transport_surface_win.cc @@ -29,7 +29,7 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( DCHECK_EQ(handle.transport_type, gfx::NATIVE_DIRECT); scoped_refptr<gfx::GLSurface> surface = gfx::GLSurface::CreateViewGLSurface(handle.handle); - if (!surface) + if (!surface.get()) return surface; return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface( manager, stub, surface.get())); diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc index 530358e..cff6e12 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc @@ -96,7 +96,7 @@ static IMFSample* CreateEmptySampleWithBuffer(int buffer_length, int align) { } RETURN_ON_HR_FAILURE(hr, "Failed to create memory buffer for sample", NULL); - hr = sample->AddBuffer(buffer); + hr = sample->AddBuffer(buffer.get()); RETURN_ON_HR_FAILURE(hr, "Failed to add buffer to sample", NULL); return sample.Detach(); @@ -114,7 +114,7 @@ static IMFSample* CreateInputSample(const uint8* stream, int size, base::win::ScopedComPtr<IMFSample> sample; sample.Attach(CreateEmptySampleWithBuffer(std::max(min_size, size), alignment)); - RETURN_ON_FAILURE(sample, "Failed to create empty sample", NULL); + RETURN_ON_FAILURE(sample.get(), "Failed to create empty sample", NULL); base::win::ScopedComPtr<IMFMediaBuffer> buffer; HRESULT hr = sample->GetBufferByIndex(0, buffer.Receive()); @@ -329,8 +329,8 @@ bool DXVAVideoDecodeAccelerator::DXVAPictureBuffer:: hr = decoding_texture_->GetSurfaceLevel(0, d3d_surface.Receive()); RETURN_ON_HR_FAILURE(hr, "Failed to get surface from texture", false); - hr = decoder.device_->StretchRect( - dest_surface, NULL, d3d_surface, NULL, D3DTEXF_NONE); + hr = decoder.device_->StretchRect(dest_surface, NULL, d3d_surface.get(), NULL, + D3DTEXF_NONE); RETURN_ON_HR_FAILURE(hr, "Colorspace conversion via StretchRect failed", false); @@ -410,7 +410,7 @@ bool DXVAVideoDecodeAccelerator::CreateD3DDevManager() { device_manager_.Receive()); RETURN_ON_HR_FAILURE(hr, "DXVA2CreateDirect3DDeviceManager9 failed", false); - hr = device_manager_->ResetDevice(device_, dev_manager_reset_token_); + hr = device_manager_->ResetDevice(device_.get(), dev_manager_reset_token_); RETURN_ON_HR_FAILURE(hr, "Failed to reset device", false); hr = device_->CreateQuery(D3DQUERYTYPE_EVENT, query_.Receive()); @@ -513,8 +513,8 @@ void DXVAVideoDecodeAccelerator::Decode( sample.Attach(CreateSampleFromInputBuffer(bitstream_buffer, input_stream_info_.cbSize, input_stream_info_.cbAlignment)); - RETURN_AND_NOTIFY_ON_FAILURE(sample, "Failed to create input sample", - PLATFORM_FAILURE,); + RETURN_AND_NOTIFY_ON_FAILURE(sample.get(), "Failed to create input sample", + PLATFORM_FAILURE, ); RETURN_AND_NOTIFY_ON_HR_FAILURE(sample->SetSampleTime(bitstream_buffer.id()), "Failed to associate input buffer id with sample", PLATFORM_FAILURE,); @@ -753,7 +753,7 @@ bool DXVAVideoDecodeAccelerator::SetDecoderInputMediaType() { MFVideoInterlace_MixedInterlaceOrProgressive); RETURN_ON_HR_FAILURE(hr, "Failed to set interlace mode", false); - hr = decoder_->SetInputType(0, media_type, 0); // No flags + hr = decoder_->SetInputType(0, media_type.get(), 0); // No flags RETURN_ON_HR_FAILURE(hr, "Failed to set decoder input type", false); return true; } @@ -771,7 +771,7 @@ bool DXVAVideoDecodeAccelerator::SetDecoderOutputMediaType( RETURN_ON_HR_FAILURE(hr, "Failed to get output major type", false); if (out_subtype == subtype) { - hr = decoder_->SetOutputType(0, out_media_type, 0); // No flags + hr = decoder_->SetOutputType(0, out_media_type.get(), 0); // No flags RETURN_ON_HR_FAILURE(hr, "Failed to set decoder output type", false); return true; } @@ -881,7 +881,7 @@ bool DXVAVideoDecodeAccelerator::ProcessOutputSample(IMFSample* sample) { RETURN_ON_HR_FAILURE(hr, "Failed to get buffer from output sample", false); base::win::ScopedComPtr<IDirect3DSurface9> surface; - hr = MFGetService(output_buffer, MR_BUFFER_SERVICE, + hr = MFGetService(output_buffer.get(), MR_BUFFER_SERVICE, IID_PPV_ARGS(surface.Receive())); RETURN_ON_HR_FAILURE(hr, "Failed to get D3D surface from output sample", false); @@ -944,7 +944,7 @@ void DXVAVideoDecodeAccelerator::ProcessPendingSamples() { hr, "Failed to get buffer from output sample", PLATFORM_FAILURE,); base::win::ScopedComPtr<IDirect3DSurface9> surface; - hr = MFGetService(output_buffer, MR_BUFFER_SERVICE, + hr = MFGetService(output_buffer.get(), MR_BUFFER_SERVICE, IID_PPV_ARGS(surface.Receive())); RETURN_AND_NOTIFY_ON_HR_FAILURE( hr, "Failed to get D3D surface from output sample", @@ -964,9 +964,9 @@ void DXVAVideoDecodeAccelerator::ProcessPendingSamples() { } RETURN_AND_NOTIFY_ON_FAILURE( - index->second->CopyOutputSampleDataToPictureBuffer(*this, surface), - "Failed to copy output sample", - PLATFORM_FAILURE, ); + index->second->CopyOutputSampleDataToPictureBuffer(*this, + surface.get()), + "Failed to copy output sample", PLATFORM_FAILURE, ); media::Picture output_picture(index->second->id(), sample_info.input_buffer_id, @@ -1115,7 +1115,7 @@ void DXVAVideoDecodeAccelerator::DecodeInternal( } inputs_before_decode_++; - HRESULT hr = decoder_->ProcessInput(0, sample, 0); + HRESULT hr = decoder_->ProcessInput(0, sample.get(), 0); // As per msdn if the decoder returns MF_E_NOTACCEPTING then it means that it // has enough data to produce one or more output samples. In this case the // recommended options are to @@ -1130,7 +1130,7 @@ void DXVAVideoDecodeAccelerator::DecodeInternal( RETURN_AND_NOTIFY_ON_FAILURE((state_ == kStopped || state_ == kNormal), "Failed to process output. Unexpected decoder state: " << state_, PLATFORM_FAILURE,); - hr = decoder_->ProcessInput(0, sample, 0); + hr = decoder_->ProcessInput(0, sample.get(), 0); // If we continue to get the MF_E_NOTACCEPTING error we do the following:- // 1. Add the input sample to the pending queue. // 2. If we don't have any output samples we post the |