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

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

Issue 655713003: Standardize usage of virtual/override/final in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « media/base/wall_clock_time_source.h ('k') | media/blink/buffered_data_source_host_impl.h » ('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_BLINK_BUFFERED_DATA_SOURCE_H_ 5 #ifndef MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 6 #define MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // will be reported to |host|. |downloading_cb| will be called whenever the 63 // will be reported to |host|. |downloading_cb| will be called whenever the
64 // downloading/paused state of the source changes. 64 // downloading/paused state of the source changes.
65 BufferedDataSource( 65 BufferedDataSource(
66 const GURL& url, 66 const GURL& url,
67 BufferedResourceLoader::CORSMode cors_mode, 67 BufferedResourceLoader::CORSMode cors_mode,
68 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 68 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
69 blink::WebFrame* frame, 69 blink::WebFrame* frame,
70 MediaLog* media_log, 70 MediaLog* media_log,
71 BufferedDataSourceHost* host, 71 BufferedDataSourceHost* host,
72 const DownloadingCB& downloading_cb); 72 const DownloadingCB& downloading_cb);
73 virtual ~BufferedDataSource(); 73 ~BufferedDataSource() override;
74 74
75 // Executes |init_cb| with the result of initialization when it has completed. 75 // Executes |init_cb| with the result of initialization when it has completed.
76 // 76 //
77 // Method called on the render thread. 77 // Method called on the render thread.
78 typedef base::Callback<void(bool)> InitializeCB; 78 typedef base::Callback<void(bool)> InitializeCB;
79 void Initialize(const InitializeCB& init_cb); 79 void Initialize(const InitializeCB& init_cb);
80 80
81 // Adjusts the buffering algorithm based on the given preload value. 81 // Adjusts the buffering algorithm based on the given preload value.
82 void SetPreload(Preload preload); 82 void SetPreload(Preload preload);
83 83
(...skipping 17 matching lines...) Expand all
101 // behavior. 101 // behavior.
102 void MediaPlaybackRateChanged(float playback_rate); 102 void MediaPlaybackRateChanged(float playback_rate);
103 void MediaIsPlaying(); 103 void MediaIsPlaying();
104 void MediaIsPaused(); 104 void MediaIsPaused();
105 105
106 // Returns true if the resource is local. 106 // Returns true if the resource is local.
107 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); } 107 bool assume_fully_buffered() { return !url_.SchemeIsHTTPOrHTTPS(); }
108 108
109 // DataSource implementation. 109 // DataSource implementation.
110 // Called from demuxer thread. 110 // Called from demuxer thread.
111 virtual void Stop() override; 111 void Stop() override;
112 112
113 virtual void Read(int64 position, int size, uint8* data, 113 void Read(int64 position,
114 const DataSource::ReadCB& read_cb) override; 114 int size,
115 virtual bool GetSize(int64* size_out) override; 115 uint8* data,
116 virtual bool IsStreaming() override; 116 const DataSource::ReadCB& read_cb) override;
117 virtual void SetBitrate(int bitrate) override; 117 bool GetSize(int64* size_out) override;
118 bool IsStreaming() override;
119 void SetBitrate(int bitrate) override;
118 120
119 protected: 121 protected:
120 // A factory method to create a BufferedResourceLoader based on the read 122 // A factory method to create a BufferedResourceLoader based on the read
121 // parameters. We can override this file to object a mock 123 // parameters. We can override this file to object a mock
122 // BufferedResourceLoader for testing. 124 // BufferedResourceLoader for testing.
123 virtual BufferedResourceLoader* CreateResourceLoader( 125 virtual BufferedResourceLoader* CreateResourceLoader(
124 int64 first_byte_position, int64 last_byte_position); 126 int64 first_byte_position, int64 last_byte_position);
125 127
126 private: 128 private:
127 friend class BufferedDataSourceTest; 129 friend class BufferedDataSourceTest;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 233
232 // NOTE: Weak pointers must be invalidated before all other member variables. 234 // NOTE: Weak pointers must be invalidated before all other member variables.
233 base::WeakPtrFactory<BufferedDataSource> weak_factory_; 235 base::WeakPtrFactory<BufferedDataSource> weak_factory_;
234 236
235 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 237 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
236 }; 238 };
237 239
238 } // namespace media 240 } // namespace media
239 241
240 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_ 242 #endif // MEDIA_BLINK_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « media/base/wall_clock_time_source.h ('k') | media/blink/buffered_data_source_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698