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..b7297ac056816a4dc532f61e9cadc97799635c33 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 { |
@@ -127,11 +127,11 @@ class MEDIA_EXPORT VideoDecodeAccelerator |
// 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. |
- virtual void Destroy() = 0; |
- |
- protected: |
- friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; |
- virtual ~VideoDecodeAccelerator(); |
+ // Because the client interface is synchronous but implementations may be |
+ // asynchronous, the caller (who may own |this|) can pass ownership of the VDA |
+ // *to* the VDA for hidden shenaniganary. |self| may be NULL if ownership |
+ // doesn't need to transfer. |
+ virtual void Destroy(scoped_ptr<VideoDecodeAccelerator> self) = 0; |
piman
2012/07/16 22:16:01
I can't say I'm a fan of this pattern (commenting
Ami GONE FROM CHROMIUM
2012/07/16 22:34:04
Interesting thoughts.
In practice this is only pos
|
}; |
} // namespace media |