Chromium Code Reviews| Index: media/filters/file_data_source.h |
| diff --git a/media/filters/file_data_source.h b/media/filters/file_data_source.h |
| index d5b81a4ce6af1146afda0f2955d255f37d16ab1c..ce653e3eccdb289d9e1cd3b8fe45c27aab2c1285 100644 |
| --- a/media/filters/file_data_source.h |
| +++ b/media/filters/file_data_source.h |
| @@ -18,7 +18,6 @@ namespace media { |
| class MEDIA_EXPORT FileDataSource : public DataSource { |
| public: |
| FileDataSource(); |
| - FileDataSource(bool disable_file_size); |
| bool Initialize(const std::string& url); |
| @@ -31,6 +30,11 @@ class MEDIA_EXPORT FileDataSource : public DataSource { |
| virtual bool IsStreaming() OVERRIDE; |
| virtual void SetBitrate(int bitrate) OVERRIDE; |
| + // Unit test helpers. Recreate the object if you want the default behaviour. |
| + void disable_file_size_for_testing() { disable_file_size_ = true; } |
|
DaleCurtis
2012/11/13 03:42:28
This isn't used anywhere in this CL. Remove?
scherkus (not reviewing)
2012/11/13 18:19:13
Done.
|
| + void force_read_errors_for_testing() { force_read_errors_ = true; } |
| + void force_streaming_for_testing() { force_streaming_ = true; } |
| + |
| protected: |
| virtual ~FileDataSource(); |
| @@ -44,17 +48,13 @@ class MEDIA_EXPORT FileDataSource : public DataSource { |
| // Size of the file in bytes. |
| int64 file_size_; |
| - // True if the FileDataSource should ignore its set file size, false |
| - // otherwise. |
| - bool disable_file_size_; |
| - |
| - // Critical section that protects all of the DataSource methods to prevent |
| - // a Stop from happening while in the middle of a file I/O operation. |
| - // TODO(ralphl): Ideally this would use asynchronous I/O or we will know |
| - // that we will block for a short period of time in reads. Otherwise, we can |
| - // hang the pipeline Stop. |
| + // Serialize all operations to prevent stopping during reads. |
| base::Lock lock_; |
| + bool disable_file_size_; |
| + bool force_read_errors_; |
| + bool force_streaming_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(FileDataSource); |
| }; |