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

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

Issue 360123002: ServiceWorker: some more groundwork in support of the update process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 20 matching lines...) Expand all
31 class ServiceWorkerContextCore; 31 class ServiceWorkerContextCore;
32 class ServiceWorkerProviderHost; 32 class ServiceWorkerProviderHost;
33 class ServiceWorkerRegistration; 33 class ServiceWorkerRegistration;
34 class ServiceWorkerVersionInfo; 34 class ServiceWorkerVersionInfo;
35 35
36 // This class corresponds to a specific version of a ServiceWorker 36 // This class corresponds to a specific version of a ServiceWorker
37 // script for a given pattern. When a script is upgraded, there may be 37 // script for a given pattern. When a script is upgraded, there may be
38 // more than one ServiceWorkerVersion "running" at a time, but only 38 // more than one ServiceWorkerVersion "running" at a time, but only
39 // one of them is active. This class connects the actual script with a 39 // one of them is active. This class connects the actual script with a
40 // running worker. 40 // running worker.
41 //
42 // is_shutdown_ detects the live-ness of the object itself. If the object is
43 // shut down, then it is in the process of being deleted from memory.
44 // This happens when a version is replaced as well as at browser shutdown.
45 class CONTENT_EXPORT ServiceWorkerVersion 41 class CONTENT_EXPORT ServiceWorkerVersion
46 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>), 42 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>),
47 public EmbeddedWorkerInstance::Listener { 43 public EmbeddedWorkerInstance::Listener {
48 public: 44 public:
49 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; 45 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback;
50 typedef base::Callback<void(ServiceWorkerStatusCode, 46 typedef base::Callback<void(ServiceWorkerStatusCode,
51 const IPC::Message& message)> MessageCallback; 47 const IPC::Message& message)> MessageCallback;
52 typedef base::Callback<void(ServiceWorkerStatusCode, 48 typedef base::Callback<void(ServiceWorkerStatusCode,
53 ServiceWorkerFetchEventResult, 49 ServiceWorkerFetchEventResult,
54 const ServiceWorkerResponse&)> FetchCallback; 50 const ServiceWorkerResponse&)> FetchCallback;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 base::OneShotTimer<ServiceWorkerVersion> update_timer_; 286 base::OneShotTimer<ServiceWorkerVersion> update_timer_;
291 287
292 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 288 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
293 289
294 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 290 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
295 }; 291 };
296 292
297 } // namespace content 293 } // namespace content
298 294
299 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 295 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698