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

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

Issue 861373002: Refactor navigator.connect code to make it more flexible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 5 years, 11 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 // 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 <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 17 matching lines...) Expand all
28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" 28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
29 29
30 class GURL; 30 class GURL;
31 31
32 namespace blink { 32 namespace blink {
33 struct WebCircularGeofencingRegion; 33 struct WebCircularGeofencingRegion;
34 } 34 }
35 35
36 namespace content { 36 namespace content {
37 37
38 struct CrossOriginServiceWorkerClient;
39 class EmbeddedWorkerRegistry; 38 class EmbeddedWorkerRegistry;
39 struct NavigatorConnectClient;
40 struct PlatformNotificationData; 40 struct PlatformNotificationData;
41 class ServiceWorkerContextCore; 41 class ServiceWorkerContextCore;
42 class ServiceWorkerProviderHost; 42 class ServiceWorkerProviderHost;
43 class ServiceWorkerRegistration; 43 class ServiceWorkerRegistration;
44 class ServiceWorkerURLRequestJob; 44 class ServiceWorkerURLRequestJob;
45 class ServiceWorkerVersionInfo; 45 class ServiceWorkerVersionInfo;
46 46
47 // This class corresponds to a specific version of a ServiceWorker 47 // This class corresponds to a specific version of a ServiceWorker
48 // script for a given pattern. When a script is upgraded, there may be 48 // script for a given pattern. When a script is upgraded, there may be
49 // more than one ServiceWorkerVersion "running" at a time, but only 49 // more than one ServiceWorkerVersion "running" at a time, but only
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 blink::WebGeofencingEventType event_type, 236 blink::WebGeofencingEventType event_type,
237 const std::string& region_id, 237 const std::string& region_id,
238 const blink::WebCircularGeofencingRegion& region); 238 const blink::WebCircularGeofencingRegion& region);
239 239
240 // Sends a cross origin connect event to the associated embedded worker and 240 // Sends a cross origin connect event to the associated embedded worker and
241 // asynchronously calls |callback| with the response from the worker. 241 // asynchronously calls |callback| with the response from the worker.
242 // 242 //
243 // This must be called when the status() is ACTIVATED. 243 // This must be called when the status() is ACTIVATED.
244 void DispatchCrossOriginConnectEvent( 244 void DispatchCrossOriginConnectEvent(
245 const CrossOriginConnectCallback& callback, 245 const CrossOriginConnectCallback& callback,
246 const CrossOriginServiceWorkerClient& client); 246 const NavigatorConnectClient& client);
247 247
248 // Sends a cross origin message event to the associated embedded worker and 248 // Sends a cross origin message event to the associated embedded worker and
249 // asynchronously calls |callback| when the message was sent (or failed to 249 // asynchronously calls |callback| when the message was sent (or failed to
250 // sent). 250 // sent).
251 // It is the responsibility of the code calling this method to make sure that 251 // It is the responsibility of the code calling this method to make sure that
252 // any transferred message ports are put on hold while potentially a process 252 // any transferred message ports are put on hold while potentially a process
253 // for the service worker is spun up. 253 // for the service worker is spun up.
254 // 254 //
255 // This must be called when the status() is ACTIVATED. 255 // This must be called when the status() is ACTIVATED.
256 void DispatchCrossOriginMessageEvent( 256 void DispatchCrossOriginMessageEvent(
257 const CrossOriginServiceWorkerClient& client, 257 const NavigatorConnectClient& client,
258 const base::string16& message, 258 const base::string16& message,
259 const std::vector<int>& sent_message_port_ids, 259 const std::vector<int>& sent_message_port_ids,
260 const StatusCallback& callback); 260 const StatusCallback& callback);
261 261
262 // Adds and removes |provider_host| as a controllee of this ServiceWorker. 262 // Adds and removes |provider_host| as a controllee of this ServiceWorker.
263 // A potential controllee is a host having the version as its .installing 263 // A potential controllee is a host having the version as its .installing
264 // or .waiting version. 264 // or .waiting version.
265 void AddControllee(ServiceWorkerProviderHost* provider_host); 265 void AddControllee(ServiceWorkerProviderHost* provider_host);
266 void RemoveControllee(ServiceWorkerProviderHost* provider_host); 266 void RemoveControllee(ServiceWorkerProviderHost* provider_host);
267 267
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 bool skip_waiting_; 411 bool skip_waiting_;
412 412
413 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 413 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
414 414
415 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 415 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
416 }; 416 };
417 417
418 } // namespace content 418 } // namespace content
419 419
420 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 420 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698