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/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 Loading... |
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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 NOTREACHED() << "Got stray response: " << request_id; | 567 NOTREACHED() << "Got stray response: " << request_id; |
566 return; | 568 return; |
567 } | 569 } |
568 scoped_ptr<blink::WebServiceWorkerError> error( | 570 scoped_ptr<blink::WebServiceWorkerError> error( |
569 new blink::WebServiceWorkerError(error_type, message)); | 571 new blink::WebServiceWorkerError(error_type, message)); |
570 callbacks->onError(error.release()); | 572 callbacks->onError(error.release()); |
571 pending_claim_clients_callbacks_.Remove(request_id); | 573 pending_claim_clients_callbacks_.Remove(request_id); |
572 } | 574 } |
573 | 575 |
574 } // namespace content | 576 } // namespace content |
OLD | NEW |