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

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

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trim thingie Created 4 years, 10 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 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 base::debug::SetCrashKeyValue("rvinit_view_id", 679 base::debug::SetCrashKeyValue("rvinit_view_id",
680 base::IntToString(routing_id())); 680 base::IntToString(routing_id()));
681 base::debug::SetCrashKeyValue("rvinit_proxy_id", 681 base::debug::SetCrashKeyValue("rvinit_proxy_id",
682 base::IntToString(params.proxy_routing_id)); 682 base::IntToString(params.proxy_routing_id));
683 base::debug::SetCrashKeyValue( 683 base::debug::SetCrashKeyValue(
684 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id)); 684 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id));
685 685
686 if (params.main_frame_routing_id != MSG_ROUTING_NONE) { 686 if (params.main_frame_routing_id != MSG_ROUTING_NONE) {
687 main_render_frame_ = RenderFrameImpl::CreateMainFrame( 687 main_render_frame_ = RenderFrameImpl::CreateMainFrame(
688 this, params.main_frame_routing_id, params.main_frame_widget_routing_id, 688 this, params.main_frame_routing_id, params.main_frame_widget_routing_id,
689 params.hidden, screen_info(), compositor_deps_); 689 params.hidden, screen_info(), compositor_deps_, opener_frame);
690 } 690 }
691 691
692 if (params.proxy_routing_id != MSG_ROUTING_NONE) { 692 if (params.proxy_routing_id != MSG_ROUTING_NONE) {
693 CHECK(params.swapped_out); 693 CHECK(params.swapped_out);
694 if (main_render_frame_) { 694 if (main_render_frame_) {
695 CHECK(!SiteIsolationPolicy::IsSwappedOutStateForbidden()); 695 CHECK(!SiteIsolationPolicy::IsSwappedOutStateForbidden());
696 RenderFrameProxy* proxy = RenderFrameProxy::CreateProxyToReplaceFrame( 696 RenderFrameProxy* proxy = RenderFrameProxy::CreateProxyToReplaceFrame(
697 main_render_frame_, params.proxy_routing_id, 697 main_render_frame_, params.proxy_routing_id,
698 blink::WebTreeScopeType::Document); 698 blink::WebTreeScopeType::Document);
699 main_render_frame_->set_render_frame_proxy(proxy); 699 main_render_frame_->set_render_frame_proxy(proxy);
700 } else { 700 } else {
701 CHECK(SiteIsolationPolicy::IsSwappedOutStateForbidden()); 701 CHECK(SiteIsolationPolicy::IsSwappedOutStateForbidden());
702 // Pass MSG_ROUTING_NONE for opener, since actual opener (if any) will be 702 RenderFrameProxy::CreateFrameProxy(
703 // set separately below. 703 params.proxy_routing_id, routing_id(), params.opener_frame_route_id,
704 RenderFrameProxy::CreateFrameProxy(params.proxy_routing_id, routing_id(), 704 MSG_ROUTING_NONE, params.replicated_frame_state);
705 MSG_ROUTING_NONE, MSG_ROUTING_NONE,
706 params.replicated_frame_state);
707 } 705 }
708 } 706 }
709 707
710 if (main_render_frame_) 708 if (main_render_frame_)
711 main_render_frame_->Initialize(); 709 main_render_frame_->Initialize();
712 710
713 #if defined(OS_ANDROID) 711 #if defined(OS_ANDROID)
714 content_detectors_.push_back(make_scoped_ptr(new AddressDetector())); 712 content_detectors_.push_back(make_scoped_ptr(new AddressDetector()));
715 const std::string& contry_iso = 713 const std::string& contry_iso =
716 params.renderer_preferences.network_contry_iso; 714 params.renderer_preferences.network_contry_iso;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 if (command_line.HasSwitch(switches::kDomAutomationController)) 799 if (command_line.HasSwitch(switches::kDomAutomationController))
802 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; 800 enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION;
803 if (command_line.HasSwitch(switches::kStatsCollectionController)) 801 if (command_line.HasSwitch(switches::kStatsCollectionController))
804 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; 802 enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION;
805 803
806 GetContentClient()->renderer()->RenderViewCreated(this); 804 GetContentClient()->renderer()->RenderViewCreated(this);
807 805
808 // If we have an opener_frame but we weren't created by a renderer, then it's 806 // If we have an opener_frame but we weren't created by a renderer, then it's
809 // the browser asking us to set our opener to another frame. 807 // the browser asking us to set our opener to another frame.
810 if (opener_frame && !was_created_by_renderer) { 808 if (opener_frame && !was_created_by_renderer) {
811 webview()->mainFrame()->setOpener(opener_frame);
812
813 // Ensure that sandbox flags are inherited from an opener in a different 809 // Ensure that sandbox flags are inherited from an opener in a different
814 // process. In that case, the browser process will set any inherited 810 // process. In that case, the browser process will set any inherited
815 // sandbox flags in |replicated_frame_state|, so apply them here. 811 // sandbox flags in |replicated_frame_state|, so apply them here.
816 if (webview()->mainFrame()->isWebLocalFrame()) { 812 if (webview()->mainFrame()->isWebLocalFrame()) {
817 webview()->mainFrame()->toWebLocalFrame()->forceSandboxFlags( 813 webview()->mainFrame()->toWebLocalFrame()->forceSandboxFlags(
818 params.replicated_frame_state.sandbox_flags); 814 params.replicated_frame_state.sandbox_flags);
819 } 815 }
820 } 816 }
821 817
822 // If we are initially swapped out, navigate to kSwappedOutURL. 818 // If we are initially swapped out, navigate to kSwappedOutURL.
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
3550 if (IsUseZoomForDSFEnabled()) { 3546 if (IsUseZoomForDSFEnabled()) {
3551 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3547 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3552 } else { 3548 } else {
3553 webview()->setDeviceScaleFactor(device_scale_factor_); 3549 webview()->setDeviceScaleFactor(device_scale_factor_);
3554 } 3550 }
3555 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3551 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3556 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3552 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3557 } 3553 }
3558 3554
3559 } // namespace content 3555 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698