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

Side by Side Diff: public/web/WebServiceWorkerContextClient.h

Issue 900793002: ServiceWorker: Support SWRegistration.unregister() in SWGlobalScope [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: return nullptr instead of 0 Created 5 years, 10 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 29 matching lines...) Expand all
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.
falken 2015/02/05 12:07:57 My comment on the chromium patch also applies here
nhiroki 2015/02/06 03:49:29 Done.
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 nullptr; }
67 69
68 // ServiceWorker specific method. Called when script accesses the 70 // ServiceWorker specific method. Called when script accesses the
69 // the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec . 71 // the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec .
70 virtual WebURL scope() const { return WebURL(); } 72 virtual WebURL scope() const { return WebURL(); }
71 73
72 // If the worker was started with WebEmbeddedWorkerStartData indicating to p ause 74 // If the worker was started with WebEmbeddedWorkerStartData indicating to p ause
73 // after download, this method is called after the main script resource has been 75 // after download, this method is called after the main script resource has been
74 // downloaded. The scope will not be created and the script will not be load ed until 76 // downloaded. The scope will not be created and the script will not be load ed until
75 // WebEmbeddedWorker.resumeAfterDownload() is invoked. 77 // WebEmbeddedWorker.resumeAfterDownload() is invoked.
76 virtual void didPauseAfterDownload() { } 78 virtual void didPauseAfterDownload() { }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script 141 // WebServiceWorkerContextProxy) is handled by the ServiceWorker's script
140 // context. 142 // context.
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 nullptr; }
152
153 // Ownership of the returned object is transferred to the caller.
154 virtual WebServiceWorkerProvider* createServiceWorkerProvider() { return nul lptr; }
150 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(); }
(...skipping 18 matching lines...) Expand all
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698