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

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: 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..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);
};

Powered by Google App Engine
This is Rietveld 408576698