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

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

Issue 224733014: Introduce ServiceWorkerHandle for tracking WebServiceWorkerImpl reference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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_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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698