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

Side by Side Diff: ppapi/shared_impl/ppb_video_decoder_shared.cc

Issue 13123003: Flash: Don't lose a reference to the Graphics3D from the VideoDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 "ppapi/shared_impl/ppb_video_decoder_shared.h" 5 #include "ppapi/shared_impl/ppb_video_decoder_shared.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/command_buffer/client/gles2_implementation.h" 8 #include "gpu/command_buffer/client/gles2_implementation.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" 10 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
(...skipping 26 matching lines...) Expand all
37 PP_Resource graphics_context, 37 PP_Resource graphics_context,
38 gpu::gles2::GLES2Implementation* gles2_impl) { 38 gpu::gles2::GLES2Implementation* gles2_impl) {
39 DCHECK(graphics_context); 39 DCHECK(graphics_context);
40 DCHECK(!gles2_impl_ && !graphics_context_); 40 DCHECK(!gles2_impl_ && !graphics_context_);
41 gles2_impl_ = gles2_impl; 41 gles2_impl_ = gles2_impl;
42 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(graphics_context); 42 PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(graphics_context);
43 graphics_context_ = graphics_context; 43 graphics_context_ = graphics_context;
44 } 44 }
45 45
46 void PPB_VideoDecoder_Shared::Destroy() { 46 void PPB_VideoDecoder_Shared::Destroy() {
47 if (graphics_context_) {
48 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(
49 graphics_context_);
50 }
47 graphics_context_ = 0; 51 graphics_context_ = 0;
piman 2013/03/27 22:48:31 nit: you can move this inside the if.
danakj 2013/03/27 22:54:52 Done.
48 gles2_impl_ = NULL; 52 gles2_impl_ = NULL;
49 PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(graphics_context_);
50 } 53 }
51 54
52 bool PPB_VideoDecoder_Shared::SetFlushCallback( 55 bool PPB_VideoDecoder_Shared::SetFlushCallback(
53 scoped_refptr<TrackedCallback> callback) { 56 scoped_refptr<TrackedCallback> callback) {
54 if (TrackedCallback::IsPending(flush_callback_)) 57 if (TrackedCallback::IsPending(flush_callback_))
55 return false; 58 return false;
56 flush_callback_ = callback; 59 flush_callback_ = callback;
57 return true; 60 return true;
58 } 61 }
59 62
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 graphics_context_, false); 100 graphics_context_, false);
98 DCHECK(enter_g3d.succeeded()); 101 DCHECK(enter_g3d.succeeded());
99 PPB_Graphics3D_Shared* graphics3d = 102 PPB_Graphics3D_Shared* graphics3d =
100 static_cast<PPB_Graphics3D_Shared*>(enter_g3d.object()); 103 static_cast<PPB_Graphics3D_Shared*>(enter_g3d.object());
101 PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d); 104 PPB_Graphics3D_Shared::ScopedNoLocking dont_lock(graphics3d);
102 gles2_impl_->Flush(); 105 gles2_impl_->Flush();
103 } 106 }
104 } 107 }
105 108
106 } // namespace ppapi 109 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('j') | webkit/plugins/ppapi/ppb_video_decoder_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698