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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "public/web/WebSharedWorker.h" | 34 #include "public/web/WebSharedWorker.h" |
35 | 35 |
36 #include <memory> | 36 #include <memory> |
37 #include "core/dom/ExecutionContext.h" | 37 #include "core/dom/ExecutionContext.h" |
38 #include "core/workers/WorkerLoaderProxy.h" | 38 #include "core/workers/WorkerLoaderProxy.h" |
39 #include "core/workers/WorkerThread.h" | 39 #include "core/workers/WorkerThread.h" |
40 #include "platform/wtf/RefPtr.h" | 40 #include "platform/wtf/RefPtr.h" |
41 #include "public/platform/WebAddressSpace.h" | 41 #include "public/platform/WebAddressSpace.h" |
42 #include "public/platform/WebContentSecurityPolicy.h" | 42 #include "public/platform/WebContentSecurityPolicy.h" |
| 43 #include "public/web/WebDataSaverFlag.h" |
43 #include "public/web/WebDevToolsAgentClient.h" | 44 #include "public/web/WebDevToolsAgentClient.h" |
44 #include "public/web/WebFrameClient.h" | 45 #include "public/web/WebFrameClient.h" |
45 #include "public/web/WebSharedWorkerClient.h" | 46 #include "public/web/WebSharedWorkerClient.h" |
46 #include "web/WebSharedWorkerReportingProxyImpl.h" | 47 #include "web/WebSharedWorkerReportingProxyImpl.h" |
47 | 48 |
48 namespace blink { | 49 namespace blink { |
49 | 50 |
50 class WebApplicationCacheHost; | 51 class WebApplicationCacheHost; |
51 class WebApplicationCacheHostClient; | 52 class WebApplicationCacheHostClient; |
52 class WebLocalFrameBase; | 53 class WebLocalFrameBase; |
(...skipping 29 matching lines...) Expand all Loading... |
82 const WebString&) override; | 83 const WebString&) override; |
83 void ResumeStartup() override; | 84 void ResumeStartup() override; |
84 WebDevToolsAgentClient::WebKitClientMessageLoop* CreateClientMessageLoop() | 85 WebDevToolsAgentClient::WebKitClientMessageLoop* CreateClientMessageLoop() |
85 override; | 86 override; |
86 | 87 |
87 // WebSharedWorker methods: | 88 // WebSharedWorker methods: |
88 void StartWorkerContext(const WebURL&, | 89 void StartWorkerContext(const WebURL&, |
89 const WebString& name, | 90 const WebString& name, |
90 const WebString& content_security_policy, | 91 const WebString& content_security_policy, |
91 WebContentSecurityPolicyType, | 92 WebContentSecurityPolicyType, |
92 WebAddressSpace) override; | 93 WebAddressSpace, |
| 94 WebDataSaverFlag) override; |
93 void Connect(std::unique_ptr<WebMessagePortChannel>) override; | 95 void Connect(std::unique_ptr<WebMessagePortChannel>) override; |
94 void TerminateWorkerContext() override; | 96 void TerminateWorkerContext() override; |
95 | 97 |
96 void PauseWorkerContextOnStart() override; | 98 void PauseWorkerContextOnStart() override; |
97 void AttachDevTools(const WebString& host_id, int session_id) override; | 99 void AttachDevTools(const WebString& host_id, int session_id) override; |
98 void ReattachDevTools(const WebString& host_id, | 100 void ReattachDevTools(const WebString& host_id, |
99 int sesion_id, | 101 int sesion_id, |
100 const WebString& saved_state) override; | 102 const WebString& saved_state) override; |
101 void DetachDevTools(int session_id) override; | 103 void DetachDevTools(int session_id) override; |
102 void DispatchDevToolsMessage(int session_id, | 104 void DispatchDevToolsMessage(int session_id, |
103 int call_id, | 105 int call_id, |
104 const WebString& method, | 106 const WebString& method, |
105 const WebString& message) override; | 107 const WebString& message) override; |
106 | 108 |
107 // Callback methods for WebSharedWorkerReportingProxyImpl. | 109 // Callback methods for WebSharedWorkerReportingProxyImpl. |
108 void CountFeature(UseCounter::Feature); | 110 void CountFeature(UseCounter::Feature); |
109 void PostMessageToPageInspector(const String& message); | 111 void PostMessageToPageInspector(const String& message); |
110 void DidCloseWorkerGlobalScope(); | 112 void DidCloseWorkerGlobalScope(); |
111 void DidTerminateWorkerThread(); | 113 void DidTerminateWorkerThread(); |
112 | 114 |
113 private: | 115 private: |
114 ~WebSharedWorkerImpl() override; | 116 ~WebSharedWorkerImpl() override; |
115 | 117 |
116 WorkerThread* GetWorkerThread() { return worker_thread_.get(); } | 118 WorkerThread* GetWorkerThread() { return worker_thread_.get(); } |
117 | 119 |
118 // Shuts down the worker thread. | 120 // Shuts down the worker thread. |
119 void TerminateWorkerThread(); | 121 void TerminateWorkerThread(); |
120 | 122 |
121 // Creates the shadow loader used for worker network requests. | 123 // Creates the shadow loader used for worker network requests. |
122 void InitializeLoader(); | 124 void InitializeLoader(WebDataSaverFlag); |
123 | 125 |
124 void LoadShadowPage(); | 126 void LoadShadowPage(); |
125 void DidReceiveScriptLoaderResponse(); | 127 void DidReceiveScriptLoaderResponse(); |
126 void OnScriptLoaderFinished(); | 128 void OnScriptLoaderFinished(); |
127 | 129 |
128 void ConnectTaskOnWorkerThread(std::unique_ptr<WebMessagePortChannel>); | 130 void ConnectTaskOnWorkerThread(std::unique_ptr<WebMessagePortChannel>); |
129 | 131 |
130 // WorkerLoaderProxyProvider | 132 // WorkerLoaderProxyProvider |
131 ThreadableLoadingContext* GetThreadableLoadingContext() override; | 133 ThreadableLoadingContext* GetThreadableLoadingContext() override; |
132 | 134 |
(...skipping 23 matching lines...) Expand all Loading... |
156 RefPtr<WorkerLoaderProxy> loader_proxy_; | 158 RefPtr<WorkerLoaderProxy> loader_proxy_; |
157 | 159 |
158 WebURL url_; | 160 WebURL url_; |
159 WebString name_; | 161 WebString name_; |
160 WebAddressSpace creation_address_space_; | 162 WebAddressSpace creation_address_space_; |
161 }; | 163 }; |
162 | 164 |
163 } // namespace blink | 165 } // namespace blink |
164 | 166 |
165 #endif // WebSharedWorkerImpl_h | 167 #endif // WebSharedWorkerImpl_h |
OLD | NEW |