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

Side by Side Diff: content/renderer/service_worker/service_worker_script_context.cc

Issue 921013002: Optionally have MessagePort pass data as base::Value, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-move-v8-value-converter
Patch Set: Update singly-included comment Created 5 years, 9 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
« no previous file with comments | « content/public/common/message_port_types.cc ('k') | no next file » | 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/renderer/service_worker/service_worker_script_context.h" 5 #include "content/renderer/service_worker/service_worker_script_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "content/child/notifications/notification_data_conversions.h" 10 #include "content/child/notifications/notification_data_conversions.h"
(...skipping 28 matching lines...) Expand all
39 routing_id, client_id, message, 39 routing_id, client_id, message,
40 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels.release()))); 40 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels.release())));
41 } 41 }
42 42
43 void SendCrossOriginMessageToClientOnMainThread( 43 void SendCrossOriginMessageToClientOnMainThread(
44 ThreadSafeSender* sender, 44 ThreadSafeSender* sender,
45 int message_port_id, 45 int message_port_id,
46 const base::string16& message, 46 const base::string16& message,
47 scoped_ptr<blink::WebMessagePortChannelArray> channels) { 47 scoped_ptr<blink::WebMessagePortChannelArray> channels) {
48 sender->Send(new MessagePortHostMsg_PostMessage( 48 sender->Send(new MessagePortHostMsg_PostMessage(
49 message_port_id, message, 49 message_port_id,
50 WebMessagePortChannelImpl::ExtractMessagePortIDs(channels.release()))); 50 MessagePortMessage(message),
51 WebMessagePortChannelImpl::ExtractMessagePortIDs(
52 channels.release())));
51 } 53 }
52 54
53 blink::WebURLRequest::FetchRequestMode GetBlinkFetchRequestMode( 55 blink::WebURLRequest::FetchRequestMode GetBlinkFetchRequestMode(
54 FetchRequestMode mode) { 56 FetchRequestMode mode) {
55 return static_cast<blink::WebURLRequest::FetchRequestMode>(mode); 57 return static_cast<blink::WebURLRequest::FetchRequestMode>(mode);
56 } 58 }
57 59
58 blink::WebURLRequest::FetchCredentialsMode GetBlinkFetchCredentialsMode( 60 blink::WebURLRequest::FetchCredentialsMode GetBlinkFetchCredentialsMode(
59 FetchCredentialsMode credentials_mode) { 61 FetchCredentialsMode credentials_mode) {
60 return static_cast<blink::WebURLRequest::FetchCredentialsMode>( 62 return static_cast<blink::WebURLRequest::FetchCredentialsMode>(
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 new blink::WebServiceWorkerError(error_type, message)); 585 new blink::WebServiceWorkerError(error_type, message));
584 callbacks->onError(error.release()); 586 callbacks->onError(error.release());
585 pending_claim_clients_callbacks_.Remove(request_id); 587 pending_claim_clients_callbacks_.Remove(request_id);
586 } 588 }
587 589
588 void ServiceWorkerScriptContext::OnPing() { 590 void ServiceWorkerScriptContext::OnPing() {
589 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); 591 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID()));
590 } 592 }
591 593
592 } // namespace content 594 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/message_port_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698