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 28 matching lines...) Expand all Loading... |
39 #include "public/web/WebEmbeddedWorkerStartData.h" | 39 #include "public/web/WebEmbeddedWorkerStartData.h" |
40 #include "public/web/WebFrameClient.h" | 40 #include "public/web/WebFrameClient.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class ServiceWorkerGlobalScopeProxy; | 44 class ServiceWorkerGlobalScopeProxy; |
45 class WebLocalFrameImpl; | 45 class WebLocalFrameImpl; |
46 class WebServiceWorkerNetworkProvider; | 46 class WebServiceWorkerNetworkProvider; |
47 class WebView; | 47 class WebView; |
48 class WorkerInspectorProxy; | 48 class WorkerInspectorProxy; |
49 class WorkerThread; | 49 class WorkerScript; |
50 | 50 |
51 class WebEmbeddedWorkerImpl final | 51 class WebEmbeddedWorkerImpl final |
52 : public WebEmbeddedWorker | 52 : public WebEmbeddedWorker |
53 , public WebFrameClient | 53 , public WebFrameClient |
54 , public WebDevToolsAgentClient | 54 , public WebDevToolsAgentClient |
55 , private WorkerLoaderProxyProvider { | 55 , private WorkerLoaderProxyProvider { |
56 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); | 56 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); |
57 public: | 57 public: |
58 WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextClient>, PassOwnPtr<
WebWorkerContentSettingsClientProxy>); | 58 WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextClient>, PassOwnPtr<
WebWorkerContentSettingsClientProxy>); |
59 virtual ~WebEmbeddedWorkerImpl(); | 59 virtual ~WebEmbeddedWorkerImpl(); |
(...skipping 24 matching lines...) Expand all Loading... |
84 virtual void willSendRequest( | 84 virtual void willSendRequest( |
85 WebLocalFrame*, unsigned identifier, WebURLRequest&, | 85 WebLocalFrame*, unsigned identifier, WebURLRequest&, |
86 const WebURLResponse& redirectResponse) override; | 86 const WebURLResponse& redirectResponse) override; |
87 virtual void didFinishDocumentLoad(WebLocalFrame*) override; | 87 virtual void didFinishDocumentLoad(WebLocalFrame*) override; |
88 | 88 |
89 // WebDevToolsAgentClient overrides. | 89 // WebDevToolsAgentClient overrides. |
90 virtual void sendProtocolMessage(int callId, const WebString&, const WebStri
ng&) override; | 90 virtual void sendProtocolMessage(int callId, const WebString&, const WebStri
ng&) override; |
91 virtual void resumeStartup() override; | 91 virtual void resumeStartup() override; |
92 | 92 |
93 void onScriptLoaderFinished(); | 93 void onScriptLoaderFinished(); |
94 void startWorkerThread(); | 94 void startWorkerScript(); |
95 | 95 |
96 // WorkerLoaderProxyProvider | 96 // WorkerLoaderProxyProvider |
97 virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override; | 97 virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override; |
98 virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) o
verride; | 98 virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) o
verride; |
99 | 99 |
100 WebEmbeddedWorkerStartData m_workerStartData; | 100 WebEmbeddedWorkerStartData m_workerStartData; |
101 | 101 |
102 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; | 102 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; |
103 | 103 |
104 // This is kept until startWorkerContext is called, and then passed on | 104 // This is kept until startWorkerContext is called, and then passed on |
105 // to WorkerContext. | 105 // to WorkerContext. |
106 OwnPtr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; | 106 OwnPtr<WebWorkerContentSettingsClientProxy> m_contentSettingsClient; |
107 | 107 |
108 // We retain ownership of this one which is for use on the | 108 // We retain ownership of this one which is for use on the |
109 // main thread only. | 109 // main thread only. |
110 OwnPtr<WebServiceWorkerNetworkProvider> m_networkProvider; | 110 OwnPtr<WebServiceWorkerNetworkProvider> m_networkProvider; |
111 | 111 |
112 // Kept around only while main script loading is ongoing. | 112 // Kept around only while main script loading is ongoing. |
113 OwnPtr<Loader> m_mainScriptLoader; | 113 OwnPtr<Loader> m_mainScriptLoader; |
114 | 114 |
115 RefPtr<WorkerThread> m_workerThread; | 115 RefPtr<WorkerScript> m_workerScript; |
116 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 116 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
117 OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; | 117 OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; |
118 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy; | 118 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy; |
119 | 119 |
120 // 'shadow page' - created to proxy loading requests from the worker. | 120 // 'shadow page' - created to proxy loading requests from the worker. |
121 // Both WebView and WebFrame objects are close()'ed (where they're | 121 // Both WebView and WebFrame objects are close()'ed (where they're |
122 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they | 122 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
123 // are guaranteed to exist while this object is around. | 123 // are guaranteed to exist while this object is around. |
124 WebView* m_webView; | 124 WebView* m_webView; |
125 WebLocalFrameImpl* m_mainFrame; | 125 WebLocalFrameImpl* m_mainFrame; |
(...skipping 11 matching lines...) Expand all Loading... |
137 DoPauseAfterDownload, | 137 DoPauseAfterDownload, |
138 IsPausedAfterDownload | 138 IsPausedAfterDownload |
139 } m_pauseAfterDownloadState; | 139 } m_pauseAfterDownloadState; |
140 | 140 |
141 WaitingForDebuggerState m_waitingForDebuggerState; | 141 WaitingForDebuggerState m_waitingForDebuggerState; |
142 }; | 142 }; |
143 | 143 |
144 } // namespace blink | 144 } // namespace blink |
145 | 145 |
146 #endif // WebEmbeddedWorkerImpl_h | 146 #endif // WebEmbeddedWorkerImpl_h |
OLD | NEW |