Chromium Code Reviews| 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 "core/dom/RemoteSecurityContext.h" | |
| 8 #include "core/frame/RemoteFrameClient.h" | 9 #include "core/frame/RemoteFrameClient.h" |
| 9 #include "core/frame/RemoteFrameView.h" | 10 #include "core/frame/RemoteFrameView.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 11 #include "core/html/HTMLFrameOwnerElement.h" |
| 11 #include "platform/weborigin/SecurityPolicy.h" | 12 #include "platform/weborigin/SecurityPolicy.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) | 16 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) |
| 16 : Frame(client, host, owner) | 17 : Frame(client, host, owner) |
| 17 { | 18 { |
| 18 } | 19 } |
| 19 | 20 |
| 20 PassRefPtrWillBeRawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* clien t, FrameHost* host, FrameOwner* owner) | 21 PassRefPtrWillBeRawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* clien t, FrameHost* host, FrameOwner* owner) |
| 21 { | 22 { |
| 22 return adoptRefWillBeNoop(new RemoteFrame(client, host, owner)); | 23 RefPtrWillBeRawPtr<RemoteFrame> frame = adoptRefWillBeNoop(new RemoteFrame(c lient, host, owner)); |
| 24 frame->m_securityContext = RemoteSecurityContext::create(); | |
|
dcheng
2014/11/12 21:55:50
Should we move this into the constructor?
alexmos
2014/11/18 18:35:17
Yes, this will be cleaner. Not sure if the the in
| |
| 25 return frame.release(); | |
| 23 } | 26 } |
| 24 | 27 |
| 25 RemoteFrame::~RemoteFrame() | 28 RemoteFrame::~RemoteFrame() |
| 26 { | 29 { |
| 27 setView(nullptr); | 30 setView(nullptr); |
| 28 } | 31 } |
| 29 | 32 |
| 30 void RemoteFrame::trace(Visitor* visitor) | 33 void RemoteFrame::trace(Visitor* visitor) |
| 31 { | 34 { |
| 32 visitor->trace(m_view); | 35 visitor->trace(m_view); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 48 if (!client()) | 51 if (!client()) |
| 49 return; | 52 return; |
| 50 Frame::detach(); | 53 Frame::detach(); |
| 51 } | 54 } |
| 52 | 55 |
| 53 void RemoteFrame::forwardInputEvent(Event* event) | 56 void RemoteFrame::forwardInputEvent(Event* event) |
| 54 { | 57 { |
| 55 remoteFrameClient()->forwardInputEvent(event); | 58 remoteFrameClient()->forwardInputEvent(event); |
| 56 } | 59 } |
| 57 | 60 |
| 61 RemoteSecurityContext* RemoteFrame::securityContext() const | |
| 62 { | |
| 63 return m_securityContext.get(); | |
| 64 } | |
| 65 | |
| 58 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) | 66 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) |
| 59 { | 67 { |
| 60 // Oilpan: as RemoteFrameView performs no finalization actions, | 68 // Oilpan: as RemoteFrameView performs no finalization actions, |
| 61 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) | 69 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
| 62 m_view = view; | 70 m_view = view; |
| 63 } | 71 } |
| 64 | 72 |
| 65 void RemoteFrame::createView() | 73 void RemoteFrame::createView() |
| 66 { | 74 { |
| 67 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); | 75 RefPtrWillBeRawPtr<RemoteFrameView> view = RemoteFrameView::create(this); |
| 68 setView(view); | 76 setView(view); |
| 69 | 77 |
| 70 if (ownerRenderer()) { | 78 if (ownerRenderer()) { |
| 71 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); | 79 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); |
| 72 ASSERT(owner); | 80 ASSERT(owner); |
| 73 owner->setWidget(view); | 81 owner->setWidget(view); |
| 74 } | 82 } |
| 75 } | 83 } |
| 76 | 84 |
| 77 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 85 RemoteFrameClient* RemoteFrame::remoteFrameClient() const |
| 78 { | 86 { |
| 79 return static_cast<RemoteFrameClient*>(client()); | 87 return static_cast<RemoteFrameClient*>(client()); |
| 80 } | 88 } |
| 81 | 89 |
| 82 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |