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 14 matching lines...) Expand all Loading... |
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 ServiceWorkerGlobalScopeProxy_h | 31 #ifndef ServiceWorkerGlobalScopeProxy_h |
32 #define ServiceWorkerGlobalScopeProxy_h | 32 #define ServiceWorkerGlobalScopeProxy_h |
33 | 33 |
34 #include "core/workers/WorkerReportingProxy.h" | 34 #include "core/workers/WorkerReportingProxy.h" |
| 35 #include "platform/heap/Handle.h" |
35 #include "public/platform/WebString.h" | 36 #include "public/platform/WebString.h" |
36 #include "public/web/WebServiceWorkerContextProxy.h" | 37 #include "public/web/WebServiceWorkerContextProxy.h" |
37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
| 42 |
41 class ConsoleMessage; | 43 class ConsoleMessage; |
42 class ExecutionContext; | 44 class ExecutionContext; |
43 } | |
44 | |
45 namespace blink { | |
46 | |
47 class WebEmbeddedWorkerImpl; | 45 class WebEmbeddedWorkerImpl; |
48 class WebServiceWorkerContextClient; | 46 class WebServiceWorkerContextClient; |
49 class WebServiceWorkerRequest; | 47 class WebServiceWorkerRequest; |
50 | 48 |
51 // This class is created and destructed on the main thread, but live most | 49 // This class is created and destructed on the main thread, but live most |
52 // of its time as a resident of the worker thread. | 50 // of its time as a resident of the worker thread. |
53 // All methods other than its ctor/dtor are called on the worker thread. | 51 // All methods other than its ctor/dtor are called on the worker thread. |
54 // | 52 // |
55 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's | 53 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's |
56 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific | 54 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific |
(...skipping 14 matching lines...) Expand all Loading... |
71 // WebServiceWorkerContextProxy overrides: | 69 // WebServiceWorkerContextProxy overrides: |
72 virtual void dispatchActivateEvent(int) OVERRIDE; | 70 virtual void dispatchActivateEvent(int) OVERRIDE; |
73 virtual void dispatchInstallEvent(int) OVERRIDE; | 71 virtual void dispatchInstallEvent(int) OVERRIDE; |
74 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRID
E; | 72 virtual void dispatchFetchEvent(int, const WebServiceWorkerRequest&) OVERRID
E; |
75 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) OVERRIDE; | 73 virtual void dispatchMessageEvent(const WebString& message, const WebMessage
PortChannelArray&) OVERRIDE; |
76 virtual void dispatchPushEvent(int, const WebString& data) OVERRIDE; | 74 virtual void dispatchPushEvent(int, const WebString& data) OVERRIDE; |
77 virtual void dispatchSyncEvent(int) OVERRIDE; | 75 virtual void dispatchSyncEvent(int) OVERRIDE; |
78 | 76 |
79 // WorkerReportingProxy overrides: | 77 // WorkerReportingProxy overrides: |
80 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; | 78 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; |
81 virtual void reportConsoleMessage(PassRefPtr<blink::ConsoleMessage>) OVERRID
E; | 79 virtual void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) OV
ERRIDE; |
82 virtual void postMessageToPageInspector(const String&) OVERRIDE; | 80 virtual void postMessageToPageInspector(const String&) OVERRIDE; |
83 virtual void updateInspectorStateCookie(const String&) OVERRIDE; | 81 virtual void updateInspectorStateCookie(const String&) OVERRIDE; |
84 virtual void workerGlobalScopeStarted(blink::WorkerGlobalScope*) OVERRIDE; | 82 virtual void workerGlobalScopeStarted(blink::WorkerGlobalScope*) OVERRIDE; |
85 virtual void workerGlobalScopeClosed() OVERRIDE; | 83 virtual void workerGlobalScopeClosed() OVERRIDE; |
86 virtual void willDestroyWorkerGlobalScope() OVERRIDE; | 84 virtual void willDestroyWorkerGlobalScope() OVERRIDE; |
87 virtual void workerGlobalScopeDestroyed() OVERRIDE; | 85 virtual void workerGlobalScopeDestroyed() OVERRIDE; |
88 | 86 |
89 private: | 87 private: |
90 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, blink::ExecutionContex
t&, WebServiceWorkerContextClient&); | 88 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, blink::ExecutionContex
t&, WebServiceWorkerContextClient&); |
91 | 89 |
92 WebEmbeddedWorkerImpl& m_embeddedWorker; | 90 WebEmbeddedWorkerImpl& m_embeddedWorker; |
93 blink::ExecutionContext& m_executionContext; | 91 blink::ExecutionContext& m_executionContext; |
94 | 92 |
95 WebServiceWorkerContextClient& m_client; | 93 WebServiceWorkerContextClient& m_client; |
96 | 94 |
97 blink::WorkerGlobalScope* m_workerGlobalScope; | 95 blink::WorkerGlobalScope* m_workerGlobalScope; |
98 }; | 96 }; |
99 | 97 |
100 } // namespace blink | 98 } // namespace blink |
101 | 99 |
102 #endif // ServiceWorkerGlobalScopeProxy_h | 100 #endif // ServiceWorkerGlobalScopeProxy_h |
OLD | NEW |