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

Side by Side Diff: content/browser/service_worker/service_worker_version.h

Issue 771103002: Implement ServiceWorkerClient attributes [2/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } 245 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; }
246 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } 246 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); }
247 247
248 // Dooms this version to have REDUNDANT status and its resources deleted. If 248 // Dooms this version to have REDUNDANT status and its resources deleted. If
249 // the version is controlling a page, these changes will happen when the 249 // the version is controlling a page, these changes will happen when the
250 // version no longer controls any pages. 250 // version no longer controls any pages.
251 void Doom(); 251 void Doom();
252 bool is_doomed() const { return is_doomed_; } 252 bool is_doomed() const { return is_doomed_; }
253 253
254 private: 254 private:
255 class GetClientDocumentsCallback;
256 class GetClientInfoCallback;
257
255 friend class base::RefCounted<ServiceWorkerVersion>; 258 friend class base::RefCounted<ServiceWorkerVersion>;
256 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, 259 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest,
257 ActivateWaitingVersion); 260 ActivateWaitingVersion);
258 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); 261 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker);
259 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); 262 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability);
260 typedef ServiceWorkerVersion self; 263 typedef ServiceWorkerVersion self;
261 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; 264 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap;
262 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap; 265 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap;
263 266
264 ~ServiceWorkerVersion() override; 267 ~ServiceWorkerVersion() override;
(...skipping 18 matching lines...) Expand all
283 const StatusCallback& callback); 286 const StatusCallback& callback);
284 void DispatchActivateEventAfterStartWorker(const StatusCallback& callback); 287 void DispatchActivateEventAfterStartWorker(const StatusCallback& callback);
285 288
286 void DispatchMessageEventInternal( 289 void DispatchMessageEventInternal(
287 const base::string16& message, 290 const base::string16& message,
288 const std::vector<int>& sent_message_port_ids, 291 const std::vector<int>& sent_message_port_ids,
289 const StatusCallback& callback); 292 const StatusCallback& callback);
290 293
291 // Message handlers. 294 // Message handlers.
292 void OnGetClientDocuments(int request_id); 295 void OnGetClientDocuments(int request_id);
296 void OnGetClientInfoSuccess(int request_id,
297 const ServiceWorkerClientInfo& info);
298 void OnGetClientInfoError(int request_id);
293 void OnActivateEventFinished(int request_id, 299 void OnActivateEventFinished(int request_id,
294 blink::WebServiceWorkerEventResult result); 300 blink::WebServiceWorkerEventResult result);
295 void OnInstallEventFinished(int request_id, 301 void OnInstallEventFinished(int request_id,
296 blink::WebServiceWorkerEventResult result); 302 blink::WebServiceWorkerEventResult result);
297 void OnFetchEventFinished(int request_id, 303 void OnFetchEventFinished(int request_id,
298 ServiceWorkerFetchEventResult result, 304 ServiceWorkerFetchEventResult result,
299 const ServiceWorkerResponse& response); 305 const ServiceWorkerResponse& response);
300 void OnSyncEventFinished(int request_id); 306 void OnSyncEventFinished(int request_id);
301 void OnNotificationClickEventFinished(int request_id); 307 void OnNotificationClickEventFinished(int request_id);
302 void OnPushEventFinished(int request_id, 308 void OnPushEventFinished(int request_id,
(...skipping 20 matching lines...) Expand all
323 std::vector<base::Closure> status_change_callbacks_; 329 std::vector<base::Closure> status_change_callbacks_;
324 330
325 // Message callbacks. 331 // Message callbacks.
326 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; 332 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_;
327 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; 333 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_;
328 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; 334 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_;
329 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; 335 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_;
330 IDMap<StatusCallback, IDMapOwnPointer> notification_click_callbacks_; 336 IDMap<StatusCallback, IDMapOwnPointer> notification_click_callbacks_;
331 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; 337 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_;
332 IDMap<StatusCallback, IDMapOwnPointer> geofencing_callbacks_; 338 IDMap<StatusCallback, IDMapOwnPointer> geofencing_callbacks_;
339 IDMap<GetClientInfoCallback, IDMapOwnPointer> get_client_info_callbacks_;
333 340
334 ControlleeMap controllee_map_; 341 ControlleeMap controllee_map_;
335 ControlleeByIDMap controllee_by_id_; 342 ControlleeByIDMap controllee_by_id_;
336 base::WeakPtr<ServiceWorkerContextCore> context_; 343 base::WeakPtr<ServiceWorkerContextCore> context_;
337 ObserverList<Listener> listeners_; 344 ObserverList<Listener> listeners_;
338 ServiceWorkerScriptCacheMap script_cache_map_; 345 ServiceWorkerScriptCacheMap script_cache_map_;
339 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; 346 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_;
340 base::OneShotTimer<ServiceWorkerVersion> update_timer_; 347 base::OneShotTimer<ServiceWorkerVersion> update_timer_;
341 bool is_doomed_; 348 bool is_doomed_;
342 349
343 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 350 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
344 351
345 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 352 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
346 }; 353 };
347 354
348 } // namespace content 355 } // namespace content
349 356
350 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 357 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698