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

Unified Diff: media/filters/file_data_source.h

Issue 11410052: Refactor FFmpegURLProtocol code from FFmpegDemuxer into BlockingUrlProtocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 8 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698