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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // This is called on the main thread. | 71 // This is called on the main thread. |
72 virtual void workerContextFailedToStart() { } | 72 virtual void workerContextFailedToStart() { } |
73 | 73 |
74 // Called when the WorkerGlobalScope had an error or an exception. | 74 // Called when the WorkerGlobalScope had an error or an exception. |
75 virtual void reportException(const WebString& errorMessage, int lineNumber,
int columnNumber, const WebString& sourceURL) { } | 75 virtual void reportException(const WebString& errorMessage, int lineNumber,
int columnNumber, const WebString& sourceURL) { } |
76 | 76 |
77 // Inspector related messages. | 77 // Inspector related messages. |
78 virtual void dispatchDevToolsMessage(const WebString&) { } | 78 virtual void dispatchDevToolsMessage(const WebString&) { } |
79 virtual void saveDevToolsAgentState(const WebString&) { } | 79 virtual void saveDevToolsAgentState(const WebString&) { } |
80 | 80 |
| 81 // ServiceWorker specific method. |
| 82 virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEven
tResult result) { } |
| 83 |
81 // ServiceWorker specific method. Called after InstallEvent (dispatched | 84 // ServiceWorker specific method. Called after InstallEvent (dispatched |
82 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's | 85 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's |
83 // script context. | 86 // script context. |
84 virtual void didHandleInstallEvent(int installEventID) { } | 87 virtual void didHandleInstallEvent(int installEventID) { } |
85 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult result) | 88 virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWork
erEventResult result) |
86 { | 89 { |
87 didHandleInstallEvent(installEventID); | 90 didHandleInstallEvent(installEventID); |
88 } | 91 } |
89 | 92 |
90 // ServiceWorker specific methods. Called after FetchEvent is handled by the | 93 // ServiceWorker specific methods. Called after FetchEvent is handled by the |
91 // ServiceWorker's script context. When no response is provided, the browser | 94 // ServiceWorker's script context. When no response is provided, the browser |
92 // should fallback to native fetch. | 95 // should fallback to native fetch. |
93 virtual void didHandleFetchEvent(int fetchEventID) { } | 96 virtual void didHandleFetchEvent(int fetchEventID) { } |
94 virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerRes
ponse& response) { } | 97 virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerRes
ponse& response) { } |
95 | 98 |
96 // Ownership of the returned object is transferred to the caller. | 99 // Ownership of the returned object is transferred to the caller. |
97 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(
blink::WebDataSource*) { return 0; } | 100 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(
blink::WebDataSource*) { return 0; } |
98 | 101 |
99 // ServiceWorker specific method. Called after SyncEvent (dispatched via | 102 // ServiceWorker specific method. Called after SyncEvent (dispatched via |
100 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script | 103 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script |
101 // context. | 104 // context. |
102 virtual void didHandleSyncEvent(int syncEventID) { } | 105 virtual void didHandleSyncEvent(int syncEventID) { } |
103 }; | 106 }; |
104 | 107 |
105 } // namespace blink | 108 } // namespace blink |
106 | 109 |
107 #endif // WebWorkerContextClient_h | 110 #endif // WebWorkerContextClient_h |
OLD | NEW |