Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextClient.h

Issue 2847983002: Use unique_ptr for Create{ServiceWorkerNetworkProvider,ApplicationCacheHost} (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 WebServiceWorkerEventResult result, 231 WebServiceWorkerEventResult result,
232 double event_dispatch_time) {} 232 double event_dispatch_time) {}
233 233
234 // ServiceWorker specific method. Called after PaymentRequestEvent (dispatched 234 // ServiceWorker specific method. Called after PaymentRequestEvent (dispatched
235 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's script 235 // via WebServiceWorkerContextProxy) is handled by the ServiceWorker's script
236 // context. 236 // context.
237 virtual void DidHandlePaymentRequestEvent(int payment_request_event_id, 237 virtual void DidHandlePaymentRequestEvent(int payment_request_event_id,
238 WebServiceWorkerEventResult result, 238 WebServiceWorkerEventResult result,
239 double event_dispatch_time) {} 239 double event_dispatch_time) {}
240 240
241 // Ownership of the returned object is transferred to the caller. 241 // Ownership of the returned object is transferred to the caller.
nhiroki 2017/05/01 05:04:28 ditto.
242 // This is called on the main thread. 242 // This is called on the main thread.
243 virtual WebServiceWorkerNetworkProvider* 243 virtual std::unique_ptr<WebServiceWorkerNetworkProvider>
244 CreateServiceWorkerNetworkProvider() { 244 CreateServiceWorkerNetworkProvider() = 0;
245 return nullptr;
246 }
247 245
248 // Creates a WebWorkerFetchContext for a service worker. Ownership of the 246 // Creates a WebWorkerFetchContext for a service worker. Ownership of the
249 // returned object is transferred to the caller. This is called on the main 247 // returned object is transferred to the caller. This is called on the main
250 // thread. This is used only when off-main-thread-fetch is enabled. 248 // thread. This is used only when off-main-thread-fetch is enabled.
251 virtual std::unique_ptr<blink::WebWorkerFetchContext> 249 virtual std::unique_ptr<blink::WebWorkerFetchContext>
252 CreateServiceWorkerFetchContext() { 250 CreateServiceWorkerFetchContext() {
253 return nullptr; 251 return nullptr;
254 } 252 }
255 253
256 // Ownership of the returned object is transferred to the caller. 254 // Ownership of the returned object is transferred to the caller.
nhiroki 2017/05/01 05:04:27 ditto.
257 // This is called on the main thread. 255 // This is called on the main thread.
258 virtual WebServiceWorkerProvider* CreateServiceWorkerProvider() { 256 virtual std::unique_ptr<WebServiceWorkerProvider>
259 return nullptr; 257 CreateServiceWorkerProvider() = 0;
260 }
261 258
262 // Ownership of the passed callbacks is transferred to the callee, callee 259 // Ownership of the passed callbacks is transferred to the callee, callee
263 // should delete the callbacks after calling either onSuccess or onError. 260 // should delete the callbacks after calling either onSuccess or onError.
264 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are 261 // WebServiceWorkerClientInfo and WebServiceWorkerError ownerships are
265 // passed to the WebServiceWorkerClientCallbacks implementation. 262 // passed to the WebServiceWorkerClientCallbacks implementation.
266 virtual void GetClient(const WebString&, 263 virtual void GetClient(const WebString&,
267 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0; 264 std::unique_ptr<WebServiceWorkerClientCallbacks>) = 0;
268 265
269 // Ownership of the passed callbacks is transferred to the callee, callee 266 // Ownership of the passed callbacks is transferred to the callee, callee
270 // should delete the callbacks after calling either onSuccess or onError. 267 // should delete the callbacks after calling either onSuccess or onError.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // Called when the worker wants to register subscopes to handle via foreign 318 // Called when the worker wants to register subscopes to handle via foreign
322 // fetch. Will only be called while an install event is in progress. 319 // fetch. Will only be called while an install event is in progress.
323 virtual void RegisterForeignFetchScopes( 320 virtual void RegisterForeignFetchScopes(
324 const WebVector<WebURL>& sub_scopes, 321 const WebVector<WebURL>& sub_scopes,
325 const WebVector<WebSecurityOrigin>& origins) = 0; 322 const WebVector<WebSecurityOrigin>& origins) = 0;
326 }; 323 };
327 324
328 } // namespace blink 325 } // namespace blink
329 326
330 #endif // WebServiceWorkerContextClient_h 327 #endif // WebServiceWorkerContextClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698