| OLD | NEW |
| 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_REGISTRATION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // includes managing which ServiceWorkerVersion is "active" vs "in | 33 // includes managing which ServiceWorkerVersion is "active" vs "in |
| 34 // waiting" (or "pending") | 34 // waiting" (or "pending") |
| 35 class CONTENT_EXPORT ServiceWorkerRegistration | 35 class CONTENT_EXPORT ServiceWorkerRegistration |
| 36 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { | 36 : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { |
| 37 public: | 37 public: |
| 38 ServiceWorkerRegistration(const GURL& pattern, | 38 ServiceWorkerRegistration(const GURL& pattern, |
| 39 const GURL& script_url, | 39 const GURL& script_url, |
| 40 int64 registration_id, | 40 int64 registration_id, |
| 41 base::WeakPtr<ServiceWorkerContextCore> context); | 41 base::WeakPtr<ServiceWorkerContextCore> context); |
| 42 | 42 |
| 43 void Shutdown(); | |
| 44 bool is_shutdown() const { return is_shutdown_; } | |
| 45 | |
| 46 int64 id() const { return registration_id_; } | 43 int64 id() const { return registration_id_; } |
| 47 const GURL& script_url() const { return script_url_; } | 44 const GURL& script_url() const { return script_url_; } |
| 48 const GURL& pattern() const { return pattern_; } | 45 const GURL& pattern() const { return pattern_; } |
| 49 | 46 |
| 50 ServiceWorkerVersion* active_version() const { | 47 ServiceWorkerVersion* active_version() const { |
| 51 DCHECK(!is_shutdown_); | 48 DCHECK(!is_shutdown_); |
| 52 return active_version_.get(); | 49 return active_version_.get(); |
| 53 } | 50 } |
| 54 | 51 |
| 55 ServiceWorkerVersion* pending_version() const { | 52 ServiceWorkerVersion* pending_version() const { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 scoped_refptr<ServiceWorkerVersion> active_version_; | 85 scoped_refptr<ServiceWorkerVersion> active_version_; |
| 89 scoped_refptr<ServiceWorkerVersion> pending_version_; | 86 scoped_refptr<ServiceWorkerVersion> pending_version_; |
| 90 | 87 |
| 91 bool is_shutdown_; | 88 bool is_shutdown_; |
| 92 base::WeakPtr<ServiceWorkerContextCore> context_; | 89 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 93 | 90 |
| 94 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 91 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
| 95 }; | 92 }; |
| 96 } // namespace content | 93 } // namespace content |
| 97 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 94 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| OLD | NEW |