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

Unified Diff: content/renderer/render_frame_proxy.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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_proxy.cc
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc
index 6b8c760fe24ceec2acadee22b830d4cc26d0a375..84b23233d7dc419b58af7bee52d744c795073cdb 100644
--- a/content/renderer/render_frame_proxy.cc
+++ b/content/renderer/render_frame_proxy.cc
@@ -9,12 +9,15 @@
#include "base/lazy_instance.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/frame_messages.h"
+#include "content/common/frame_replication_state.h"
#include "content/common/swapped_out_messages.h"
#include "content/common/view_messages.h"
#include "content/renderer/child_frame_compositing_helper.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
+
Charlie Reis 2014/11/20 17:20:28 nit: No blank line here. (Might as well remove th
alexmos 2014/11/20 21:09:10 Done.
+#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -54,7 +57,8 @@ RenderFrameProxy* RenderFrameProxy::CreateProxyToReplaceFrame(
RenderFrameProxy* RenderFrameProxy::CreateFrameProxy(
int routing_id,
int parent_routing_id,
- int render_view_routing_id) {
+ int render_view_routing_id,
+ const FrameReplicationState& replicated_state) {
scoped_ptr<RenderFrameProxy> proxy(
new RenderFrameProxy(routing_id, MSG_ROUTING_NONE));
RenderViewImpl* render_view = NULL;
@@ -76,6 +80,10 @@ RenderFrameProxy* RenderFrameProxy::CreateFrameProxy(
proxy->Init(web_frame, render_view);
+ // Initialize proxy's WebRemoteFrame with the security origin and other
+ // replicated information.
+ proxy->SetReplicatedState(replicated_state);
+
return proxy.release();
}
@@ -141,6 +149,12 @@ void RenderFrameProxy::DidCommitCompositorFrame() {
compositing_helper_->DidCommitCompositorFrame();
}
+void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
+ DCHECK(web_frame_);
+ web_frame_->setReplicatedOrigin(blink::WebSecurityOrigin::createFromString(
+ blink::WebString::fromUTF8(state.origin.string())));
+}
+
bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderFrameProxy, msg)

Powered by Google App Engine
This is Rietveld 408576698