 Chromium Code Reviews
 Chromium Code Reviews Issue 62203007:
  Implement memory-persistent registration  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 62203007:
  Implement memory-persistent registration  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "content/browser/service_worker/service_worker_storage.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 class ServiceWorkerRegisterJob { | |
| 
kinuko
2013/11/25 08:17:10
It feels this job's basically providing implementa
 
alecflett
2013/11/26 00:19:14
Not exactly... There may be one or more ServiceWor
 
kinuko
2013/11/26 08:02:00
Ok, the class structure (storage class starts this
 | |
| 14 public: | |
| 15 typedef base::Callback< | |
| 16 void(ServiceWorkerRegisterJob*, ServiceWorkerRegistration*)> | |
| 17 RegistrationCompleteCallback; | |
| 18 | |
| 19 ServiceWorkerRegisterJob(const base::WeakPtr<ServiceWorkerStorage>& storage, | |
| 20 const RegistrationCompleteCallback& callback); | |
| 21 ~ServiceWorkerRegisterJob(); | |
| 22 void StartRegister(const GURL& pattern, const GURL& script_url); | |
| 23 void StartUnregister(const GURL& pattern); | |
| 24 | |
| 25 private: | |
| 26 void RegisterPatternAndContinue( | |
| 27 const GURL& pattern, | |
| 28 const GURL& script_url, | |
| 29 const ServiceWorkerStorage::ResponseCallback callback); | |
| 30 | |
| 31 void UnregisterPatternAndContinue( | |
| 32 const GURL& pattern, | |
| 33 const GURL& script_url, | |
| 34 const base::Closure& callback, | |
| 35 const scoped_refptr<ServiceWorkerRegistration>& previous_registration); | |
| 36 | |
| 37 void UnregisterComplete(); | |
| 38 void RegisterComplete( | |
| 39 const scoped_refptr<ServiceWorkerRegistration>& registration); | |
| 40 | |
| 41 const base::WeakPtr<ServiceWorkerStorage> storage_; | |
| 42 const RegistrationCompleteCallback callback_; | |
| 43 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); | |
| 46 }; | |
| 47 } // namespace content | |
| 48 | |
| 49 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | |
| OLD | NEW |