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

Side by Side Diff: webkit/media/buffered_data_source.h

Issue 10066044: RefCounted types should not have public destructors, webkit/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation ordering Created 8 years, 7 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
« no previous file with comments | « webkit/glue/resource_loader_bridge.cc ('k') | webkit/media/buffered_data_source_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 5 #ifndef WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 17 matching lines...) Expand all
28 // in-memory sliding window. 28 // in-memory sliding window.
29 // 29 //
30 // BufferedDataSource must be created and initialized on the render thread 30 // BufferedDataSource must be created and initialized on the render thread
31 // before being passed to other threads. It may be deleted on any thread. 31 // before being passed to other threads. It may be deleted on any thread.
32 class BufferedDataSource : public media::DataSource { 32 class BufferedDataSource : public media::DataSource {
33 public: 33 public:
34 BufferedDataSource(MessageLoop* render_loop, 34 BufferedDataSource(MessageLoop* render_loop,
35 WebKit::WebFrame* frame, 35 WebKit::WebFrame* frame,
36 media::MediaLog* media_log); 36 media::MediaLog* media_log);
37 37
38 virtual ~BufferedDataSource();
39
40 // Initialize this object using |url|. This object calls |status_cb| when 38 // Initialize this object using |url|. This object calls |status_cb| when
41 // initialization has completed. 39 // initialization has completed.
42 // 40 //
43 // Method called on the render thread. 41 // Method called on the render thread.
44 void Initialize(const GURL& url, 42 void Initialize(const GURL& url,
45 const media::PipelineStatusCB& status_cb); 43 const media::PipelineStatusCB& status_cb);
46 44
47 // Adjusts the buffering algorithm based on the given preload value. 45 // Adjusts the buffering algorithm based on the given preload value.
48 void SetPreload(Preload preload); 46 void SetPreload(Preload preload);
49 47
(...skipping 16 matching lines...) Expand all
66 virtual void Stop(const base::Closure& closure) OVERRIDE; 64 virtual void Stop(const base::Closure& closure) OVERRIDE;
67 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; 65 virtual void SetPlaybackRate(float playback_rate) OVERRIDE;
68 66
69 virtual void Read(int64 position, int size, uint8* data, 67 virtual void Read(int64 position, int size, uint8* data,
70 const media::DataSource::ReadCB& read_cb) OVERRIDE; 68 const media::DataSource::ReadCB& read_cb) OVERRIDE;
71 virtual bool GetSize(int64* size_out) OVERRIDE; 69 virtual bool GetSize(int64* size_out) OVERRIDE;
72 virtual bool IsStreaming() OVERRIDE; 70 virtual bool IsStreaming() OVERRIDE;
73 virtual void SetBitrate(int bitrate) OVERRIDE; 71 virtual void SetBitrate(int bitrate) OVERRIDE;
74 72
75 protected: 73 protected:
74 virtual ~BufferedDataSource();
75
76 // A factory method to create a BufferedResourceLoader based on the read 76 // A factory method to create a BufferedResourceLoader based on the read
77 // parameters. We can override this file to object a mock 77 // parameters. We can override this file to object a mock
78 // BufferedResourceLoader for testing. 78 // BufferedResourceLoader for testing.
79 virtual BufferedResourceLoader* CreateResourceLoader( 79 virtual BufferedResourceLoader* CreateResourceLoader(
80 int64 first_byte_position, int64 last_byte_position); 80 int64 first_byte_position, int64 last_byte_position);
81 81
82 private: 82 private:
83 friend class BufferedDataSourceTest; 83 friend class BufferedDataSourceTest;
84 84
85 // Task posted to perform actual reading on the render thread. 85 // Task posted to perform actual reading on the render thread.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 float playback_rate_; 215 float playback_rate_;
216 216
217 scoped_refptr<media::MediaLog> media_log_; 217 scoped_refptr<media::MediaLog> media_log_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 219 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
220 }; 220 };
221 221
222 } // namespace webkit_media 222 } // namespace webkit_media
223 223
224 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 224 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « webkit/glue/resource_loader_bridge.cc ('k') | webkit/media/buffered_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698