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

Side by Side Diff: public/platform/WebServiceWorkerProvider.h

Issue 512163002: ServiceWorker: Change the return value of ServiceWorkerRegistration::unregister to boolean (3/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class WebString; 38 class WebString;
39 class WebURL; 39 class WebURL;
40 class WebServiceWorker; 40 class WebServiceWorker;
41 class WebServiceWorkerProviderClient; 41 class WebServiceWorkerProviderClient;
42 class WebServiceWorkerRegistration; 42 class WebServiceWorkerRegistration;
43 struct WebServiceWorkerError; 43 struct WebServiceWorkerError;
44 44
45 // FIXME: Remove this macro after the chromium side patch is applied
46 // See: https://crbug.com/390894
47 #define DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN
48
49 // Created on the main thread, and may be passed to another script context 45 // Created on the main thread, and may be passed to another script context
50 // thread (e.g. worker thread) later. All methods of this class must be called 46 // thread (e.g. worker thread) later. All methods of this class must be called
51 // on the single script context thread. 47 // on the single script context thread.
52 class WebServiceWorkerProvider { 48 class WebServiceWorkerProvider {
53 public: 49 public:
54 // Called when a client wants to start listening to the service worker 50 // Called when a client wants to start listening to the service worker
55 // events. Must be cleared before the client becomes invalid. 51 // events. Must be cleared before the client becomes invalid.
56 virtual void setClient(WebServiceWorkerProviderClient*) { } 52 virtual void setClient(WebServiceWorkerProviderClient*) { }
57 53
58 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are 54 // The WebServiceWorkerRegistration and WebServiceWorkerError ownership are
59 // passed to the WebServiceWorkerRegistrationCallbacks implementation. 55 // passed to the WebServiceWorkerRegistrationCallbacks implementation.
60 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks; 56 typedef WebCallbacks<WebServiceWorkerRegistration, WebServiceWorkerError> We bServiceWorkerRegistrationCallbacks;
61 #ifdef DISABLE_SERVICEWORKER_UNREGISTER_RESOLVE_TO_BOOLEAN
62 typedef WebServiceWorkerRegistrationCallbacks WebServiceWorkerUnregistration Callbacks;
63 #else
64 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra tionCallbacks; 57 typedef WebCallbacks<bool, WebServiceWorkerError> WebServiceWorkerUnregistra tionCallbacks;
65 #endif
66 58
67 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { } 59 virtual void registerServiceWorker(const WebURL& pattern, const WebURL& scri ptUrl, WebServiceWorkerRegistrationCallbacks*) { }
68 60
69 // Unregisters the ServiceWorker for a given scope. 61 // Unregisters the ServiceWorker for a given scope.
70 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker UnregistrationCallbacks*) { } 62 virtual void unregisterServiceWorker(const WebURL& pattern, WebServiceWorker UnregistrationCallbacks*) { }
71 63
72 virtual ~WebServiceWorkerProvider() { } 64 virtual ~WebServiceWorkerProvider() { }
73 }; 65 };
74 66
75 } // namespace blink 67 } // namespace blink
76 68
77 #endif 69 #endif
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerRegistration.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698