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

Side by Side Diff: content/browser/service_worker/service_worker_registration_handle.cc

Issue 486083002: ServiceWorker: Introduce ServiceWorkerRegistrationObjectInfo for cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/service_worker/service_worker_registration_handle.h" 5 #include "content/browser/service_worker/service_worker_registration_handle.h"
6 6
7 #include "content/browser/service_worker/service_worker_context_core.h" 7 #include "content/browser/service_worker/service_worker_context_core.h"
8 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 8 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
9 #include "content/browser/service_worker/service_worker_handle.h" 9 #include "content/browser/service_worker/service_worker_handle.h"
10 #include "content/common/service_worker/service_worker_messages.h" 10 #include "content/common/service_worker/service_worker_messages.h"
(...skipping 19 matching lines...) Expand all
30 registration->waiting_version(), 30 registration->waiting_version(),
31 registration->active_version()); 31 registration->active_version());
32 registration_->AddListener(this); 32 registration_->AddListener(this);
33 } 33 }
34 34
35 ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() { 35 ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() {
36 DCHECK(registration_); 36 DCHECK(registration_);
37 registration_->RemoveListener(this); 37 registration_->RemoveListener(this);
38 } 38 }
39 39
40 ServiceWorkerRegistrationObjectInfo
41 ServiceWorkerRegistrationHandle::GetObjectInfo() {
42 ServiceWorkerRegistrationObjectInfo info;
43 info.handle_id = handle_id_;
44 info.scope = registration_->pattern();
45 return info;
46 }
47
40 void ServiceWorkerRegistrationHandle::IncrementRefCount() { 48 void ServiceWorkerRegistrationHandle::IncrementRefCount() {
41 DCHECK_GT(ref_count_, 0); 49 DCHECK_GT(ref_count_, 0);
42 ++ref_count_; 50 ++ref_count_;
43 } 51 }
44 52
45 void ServiceWorkerRegistrationHandle::DecrementRefCount() { 53 void ServiceWorkerRegistrationHandle::DecrementRefCount() {
46 DCHECK_GT(ref_count_, 0); 54 DCHECK_GT(ref_count_, 0);
47 --ref_count_; 55 --ref_count_;
48 } 56 }
49 57
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 kDocumentMainThreadId, 129 kDocumentMainThreadId,
122 provider_id_, 130 provider_id_,
123 version); 131 version);
124 info = handle->GetObjectInfo(); 132 info = handle->GetObjectInfo();
125 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); 133 dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass());
126 } 134 }
127 return info; 135 return info;
128 } 136 }
129 137
130 } // namespace content 138 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698