| 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 WebSharedWorker_h | 31 #ifndef WebSharedWorker_h |
| 32 #define WebSharedWorker_h | 32 #define WebSharedWorker_h |
| 33 | 33 |
| 34 #include "../platform/WebAddressSpace.h" |
| 34 #include "../platform/WebCommon.h" | 35 #include "../platform/WebCommon.h" |
| 35 #include "WebContentSecurityPolicy.h" | 36 #include "WebContentSecurityPolicy.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 class WebString; | 40 class WebString; |
| 40 class WebMessagePortChannel; | 41 class WebMessagePortChannel; |
| 41 class WebSharedWorkerClient; | 42 class WebSharedWorkerClient; |
| 42 class WebURL; | 43 class WebURL; |
| 43 | 44 |
| 44 // This is the interface to a SharedWorker thread. | 45 // This is the interface to a SharedWorker thread. |
| 45 class WebSharedWorker { | 46 class WebSharedWorker { |
| 46 public: | 47 public: |
| 47 // Instantiate a WebSharedWorker that interacts with the shared worker. | 48 // Instantiate a WebSharedWorker that interacts with the shared worker. |
| 48 // WebSharedWorkerClient given here must outlive or have the identical | 49 // WebSharedWorkerClient given here must outlive or have the identical |
| 49 // lifetime as this instance. | 50 // lifetime as this instance. |
| 50 BLINK_EXPORT static WebSharedWorker* create(WebSharedWorkerClient*); | 51 BLINK_EXPORT static WebSharedWorker* create(WebSharedWorkerClient*); |
| 51 | 52 |
| 52 virtual void startWorkerContext( | 53 virtual void startWorkerContext( |
| 53 const WebURL& scriptURL, | 54 const WebURL& scriptURL, |
| 54 const WebString& name, | 55 const WebString& name, |
| 55 const WebString& contentSecurityPolicy, | 56 const WebString& contentSecurityPolicy, |
| 56 WebContentSecurityPolicyType) = 0; | 57 WebContentSecurityPolicyType, |
| 58 WebAddressSpace) = 0; |
| 57 | 59 |
| 58 // Sends a connect event to the SharedWorker context. | 60 // Sends a connect event to the SharedWorker context. |
| 59 virtual void connect(WebMessagePortChannel*) = 0; | 61 virtual void connect(WebMessagePortChannel*) = 0; |
| 60 | 62 |
| 61 // Invoked to shutdown the worker when there are no more associated document
s. This eventually deletes this instance. | 63 // Invoked to shutdown the worker when there are no more associated document
s. This eventually deletes this instance. |
| 62 virtual void terminateWorkerContext() = 0; | 64 virtual void terminateWorkerContext() = 0; |
| 63 | 65 |
| 64 virtual void pauseWorkerContextOnStart() = 0; | 66 virtual void pauseWorkerContextOnStart() = 0; |
| 65 virtual void attachDevTools(const WebString& hostId, int sessionId) = 0; | 67 virtual void attachDevTools(const WebString& hostId, int sessionId) = 0; |
| 66 virtual void reattachDevTools(const WebString& hostId, int sessionId, const
WebString& savedState) = 0; | 68 virtual void reattachDevTools(const WebString& hostId, int sessionId, const
WebString& savedState) = 0; |
| 67 virtual void detachDevTools() = 0; | 69 virtual void detachDevTools() = 0; |
| 68 virtual void dispatchDevToolsMessage(int sessionId, const WebString&) = 0; | 70 virtual void dispatchDevToolsMessage(int sessionId, const WebString&) = 0; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace blink | 73 } // namespace blink |
| 72 | 74 |
| 73 #endif | 75 #endif |
| OLD | NEW |