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 16 matching lines...) Expand all Loading... |
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/WebAddressSpace.h" |
35 #include "../platform/WebCommon.h" | 35 #include "../platform/WebCommon.h" |
36 #include "../platform/WebContentSecurityPolicy.h" | 36 #include "../platform/WebContentSecurityPolicy.h" |
| 37 #include "public/web/WebDataSaverFlag.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 class WebString; | 41 class WebString; |
41 class WebMessagePortChannel; | 42 class WebMessagePortChannel; |
42 class WebSharedWorkerClient; | 43 class WebSharedWorkerClient; |
43 class WebURL; | 44 class WebURL; |
44 | 45 |
45 // This is the interface to a SharedWorker thread. | 46 // This is the interface to a SharedWorker thread. |
46 class WebSharedWorker { | 47 class WebSharedWorker { |
47 public: | 48 public: |
48 // Instantiate a WebSharedWorker that interacts with the shared worker. | 49 // Instantiate a WebSharedWorker that interacts with the shared worker. |
49 // WebSharedWorkerClient given here must outlive or have the identical | 50 // WebSharedWorkerClient given here must outlive or have the identical |
50 // lifetime as this instance. | 51 // lifetime as this instance. |
51 BLINK_EXPORT static WebSharedWorker* Create(WebSharedWorkerClient*); | 52 BLINK_EXPORT static WebSharedWorker* Create(WebSharedWorkerClient*); |
52 | 53 |
53 virtual void StartWorkerContext(const WebURL& script_url, | 54 virtual void StartWorkerContext(const WebURL& script_url, |
54 const WebString& name, | 55 const WebString& name, |
55 const WebString& content_security_policy, | 56 const WebString& content_security_policy, |
56 WebContentSecurityPolicyType, | 57 WebContentSecurityPolicyType, |
57 WebAddressSpace) = 0; | 58 WebAddressSpace, |
| 59 WebDataSaverFlag) = 0; |
58 | 60 |
59 // Sends a connect event to the SharedWorker context. | 61 // Sends a connect event to the SharedWorker context. |
60 virtual void Connect(std::unique_ptr<WebMessagePortChannel>) = 0; | 62 virtual void Connect(std::unique_ptr<WebMessagePortChannel>) = 0; |
61 | 63 |
62 // Invoked to shutdown the worker when there are no more associated documents. | 64 // Invoked to shutdown the worker when there are no more associated documents. |
63 // This eventually deletes this instance. | 65 // This eventually deletes this instance. |
64 virtual void TerminateWorkerContext() = 0; | 66 virtual void TerminateWorkerContext() = 0; |
65 | 67 |
66 virtual void PauseWorkerContextOnStart() = 0; | 68 virtual void PauseWorkerContextOnStart() = 0; |
67 virtual void AttachDevTools(const WebString& host_id, int session_id) = 0; | 69 virtual void AttachDevTools(const WebString& host_id, int session_id) = 0; |
68 virtual void ReattachDevTools(const WebString& host_id, | 70 virtual void ReattachDevTools(const WebString& host_id, |
69 int session_id, | 71 int session_id, |
70 const WebString& saved_state) = 0; | 72 const WebString& saved_state) = 0; |
71 virtual void DetachDevTools(int session_id) = 0; | 73 virtual void DetachDevTools(int session_id) = 0; |
72 virtual void DispatchDevToolsMessage(int session_id, | 74 virtual void DispatchDevToolsMessage(int session_id, |
73 int call_id, | 75 int call_id, |
74 const WebString& method, | 76 const WebString& method, |
75 const WebString& message) = 0; | 77 const WebString& message) = 0; |
76 }; | 78 }; |
77 | 79 |
78 } // namespace blink | 80 } // namespace blink |
79 | 81 |
80 #endif | 82 #endif |
OLD | NEW |