Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebInbandTextTrack_h | 31 #ifndef WebEmbeddedWorkerClient_h |
| 32 #define WebInbandTextTrack_h | 32 #define WebEmbeddedWorkerClient_h |
| 33 | |
| 34 #include "WebWorkerPermissionClientProxy.h" | |
| 33 | 35 |
| 34 namespace WebKit { | 36 namespace WebKit { |
|
abarth-chromium
2013/11/07 17:51:13
WebKit -> blink
kinuko
2013/11/08 12:17:23
Done.
| |
| 35 | 37 |
| 36 class WebString; | 38 class WebString; |
| 37 class WebInbandTextTrackClient; | 39 class WebServiceWorkerGlobalScopeProxy; |
| 38 | 40 |
| 39 class WebInbandTextTrack { | 41 // This interface is implemented by the client. It is suppoed to be created |
| 42 // on the main thread and then passed on to the worker thread to be owned | |
| 43 // by a newly created WorkerGlobalScope. All methods of this class are | |
| 44 // called on the worker thread. | |
| 45 class WebEmbeddedWorkerClient : public WebWorkerPermissionClientProxy { | |
|
alecflett
2013/11/08 23:18:35
This may be a non-issue, but it seems odd for an "
| |
| 40 public: | 46 public: |
| 41 enum Kind { | 47 // A new WorkerGlobalScope is created and started to run on the |
| 42 KindSubtitles, | 48 // worker thread. |
| 43 KindCaptions, | 49 // This also gives back a proxy to the client to talk to the |
| 44 KindDescriptions, | 50 // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope |
| 45 KindChapters, | 51 // and should not be held by the caller. No proxy methods should be called |
| 46 KindMetadata, | 52 // after workerGlobalScopeDestroyed() is called. |
| 47 KindNone | 53 virtual void workerGlobalScopeStarted(WebServiceWorkerGlobalScopeProxy*) { } |
| 48 }; | |
| 49 | 54 |
| 50 enum Mode { | 55 // WorkerGlobalScope.close() is called. |
| 51 ModeDisabled, | 56 virtual void workerGlobalScopeClosed() { } |
| 52 ModeHidden, | |
| 53 ModeShowing | |
| 54 }; | |
| 55 | 57 |
| 56 virtual ~WebInbandTextTrack() {} | 58 // WorkerGlobalScope is destroyed. The client should clear the |
| 59 // WebServiceWorkerGlobalScopeProxy when this is called. | |
| 60 virtual void workerGlobalScopeDestroyed() { } | |
| 57 | 61 |
| 58 virtual void setClient(WebInbandTextTrackClient*) = 0; | 62 virtual void dispatchDevToolsMessage(const WebString&) { } |
| 59 virtual WebInbandTextTrackClient* client() = 0; | 63 virtual void saveDevToolsAgentState(const WebString&) { } |
| 60 | |
| 61 virtual void setMode(Mode) = 0; | |
| 62 virtual Mode mode() const = 0; | |
| 63 | |
| 64 virtual Kind kind() const = 0; | |
| 65 | |
| 66 virtual WebString label() const = 0; | |
| 67 virtual WebString language() const = 0; | |
| 68 | |
| 69 virtual int textTrackIndex() const = 0; | |
| 70 }; | 64 }; |
| 71 | 65 |
| 72 } // namespace WebKit | 66 } // namespace WebKit |
| 73 | 67 |
| 74 #endif | 68 #endif // WebEmbeddedWorkerClient_h |
| OLD | NEW |