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 20 matching lines...) Expand all Loading... | |
| 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/WebURL.h" | 35 #include "public/platform/WebURL.h" |
| 36 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall backs.h" | 36 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsClaimCall backs.h" |
| 37 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" | 37 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" |
| 38 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" | 38 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" |
| 39 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb acks.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerSkipWaitingCallb acks.h" |
| 40 #include "public/web/WebDevToolsAgentClient.h" | 40 #include "public/web/WebDevToolsAgentClient.h" |
| 41 #include <memory> | |
| 42 #include <utility> | |
|
danakj
2016/11/30 00:34:01
same
| |
| 41 #include <v8.h> | 43 #include <v8.h> |
| 42 | 44 |
| 43 namespace blink { | 45 namespace blink { |
| 44 | 46 |
| 45 struct WebCrossOriginServiceWorkerClient; | 47 struct WebCrossOriginServiceWorkerClient; |
| 46 struct WebServiceWorkerClientQueryOptions; | 48 struct WebServiceWorkerClientQueryOptions; |
| 47 class WebDataSource; | 49 class WebDataSource; |
| 48 class WebServiceWorkerContextProxy; | 50 class WebServiceWorkerContextProxy; |
| 49 class WebServiceWorkerNetworkProvider; | 51 class WebServiceWorkerNetworkProvider; |
| 50 class WebServiceWorkerProvider; | 52 class WebServiceWorkerProvider; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 // This is called on the main thread. | 202 // This is called on the main thread. |
| 201 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { | 203 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { |
| 202 return nullptr; | 204 return nullptr; |
| 203 } | 205 } |
| 204 | 206 |
| 205 // Ownership of the passed callbacks is transferred to the callee, callee | 207 // Ownership of the passed callbacks is transferred to the callee, callee |
| 206 // should delete the callbacks after calling either onSuccess or onError. | 208 // should delete the callbacks after calling either onSuccess or onError. |
| 207 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are | 209 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are |
| 208 // passed to the WebServiceWorkerClientCallbacks implementation. | 210 // passed to the WebServiceWorkerClientCallbacks implementation. |
| 209 virtual void getClient(const WebString&, | 211 virtual void getClient(const WebString&, |
| 210 WebServiceWorkerClientCallbacks*) = 0; | 212 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; |
| 211 | 213 |
| 212 // Ownership of the passed callbacks is transferred to the callee, callee | 214 // Ownership of the passed callbacks is transferred to the callee, callee |
| 213 // should delete the callbacks after calling either onSuccess or onError. | 215 // should delete the callbacks after calling either onSuccess or onError. |
| 214 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are | 216 // WebServiceWorkerClientsInfo and WebServiceWorkerError ownerships are |
| 215 // passed to the WebServiceWorkerClientsCallbacks implementation. | 217 // passed to the WebServiceWorkerClientsCallbacks implementation. |
| 216 virtual void getClients(const WebServiceWorkerClientQueryOptions&, | 218 virtual void getClients( |
| 217 WebServiceWorkerClientsCallbacks*) = 0; | 219 const WebServiceWorkerClientQueryOptions&, |
| 220 std::unique_ptr<WebServiceWorkerClientsCallbacks>) = 0; | |
| 218 | 221 |
| 219 // Ownership of the passed callbacks is transferred to the callee, callee | 222 // Ownership of the passed callbacks is transferred to the callee, callee |
| 220 // should delete the callbacks after calling either onSuccess or onError. | 223 // should delete the callbacks after calling either onSuccess or onError. |
| 221 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are | 224 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are |
| 222 // passed to the WebServiceWorkerClientsCallbacks implementation. | 225 // passed to the WebServiceWorkerClientsCallbacks implementation. |
| 223 virtual void openWindow(const WebURL&, WebServiceWorkerClientCallbacks*) = 0; | 226 virtual void openWindow(const WebURL&, |
| 227 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; | |
| 224 | 228 |
| 225 // A suggestion to cache this metadata in association with this URL. | 229 // A suggestion to cache this metadata in association with this URL. |
| 226 virtual void setCachedMetadata(const WebURL& url, | 230 virtual void setCachedMetadata(const WebURL& url, |
| 227 const char* data, | 231 const char* data, |
| 228 size_t size) {} | 232 size_t size) {} |
| 229 | 233 |
| 230 // A suggestion to clear the cached metadata in association with this URL. | 234 // A suggestion to clear the cached metadata in association with this URL. |
| 231 virtual void clearCachedMetadata(const WebURL& url) {} | 235 virtual void clearCachedMetadata(const WebURL& url) {} |
| 232 | 236 |
| 233 // Callee receives ownership of the passed vector. | 237 // Callee receives ownership of the passed vector. |
| 234 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 | 238 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 |
| 235 virtual void postMessageToClient(const WebString& uuid, | 239 virtual void postMessageToClient(const WebString& uuid, |
| 236 const WebString&, | 240 const WebString&, |
| 237 WebMessagePortChannelArray*) = 0; | 241 WebMessagePortChannelArray*) = 0; |
| 238 | 242 |
| 239 // Callee receives ownership of the passed vector. | 243 // Callee receives ownership of the passed vector. |
| 240 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 | 244 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753 |
| 241 virtual void postMessageToCrossOriginClient( | 245 virtual void postMessageToCrossOriginClient( |
| 242 const WebCrossOriginServiceWorkerClient&, | 246 const WebCrossOriginServiceWorkerClient&, |
| 243 const WebString&, | 247 const WebString&, |
| 244 WebMessagePortChannelArray*) = 0; | 248 WebMessagePortChannelArray*) = 0; |
| 245 | 249 |
| 246 // Ownership of the passed callbacks is transferred to the callee, callee | 250 // Ownership of the passed callbacks is transferred to the callee, callee |
| 247 // should delete the callbacks after run. | 251 // should delete the callbacks after run. |
| 248 virtual void skipWaiting(WebServiceWorkerSkipWaitingCallbacks*) = 0; | 252 virtual void skipWaiting( |
| 253 std::unique_ptr<WebServiceWorkerSkipWaitingCallbacks>) = 0; | |
| 249 | 254 |
| 250 // Ownership of the passed callbacks is transferred to the callee, callee | 255 // Ownership of the passed callbacks is transferred to the callee, callee |
| 251 // should delete the callbacks after run. | 256 // should delete the callbacks after run. |
| 252 virtual void claim(WebServiceWorkerClientsClaimCallbacks*) = 0; | 257 virtual void claim( |
| 258 std::unique_ptr<WebServiceWorkerClientsClaimCallbacks>) = 0; | |
| 253 | 259 |
| 254 // Ownership of the passed callbacks is transferred to the callee, callee | 260 // Ownership of the passed callbacks is transferred to the callee, callee |
| 255 // should delete the callback after calling either onSuccess or onError. | 261 // should delete the callback after calling either onSuccess or onError. |
| 256 virtual void focus(const WebString& uuid, | 262 virtual void focus(const WebString& uuid, |
| 257 WebServiceWorkerClientCallbacks*) = 0; | 263 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; |
| 258 | 264 |
| 259 // Ownership of the passed callbacks is transferred to the callee, callee | 265 // Ownership of the passed callbacks is transferred to the callee, callee |
| 260 // should delete the callbacks after calling either onSuccess or onError. | 266 // should delete the callbacks after calling either onSuccess or onError. |
| 261 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are | 267 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are |
| 262 // passed to the WebServiceWorkerClientsCallbacks implementation. | 268 // passed to the WebServiceWorkerClientsCallbacks implementation. |
| 263 virtual void navigate(const WebString& uuid, | 269 virtual void navigate(const WebString& uuid, |
| 264 const WebURL&, | 270 const WebURL&, |
| 265 WebServiceWorkerClientCallbacks*) = 0; | 271 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; |
| 266 | 272 |
| 267 // Called when the worker wants to register subscopes to handle via foreign | 273 // Called when the worker wants to register subscopes to handle via foreign |
| 268 // fetch. Will only be called while an install event is in progress. | 274 // fetch. Will only be called while an install event is in progress. |
| 269 virtual void registerForeignFetchScopes( | 275 virtual void registerForeignFetchScopes( |
| 270 const WebVector<WebURL>& subScopes, | 276 const WebVector<WebURL>& subScopes, |
| 271 const WebVector<WebSecurityOrigin>& origins) = 0; | 277 const WebVector<WebSecurityOrigin>& origins) = 0; |
| 272 }; | 278 }; |
| 273 | 279 |
| 274 } // namespace blink | 280 } // namespace blink |
| 275 | 281 |
| 276 #endif // WebServiceWorkerContextClient_h | 282 #endif // WebServiceWorkerContextClient_h |
| OLD | NEW |