Chromium Code Reviews| Index: webkit/media/webinbandtexttrack_impl.h |
| diff --git a/webkit/media/webinbandtexttrack_impl.h b/webkit/media/webinbandtexttrack_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c731d4641ba153b6b928701f3e7500ae594b1dd1 |
| --- /dev/null |
| +++ b/webkit/media/webinbandtexttrack_impl.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright (c) 2013 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. |
| + |
| +// Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
| +// It contains Pipeline which is the actual media player pipeline, it glues |
| +// the media player pipeline, data source, audio renderer and renderer. |
| +// Pipeline would creates multiple threads and access some public methods |
|
fgalligan1
2013/04/02 19:38:32
s/would//
Matthew Heaney (Chromium)
2013/04/04 04:01:52
This comment was a copy-and-paste of another. Com
|
| +// of this class, so we need to be extra careful about concurrent access of |
| +// methods and members. |
| +// |
| +// Other issues: |
| +// During tear down of the whole browser or a tab, the DOM tree may not be |
| +// destructed nicely, and there will be some dangling media threads trying to |
|
fgalligan1
2013/04/02 19:38:32
s/to/to access/
Matthew Heaney (Chromium)
2013/04/04 04:01:52
ack
|
| +// the main thread, so we need this class to listen to destruction event of the |
| +// main thread and cleanup the media threads when the even is received. Also |
|
fgalligan1
2013/04/02 19:38:32
s/even/event/
Matthew Heaney (Chromium)
2013/04/04 04:01:52
ack
|
| +// at destruction of this class we will need to unhook it from destruction event |
| +// list of the main thread. |
| + |
| +#ifndef WEBKIT_MEDIA_WEBINANDTEXTTRACK_IMPL_H_ |
| +#define WEBKIT_MEDIA_WEBINANDTEXTTRACK_IMPL_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInbandTextTrack.h" |
| + |
| +namespace webkit_media { |
| + |
| +class WebInbandTextTrackImpl |
| + : public WebKit::WebInbandTextTrack, |
| + public base::RefCountedThreadSafe<WebInbandTextTrackImpl> { |
| + public: |
| + WebInbandTextTrackImpl(Kind kind, |
| + const WebKit::WebString& label, |
| + const WebKit::WebString& language); |
| + virtual ~WebInbandTextTrackImpl(); |
| + |
| + // TODO(matthewjheaney): Need help with this type |
| + //virtual void setClient(WebCore::InbandTextTrackPrivateClient* client); |
|
scherkus (not reviewing)
2013/04/04 01:03:46
you'll have to define a WebKit::WebInbandTextTrack
Matthew Heaney (Chromium)
2013/04/04 04:01:52
OK. Have WebKit::WebInbandTextTrackPrivateClient
|
| + //virtual WebCore::InbandTextTrackPrivateClient* client(); |
| + |
| + // TODO(matthewjheaney): For now try this: |
| + virtual void setClient(WebKit::WebInbandTextTrackPrivateClient* client); |
|
scherkus (not reviewing)
2013/04/04 01:03:46
ah! this looks just about right :)
you can ditch
Matthew Heaney (Chromium)
2013/04/04 04:01:52
Done.
|
| + virtual WebKit::WebInbandTextTrackPrivateClient* client(); |
| + |
| + virtual void setMode(Mode mode); |
| + virtual Mode mode() const; |
| + |
| + virtual Kind kind() const; |
| + virtual bool isClosedCaptions() const; |
| + |
| + virtual WebKit::WebString label() const; |
| + virtual WebKit::WebString language() const; |
| + virtual bool isDefault() const; |
| + |
| + virtual int textTrackIndex() const; |
| + |
| + private: |
| + // TODO(matthewjheaney): resolve ownership issues |
| + WebKit::WebInbandTextTrackPrivateClient* client_; |
| + Mode mode_; |
| + Kind kind_; |
| + WebKit::WebString label_; |
| + WebKit::WebString language_; |
| + DISALLOW_COPY_AND_ASSIGN(WebInbandTextTrackImpl); |
| +}; |
| + |
| +} // namespace webkit_media |
| + |
| +#endif // WEBKIT_MEDIA_WEBINANDTEXTTRACK_IMPL_H_ |