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() and workerContextFailedToStart(), |
57 // are called on the worker thread. | 58 // are called on the worker thread. |
kinuko
2015/02/04 15:39:30
Please update this comment too.
nhiroki
2015/02/05 08:36:38
Done.
| |
58 // FIXME: Split this into EmbeddedWorkerContextClient and | 59 // FIXME: Split this into EmbeddedWorkerContextClient and |
59 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker | 60 // ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker |
60 // framework for other implementation (like SharedWorker). | 61 // framework for other implementation (like SharedWorker). |
61 class WebServiceWorkerContextClient { | 62 class WebServiceWorkerContextClient { |
62 public: | 63 public: |
63 virtual ~WebServiceWorkerContextClient() { } | 64 virtual ~WebServiceWorkerContextClient() { } |
64 | 65 |
65 // ServiceWorker specific method. | 66 // ServiceWorker specific method. |
66 virtual WebServiceWorkerCacheStorage* cacheStorage() { return 0; } | 67 virtual WebServiceWorkerCacheStorage* cacheStorage() { return 0; } |
67 | 68 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 virtual void didHandleSyncEvent(int syncEventID) { } | 142 virtual void didHandleSyncEvent(int syncEventID) { } |
142 | 143 |
143 // ServiceWorker specific method. Called after CrossOriginConnectEvent | 144 // ServiceWorker specific method. Called after CrossOriginConnectEvent |
144 // (dispatched via WebServiceWorkerContextProxy) is handled by the | 145 // (dispatched via WebServiceWorkerContextProxy) is handled by the |
145 // ServiceWorker's script context. | 146 // ServiceWorker's script context. |
146 virtual void didHandleCrossOriginConnectEvent(int connectEventID, bool accep tConnect) { } | 147 virtual void didHandleCrossOriginConnectEvent(int connectEventID, bool accep tConnect) { } |
147 | 148 |
148 // Ownership of the returned object is transferred to the caller. | 149 // Ownership of the returned object is transferred to the caller. |
149 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider( WebDataSource*) { return 0; } | 150 virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider( WebDataSource*) { return 0; } |
150 | 151 |
152 // Ownership of the returned object is transferred to the caller. | |
153 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { return 0; } | |
154 | |
151 // Ownership of the passed callbacks is transferred to the callee, callee | 155 // Ownership of the passed callbacks is transferred to the callee, callee |
152 // should delete the callbacks after calling either onSuccess or onError. | 156 // should delete the callbacks after calling either onSuccess or onError. |
153 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are | 157 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are |
154 // passed to the WebServiceWorkerClientsCallbacks implementation. | 158 // passed to the WebServiceWorkerClientsCallbacks implementation. |
155 virtual void getClients(WebServiceWorkerClientsCallbacks*) { BLINK_ASSERT_NO T_REACHED(); } | 159 virtual void getClients(WebServiceWorkerClientsCallbacks*) { BLINK_ASSERT_NO T_REACHED(); } |
156 | 160 |
157 // Callee receives ownership of the passed vector. | 161 // Callee receives ownership of the passed vector. |
158 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175 3 | 162 // 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(); } | 163 virtual void postMessageToClient(int clientID, const WebString&, WebMessageP ortChannelArray*) { BLINK_ASSERT_NOT_REACHED(); } |
160 | 164 |
(...skipping 17 matching lines...) Expand all Loading... | |
178 // is present. https://crbug.com/437149 | 182 // is present. https://crbug.com/437149 |
179 bool result = true; | 183 bool result = true; |
180 callback->onSuccess(&result); | 184 callback->onSuccess(&result); |
181 delete callback; | 185 delete callback; |
182 } | 186 } |
183 }; | 187 }; |
184 | 188 |
185 } // namespace blink | 189 } // namespace blink |
186 | 190 |
187 #endif // WebServiceWorkerContextClient_h | 191 #endif // WebServiceWorkerContextClient_h |
OLD | NEW |