| 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 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class ServiceWorkerGlobalScopeProxy; | 42 class ServiceWorkerGlobalScopeProxy; |
| 43 class WebServiceWorkerNetworkProvider; | 43 class WebServiceWorkerNetworkProvider; |
| 44 class WebView; | 44 class WebView; |
| 45 class WorkerInspectorProxy; | 45 class WorkerInspectorProxy; |
| 46 class WorkerScriptLoader; | 46 class WorkerScriptLoader; |
| 47 class WorkerThread; | 47 class WorkerThread; |
| 48 | 48 |
| 49 class WebEmbeddedWorkerImpl FINAL | 49 class WebEmbeddedWorkerImpl final |
| 50 : public WebEmbeddedWorker | 50 : public WebEmbeddedWorker |
| 51 , public WebFrameClient | 51 , public WebFrameClient |
| 52 , public WebDevToolsAgentClient { | 52 , public WebDevToolsAgentClient { |
| 53 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); | 53 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); |
| 54 public: | 54 public: |
| 55 WebEmbeddedWorkerImpl( | 55 WebEmbeddedWorkerImpl( |
| 56 PassOwnPtr<WebServiceWorkerContextClient>, | 56 PassOwnPtr<WebServiceWorkerContextClient>, |
| 57 PassOwnPtr<WebWorkerPermissionClientProxy>); | 57 PassOwnPtr<WebWorkerPermissionClientProxy>); |
| 58 virtual ~WebEmbeddedWorkerImpl(); | 58 virtual ~WebEmbeddedWorkerImpl(); |
| 59 | 59 |
| 60 // Terminate all WebEmbeddedWorkerImpl for testing purposes. | 60 // Terminate all WebEmbeddedWorkerImpl for testing purposes. |
| 61 // Note that this only schedules termination and | 61 // Note that this only schedules termination and |
| 62 // does not synchronously wait for it to complete. | 62 // does not synchronously wait for it to complete. |
| 63 static void terminateAll(); | 63 static void terminateAll(); |
| 64 | 64 |
| 65 // WebEmbeddedWorker overrides. | 65 // WebEmbeddedWorker overrides. |
| 66 virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) OVERRIDE; | 66 virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) override; |
| 67 virtual void resumeAfterDownload() OVERRIDE; | 67 virtual void resumeAfterDownload() override; |
| 68 virtual void terminateWorkerContext() OVERRIDE; | 68 virtual void terminateWorkerContext() override; |
| 69 virtual void resumeWorkerContext() OVERRIDE; | 69 virtual void resumeWorkerContext() override; |
| 70 virtual void attachDevTools(const WebString& hostId) OVERRIDE; | 70 virtual void attachDevTools(const WebString& hostId) override; |
| 71 virtual void reattachDevTools(const WebString& hostId, const WebString& save
dState) OVERRIDE; | 71 virtual void reattachDevTools(const WebString& hostId, const WebString& save
dState) override; |
| 72 virtual void detachDevTools() OVERRIDE; | 72 virtual void detachDevTools() override; |
| 73 virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE; | 73 virtual void dispatchDevToolsMessage(const WebString&) override; |
| 74 | 74 |
| 75 void postMessageToPageInspector(const WTF::String&); | 75 void postMessageToPageInspector(const WTF::String&); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 class Loader; | 78 class Loader; |
| 79 class LoaderProxy; | 79 class LoaderProxy; |
| 80 | 80 |
| 81 void prepareShadowPageForLoader(); | 81 void prepareShadowPageForLoader(); |
| 82 void loadShadowPage(); | 82 void loadShadowPage(); |
| 83 | 83 |
| 84 // WebFrameClient overrides. | 84 // WebFrameClient overrides. |
| 85 virtual void willSendRequest( | 85 virtual void willSendRequest( |
| 86 WebLocalFrame*, unsigned identifier, WebURLRequest&, | 86 WebLocalFrame*, unsigned identifier, WebURLRequest&, |
| 87 const WebURLResponse& redirectResponse) OVERRIDE; | 87 const WebURLResponse& redirectResponse) override; |
| 88 virtual void didFinishDocumentLoad(WebLocalFrame*) OVERRIDE; | 88 virtual void didFinishDocumentLoad(WebLocalFrame*) override; |
| 89 | 89 |
| 90 // WebDevToolsAgentClient overrides. | 90 // WebDevToolsAgentClient overrides. |
| 91 virtual void sendMessageToInspectorFrontend(const WebString&) OVERRIDE; | 91 virtual void sendMessageToInspectorFrontend(const WebString&) override; |
| 92 virtual void saveAgentRuntimeState(const WebString&) OVERRIDE; | 92 virtual void saveAgentRuntimeState(const WebString&) override; |
| 93 virtual void resumeStartup() OVERRIDE; | 93 virtual void resumeStartup() override; |
| 94 | 94 |
| 95 void onScriptLoaderFinished(); | 95 void onScriptLoaderFinished(); |
| 96 void startWorkerThread(); | 96 void startWorkerThread(); |
| 97 | 97 |
| 98 WebEmbeddedWorkerStartData m_workerStartData; | 98 WebEmbeddedWorkerStartData m_workerStartData; |
| 99 | 99 |
| 100 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; | 100 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; |
| 101 | 101 |
| 102 // This is kept until startWorkerContext is called, and then passed on | 102 // This is kept until startWorkerContext is called, and then passed on |
| 103 // to WorkerContext. | 103 // to WorkerContext. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 DoPauseAfterDownload, | 135 DoPauseAfterDownload, |
| 136 IsPausedAfterDownload | 136 IsPausedAfterDownload |
| 137 } m_pauseAfterDownloadState; | 137 } m_pauseAfterDownloadState; |
| 138 | 138 |
| 139 WaitingForDebuggerState m_waitingForDebuggerState; | 139 WaitingForDebuggerState m_waitingForDebuggerState; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace blink | 142 } // namespace blink |
| 143 | 143 |
| 144 #endif // WebEmbeddedWorkerImpl_h | 144 #endif // WebEmbeddedWorkerImpl_h |
| OLD | NEW |