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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
759 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); | 759 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); |
760 | 760 |
761 RenderFrameProxy* proxy = NULL; | 761 RenderFrameProxy* proxy = NULL; |
762 if (params->proxy_routing_id != MSG_ROUTING_NONE) { | 762 if (params->proxy_routing_id != MSG_ROUTING_NONE) { |
763 CHECK(params->swapped_out); | 763 CHECK(params->swapped_out); |
764 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( | 764 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( |
765 main_render_frame_.get(), params->proxy_routing_id); | 765 main_render_frame_.get(), params->proxy_routing_id); |
766 main_render_frame_->set_render_frame_proxy(proxy); | 766 main_render_frame_->set_render_frame_proxy(proxy); |
767 } | 767 } |
768 | 768 |
769 bool is_site_per_process = | |
770 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess); | |
771 | |
769 // In --site-per-process, just use the WebRemoteFrame as the main frame. | 772 // In --site-per-process, just use the WebRemoteFrame as the main frame. |
770 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && | 773 if (is_site_per_process && proxy) { |
771 proxy) { | |
772 webview()->setMainFrame(proxy->web_frame()); | 774 webview()->setMainFrame(proxy->web_frame()); |
773 } else { | 775 } else { |
774 webview()->setMainFrame(main_render_frame_->GetWebFrame()); | 776 webview()->setMainFrame(main_render_frame_->GetWebFrame()); |
775 } | 777 } |
776 main_render_frame_->Initialize(); | 778 main_render_frame_->Initialize(); |
777 | 779 |
780 // In --site-per-process, initialize the WebRemoteFrame with information | |
dcheng
2014/11/19 00:50:11
Any chance we can combine this if block with the a
alexmos
2014/11/19 02:49:27
Done.
| |
781 // replicated from the browser process. | |
782 if (is_site_per_process && proxy) { | |
783 RenderFrameImpl::SetReplicatedState(proxy->web_frame(), | |
784 params->remote_frame_state); | |
785 } | |
786 | |
778 if (switches::IsTouchDragDropEnabled()) | 787 if (switches::IsTouchDragDropEnabled()) |
779 webview()->settings()->setTouchDragDropEnabled(true); | 788 webview()->settings()->setTouchDragDropEnabled(true); |
780 | 789 |
781 if (switches::IsTouchEditingEnabled()) | 790 if (switches::IsTouchEditingEnabled()) |
782 webview()->settings()->setTouchEditingEnabled(true); | 791 webview()->settings()->setTouchEditingEnabled(true); |
783 | 792 |
784 if (!params->frame_name.empty()) | 793 if (!params->frame_name.empty()) |
785 webview()->mainFrame()->setName(params->frame_name); | 794 webview()->mainFrame()->setName(params->frame_name); |
786 | 795 |
787 // TODO(davidben): Move this state from Blink into content. | 796 // TODO(davidben): Move this state from Blink into content. |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1131 bool window_was_created_with_opener, | 1140 bool window_was_created_with_opener, |
1132 const RendererPreferences& renderer_prefs, | 1141 const RendererPreferences& renderer_prefs, |
1133 const WebPreferences& webkit_prefs, | 1142 const WebPreferences& webkit_prefs, |
1134 int32 routing_id, | 1143 int32 routing_id, |
1135 int32 main_frame_routing_id, | 1144 int32 main_frame_routing_id, |
1136 int32 surface_id, | 1145 int32 surface_id, |
1137 int64 session_storage_namespace_id, | 1146 int64 session_storage_namespace_id, |
1138 const base::string16& frame_name, | 1147 const base::string16& frame_name, |
1139 bool is_renderer_created, | 1148 bool is_renderer_created, |
1140 bool swapped_out, | 1149 bool swapped_out, |
1150 const FrameReplicationState& remote_frame_state, | |
1141 int32 proxy_routing_id, | 1151 int32 proxy_routing_id, |
1142 bool hidden, | 1152 bool hidden, |
1143 bool never_visible, | 1153 bool never_visible, |
1144 int32 next_page_id, | 1154 int32 next_page_id, |
1145 const blink::WebScreenInfo& screen_info) { | 1155 const blink::WebScreenInfo& screen_info) { |
1146 DCHECK(routing_id != MSG_ROUTING_NONE); | 1156 DCHECK(routing_id != MSG_ROUTING_NONE); |
1147 RenderViewImplParams params(opener_id, | 1157 RenderViewImplParams params(opener_id, |
1148 window_was_created_with_opener, | 1158 window_was_created_with_opener, |
1149 renderer_prefs, | 1159 renderer_prefs, |
1150 webkit_prefs, | 1160 webkit_prefs, |
1151 routing_id, | 1161 routing_id, |
1152 main_frame_routing_id, | 1162 main_frame_routing_id, |
1153 surface_id, | 1163 surface_id, |
1154 session_storage_namespace_id, | 1164 session_storage_namespace_id, |
1155 frame_name, | 1165 frame_name, |
1156 is_renderer_created, | 1166 is_renderer_created, |
1157 swapped_out, | 1167 swapped_out, |
1168 remote_frame_state, | |
1158 proxy_routing_id, | 1169 proxy_routing_id, |
1159 hidden, | 1170 hidden, |
1160 never_visible, | 1171 never_visible, |
1161 next_page_id, | 1172 next_page_id, |
1162 screen_info); | 1173 screen_info); |
1163 RenderViewImpl* render_view = NULL; | 1174 RenderViewImpl* render_view = NULL; |
1164 if (g_create_render_view_impl) | 1175 if (g_create_render_view_impl) |
1165 render_view = g_create_render_view_impl(¶ms); | 1176 render_view = g_create_render_view_impl(¶ms); |
1166 else | 1177 else |
1167 render_view = new RenderViewImpl(¶ms); | 1178 render_view = new RenderViewImpl(¶ms); |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1682 true, // window_was_created_with_opener | 1693 true, // window_was_created_with_opener |
1683 renderer_preferences_, | 1694 renderer_preferences_, |
1684 webkit_preferences_, | 1695 webkit_preferences_, |
1685 routing_id, | 1696 routing_id, |
1686 main_frame_routing_id, | 1697 main_frame_routing_id, |
1687 surface_id, | 1698 surface_id, |
1688 cloned_session_storage_namespace_id, | 1699 cloned_session_storage_namespace_id, |
1689 base::string16(), // WebCore will take care of setting the correct name. | 1700 base::string16(), // WebCore will take care of setting the correct name. |
1690 true, // is_renderer_created | 1701 true, // is_renderer_created |
1691 false, // swapped_out | 1702 false, // swapped_out |
1703 FrameReplicationState(), // Empty since swapped_out is false. | |
1692 MSG_ROUTING_NONE, // proxy_routing_id | 1704 MSG_ROUTING_NONE, // proxy_routing_id |
1693 params.disposition == NEW_BACKGROUND_TAB, // hidden | 1705 params.disposition == NEW_BACKGROUND_TAB, // hidden |
1694 never_visible, | 1706 never_visible, |
1695 1, // next_page_id | 1707 1, // next_page_id |
1696 screen_info_); | 1708 screen_info_); |
1697 view->opened_by_user_gesture_ = params.user_gesture; | 1709 view->opened_by_user_gesture_ = params.user_gesture; |
1698 | 1710 |
1699 // Record whether the creator frame is trying to suppress the opener field. | 1711 // Record whether the creator frame is trying to suppress the opener field. |
1700 view->opener_suppressed_ = params.opener_suppressed; | 1712 view->opener_suppressed_ = params.opener_suppressed; |
1701 | 1713 |
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4220 std::vector<gfx::Size> sizes; | 4232 std::vector<gfx::Size> sizes; |
4221 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4233 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4222 if (!url.isEmpty()) | 4234 if (!url.isEmpty()) |
4223 urls.push_back( | 4235 urls.push_back( |
4224 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4236 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4225 } | 4237 } |
4226 SendUpdateFaviconURL(urls); | 4238 SendUpdateFaviconURL(urls); |
4227 } | 4239 } |
4228 | 4240 |
4229 } // namespace content | 4241 } // namespace content |
OLD | NEW |