| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 13 matching lines...) Expand all Loading... |
| 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 WebWorker_h | 31 #ifndef WebWorker_h |
| 32 #define WebWorker_h | 32 #define WebWorker_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebMessagePortChannel.h" |
| 35 | 35 |
| 36 namespace WebKit { | 36 namespace WebKit { |
| 37 class WebMessagePortChannel; | |
| 38 class WebString; | 37 class WebString; |
| 39 class WebURL; | 38 class WebURL; |
| 40 class WebWorkerClient; | 39 class WebWorkerClient; |
| 41 | 40 |
| 42 // Provides an interface to the script execution context for a worker. | 41 // Provides an interface to the script execution context for a worker. |
| 43 class WebWorker { | 42 class WebWorker { |
| 44 public: | 43 public: |
| 45 // Instantiates a built-in WebWorker. | 44 // Instantiates a built-in WebWorker. |
| 46 WEBKIT_API static WebWorker* create(WebWorkerClient*); | 45 WEBKIT_API static WebWorker* create(WebWorkerClient*); |
| 47 | 46 |
| 48 virtual ~WebWorker() { } | 47 virtual ~WebWorker() { } |
| 49 virtual void startWorkerContext(const WebURL& scriptURL, | 48 virtual void startWorkerContext(const WebURL& scriptURL, |
| 50 const WebString& userAgent, | 49 const WebString& userAgent, |
| 51 const WebString& sourceCode) = 0; | 50 const WebString& sourceCode) = 0; |
| 52 virtual void terminateWorkerContext() = 0; | 51 virtual void terminateWorkerContext() = 0; |
| 53 virtual void postMessageToWorkerContext(const WebString&, | 52 virtual void postMessageToWorkerContext( |
| 54 WebMessagePortChannel*) = 0; | 53 const WebString&, |
| 54 const WebMessagePortChannelArray&) = 0; |
| 55 virtual void workerObjectDestroyed() = 0; | 55 virtual void workerObjectDestroyed() = 0; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace WebKit | 58 } // namespace WebKit |
| 59 | 59 |
| 60 #endif | 60 #endif |
| OLD | NEW |