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

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

Issue 640803004: Add a basic DOMWindow base class and use it in WindowProxy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/frame/RemoteFrameClient.h" 8 #include "core/frame/RemoteFrameClient.h"
9 #include "core/frame/RemoteFrameView.h" 9 #include "core/frame/RemoteFrameView.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 10 #include "core/html/HTMLFrameOwnerElement.h"
11 #include "platform/weborigin/SecurityPolicy.h" 11 #include "platform/weborigin/SecurityPolicy.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) 15 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner)
16 : Frame(client, host, owner) 16 : Frame(client, host, owner)
17 { 17 {
18 } 18 }
19 19
20 PassRefPtrWillBeRawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* clien t, FrameHost* host, FrameOwner* owner) 20 PassRefPtrWillBeRawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* clien t, FrameHost* host, FrameOwner* owner)
21 { 21 {
22 return adoptRefWillBeNoop(new RemoteFrame(client, host, owner)); 22 return adoptRefWillBeNoop(new RemoteFrame(client, host, owner));
23 } 23 }
24 24
25 RemoteFrame::~RemoteFrame() 25 RemoteFrame::~RemoteFrame()
26 { 26 {
27 setView(nullptr); 27 setView(nullptr);
28 } 28 }
29 29
30 void RemoteFrame::trace(Visitor* visitor)
31 {
32 visitor->trace(m_view);
33 Frame::trace(visitor);
34 }
35
30 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList) 36 void RemoteFrame::navigate(Document& originDocument, const KURL& url, bool lockB ackForwardList)
31 { 37 {
32 // The process where this frame actually lives won't have sufficient informa tion to determine 38 // The process where this frame actually lives won't have sufficient informa tion to determine
33 // correct referrer, since it won't have access to the originDocument. Set i t now. 39 // correct referrer, since it won't have access to the originDocument. Set i t now.
34 ResourceRequest request(url); 40 ResourceRequest request(url);
35 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer())); 41 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer()));
36 remoteFrameClient()->navigate(request, lockBackForwardList); 42 remoteFrameClient()->navigate(request, lockBackForwardList);
37 } 43 }
38 44
39 void RemoteFrame::detach() 45 void RemoteFrame::detach()
40 { 46 {
41 detachChildren(); 47 detachChildren();
42 if (!client()) 48 if (!client())
43 return; 49 return;
44 Frame::detach(); 50 Frame::detach();
45 } 51 }
46 52
47 void RemoteFrame::forwardInputEvent(Event* event) 53 void RemoteFrame::forwardInputEvent(Event* event)
48 { 54 {
49 remoteFrameClient()->forwardInputEvent(event); 55 remoteFrameClient()->forwardInputEvent(event);
50 } 56 }
51 57
52 void RemoteFrame::trace(Visitor* visitor)
53 {
54 visitor->trace(m_view);
55 Frame::trace(visitor);
56 }
57
58 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) 58 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view)
59 { 59 {
60 // Oilpan: as RemoteFrameView performs no finalization actions, 60 // Oilpan: as RemoteFrameView performs no finalization actions,
61 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) 61 // no explicit dispose() of it needed here. (cf. FrameView::dispose().)
62 m_view = view; 62 m_view = view;
63 } 63 }
64 64
65 void RemoteFrame::createView() 65 void RemoteFrame::createView()
66 { 66 {
67 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); 67 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this);
68 setView(view); 68 setView(view);
69 69
70 if (ownerRenderer()) { 70 if (ownerRenderer()) {
71 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); 71 HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
72 ASSERT(owner); 72 ASSERT(owner);
73 owner->setWidget(view); 73 owner->setWidget(view);
74 } 74 }
75 } 75 }
76 76
77 RemoteFrameClient* RemoteFrame::remoteFrameClient() const 77 RemoteFrameClient* RemoteFrame::remoteFrameClient() const
78 { 78 {
79 return static_cast<RemoteFrameClient*>(client()); 79 return static_cast<RemoteFrameClient*>(client());
80 } 80 }
81 81
82 } // namespace blink 82 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698