| 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..a2c728de2407b9f6f074220b1aa72defc2716f75 100644
|
| --- a/media/filters/file_data_source.h
|
| +++ b/media/filters/file_data_source.h
|
| @@ -7,7 +7,6 @@
|
|
|
| #include <string>
|
|
|
| -#include "base/gtest_prod_util.h"
|
| #include "base/synchronization/lock.h"
|
| #include "media/base/data_source.h"
|
|
|
| @@ -18,7 +17,6 @@ namespace media {
|
| class MEDIA_EXPORT FileDataSource : public DataSource {
|
| public:
|
| FileDataSource();
|
| - FileDataSource(bool disable_file_size);
|
|
|
| bool Initialize(const std::string& url);
|
|
|
| @@ -31,6 +29,10 @@ 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 force_read_errors_for_testing() { force_read_errors_ = true; }
|
| + void force_streaming_for_testing() { force_streaming_ = true; }
|
| +
|
| protected:
|
| virtual ~FileDataSource();
|
|
|
| @@ -44,17 +46,12 @@ 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 force_read_errors_;
|
| + bool force_streaming_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(FileDataSource);
|
| };
|
|
|
|
|