OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() { | 35 ServiceWorkerRegistrationHandle::~ServiceWorkerRegistrationHandle() { |
36 DCHECK(registration_.get()); | 36 DCHECK(registration_.get()); |
37 registration_->RemoveListener(this); | 37 registration_->RemoveListener(this); |
38 } | 38 } |
39 | 39 |
40 ServiceWorkerRegistrationObjectInfo | 40 ServiceWorkerRegistrationObjectInfo |
41 ServiceWorkerRegistrationHandle::GetObjectInfo() { | 41 ServiceWorkerRegistrationHandle::GetObjectInfo() { |
42 ServiceWorkerRegistrationObjectInfo info; | 42 ServiceWorkerRegistrationObjectInfo info; |
43 info.handle_id = handle_id_; | 43 info.handle_id = handle_id_; |
44 info.scope = registration_->pattern(); | 44 info.scope = registration_->pattern(); |
| 45 info.registration_id = registration_->id(); |
45 return info; | 46 return info; |
46 } | 47 } |
47 | 48 |
48 ServiceWorkerObjectInfo | 49 ServiceWorkerObjectInfo |
49 ServiceWorkerRegistrationHandle::CreateServiceWorkerHandleAndPass( | 50 ServiceWorkerRegistrationHandle::CreateServiceWorkerHandleAndPass( |
50 ServiceWorkerVersion* version) { | 51 ServiceWorkerVersion* version) { |
51 ServiceWorkerObjectInfo info; | 52 ServiceWorkerObjectInfo info; |
52 if (context_ && version) { | 53 if (context_ && version) { |
53 scoped_ptr<ServiceWorkerHandle> handle = | 54 scoped_ptr<ServiceWorkerHandle> handle = |
54 ServiceWorkerHandle::Create(context_, | 55 ServiceWorkerHandle::Create(context_, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 dispatcher_host_->Send(new ServiceWorkerMsg_SetVersionAttributes( | 138 dispatcher_host_->Send(new ServiceWorkerMsg_SetVersionAttributes( |
138 kDocumentMainThreadId, provider_id_, handle_id_, | 139 kDocumentMainThreadId, provider_id_, handle_id_, |
139 mask.changed(), attributes)); | 140 mask.changed(), attributes)); |
140 } | 141 } |
141 | 142 |
142 void ServiceWorkerRegistrationHandle::ClearVersionAttributes() { | 143 void ServiceWorkerRegistrationHandle::ClearVersionAttributes() { |
143 SetVersionAttributes(NULL, NULL, NULL); | 144 SetVersionAttributes(NULL, NULL, NULL); |
144 } | 145 } |
145 | 146 |
146 } // namespace content | 147 } // namespace content |
OLD | NEW |