Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #ifndef WebServiceWorkerContextClient_h | 31 #ifndef WebServiceWorkerContextClient_h |
| 32 #define WebServiceWorkerContextClient_h | 32 #define WebServiceWorkerContextClient_h |
| 33 | 33 |
| 34 #include "public/platform/WebMessagePortChannel.h" | 34 #include "public/platform/WebMessagePortChannel.h" |
| 35 #include "public/platform/WebServiceWorkerClientsClaimCallbacks.h" | 35 #include "public/platform/WebServiceWorkerClientsClaimCallbacks.h" |
| 36 #include "public/platform/WebServiceWorkerClientsInfo.h" | 36 #include "public/platform/WebServiceWorkerClientsInfo.h" |
| 37 #include "public/platform/WebServiceWorkerEventResult.h" | 37 #include "public/platform/WebServiceWorkerEventResult.h" |
| 38 #include "public/platform/WebServiceWorkerSkipWaitingCallbacks.h" | 38 #include "public/platform/WebServiceWorkerSkipWaitingCallbacks.h" |
| 39 #include "public/platform/WebURL.h" | 39 #include "public/platform/WebURL.h" |
| 40 #include <v8.h> | |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 struct WebCrossOriginServiceWorkerClient; | 44 struct WebCrossOriginServiceWorkerClient; |
| 44 struct WebServiceWorkerClientQueryOptions; | 45 struct WebServiceWorkerClientQueryOptions; |
| 45 class WebDataSource; | 46 class WebDataSource; |
| 46 class WebServiceWorkerContextProxy; | 47 class WebServiceWorkerContextProxy; |
| 47 class WebServiceWorkerNetworkProvider; | 48 class WebServiceWorkerNetworkProvider; |
| 48 class WebServiceWorkerProvider; | 49 class WebServiceWorkerProvider; |
| 49 class WebServiceWorkerResponse; | 50 class WebServiceWorkerResponse; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 86 |
| 86 // Starting worker context is failed. This could happen when loading | 87 // Starting worker context is failed. This could happen when loading |
| 87 // worker script fails, or is asked to terminated before the context starts. | 88 // worker script fails, or is asked to terminated before the context starts. |
| 88 // This is called on the main thread. | 89 // This is called on the main thread. |
| 89 virtual void workerContextFailedToStart() { } | 90 virtual void workerContextFailedToStart() { } |
| 90 | 91 |
| 91 // Called when the worker script is evaluated. |success| is true if the | 92 // Called when the worker script is evaluated. |success| is true if the |
| 92 // evaluation completed with no uncaught exception. | 93 // evaluation completed with no uncaught exception. |
| 93 virtual void didEvaluateWorkerScript(bool success) { } | 94 virtual void didEvaluateWorkerScript(bool success) { } |
| 94 | 95 |
| 96 // Called when the worker context is initialized. | |
| 97 virtual void didInitializeWorkerContext(v8::Local<v8::Context> context, cons t blink::WebURL& url) { } | |
|
dcheng
2015/08/04 00:27:36
Is it necessary to plumb |context| through like th
| |
| 98 | |
| 95 // Called when the WorkerGlobalScope had an error or an exception. | 99 // Called when the WorkerGlobalScope had an error or an exception. |
| 96 virtual void reportException(const WebString& errorMessage, int lineNumber, int columnNumber, const WebString& sourceURL) { } | 100 virtual void reportException(const WebString& errorMessage, int lineNumber, int columnNumber, const WebString& sourceURL) { } |
| 97 | 101 |
| 98 // Called when the console message is reported. | 102 // Called when the console message is reported. |
| 99 virtual void reportConsoleMessage(int source, int level, const WebString& me ssage, int lineNumber, const WebString& sourceURL) { } | 103 virtual void reportConsoleMessage(int source, int level, const WebString& me ssage, int lineNumber, const WebString& sourceURL) { } |
| 100 | 104 |
| 101 // Inspector related messages. | 105 // Inspector related messages. |
| 102 virtual void sendDevToolsMessage(int callId, const WebString& message, const WebString& state) { } | 106 virtual void sendDevToolsMessage(int callId, const WebString& message, const WebString& state) { } |
| 103 | 107 |
| 104 // ServiceWorker specific method. | 108 // ServiceWorker specific method. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 // Ownership of the passed callbacks is transferred to the callee, callee | 183 // Ownership of the passed callbacks is transferred to the callee, callee |
| 180 // should delete the callbacks after calling either onSuccess or onError. | 184 // should delete the callbacks after calling either onSuccess or onError. |
| 181 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are | 185 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are |
| 182 // passed to the WebServiceWorkerClientsCallbacks implementation. | 186 // passed to the WebServiceWorkerClientsCallbacks implementation. |
| 183 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker ClientCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } | 187 virtual void navigate(const WebString& uuid, const WebURL&, WebServiceWorker ClientCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } |
| 184 }; | 188 }; |
| 185 | 189 |
| 186 } // namespace blink | 190 } // namespace blink |
| 187 | 191 |
| 188 #endif // WebServiceWorkerContextClient_h | 192 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |