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

Side by Side Diff: webkit/plugins/ppapi/ppb_audio_impl.cc

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_audio_impl.h" 5 #include "webkit/plugins/ppapi/ppb_audio_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/c/pp_completion_callback.h" 8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/ppb_audio.h" 9 #include "ppapi/c/ppb_audio.h"
10 #include "ppapi/c/ppb_audio_config.h" 10 #include "ppapi/c/ppb_audio_config.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 : Resource(instance), 51 : Resource(instance),
52 config_id_(0), 52 config_id_(0),
53 audio_(NULL), 53 audio_(NULL),
54 create_callback_pending_(false), 54 create_callback_pending_(false),
55 shared_memory_size_for_create_callback_(0) { 55 shared_memory_size_for_create_callback_(0) {
56 create_callback_ = PP_MakeCompletionCallback(NULL, NULL); 56 create_callback_ = PP_MakeCompletionCallback(NULL, NULL);
57 } 57 }
58 58
59 PPB_Audio_Impl::~PPB_Audio_Impl() { 59 PPB_Audio_Impl::~PPB_Audio_Impl() {
60 if (config_id_) 60 if (config_id_)
61 ResourceTracker::Get()->UnrefResource(config_id_); 61 ResourceTracker::Get()->ReleaseResource(config_id_);
62 62
63 // Calling ShutDown() makes sure StreamCreated cannot be called anymore and 63 // Calling ShutDown() makes sure StreamCreated cannot be called anymore and
64 // releases the audio data associated with the pointer. Note however, that 64 // releases the audio data associated with the pointer. Note however, that
65 // until ShutDown returns, StreamCreated may still be called. This will be 65 // until ShutDown returns, StreamCreated may still be called. This will be
66 // OK since we'll just immediately clean up the data it stored later in this 66 // OK since we'll just immediately clean up the data it stored later in this
67 // destructor. 67 // destructor.
68 if (audio_) { 68 if (audio_) {
69 audio_->ShutDown(); 69 audio_->ShutDown();
70 audio_ = NULL; 70 audio_ = NULL;
71 } 71 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // something more elaborate like an ACK from the plugin or post a task to 221 // something more elaborate like an ACK from the plugin or post a task to
222 // the I/O thread and back, but this extra complexity doesn't seem worth it 222 // the I/O thread and back, but this extra complexity doesn't seem worth it
223 // just to clean up these handles faster. 223 // just to clean up these handles faster.
224 } else { 224 } else {
225 SetStreamInfo(shared_memory_handle, shared_memory_size, socket_handle); 225 SetStreamInfo(shared_memory_handle, shared_memory_size, socket_handle);
226 } 226 }
227 } 227 }
228 228
229 } // namespace ppapi 229 } // namespace ppapi
230 } // namespace webkit 230 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698