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

Side by Side Diff: Source/core/frame/RemoteFrame.cpp

Issue 1152053006: Allow RemoteFrames to be navigated through targeted navigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add Frame::navigate method that takes FrameLoadRequest param. Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/frame/RemoteFrame.h" 6 #include "core/frame/RemoteFrame.h"
7 7
8 #include "bindings/core/v8/WindowProxy.h" 8 #include "bindings/core/v8/WindowProxy.h"
9 #include "bindings/core/v8/WindowProxyManager.h" 9 #include "bindings/core/v8/WindowProxyManager.h"
10 #include "core/dom/RemoteSecurityContext.h" 10 #include "core/dom/RemoteSecurityContext.h"
11 #include "core/frame/RemoteDOMWindow.h" 11 #include "core/frame/RemoteDOMWindow.h"
12 #include "core/frame/RemoteFrameClient.h" 12 #include "core/frame/RemoteFrameClient.h"
13 #include "core/frame/RemoteFrameView.h" 13 #include "core/frame/RemoteFrameView.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/layout/LayoutPart.h" 15 #include "core/layout/LayoutPart.h"
16 #include "core/loader/FrameLoadRequest.h"
16 #include "core/paint/DeprecatedPaintLayer.h" 17 #include "core/paint/DeprecatedPaintLayer.h"
18 #include "platform/UserGestureIndicator.h"
17 #include "platform/graphics/GraphicsLayer.h" 19 #include "platform/graphics/GraphicsLayer.h"
18 #include "platform/weborigin/SecurityPolicy.h" 20 #include "platform/weborigin/SecurityPolicy.h"
19 #include "public/platform/WebLayer.h" 21 #include "public/platform/WebLayer.h"
20 22
21 namespace blink { 23 namespace blink {
22 24
23 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) 25 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner)
24 : Frame(client, host, owner) 26 : Frame(client, host, owner)
25 , m_securityContext(RemoteSecurityContext::create()) 27 , m_securityContext(RemoteSecurityContext::create())
26 , m_domWindow(RemoteDOMWindow::create(*this)) 28 , m_domWindow(RemoteDOMWindow::create(*this))
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList, UserGestureStatus userGestureStatus) 64 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList, UserGestureStatus userGestureStatus)
63 { 65 {
64 // The process where this frame actually lives won't have sufficient informa tion to determine 66 // The process where this frame actually lives won't have sufficient informa tion to determine
65 // correct referrer, since it won't have access to the originDocument. Set i t now. 67 // correct referrer, since it won't have access to the originDocument. Set i t now.
66 ResourceRequest request(url); 68 ResourceRequest request(url);
67 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer())); 69 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer()));
68 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active); 70 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active);
69 remoteFrameClient()->navigate(request, lockBackForwardList); 71 remoteFrameClient()->navigate(request, lockBackForwardList);
70 } 72 }
71 73
74 void RemoteFrame::navigate(const FrameLoadRequest& passedRequest)
75 {
76 UserGestureStatus gesture = UserGestureIndicator::processingUserGesture() ? UserGestureStatus::Active : UserGestureStatus::None;
77 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur l(), passedRequest. lockBackForwardList(), gesture);
Nate Chapin 2015/06/08 16:56:22 Spurious whitespace after "passedRequest."
nasko 2015/06/08 17:27:04 Done.
78 }
79
72 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy) 80 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy)
73 { 81 {
74 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy); 82 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy);
75 } 83 }
76 84
77 void RemoteFrame::detach() 85 void RemoteFrame::detach()
78 { 86 {
79 // Frame::detach() requires the caller to keep a reference to this, since 87 // Frame::detach() requires the caller to keep a reference to this, since
80 // otherwise it may clear the last reference to this, causing it to be 88 // otherwise it may clear the last reference to this, causing it to be
81 // deleted, which can cause a use-after-free. 89 // deleted, which can cause a use-after-free.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (m_remotePlatformLayer) 163 if (m_remotePlatformLayer)
156 GraphicsLayer::registerContentsLayer(layer); 164 GraphicsLayer::registerContentsLayer(layer);
157 165
158 ASSERT(owner()); 166 ASSERT(owner());
159 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 167 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
160 if (LayoutPart* layoutObject = ownerLayoutObject()) 168 if (LayoutPart* layoutObject = ownerLayoutObject())
161 layoutObject->layer()->updateSelfPaintingLayer(); 169 layoutObject->layer()->updateSelfPaintingLayer();
162 } 170 }
163 171
164 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698