OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 | 2778 |
2779 // Find the source frame if it exists. | 2779 // Find the source frame if it exists. |
2780 WebFrame* source_frame = NULL; | 2780 WebFrame* source_frame = NULL; |
2781 if (params.source_routing_id != MSG_ROUTING_NONE) { | 2781 if (params.source_routing_id != MSG_ROUTING_NONE) { |
2782 RenderViewImpl* source_view = FromRoutingID(params.source_routing_id); | 2782 RenderViewImpl* source_view = FromRoutingID(params.source_routing_id); |
2783 if (source_view) | 2783 if (source_view) |
2784 source_frame = source_view->webview()->mainFrame(); | 2784 source_frame = source_view->webview()->mainFrame(); |
2785 } | 2785 } |
2786 | 2786 |
2787 // If the message contained MessagePorts, create the corresponding endpoints. | 2787 // If the message contained MessagePorts, create the corresponding endpoints. |
2788 DCHECK_EQ(params.message_port_ids.size(), params.new_routing_ids.size()); | 2788 blink::WebMessagePortChannelArray channels = |
2789 blink::WebMessagePortChannelArray channels(params.message_port_ids.size()); | 2789 WebMessagePortChannelImpl::CreatePorts( |
2790 for (size_t i = 0; | 2790 params.message_ports, params.new_routing_ids, |
2791 i < params.message_port_ids.size() && i < params.new_routing_ids.size(); | 2791 base::MessageLoopProxy::current().get()); |
2792 ++i) { | |
2793 channels[i] = | |
2794 new WebMessagePortChannelImpl(params.new_routing_ids[i], | |
2795 params.message_port_ids[i], | |
2796 base::MessageLoopProxy::current().get()); | |
2797 } | |
2798 | 2792 |
2799 WebSerializedScriptValue serialized_script_value; | 2793 WebSerializedScriptValue serialized_script_value; |
2800 if (params.is_data_raw_string) { | 2794 if (params.is_data_raw_string) { |
2801 v8::HandleScope handle_scope(blink::mainThreadIsolate()); | 2795 v8::HandleScope handle_scope(blink::mainThreadIsolate()); |
2802 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); | 2796 v8::Local<v8::Context> context = frame->mainWorldScriptContext(); |
2803 v8::Context::Scope context_scope(context); | 2797 v8::Context::Scope context_scope(context); |
2804 V8ValueConverterImpl converter; | 2798 V8ValueConverterImpl converter; |
2805 converter.SetDateAllowed(true); | 2799 converter.SetDateAllowed(true); |
2806 converter.SetRegExpAllowed(true); | 2800 converter.SetRegExpAllowed(true); |
2807 scoped_ptr<base::Value> value(new base::StringValue(params.data)); | 2801 scoped_ptr<base::Value> value(new base::StringValue(params.data)); |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4037 std::vector<gfx::Size> sizes; | 4031 std::vector<gfx::Size> sizes; |
4038 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4032 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4039 if (!url.isEmpty()) | 4033 if (!url.isEmpty()) |
4040 urls.push_back( | 4034 urls.push_back( |
4041 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4035 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4042 } | 4036 } |
4043 SendUpdateFaviconURL(urls); | 4037 SendUpdateFaviconURL(urls); |
4044 } | 4038 } |
4045 | 4039 |
4046 } // namespace content | 4040 } // namespace content |
OLD | NEW |