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 "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class ConsoleMessage; | 43 class ConsoleMessage; |
44 class Document; | 44 class Document; |
45 class ServiceWorkerGlobalScope; | 45 class ServiceWorkerGlobalScope; |
46 class WebEmbeddedWorkerImpl; | 46 class WebEmbeddedWorkerImpl; |
47 class WebServiceWorkerContextClient; | 47 class WebServiceWorkerContextClient; |
48 class WebServiceWorkerRequest; | 48 class WebServiceWorkerRequest; |
| 49 struct WebSyncRegistration; |
49 | 50 |
50 // This class is created and destructed on the main thread, but live most | 51 // This class is created and destructed on the main thread, but live most |
51 // of its time as a resident of the worker thread. | 52 // of its time as a resident of the worker thread. |
52 // All methods other than its ctor/dtor are called on the worker thread. | 53 // All methods other than its ctor/dtor are called on the worker thread. |
53 // | 54 // |
54 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's | 55 // This implements WebServiceWorkerContextProxy, which connects ServiceWorker's |
55 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific | 56 // WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific |
56 // events/upcall methods that are to be called by embedder/chromium, | 57 // events/upcall methods that are to be called by embedder/chromium, |
57 // e.g. onfetch. | 58 // e.g. onfetch. |
58 // | 59 // |
(...skipping 13 matching lines...) Expand all Loading... |
72 void dispatchActivateEvent(int) override; | 73 void dispatchActivateEvent(int) override; |
73 void dispatchCrossOriginConnectEvent(int, const WebCrossOriginServiceWorkerC
lient&) override; | 74 void dispatchCrossOriginConnectEvent(int, const WebCrossOriginServiceWorkerC
lient&) override; |
74 void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWorkerClient
&, const WebString& message, const WebMessagePortChannelArray&) override; | 75 void dispatchCrossOriginMessageEvent(const WebCrossOriginServiceWorkerClient
&, const WebString& message, const WebMessagePortChannelArray&) override; |
75 void dispatchFetchEvent(int, const WebServiceWorkerRequest&) override; | 76 void dispatchFetchEvent(int, const WebServiceWorkerRequest&) override; |
76 void dispatchGeofencingEvent(int, WebGeofencingEventType, const WebString& r
egionID, const WebCircularGeofencingRegion&) override; | 77 void dispatchGeofencingEvent(int, WebGeofencingEventType, const WebString& r
egionID, const WebCircularGeofencingRegion&) override; |
77 void dispatchInstallEvent(int) override; | 78 void dispatchInstallEvent(int) override; |
78 void dispatchMessageEvent(const WebString& message, const WebMessagePortChan
nelArray&) override; | 79 void dispatchMessageEvent(const WebString& message, const WebMessagePortChan
nelArray&) override; |
79 void dispatchNotificationClickEvent(int, int64_t notificationID, const WebNo
tificationData&) override; | 80 void dispatchNotificationClickEvent(int, int64_t notificationID, const WebNo
tificationData&) override; |
80 void dispatchPushEvent(int, const WebString& data) override; | 81 void dispatchPushEvent(int, const WebString& data) override; |
81 void dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks*, c
onst WebURL& targetURL, const WebString& origin, WebServicePortID) override; | 82 void dispatchServicePortConnectEvent(WebServicePortConnectEventCallbacks*, c
onst WebURL& targetURL, const WebString& origin, WebServicePortID) override; |
| 83 // TODO(iclelland): Remove the single-parameter version once all call sites |
| 84 // have been updated. |
82 void dispatchSyncEvent(int) override; | 85 void dispatchSyncEvent(int) override; |
| 86 void dispatchSyncEvent(int, const WebSyncRegistration&) override; |
83 void addStashedMessagePorts(const WebMessagePortChannelArray&, const WebVect
or<WebString>& webChannelNames) override; | 87 void addStashedMessagePorts(const WebMessagePortChannelArray&, const WebVect
or<WebString>& webChannelNames) override; |
84 | 88 |
85 // WorkerReportingProxy overrides: | 89 // WorkerReportingProxy overrides: |
86 void reportException(const String& errorMessage, int lineNumber, int columnN
umber, const String& sourceURL, int exceptionId) override; | 90 void reportException(const String& errorMessage, int lineNumber, int columnN
umber, const String& sourceURL, int exceptionId) override; |
87 void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override; | 91 void reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override; |
88 void postMessageToPageInspector(const String&) override; | 92 void postMessageToPageInspector(const String&) override; |
89 void postWorkerConsoleAgentEnabled() override { } | 93 void postWorkerConsoleAgentEnabled() override { } |
90 void didEvaluateWorkerScript(bool success) override; | 94 void didEvaluateWorkerScript(bool success) override; |
91 void workerGlobalScopeStarted(WorkerGlobalScope*) override; | 95 void workerGlobalScopeStarted(WorkerGlobalScope*) override; |
92 void workerGlobalScopeClosed() override; | 96 void workerGlobalScopeClosed() override; |
93 void willDestroyWorkerGlobalScope() override; | 97 void willDestroyWorkerGlobalScope() override; |
94 void workerThreadTerminated() override; | 98 void workerThreadTerminated() override; |
95 | 99 |
96 private: | 100 private: |
97 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW
orkerContextClient&); | 101 ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceW
orkerContextClient&); |
98 | 102 |
99 WebEmbeddedWorkerImpl& m_embeddedWorker; | 103 WebEmbeddedWorkerImpl& m_embeddedWorker; |
100 Document& m_document; | 104 Document& m_document; |
101 | 105 |
102 WebServiceWorkerContextClient& m_client; | 106 WebServiceWorkerContextClient& m_client; |
103 | 107 |
104 ServiceWorkerGlobalScope* m_workerGlobalScope; | 108 ServiceWorkerGlobalScope* m_workerGlobalScope; |
105 }; | 109 }; |
106 | 110 |
107 } // namespace blink | 111 } // namespace blink |
108 | 112 |
109 #endif // ServiceWorkerGlobalScopeProxy_h | 113 #endif // ServiceWorkerGlobalScopeProxy_h |
OLD | NEW |