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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from dcheng@ Created 5 years, 2 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 551545eb266cc147cb0d83ef246234a110e9dd27..e074c6838f992f7d7798c900e1fd0ba244520e8f 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -251,6 +251,13 @@ namespace content {
namespace {
+int GetRoutingIDForFrame(blink::WebFrame* frame) {
alexmos 2015/10/09 21:55:49 Heads up: you don't need this anymore, as Nick has
lazyboy 2015/10/13 21:59:08 Done.
+ if (frame->isWebRemoteFrame())
+ return RenderFrameProxy::FromWebFrame(frame)->routing_id();
+
+ return RenderFrameImpl::FromWebFrame(frame)->GetRoutingID();
+}
+
const char kDefaultAcceptHeader[] =
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/"
"*;q=0.8";
@@ -567,7 +574,8 @@ void RenderFrameImpl::CreateFrame(
int previous_sibling_routing_id,
const FrameReplicationState& replicated_state,
CompositorDependencies* compositor_deps,
- const FrameMsg_NewFrame_WidgetParams& widget_params) {
+ const FrameMsg_NewFrame_WidgetParams& widget_params,
+ const blink::WebFrameOwnerProperties& frame_owner_properties) {
blink::WebLocalFrame* web_frame;
RenderFrameImpl* render_frame;
if (proxy_routing_id == MSG_ROUTING_NONE) {
@@ -590,7 +598,7 @@ void RenderFrameImpl::CreateFrame(
web_frame = parent_web_frame->createLocalChild(
replicated_state.scope, WebString::fromUTF8(replicated_state.name),
replicated_state.sandbox_flags, render_frame,
- previous_sibling_web_frame);
+ previous_sibling_web_frame, frame_owner_properties);
} else {
RenderFrameProxy* proxy =
RenderFrameProxy::FromRoutingID(proxy_routing_id);
@@ -601,7 +609,7 @@ void RenderFrameImpl::CreateFrame(
render_frame->proxy_routing_id_ = proxy_routing_id;
web_frame->initializeToReplaceRemoteFrame(
proxy->web_frame(), WebString::fromUTF8(replicated_state.name),
- replicated_state.sandbox_flags);
+ replicated_state.sandbox_flags, frame_owner_properties);
}
render_frame->SetWebFrame(web_frame);
CHECK_IMPLIES(parent_routing_id == MSG_ROUTING_NONE, !web_frame->parent());
@@ -1126,6 +1134,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener)
IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation)
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
+ IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
+ OnSetFrameOwnerProperties)
IPC_MESSAGE_HANDLER(FrameMsg_ClearFocus, OnClearFocus)
IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings,
OnTextTrackSettingsChanged)
@@ -1683,6 +1693,12 @@ void RenderFrameImpl::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) {
frame_->setFrameOwnerSandboxFlags(flags);
}
+void RenderFrameImpl::OnSetFrameOwnerProperties(
+ const blink::WebFrameOwnerProperties& frame_owner_properties) {
+ DCHECK(frame_);
+ frame_->setFrameOwnerProperties(frame_owner_properties);
+}
+
void RenderFrameImpl::OnClearFocus() {
frame_->clearFocus();
}
@@ -2215,14 +2231,14 @@ blink::WebFrame* RenderFrameImpl::createChildFrame(
blink::WebLocalFrame* parent,
blink::WebTreeScopeType scope,
const blink::WebString& name,
- blink::WebSandboxFlags sandbox_flags) {
+ blink::WebSandboxFlags sandbox_flags,
+ const blink::WebFrameOwnerProperties& frameOwnerProperties) {
// Synchronously notify the browser of a child frame creation to get the
// routing_id for the RenderFrame.
int child_routing_id = MSG_ROUTING_NONE;
Send(new FrameHostMsg_CreateChildFrame(
- routing_id_, scope,
- base::UTF16ToUTF8(base::StringPiece16(name)), sandbox_flags,
- &child_routing_id));
+ routing_id_, scope, base::UTF16ToUTF8(base::StringPiece16(name)),
+ sandbox_flags, frameOwnerProperties, &child_routing_id));
// Allocation of routing id failed, so we can't create a child frame. This can
// happen if this RenderFrameImpl's IPCs are being filtered when in swapped
@@ -2353,19 +2369,19 @@ void RenderFrameImpl::didChangeName(blink::WebLocalFrame* frame,
void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
blink::WebSandboxFlags flags) {
- int frame_routing_id = MSG_ROUTING_NONE;
- if (child_frame->isWebRemoteFrame()) {
- frame_routing_id =
- RenderFrameProxy::FromWebFrame(child_frame)->routing_id();
- } else {
- frame_routing_id =
- RenderFrameImpl::FromWebFrame(child_frame)->GetRoutingID();
- }
-
+ int frame_routing_id = GetRoutingIDForFrame(child_frame);
Send(new FrameHostMsg_DidChangeSandboxFlags(routing_id_, frame_routing_id,
flags));
}
+void RenderFrameImpl::didChangeFrameOwnerProperties(
+ blink::WebFrame* child_frame,
+ const blink::WebFrameOwnerProperties& frame_owner_properties) {
+ int frame_routing_id = GetRoutingIDForFrame(child_frame);
+ Send(new FrameHostMsg_DidChangeFrameOwnerProperties(
+ routing_id_, frame_routing_id, frame_owner_properties));
+}
+
void RenderFrameImpl::didMatchCSS(
blink::WebLocalFrame* frame,
const blink::WebVector<blink::WebString>& newly_matching_selectors,

Powered by Google App Engine
This is Rietveld 408576698