Index: content/common/gpu/media/video_decode_accelerator_impl.h |
diff --git a/content/common/gpu/media/video_decode_accelerator_impl.h b/content/common/gpu/media/video_decode_accelerator_impl.h |
index 30abfa658e1ba42d7eb1cdf5d8c1a367b06207f8..c0762a09e7aa3784f6598473ac1e365ca266b6cc 100644 |
--- a/content/common/gpu/media/video_decode_accelerator_impl.h |
+++ b/content/common/gpu/media/video_decode_accelerator_impl.h |
@@ -14,7 +14,6 @@ class CONTENT_EXPORT VideoDecodeAcceleratorImpl |
: public media::VideoDecodeAccelerator { |
public: |
VideoDecodeAcceleratorImpl(); |
- virtual ~VideoDecodeAcceleratorImpl(); |
// Returns true if VDA::Decode and VDA::Client callbacks can run on the IO |
// thread. Otherwise they will run on the GPU child thread. The purpose of |
@@ -23,8 +22,29 @@ class CONTENT_EXPORT VideoDecodeAcceleratorImpl |
// PictureReady should be run on the child thread if a picture is delivered |
// the first time so it can be cleared. |
virtual bool CanDecodeOnIOThread(); |
+ |
+ protected: |
+ virtual ~VideoDecodeAcceleratorImpl(); |
}; |
} // namespace content |
+namespace base { |
+ |
+template <class T> |
+struct DefaultDeleter; |
+ |
+// Specialize DefaultDeleter so that scoped_ptr<VideoDecodeAcceleratorImpl> |
+// always uses "Destroy()" instead of trying to use the destructor. |
+template <> |
+struct DefaultDeleter<content::VideoDecodeAcceleratorImpl> { |
+ public: |
+ inline void operator()(void* video_decode_accelerator) const { |
+ static_cast<content::VideoDecodeAcceleratorImpl*>(video_decode_accelerator) |
+ ->Destroy(); |
+ } |
+}; |
+ |
+} // namespace base |
+ |
#endif // CONTENT_COMMON_GPU_MEDIA_VIDEO_DECODE_ACCELERATOR_IMPL_H_ |