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

Unified Diff: content/renderer/render_view_impl.cc

Issue 438393004: Revert of Start using RenderFrameProxyHost objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 7269f45cd65382f8bf78a44ff08f16d555beb5d6..aeb07c5e1f6aa8c895fcdcebdf0fcaa7fe6cdb36 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -754,6 +754,13 @@
WebLocalFrame* web_frame = WebLocalFrame::create(main_render_frame_.get());
main_render_frame_->SetWebFrame(web_frame);
+ if (params->proxy_routing_id != MSG_ROUTING_NONE) {
+ CHECK(params->swapped_out);
+ RenderFrameProxy* proxy = RenderFrameProxy::CreateProxyToReplaceFrame(
+ main_render_frame_.get(), params->proxy_routing_id);
+ main_render_frame_->set_render_frame_proxy(proxy);
+ }
+
webwidget_ = WebView::create(this);
webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_));
@@ -811,21 +818,7 @@
webview()->settings()->setAllowConnectingInsecureWebSocket(
command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin));
- RenderFrameProxy* proxy = NULL;
- if (params->proxy_routing_id != MSG_ROUTING_NONE) {
- CHECK(params->swapped_out);
- proxy = RenderFrameProxy::CreateProxyToReplaceFrame(
- main_render_frame_.get(), params->proxy_routing_id);
- main_render_frame_->set_render_frame_proxy(proxy);
- }
-
- // In --site-per-process, just use the WebRemoteFrame as the main frame.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
- proxy) {
- webview()->setMainFrame(proxy->web_frame());
- } else {
- webview()->setMainFrame(main_render_frame_->GetWebFrame());
- }
+ webview()->setMainFrame(main_render_frame_->GetWebFrame());
main_render_frame_->Initialize();
if (switches::IsTouchDragDropEnabled())
@@ -879,7 +872,7 @@
// If we are initially swapped out, navigate to kSwappedOutURL.
// This ensures we are in a unique origin that others cannot script.
- if (is_swapped_out_ && webview()->mainFrame()->isWebLocalFrame())
+ if (is_swapped_out_)
NavigateToSwappedOutURL(webview()->mainFrame());
}
@@ -1333,7 +1326,7 @@
bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL;
- if (main_frame && main_frame->isWebLocalFrame())
+ if (main_frame)
GetContentClient()->SetActiveURL(main_frame->document().url());
ObserverListBase<RenderViewObserver>::Iterator it(observers_);
@@ -2277,7 +2270,6 @@
// Carry over the user agent override flag, if it exists.
if (content_initiated && webview() && webview()->mainFrame() &&
- webview()->mainFrame()->isWebLocalFrame() &&
webview()->mainFrame()->dataSource()) {
DocumentState* old_document_state =
DocumentState::FromDataSource(webview()->mainFrame()->dataSource());
@@ -2313,9 +2305,9 @@
const WebURLRequest& original_request = ds->originalRequest();
const GURL referrer(
original_request.httpHeaderField(WebString::fromUTF8("Referer")));
- if (!referrer.is_empty() && old_frame->isWebLocalFrame() &&
- DocumentState::FromDataSource(old_frame->dataSource())
- ->was_prefetcher()) {
+ if (!referrer.is_empty() &&
+ DocumentState::FromDataSource(
+ old_frame->dataSource())->was_prefetcher()) {
for (; old_frame; old_frame = old_frame->traverseNext(false)) {
WebDataSource* old_frame_ds = old_frame->dataSource();
if (old_frame_ds && referrer == GURL(old_frame_ds->request().url())) {
@@ -2663,8 +2655,7 @@
return NULL;
WebFrame* main_frame = webview()->mainFrame();
- if (main_frame->isWebLocalFrame() &&
- main_frame->document().isPluginDocument())
+ if (main_frame->document().isPluginDocument())
return webview()->mainFrame()->document().to<WebPluginDocument>().plugin();
#if defined(ENABLE_PLUGINS)
@@ -3185,8 +3176,7 @@
// If the zoom level for this page matches the old zoom default, and this
// is not a plugin, update the zoom level to match the new default.
- if (webview() && webview()->mainFrame()->isWebLocalFrame() &&
- !webview()->mainFrame()->document().isPluginDocument() &&
+ if (webview() && !webview()->mainFrame()->document().isPluginDocument() &&
!ZoomValuesEqual(old_zoom_level,
renderer_preferences_.default_zoom_level) &&
ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) {
@@ -3298,8 +3288,7 @@
CHECK(is_swapped_out_ || rf->is_swapped_out());
GURL swappedOutURL(kSwappedOutURL);
WebURLRequest request(swappedOutURL);
- if (frame->isWebLocalFrame())
- frame->loadRequest(request);
+ frame->loadRequest(request);
}
void RenderViewImpl::OnClosePage() {
@@ -3402,11 +3391,6 @@
return;
WebFrame* main_frame = webview()->mainFrame();
- for (WebFrame* frame = main_frame; frame;
- frame = frame->traverseNext(false)) {
- if (frame->isWebLocalFrame())
- main_frame = frame;
- }
// If we have a provisional frame we are between the start and commit stages
// of loading and we don't want to save stats.
@@ -3428,19 +3412,7 @@
}
gfx::Vector2d RenderViewImpl::GetScrollOffset() {
- WebFrame* main_frame = webview()->mainFrame();
- for (WebFrame* frame = main_frame; frame;
- frame = frame->traverseNext(false)) {
- // TODO(nasko): This is a hack for the case in which the top-level
- // frame is being rendered in another process. It will not
- // behave correctly for out of process iframes.
- if (frame->isWebLocalFrame()) {
- main_frame = frame;
- break;
- }
- }
-
- WebSize scroll_offset = main_frame->scrollOffset();
+ WebSize scroll_offset = webview()->mainFrame()->scrollOffset();
return gfx::Vector2d(scroll_offset.width, scroll_offset.height);
}
@@ -3627,7 +3599,7 @@
GURL RenderViewImpl::GetURLForGraphicsContext3D() {
DCHECK(webview());
- if (webview()->mainFrame()->isWebLocalFrame())
+ if (webview()->mainFrame())
return GURL(webview()->mainFrame()->document().url());
else
return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D");
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698