| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // Inspector related messages. | 107 // Inspector related messages. |
| 108 virtual void sendDevToolsMessage(int sessionId, int callId, const WebString&
message, const WebString& state) { } | 108 virtual void sendDevToolsMessage(int sessionId, int callId, const WebString&
message, const WebString& state) { } |
| 109 | 109 |
| 110 // ServiceWorker specific method. | 110 // ServiceWorker specific method. |
| 111 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
result) { } | 111 virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult
result) { } |
| 112 | 112 |
| 113 // Called after ExtendableMessageEvent is handled by the ServiceWorker's | 113 // Called after ExtendableMessageEvent is handled by the ServiceWorker's |
| 114 // script context. | 114 // script context. |
| 115 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult result) { } | 115 virtual void didHandleExtendableMessageEvent(int eventID, WebServiceWorkerEv
entResult result) { } |
| 116 | 116 |
| 117 // ServiceWorker specific methods. Called after FetchEvent is handled by the | 117 // ServiceWorker specific methods. respondFetchEvent will be called after |
| 118 // ServiceWorker's script context. When no response is provided, the browser | 118 // FetchEvent returns a response by the ServiceWorker's script context, and |
| 119 // should fallback to native fetch. | 119 // didHandleFetchEvent will be called after the end of FetchEvent's |
| 120 virtual void didHandleFetchEvent(int fetchEventID) { } | 120 // lifecycle. When no response is provided, the browser should fallback to |
| 121 virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerRes
ponse& response) { } | 121 // native fetch. EventIDs are the same with the ids passed from |
| 122 // dispatchFetchEvent respectively. |
| 123 virtual void respondToFetchEvent(int responseID) { }; |
| 124 virtual void respondToFetchEvent(int responseID, const WebServiceWorkerRespo
nse& response) { }; |
| 125 virtual void didHandleFetchEvent(int eventFinishID, WebServiceWorkerEventRes
ult result) { }; |
| 122 | 126 |
| 123 // ServiceWorker specific method. Called after InstallEvent (dispatched | 127 // ServiceWorker specific method. Called after InstallEvent (dispatched |
| 124 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 128 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's |
| 125 // script context. | 129 // script context. |
| 126 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result result) { } | 130 virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEvent
Result result) { } |
| 127 | 131 |
| 128 // ServiceWorker specific method. Called after NotificationClickEvent | 132 // ServiceWorker specific method. Called after NotificationClickEvent |
| 129 // (dispatched via WebServiceWorkerContextProxy) is handled by the | 133 // (dispatched via WebServiceWorkerContextProxy) is handled by the |
| 130 // ServiceWorker's script context. | 134 // ServiceWorker's script context. |
| 131 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult result) { } | 135 virtual void didHandleNotificationClickEvent(int eventID, WebServiceWorkerEv
entResult result) { } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker
ClientCallbacks*) = 0; | 208 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker
ClientCallbacks*) = 0; |
| 205 | 209 |
| 206 // Called when the worker wants to register subscopes to handle via foreign | 210 // Called when the worker wants to register subscopes to handle via foreign |
| 207 // fetch. Will only be called while an install event is in progress. | 211 // fetch. Will only be called while an install event is in progress. |
| 208 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>& origins) = 0; | 212 virtual void registerForeignFetchScopes(const WebVector<WebURL>& subScopes,
const WebVector<WebSecurityOrigin>& origins) = 0; |
| 209 }; | 213 }; |
| 210 | 214 |
| 211 } // namespace blink | 215 } // namespace blink |
| 212 | 216 |
| 213 #endif // WebServiceWorkerContextClient_h | 217 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |