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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 692973005: Pass origin information for remote frame creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add EXPECT_TRUE to NavigateToURL in new tests; nits Created 6 years, 1 month 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
OLDNEW
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 CHECK(params->swapped_out); 765 CHECK(params->swapped_out);
766 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( 766 proxy = RenderFrameProxy::CreateProxyToReplaceFrame(
767 main_render_frame_.get(), params->proxy_routing_id); 767 main_render_frame_.get(), params->proxy_routing_id);
768 main_render_frame_->set_render_frame_proxy(proxy); 768 main_render_frame_->set_render_frame_proxy(proxy);
769 } 769 }
770 770
771 // In --site-per-process, just use the WebRemoteFrame as the main frame. 771 // In --site-per-process, just use the WebRemoteFrame as the main frame.
772 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && 772 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
773 proxy) { 773 proxy) {
774 webview()->setMainFrame(proxy->web_frame()); 774 webview()->setMainFrame(proxy->web_frame());
775 // Initialize the WebRemoteFrame with information replicated from the
776 // browser process.
777 proxy->SetReplicatedState(params->remote_frame_state);
775 } else { 778 } else {
776 webview()->setMainFrame(main_render_frame_->GetWebFrame()); 779 webview()->setMainFrame(main_render_frame_->GetWebFrame());
777 } 780 }
778 main_render_frame_->Initialize(); 781 main_render_frame_->Initialize();
779 782
780 if (switches::IsTouchDragDropEnabled()) 783 if (switches::IsTouchDragDropEnabled())
781 webview()->settings()->setTouchDragDropEnabled(true); 784 webview()->settings()->setTouchDragDropEnabled(true);
782 785
783 if (switches::IsTouchEditingEnabled()) 786 if (switches::IsTouchEditingEnabled())
784 webview()->settings()->setTouchEditingEnabled(true); 787 webview()->settings()->setTouchEditingEnabled(true);
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 bool window_was_created_with_opener, 1150 bool window_was_created_with_opener,
1148 const RendererPreferences& renderer_prefs, 1151 const RendererPreferences& renderer_prefs,
1149 const WebPreferences& webkit_prefs, 1152 const WebPreferences& webkit_prefs,
1150 int32 routing_id, 1153 int32 routing_id,
1151 int32 main_frame_routing_id, 1154 int32 main_frame_routing_id,
1152 int32 surface_id, 1155 int32 surface_id,
1153 int64 session_storage_namespace_id, 1156 int64 session_storage_namespace_id,
1154 const base::string16& frame_name, 1157 const base::string16& frame_name,
1155 bool is_renderer_created, 1158 bool is_renderer_created,
1156 bool swapped_out, 1159 bool swapped_out,
1160 const FrameReplicationState& remote_frame_state,
1157 int32 proxy_routing_id, 1161 int32 proxy_routing_id,
1158 bool hidden, 1162 bool hidden,
1159 bool never_visible, 1163 bool never_visible,
1160 int32 next_page_id, 1164 int32 next_page_id,
1161 const ViewMsg_Resize_Params& initial_size, 1165 const ViewMsg_Resize_Params& initial_size,
1162 bool enable_auto_resize, 1166 bool enable_auto_resize,
1163 const gfx::Size& min_size, 1167 const gfx::Size& min_size,
1164 const gfx::Size& max_size) { 1168 const gfx::Size& max_size) {
1165 DCHECK(routing_id != MSG_ROUTING_NONE); 1169 DCHECK(routing_id != MSG_ROUTING_NONE);
1166 RenderViewImplParams params(opener_id, 1170 RenderViewImplParams params(opener_id,
1167 window_was_created_with_opener, 1171 window_was_created_with_opener,
1168 renderer_prefs, 1172 renderer_prefs,
1169 webkit_prefs, 1173 webkit_prefs,
1170 routing_id, 1174 routing_id,
1171 main_frame_routing_id, 1175 main_frame_routing_id,
1172 surface_id, 1176 surface_id,
1173 session_storage_namespace_id, 1177 session_storage_namespace_id,
1174 frame_name, 1178 frame_name,
1175 is_renderer_created, 1179 is_renderer_created,
1176 swapped_out, 1180 swapped_out,
1181 remote_frame_state,
1177 proxy_routing_id, 1182 proxy_routing_id,
1178 hidden, 1183 hidden,
1179 never_visible, 1184 never_visible,
1180 next_page_id, 1185 next_page_id,
1181 initial_size, 1186 initial_size,
1182 enable_auto_resize, 1187 enable_auto_resize,
1183 min_size, 1188 min_size,
1184 max_size); 1189 max_size);
1185 RenderViewImpl* render_view = NULL; 1190 RenderViewImpl* render_view = NULL;
1186 if (g_create_render_view_impl) 1191 if (g_create_render_view_impl)
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 true, // window_was_created_with_opener 1712 true, // window_was_created_with_opener
1708 renderer_preferences_, 1713 renderer_preferences_,
1709 webkit_preferences_, 1714 webkit_preferences_,
1710 routing_id, 1715 routing_id,
1711 main_frame_routing_id, 1716 main_frame_routing_id,
1712 surface_id, 1717 surface_id,
1713 cloned_session_storage_namespace_id, 1718 cloned_session_storage_namespace_id,
1714 base::string16(), // WebCore will take care of setting the correct name. 1719 base::string16(), // WebCore will take care of setting the correct name.
1715 true, // is_renderer_created 1720 true, // is_renderer_created
1716 false, // swapped_out 1721 false, // swapped_out
1722 FrameReplicationState(), // Empty since swapped_out is false.
1717 MSG_ROUTING_NONE, // proxy_routing_id 1723 MSG_ROUTING_NONE, // proxy_routing_id
1718 params.disposition == NEW_BACKGROUND_TAB, // hidden 1724 params.disposition == NEW_BACKGROUND_TAB, // hidden
1719 never_visible, 1725 never_visible,
1720 1, // next_page_id 1726 1, // next_page_id
1721 initial_size, 1727 initial_size,
1722 false, // enable_auto_resize 1728 false, // enable_auto_resize
1723 gfx::Size(), // min_size 1729 gfx::Size(), // min_size
1724 gfx::Size() // max_size 1730 gfx::Size() // max_size
1725 ); 1731 );
1726 view->opened_by_user_gesture_ = params.user_gesture; 1732 view->opened_by_user_gesture_ = params.user_gesture;
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 std::vector<gfx::Size> sizes; 4232 std::vector<gfx::Size> sizes;
4227 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4233 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4228 if (!url.isEmpty()) 4234 if (!url.isEmpty())
4229 urls.push_back( 4235 urls.push_back(
4230 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4236 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4231 } 4237 }
4232 SendUpdateFaviconURL(urls); 4238 SendUpdateFaviconURL(urls);
4233 } 4239 }
4234 4240
4235 } // namespace content 4241 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698