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

Side by Side Diff: content/child/service_worker/web_service_worker_impl.cc

Issue 1221643014: Service Worker: Migrate to version_uuid and surface ServiceWorker.id. (Chromium 2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 #include "content/child/service_worker/web_service_worker_impl.h" 5 #include "content/child/service_worker/web_service_worker_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
10 #include "content/child/webmessageportchannel_impl.h" 10 #include "content/child/webmessageportchannel_impl.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 blink::WebURL WebServiceWorkerImpl::url() const { 58 blink::WebURL WebServiceWorkerImpl::url() const {
59 return handle_ref_->url(); 59 return handle_ref_->url();
60 } 60 }
61 61
62 blink::WebServiceWorkerState WebServiceWorkerImpl::state() const { 62 blink::WebServiceWorkerState WebServiceWorkerImpl::state() const {
63 return state_; 63 return state_;
64 } 64 }
65 65
66 blink::WebString WebServiceWorkerImpl::id() const {
67 return blink::WebString::fromUTF8(handle_ref_->id());
68 }
69
66 void WebServiceWorkerImpl::postMessage(const WebString& message, 70 void WebServiceWorkerImpl::postMessage(const WebString& message,
67 WebMessagePortChannelArray* channels) { 71 WebMessagePortChannelArray* channels) {
68 thread_safe_sender_->Send(new ServiceWorkerHostMsg_PostMessageToWorker( 72 thread_safe_sender_->Send(new ServiceWorkerHostMsg_PostMessageToWorker(
69 handle_ref_->handle_id(), 73 handle_ref_->handle_id(),
70 message, 74 message,
71 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels))); 75 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels)));
72 } 76 }
73 77
74 void WebServiceWorkerImpl::terminate() { 78 void WebServiceWorkerImpl::terminate() {
75 thread_safe_sender_->Send( 79 thread_safe_sender_->Send(
76 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id())); 80 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id()));
77 } 81 }
78 82
79 } // namespace content 83 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/web_service_worker_impl.h ('k') | content/common/service_worker/embedded_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698