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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 14081010: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some gtk issues Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 make_context_current_ = 72 make_context_current_ =
73 base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr()); 73 base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr());
74 } 74 }
75 75
76 GpuVideoDecodeAccelerator::~GpuVideoDecodeAccelerator() { 76 GpuVideoDecodeAccelerator::~GpuVideoDecodeAccelerator() {
77 if (stub_) { 77 if (stub_) {
78 stub_->channel()->RemoveRoute(host_route_id_); 78 stub_->channel()->RemoveRoute(host_route_id_);
79 stub_->RemoveDestructionObserver(this); 79 stub_->RemoveDestructionObserver(this);
80 } 80 }
81 81
82 if (video_decode_accelerator_.get()) 82 if (video_decode_accelerator_)
83 video_decode_accelerator_.release()->Destroy(); 83 video_decode_accelerator_.release()->Destroy();
84 } 84 }
85 85
86 bool GpuVideoDecodeAccelerator::OnMessageReceived(const IPC::Message& msg) { 86 bool GpuVideoDecodeAccelerator::OnMessageReceived(const IPC::Message& msg) {
87 if (!stub_ || !video_decode_accelerator_.get()) 87 if (!stub_ || !video_decode_accelerator_)
88 return false; 88 return false;
89 bool handled = true; 89 bool handled = true;
90 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAccelerator, msg) 90 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAccelerator, msg)
91 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Decode, OnDecode) 91 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Decode, OnDecode)
92 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_AssignPictureBuffers, 92 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_AssignPictureBuffers,
93 OnAssignPictureBuffers) 93 OnAssignPictureBuffers)
94 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_ReusePictureBuffer, 94 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_ReusePictureBuffer,
95 OnReusePictureBuffer) 95 OnReusePictureBuffer)
96 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Flush, OnFlush) 96 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Flush, OnFlush)
97 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Reset, OnReset) 97 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Reset, OnReset)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed"; 342 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed";
343 } 343 }
344 344
345 void GpuVideoDecodeAccelerator::NotifyResetDone() { 345 void GpuVideoDecodeAccelerator::NotifyResetDone() {
346 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) 346 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_)))
347 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; 347 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed";
348 } 348 }
349 349
350 void GpuVideoDecodeAccelerator::OnWillDestroyStub(GpuCommandBufferStub* stub) { 350 void GpuVideoDecodeAccelerator::OnWillDestroyStub(GpuCommandBufferStub* stub) {
351 DCHECK_EQ(stub, stub_.get()); 351 DCHECK_EQ(stub, stub_.get());
352 if (video_decode_accelerator_.get()) 352 if (video_decode_accelerator_)
353 video_decode_accelerator_.release()->Destroy(); 353 video_decode_accelerator_.release()->Destroy();
354 if (stub_) { 354 if (stub_) {
355 stub_->RemoveDestructionObserver(this); 355 stub_->RemoveDestructionObserver(this);
356 stub_.reset(); 356 stub_.reset();
357 } 357 }
358 } 358 }
359 359
360 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { 360 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) {
361 DCHECK(stub_); 361 DCHECK(stub_);
362 return stub_->channel()->Send(message); 362 return stub_->channel()->Send(message);
363 } 363 }
364 364
365 } // namespace content 365 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/android_video_decode_accelerator.cc ('k') | content/common/gpu/media/vaapi_h264_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698