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

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

Issue 669303003: ServiceWorker: Make a way to retrieve a service worker version id (Chromium) (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_handle_reference.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_handle.h" 5 #include "content/browser/service_worker/service_worker_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_registration.h" 8 #include "content/browser/service_worker/service_worker_registration.h"
9 #include "content/common/service_worker/service_worker_messages.h" 9 #include "content/common/service_worker/service_worker_messages.h"
10 #include "ipc/ipc_sender.h" 10 #include "ipc/ipc_sender.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 sender_->Send(new ServiceWorkerMsg_ServiceWorkerStateChanged( 105 sender_->Send(new ServiceWorkerMsg_ServiceWorkerStateChanged(
106 thread_id_, handle_id_, GetWebServiceWorkerState(version))); 106 thread_id_, handle_id_, GetWebServiceWorkerState(version)));
107 } 107 }
108 108
109 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() { 109 ServiceWorkerObjectInfo ServiceWorkerHandle::GetObjectInfo() {
110 ServiceWorkerObjectInfo info; 110 ServiceWorkerObjectInfo info;
111 info.handle_id = handle_id_; 111 info.handle_id = handle_id_;
112 info.scope = registration_->pattern(); 112 info.scope = registration_->pattern();
113 info.url = version_->script_url(); 113 info.url = version_->script_url();
114 info.state = GetWebServiceWorkerState(version_.get()); 114 info.state = GetWebServiceWorkerState(version_.get());
115 info.version_id = version_->version_id();
115 return info; 116 return info;
116 } 117 }
117 118
118 void ServiceWorkerHandle::IncrementRefCount() { 119 void ServiceWorkerHandle::IncrementRefCount() {
119 DCHECK_GT(ref_count_, 0); 120 DCHECK_GT(ref_count_, 0);
120 ++ref_count_; 121 ++ref_count_;
121 } 122 }
122 123
123 void ServiceWorkerHandle::DecrementRefCount() { 124 void ServiceWorkerHandle::DecrementRefCount() {
124 DCHECK_GE(ref_count_, 0); 125 DCHECK_GE(ref_count_, 0);
125 --ref_count_; 126 --ref_count_;
126 } 127 }
127 128
128 } // namespace content 129 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_handle_reference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698