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

Side by Side Diff: media/video/video_encode_accelerator.h

Issue 1445003002: Use std::default_delete as the default deleter for scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: How many trial and errors before this builds on the Windows bots Created 5 years, 1 month 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
« no previous file with comments | « media/video/video_decode_accelerator.cc ('k') | media/video/video_encode_accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ 5 #ifndef MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_
6 #define MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ 6 #define MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_
7 7
8 #include <memory>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "media/base/bitstream_buffer.h" 13 #include "media/base/bitstream_buffer.h"
13 #include "media/base/media_export.h" 14 #include "media/base/media_export.h"
14 #include "media/base/video_decoder_config.h" 15 #include "media/base/video_decoder_config.h"
15 #include "media/base/video_frame.h" 16 #include "media/base/video_frame.h"
16 17
17 namespace media { 18 namespace media {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 virtual void Destroy() = 0; 149 virtual void Destroy() = 0;
149 150
150 protected: 151 protected:
151 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which 152 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which
152 // will Destroy() it properly by default. 153 // will Destroy() it properly by default.
153 virtual ~VideoEncodeAccelerator(); 154 virtual ~VideoEncodeAccelerator();
154 }; 155 };
155 156
156 } // namespace media 157 } // namespace media
157 158
158 namespace base { 159 namespace std {
159 160
160 template <class T> 161 // Specialize std::default_delete so that scoped_ptr<VideoEncodeAccelerator>
161 struct DefaultDeleter;
162
163 // Specialize DefaultDeleter so that scoped_ptr<VideoEncodeAccelerator> always
164 // uses "Destroy()" instead of trying to use the destructor. 162 // uses "Destroy()" instead of trying to use the destructor.
165 template <> 163 template <>
166 struct MEDIA_EXPORT DefaultDeleter<media::VideoEncodeAccelerator> { 164 struct MEDIA_EXPORT default_delete<media::VideoEncodeAccelerator> {
167 public: 165 void operator()(media::VideoEncodeAccelerator* vea) const;
168 void operator()(void* video_encode_accelerator) const;
169 }; 166 };
170 167
171 } // namespace base 168 } // namespace std
172 169
173 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_ 170 #endif // MEDIA_VIDEO_VIDEO_ENCODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « media/video/video_decode_accelerator.cc ('k') | media/video/video_encode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698