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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // Called when the console message is reported. | 105 // Called when the console message is reported. |
106 virtual void reportConsoleMessage(int source, int level, const WebString& me
ssage, int lineNumber, const WebString& sourceURL) { } | 106 virtual void reportConsoleMessage(int source, int level, const WebString& me
ssage, int lineNumber, const WebString& sourceURL) { } |
107 | 107 |
108 // Inspector related messages. | 108 // Inspector related messages. |
109 virtual void sendDevToolsMessage(int sessionId, int callId, const WebString&
message, const WebString& state) { } | 109 virtual void sendDevToolsMessage(int sessionId, int callId, const WebString&
message, const WebString& state) { } |
110 | 110 |
111 // Message loop for debugging. | 111 // Message loop for debugging. |
112 virtual WebDevToolsAgentClient::WebKitClientMessageLoop* createDevToolsMessa
geLoop() { return nullptr; } | 112 virtual WebDevToolsAgentClient::WebKitClientMessageLoop* createDevToolsMessa
geLoop() { return nullptr; } |
113 | 113 |
114 // ServiceWorker specific method. | 114 // ServiceWorker specific method. |
115 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
result) { } | 115 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
result, double eventDispatchTime) {} |
116 | 116 |
117 // Called after ExtendableMessageEvent is handled by the ServiceWorker's | 117 // Called after ExtendableMessageEvent is handled by the ServiceWorker's |
118 // script context. | 118 // script context. |
119 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult result) { } | 119 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult result, double eventDispatchTime) {} |
120 | 120 |
121 // ServiceWorker specific methods. respondFetchEvent will be called after | 121 // ServiceWorker specific methods. respondFetchEvent will be called after |
122 // FetchEvent returns a response by the ServiceWorker's script context, and | 122 // FetchEvent returns a response by the ServiceWorker's script context, and |
123 // didHandleFetchEvent will be called after the end of FetchEvent's | 123 // didHandleFetchEvent will be called after the end of FetchEvent's |
124 // lifecycle. When no response is provided, the browser should fallback to | 124 // lifecycle. When no response is provided, the browser should fallback to |
125 // native fetch. EventIDs are the same with the ids passed from | 125 // native fetch. EventIDs are the same with the ids passed from |
126 // dispatchFetchEvent respectively. | 126 // dispatchFetchEvent respectively. |
127 virtual void respondToFetchEvent(int responseID) { }; | 127 virtual void respondToFetchEvent(int responseID, double eventDispatchTime) {
} |
128 virtual void respondToFetchEvent(int responseID, const WebServiceWorkerRespo
nse& response) { }; | 128 virtual void respondToFetchEvent(int responseID, const WebServiceWorkerRespo
nse& response, double eventDispatchTime) {} |
129 virtual void didHandleFetchEvent(int eventFinishID, WebServiceWorkerEventRes
ult result) { }; | 129 virtual void didHandleFetchEvent(int eventFinishID, WebServiceWorkerEventRes
ult result, double eventDispatchTime) {} |
130 | 130 |
131 // ServiceWorker specific method. Called after InstallEvent (dispatched | 131 // ServiceWorker specific method. Called after InstallEvent (dispatched |
132 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 132 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's |
133 // script context. | 133 // script context. |
134 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result result) { } | 134 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result result, double eventDispatchTime) {} |
135 | 135 |
136 // ServiceWorker specific method. Called after NotificationClickEvent | 136 // ServiceWorker specific method. Called after NotificationClickEvent |
137 // (dispatched via WebServiceWorkerContextProxy) is handled by the | 137 // (dispatched via WebServiceWorkerContextProxy) is handled by the |
138 // ServiceWorker's script context. | 138 // ServiceWorker's script context. |
139 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult result) { } | 139 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult result, double eventDispatchTime) {} |
140 | 140 |
141 // ServiceWorker specific method. Called after NotificationCloseEvent | 141 // ServiceWorker specific method. Called after NotificationCloseEvent |
142 // (dispatched via WebServiceWorkerContextProxy) is handled by the | 142 // (dispatched via WebServiceWorkerContextProxy) is handled by the |
143 // ServiceWorker's script context. | 143 // ServiceWorker's script context. |
144 virtual void didHandleNotificationCloseEvent(int eventID, WebServiceWorkerEv
entResult result) { } | 144 virtual void didHandleNotificationCloseEvent(int eventID, WebServiceWorkerEv
entResult result, double eventDispatchTime) {} |
145 | 145 |
146 // ServiceWorker specific method. Called after PushEvent (dispatched via | 146 // ServiceWorker specific method. Called after PushEvent (dispatched via |
147 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script | 147 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script |
148 // context. | 148 // context. |
149 virtual void didHandlePushEvent(int pushEventID, WebServiceWorkerEventResult
result) { } | 149 virtual void didHandlePushEvent(int pushEventID, WebServiceWorkerEventResult
result, double eventDispatchTime) {} |
150 | 150 |
151 // ServiceWorker specific method. Called after SyncEvent (dispatched via | 151 // ServiceWorker specific method. Called after SyncEvent (dispatched via |
152 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script | 152 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script |
153 // context. | 153 // context. |
154 virtual void didHandleSyncEvent(int syncEventID, WebServiceWorkerEventResult
result) { } | 154 virtual void didHandleSyncEvent(int syncEventID, WebServiceWorkerEventResult
result, double eventDispatchTime) {} |
155 | 155 |
156 // Ownership of the returned object is transferred to the caller. | 156 // Ownership of the returned object is transferred to the caller. |
157 // This is called on the main thread. | 157 // This is called on the main thread. |
158 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(
WebDataSource*) { return nullptr; } | 158 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(
WebDataSource*) { return nullptr; } |
159 | 159 |
160 // Ownership of the returned object is transferred to the caller. | 160 // Ownership of the returned object is transferred to the caller. |
161 // This is called on the main thread. | 161 // This is called on the main thread. |
162 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { return nul
lptr; } | 162 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { return nul
lptr; } |
163 | 163 |
164 // Ownership of the passed callbacks is transferred to the callee, callee | 164 // Ownership of the passed callbacks is transferred to the callee, callee |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker
ClientCallbacks*) = 0; | 212 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker
ClientCallbacks*) = 0; |
213 | 213 |
214 // Called when the worker wants to register subscopes to handle via foreign | 214 // Called when the worker wants to register subscopes to handle via foreign |
215 // fetch. Will only be called while an install event is in progress. | 215 // fetch. Will only be called while an install event is in progress. |
216 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>& origins) = 0; | 216 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>& origins) = 0; |
217 }; | 217 }; |
218 | 218 |
219 } // namespace blink | 219 } // namespace blink |
220 | 220 |
221 #endif // WebServiceWorkerContextClient_h | 221 #endif // WebServiceWorkerContextClient_h |
OLD | NEW |