| 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 25 matching lines...) Expand all Loading... |
| 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 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 struct WebCrossOriginServiceWorkerClient; | 43 struct WebCrossOriginServiceWorkerClient; |
| 44 struct WebServiceWorkerClientQueryOptions; | 44 struct WebServiceWorkerClientQueryOptions; |
| 45 class WebDataSource; | 45 class WebDataSource; |
| 46 class WebServiceWorkerCacheStorage; | |
| 47 class WebServiceWorkerContextProxy; | 46 class WebServiceWorkerContextProxy; |
| 48 class WebServiceWorkerNetworkProvider; | 47 class WebServiceWorkerNetworkProvider; |
| 49 class WebServiceWorkerProvider; | 48 class WebServiceWorkerProvider; |
| 50 class WebServiceWorkerResponse; | 49 class WebServiceWorkerResponse; |
| 51 class WebString; | 50 class WebString; |
| 52 | 51 |
| 53 // This interface is implemented by the client. It is supposed to be created | 52 // This interface is implemented by the client. It is supposed to be created |
| 54 // on the main thread and then passed on to the worker thread by a newly | 53 // on the main thread and then passed on to the worker thread by a newly |
| 55 // created WorkerGlobalScope. Unless otherwise noted, all methods of this class | 54 // created WorkerGlobalScope. Unless otherwise noted, all methods of this class |
| 56 // are called on the worker thread. | 55 // are called on the worker thread. |
| 57 // | 56 // |
| 58 // FIXME: Split this into EmbeddedWorkerContextClient and | 57 // FIXME: Split this into EmbeddedWorkerContextClient and |
| 59 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker | 58 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker |
| 60 // framework for other implementation (like SharedWorker). | 59 // framework for other implementation (like SharedWorker). |
| 61 class WebServiceWorkerContextClient { | 60 class WebServiceWorkerContextClient { |
| 62 public: | 61 public: |
| 63 virtual ~WebServiceWorkerContextClient() { } | 62 virtual ~WebServiceWorkerContextClient() { } |
| 64 | 63 |
| 65 // ServiceWorker specific method. | |
| 66 virtual WebServiceWorkerCacheStorage* cacheStorage() { return nullptr; } | |
| 67 | |
| 68 // ServiceWorker specific method. Called when script accesses the | 64 // ServiceWorker specific method. Called when script accesses the |
| 69 // the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec
. | 65 // the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec
. |
| 70 virtual WebURL scope() const { return WebURL(); } | 66 virtual WebURL scope() const { return WebURL(); } |
| 71 | 67 |
| 72 // If the worker was started with WebEmbeddedWorkerStartData indicating to p
ause | 68 // If the worker was started with WebEmbeddedWorkerStartData indicating to p
ause |
| 73 // after download, this method is called after the main script resource has
been | 69 // after download, this method is called after the main script resource has
been |
| 74 // downloaded. The scope will not be created and the script will not be load
ed until | 70 // downloaded. The scope will not be created and the script will not be load
ed until |
| 75 // WebEmbeddedWorker.resumeAfterDownload() is invoked. | 71 // WebEmbeddedWorker.resumeAfterDownload() is invoked. |
| 76 virtual void didPauseAfterDownload() { } | 72 virtual void didPauseAfterDownload() { } |
| 77 | 73 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 virtual void claim(WebServiceWorkerClientsClaimCallbacks*) { BLINK_ASSERT_NO
T_REACHED(); } | 184 virtual void claim(WebServiceWorkerClientsClaimCallbacks*) { BLINK_ASSERT_NO
T_REACHED(); } |
| 189 | 185 |
| 190 // Ownership of the passed callbacks is transferred to the callee, callee | 186 // Ownership of the passed callbacks is transferred to the callee, callee |
| 191 // should delete the callback after calling either onSuccess or onError. | 187 // should delete the callback after calling either onSuccess or onError. |
| 192 virtual void focus(const WebString& uuid, WebServiceWorkerClientCallbacks*)
{ BLINK_ASSERT_NOT_REACHED(); } | 188 virtual void focus(const WebString& uuid, WebServiceWorkerClientCallbacks*)
{ BLINK_ASSERT_NOT_REACHED(); } |
| 193 }; | 189 }; |
| 194 | 190 |
| 195 } // namespace blink | 191 } // namespace blink |
| 196 | 192 |
| 197 #endif // WebServiceWorkerContextClient_h | 193 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |