OLD | NEW |
---|---|
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/WindowProxyManager.h" | 9 #include "bindings/core/v8/WindowProxyManager.h" |
9 #include "core/dom/RemoteSecurityContext.h" | 10 #include "core/dom/RemoteSecurityContext.h" |
10 #include "core/frame/RemoteDOMWindow.h" | 11 #include "core/frame/RemoteDOMWindow.h" |
11 #include "core/frame/RemoteFrameClient.h" | 12 #include "core/frame/RemoteFrameClient.h" |
12 #include "core/frame/RemoteFrameView.h" | 13 #include "core/frame/RemoteFrameView.h" |
13 #include "core/html/HTMLFrameOwnerElement.h" | 14 #include "core/html/HTMLFrameOwnerElement.h" |
14 #include "platform/weborigin/SecurityPolicy.h" | 15 #include "platform/weborigin/SecurityPolicy.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
(...skipping 23 matching lines...) Expand all Loading... | |
41 Frame::trace(visitor); | 42 Frame::trace(visitor); |
42 } | 43 } |
43 | 44 |
44 DOMWindow* RemoteFrame::domWindow() const | 45 DOMWindow* RemoteFrame::domWindow() const |
45 { | 46 { |
46 return m_domWindow.get(); | 47 return m_domWindow.get(); |
47 } | 48 } |
48 | 49 |
49 WindowProxy* RemoteFrame::windowProxy(DOMWrapperWorld& world) | 50 WindowProxy* RemoteFrame::windowProxy(DOMWrapperWorld& world) |
50 { | 51 { |
51 return m_windowProxyManager->windowProxy(world); | 52 WindowProxy* windowProxy = m_windowProxyManager->windowProxy(world); |
53 if (windowProxy) | |
54 windowProxy->initializeIfNeeded(); | |
55 return windowProxy; | |
52 } | 56 } |
53 | 57 |
54 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList) | 58 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList) |
55 { | 59 { |
56 // The process where this frame actually lives won't have sufficient informa tion to determine | 60 // The process where this frame actually lives won't have sufficient informa tion to determine |
57 // correct referrer, since it won't have access to the originDocument. Set i t now. | 61 // correct referrer, since it won't have access to the originDocument. Set i t now. |
58 ResourceRequest request(url); | 62 ResourceRequest request(url); |
59 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer())); | 63 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer())); |
60 remoteFrameClient()->navigate(request, lockBackForwardList); | 64 remoteFrameClient()->navigate(request, lockBackForwardList); |
61 } | 65 } |
62 | 66 |
63 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy) | 67 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy) |
64 { | 68 { |
65 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy); | 69 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy); |
66 } | 70 } |
67 | 71 |
68 void RemoteFrame::detach() | 72 void RemoteFrame::detach() |
69 { | 73 { |
70 detachChildren(); | 74 detachChildren(); |
71 if (!client()) | 75 if (!client()) |
72 return; | 76 return; |
73 m_windowProxyManager->clearForClose(); | 77 m_windowProxyManager->clearForClose(); |
78 m_domWindow->resetLocation(); | |
dcheng
2015/02/09 23:29:58
Hmm... is this something we could get away with do
Nate Chapin
2015/02/10 19:45:27
Done.
| |
74 Frame::detach(); | 79 Frame::detach(); |
75 } | 80 } |
76 | 81 |
77 RemoteSecurityContext* RemoteFrame::securityContext() const | 82 RemoteSecurityContext* RemoteFrame::securityContext() const |
78 { | 83 { |
79 return m_securityContext.get(); | 84 return m_securityContext.get(); |
80 } | 85 } |
81 | 86 |
82 void RemoteFrame::forwardInputEvent(Event* event) | 87 void RemoteFrame::forwardInputEvent(Event* event) |
83 { | 88 { |
(...skipping 18 matching lines...) Expand all Loading... | |
102 owner->setWidget(view); | 107 owner->setWidget(view); |
103 } | 108 } |
104 } | 109 } |
105 | 110 |
106 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 111 RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
107 { | 112 { |
108 return static_cast<RemoteFrameClient*>(client()); | 113 return static_cast<RemoteFrameClient*>(client()); |
109 } | 114 } |
110 | 115 |
111 } // namespace blink | 116 } // namespace blink |
OLD | NEW |