OLD | NEW |
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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3418 if (!is_swapped_out_) | 3418 if (!is_swapped_out_) |
3419 return false; | 3419 return false; |
3420 | 3420 |
3421 ViewMsg_PostMessage_Params params; | 3421 ViewMsg_PostMessage_Params params; |
3422 params.is_data_raw_string = false; | 3422 params.is_data_raw_string = false; |
3423 params.data = event.data().toString(); | 3423 params.data = event.data().toString(); |
3424 params.source_origin = event.origin(); | 3424 params.source_origin = event.origin(); |
3425 if (!target_origin.isNull()) | 3425 if (!target_origin.isNull()) |
3426 params.target_origin = target_origin.toString(); | 3426 params.target_origin = target_origin.toString(); |
3427 | 3427 |
3428 blink::WebMessagePortChannelArray channels = event.releaseChannels(); | 3428 params.message_ports = |
3429 if (!channels.isEmpty()) { | 3429 WebMessagePortChannelImpl::ExtractMessagePortIDs(event.releaseChannels()); |
3430 std::vector<int> message_port_ids(channels.size()); | |
3431 // Extract the port IDs from the channel array. | |
3432 for (size_t i = 0; i < channels.size(); ++i) { | |
3433 WebMessagePortChannelImpl* webchannel = | |
3434 static_cast<WebMessagePortChannelImpl*>(channels[i]); | |
3435 message_port_ids[i] = webchannel->message_port_id(); | |
3436 webchannel->QueueMessages(); | |
3437 DCHECK_NE(message_port_ids[i], MSG_ROUTING_NONE); | |
3438 } | |
3439 params.message_port_ids = message_port_ids; | |
3440 } | |
3441 | 3430 |
3442 // Include the routing ID for the source frame (if one exists), which the | 3431 // Include the routing ID for the source frame (if one exists), which the |
3443 // browser process will translate into the routing ID for the equivalent | 3432 // browser process will translate into the routing ID for the equivalent |
3444 // frame in the target process. | 3433 // frame in the target process. |
3445 params.source_routing_id = MSG_ROUTING_NONE; | 3434 params.source_routing_id = MSG_ROUTING_NONE; |
3446 if (source_frame) { | 3435 if (source_frame) { |
3447 RenderViewImpl* source_view = | 3436 RenderViewImpl* source_view = |
3448 RenderViewImpl::FromWebView(source_frame->view()); | 3437 RenderViewImpl::FromWebView(source_frame->view()); |
3449 if (source_view) | 3438 if (source_view) |
3450 params.source_routing_id = source_view->routing_id(); | 3439 params.source_routing_id = source_view->routing_id(); |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4454 | 4443 |
4455 #if defined(ENABLE_BROWSER_CDMS) | 4444 #if defined(ENABLE_BROWSER_CDMS) |
4456 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4445 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4457 if (!cdm_manager_) | 4446 if (!cdm_manager_) |
4458 cdm_manager_ = new RendererCdmManager(this); | 4447 cdm_manager_ = new RendererCdmManager(this); |
4459 return cdm_manager_; | 4448 return cdm_manager_; |
4460 } | 4449 } |
4461 #endif // defined(ENABLE_BROWSER_CDMS) | 4450 #endif // defined(ENABLE_BROWSER_CDMS) |
4462 | 4451 |
4463 } // namespace content | 4452 } // namespace content |
OLD | NEW |