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

Unified Diff: media/base/data_source.h

Issue 2267963002: Add support for cancellation of demuxer reads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add tests. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/media_galleries/ipc_data_source.cc ('k') | media/base/demuxer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/data_source.h
diff --git a/media/base/data_source.h b/media/base/data_source.h
index 5aeea838c812ecf9f382636360ce185958e8d780..697b2ce0dae55818f756b34c28fc33ef90840514 100644
--- a/media/base/data_source.h
+++ b/media/base/data_source.h
@@ -19,7 +19,7 @@ class MEDIA_EXPORT DataSource {
typedef base::Callback<void(int64_t, int64_t)> StatusCallback;
typedef base::Callback<void(int)> ReadCB;
- enum { kReadError = -1 };
+ enum { kReadError = -1, kAborted = -2 };
DataSource();
virtual ~DataSource();
@@ -36,6 +36,9 @@ class MEDIA_EXPORT DataSource {
// return an error.
virtual void Stop() = 0;
+ // Similar to Stop(), but only aborts current reads and not future reads.
+ virtual void Abort() = 0;
+
// Returns true and the file size, false if the file size could not be
// retrieved.
virtual bool GetSize(int64_t* size_out) = 0;
« no previous file with comments | « chrome/utility/media_galleries/ipc_data_source.cc ('k') | media/base/demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698