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 29 matching lines...) Expand all Loading... | |
40 #include "public/platform/WebServiceWorkerSkipWaitingCallbacks.h" | 40 #include "public/platform/WebServiceWorkerSkipWaitingCallbacks.h" |
41 #include "public/platform/WebURL.h" | 41 #include "public/platform/WebURL.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 struct WebCrossOriginServiceWorkerClient; | 45 struct WebCrossOriginServiceWorkerClient; |
46 class WebDataSource; | 46 class WebDataSource; |
47 class WebServiceWorkerCacheStorage; | 47 class WebServiceWorkerCacheStorage; |
48 class WebServiceWorkerContextProxy; | 48 class WebServiceWorkerContextProxy; |
49 class WebServiceWorkerNetworkProvider; | 49 class WebServiceWorkerNetworkProvider; |
50 class WebServiceWorkerProvider; | |
50 class WebServiceWorkerResponse; | 51 class WebServiceWorkerResponse; |
51 class WebString; | 52 class WebString; |
52 | 53 |
53 // This interface is implemented by the client. It is supposed to be created | 54 // 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. | 55 // on the main thread and then passed on to the worker thread. |
55 // by a newly created WorkerGlobalScope. All methods of this class, except | 56 // by a newly created WorkerGlobalScope. All methods of this class, except |
56 // for createServiceWorkerNetworkProvider() and workerContextFailedToStart(), | 57 // for createServiceWorkerNetworkProvider(), createServiceWorkerProvider() and |
57 // are called on the worker thread. | 58 // workerContextFailedToStart(), are called on the worker thread. |
59 // | |
58 // FIXME: Split this into EmbeddedWorkerContextClient and | 60 // FIXME: Split this into EmbeddedWorkerContextClient and |
59 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker | 61 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker |
60 // framework for other implementation (like SharedWorker). | 62 // framework for other implementation (like SharedWorker). |
61 class WebServiceWorkerContextClient { | 63 class WebServiceWorkerContextClient { |
62 public: | 64 public: |
63 virtual ~WebServiceWorkerContextClient() { } | 65 virtual ~WebServiceWorkerContextClient() { } |
64 | 66 |
65 // ServiceWorker specific method. | 67 // ServiceWorker specific method. |
66 virtual WebServiceWorkerCacheStorage* cacheStorage() { return 0; } | 68 virtual WebServiceWorkerCacheStorage* cacheStorage() { return 0; } |
67 | 69 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 virtual void didHandleSyncEvent(int syncEventID) { } | 143 virtual void didHandleSyncEvent(int syncEventID) { } |
142 | 144 |
143 // ServiceWorker specific method. Called after CrossOriginConnectEvent | 145 // ServiceWorker specific method. Called after CrossOriginConnectEvent |
144 // (dispatched via WebServiceWorkerContextProxy) is handled by the | 146 // (dispatched via WebServiceWorkerContextProxy) is handled by the |
145 // ServiceWorker's script context. | 147 // ServiceWorker's script context. |
146 virtual void didHandleCrossOriginConnectEvent(int connectEventID, bool accep tConnect) { } | 148 virtual void didHandleCrossOriginConnectEvent(int connectEventID, bool accep tConnect) { } |
147 | 149 |
148 // Ownership of the returned object is transferred to the caller. | 150 // Ownership of the returned object is transferred to the caller. |
149 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider( WebDataSource*) { return 0; } | 151 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider( WebDataSource*) { return 0; } |
150 | 152 |
153 // Ownership of the returned object is transferred to the caller. | |
154 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { return 0; } | |
kinuko
2015/02/05 09:09:29
nit: I think we can now return nullptr (back then
nhiroki
2015/02/05 09:12:42
Done.
| |
155 | |
151 // Ownership of the passed callbacks is transferred to the callee, callee | 156 // Ownership of the passed callbacks is transferred to the callee, callee |
152 // should delete the callbacks after calling either onSuccess or onError. | 157 // should delete the callbacks after calling either onSuccess or onError. |
153 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are | 158 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are |
154 // passed to the WebServiceWorkerClientsCallbacks implementation. | 159 // passed to the WebServiceWorkerClientsCallbacks implementation. |
155 virtual void getClients(WebServiceWorkerClientsCallbacks*) { BLINK_ASSERT_NO T_REACHED(); } | 160 virtual void getClients(WebServiceWorkerClientsCallbacks*) { BLINK_ASSERT_NO T_REACHED(); } |
156 | 161 |
157 // Callee receives ownership of the passed vector. | 162 // Callee receives ownership of the passed vector. |
158 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175 3 | 163 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175 3 |
159 virtual void postMessageToClient(int clientID, const WebString&, WebMessageP ortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } | 164 virtual void postMessageToClient(int clientID, const WebString&, WebMessageP ortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } |
160 | 165 |
(...skipping 17 matching lines...) Expand all Loading... | |
178 // is present. https://crbug.com/437149 | 183 // is present. https://crbug.com/437149 |
179 bool result = true; | 184 bool result = true; |
180 callback->onSuccess(&result); | 185 callback->onSuccess(&result); |
181 delete callback; | 186 delete callback; |
182 } | 187 } |
183 }; | 188 }; |
184 | 189 |
185 } // namespace blink | 190 } // namespace blink |
186 | 191 |
187 #endif // WebServiceWorkerContextClient_h | 192 #endif // WebServiceWorkerContextClient_h |
OLD | NEW |