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

Unified Diff: media/video/video_decode_accelerator.h

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/video_decode_accelerator.h
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 83d0b95631ca775fdfcb9ec34ef515568481f7dc..63553a9ca2f4a6a75b2dae13d0021412c918aaad 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/weak_ptr.h"
#include "media/base/bitstream_buffer.h"
#include "media/base/video_decoder_config.h"
#include "media/video/picture.h"
@@ -18,12 +19,11 @@ namespace media {
// Video decoder interface.
// This interface is extended by the various components that ultimately
// implement the backend of PPB_VideoDecode_Dev.
-//
-// No thread-safety guarantees are implied by the use of RefCountedThreadSafe
-// below.
class MEDIA_EXPORT VideoDecodeAccelerator
- : public base::RefCountedThreadSafe<VideoDecodeAccelerator> {
+ : public base::SupportsWeakPtr<VideoDecodeAccelerator> {
public:
+ virtual ~VideoDecodeAccelerator();
+
// Enumeration of potential errors generated by the API.
// Note: Keep these in sync with PP_VideoDecodeError_Dev.
enum Error {
@@ -126,12 +126,9 @@ class MEDIA_EXPORT VideoDecodeAccelerator
// Destroys the decoder: all pending inputs are dropped immediately and the
// component is freed. This call may asynchornously free system resources,
// but its client-visible effects are synchronous. After this method returns
- // no more callbacks will be made on the client.
+ // no more callbacks will be made on the client. Deletes |this|
+ // unconditionally, so make sure to drop all pointers to it!
virtual void Destroy() = 0;
-
- protected:
- friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>;
- virtual ~VideoDecodeAccelerator();
};
} // namespace media
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | webkit/plugins/ppapi/plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698