summaryrefslogtreecommitdiffstats
path: root/webkit/glue/media/web_data_source.h
diff options
context:
space:
mode:
authorvrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 19:57:36 +0000
committervrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 19:57:36 +0000
commit5b5bb9d530c0085a5b8becad2a2302737e215890 (patch)
tree4d15db1e004de0d17c9baeaa73ec13900a43f82f /webkit/glue/media/web_data_source.h
parent11c4c816a056ad651aefc241446b77f4e57cebd8 (diff)
downloadchromium_src-5b5bb9d530c0085a5b8becad2a2302737e215890.zip
chromium_src-5b5bb9d530c0085a5b8becad2a2302737e215890.tar.gz
chromium_src-5b5bb9d530c0085a5b8becad2a2302737e215890.tar.bz2
Adding Abort() to DataSource to wake up hanging Read()
This change adds an Abort() method to BufferedDataSource, which will wake up a blocking read if one exists. When WebMediaPlayerImpl being destroyed, it now tells BufferedDataSource to abort before it tells the pipeline to stop, so the pipeline will not hang while waiting for a never-ending Read() to return. BUG=54465 TEST=test_shell_tests Review URL: http://codereview.chromium.org/4009002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media/web_data_source.h')
-rw-r--r--webkit/glue/media/web_data_source.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/webkit/glue/media/web_data_source.h b/webkit/glue/media/web_data_source.h
new file mode 100644
index 0000000..2bbfd1c
--- /dev/null
+++ b/webkit/glue/media/web_data_source.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_GLUE_MEDIA_WEB_DATA_SOURCE_H_
+#define WEBKIT_GLUE_MEDIA_WEB_DATA_SOURCE_H_
+
+#include "media/base/filters.h"
+
+namespace webkit_glue {
+
+// An interface that allows WebMediaPlayerImpl::Proxy to communicate with the
+// DataSource in the pipeline.
+class WebDataSource : public media::DataSource {
+ public:
+ WebDataSource();
+ virtual ~WebDataSource();
+
+ // This method is used to unblock any read calls that would cause the
+ // media pipeline to stall.
+ //
+ // Method called on the render thread.
+ virtual void Abort() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebDataSource);
+};
+
+} // namespace webkit_glue
+
+#endif // WEBKIT_GLUE_MEDIA_WEB_DATA_SOURCE_H_