| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 static void setRegistry(URLRegistry*); | 50 static void setRegistry(URLRegistry*); |
| 51 static HTMLMediaSource* lookup(const String& url) { | 51 static HTMLMediaSource* lookup(const String& url) { |
| 52 return s_registry ? static_cast<HTMLMediaSource*>(s_registry->lookup(url)) | 52 return s_registry ? static_cast<HTMLMediaSource*>(s_registry->lookup(url)) |
| 53 : 0; | 53 : 0; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Called when an HTMLMediaElement is attempting to attach to this object, | 56 // Called when an HTMLMediaElement is attempting to attach to this object, |
| 57 // and helps enforce attachment to at most one element at a time. | 57 // and helps enforce attachment to at most one element at a time. |
| 58 // If already attached, returns false. Otherwise, must be in | 58 // If already attached, returns false. Otherwise, must be in |
| 59 // 'closed' state, and returns true to indicate attachment success. | 59 // 'closed' state, and returns true to indicate attachment success. |
| 60 // Reattachment allowed by first calling close() (even if already in 'closed')
. | 60 // Reattachment allowed by first calling close() (even if already in |
| 61 // 'closed'). |
| 61 // Once attached, the source uses the element to synchronously service some | 62 // Once attached, the source uses the element to synchronously service some |
| 62 // API operations like duration change that may need to initiate seek. | 63 // API operations like duration change that may need to initiate seek. |
| 63 virtual bool attachToElement(HTMLMediaElement*) = 0; | 64 virtual bool attachToElement(HTMLMediaElement*) = 0; |
| 64 virtual void setWebMediaSourceAndOpen(std::unique_ptr<WebMediaSource>) = 0; | 65 virtual void setWebMediaSourceAndOpen(std::unique_ptr<WebMediaSource>) = 0; |
| 65 virtual void close() = 0; | 66 virtual void close() = 0; |
| 66 virtual bool isClosed() const = 0; | 67 virtual bool isClosed() const = 0; |
| 67 virtual double duration() const = 0; | 68 virtual double duration() const = 0; |
| 68 virtual TimeRanges* buffered() const = 0; | 69 virtual TimeRanges* buffered() const = 0; |
| 69 virtual TimeRanges* seekable() const = 0; | 70 virtual TimeRanges* seekable() const = 0; |
| 70 virtual void onTrackChanged(TrackBase*) = 0; | 71 virtual void onTrackChanged(TrackBase*) = 0; |
| 71 | 72 |
| 72 // URLRegistrable | 73 // URLRegistrable |
| 73 URLRegistry& registry() const override { return *s_registry; } | 74 URLRegistry& registry() const override { return *s_registry; } |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 static URLRegistry* s_registry; | 77 static URLRegistry* s_registry; |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace blink | 80 } // namespace blink |
| 80 | 81 |
| 81 #endif | 82 #endif |
| OLD | NEW |