| 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 "web/WebRemoteFrameImpl.h" | 6 #include "web/WebRemoteFrameImpl.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/RemoteFrame.h" | |
| 10 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 11 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| 12 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 13 #include "public/platform/WebFloatRect.h" | 12 #include "public/platform/WebFloatRect.h" |
| 14 #include "public/platform/WebRect.h" | 13 #include "public/platform/WebRect.h" |
| 15 #include "public/web/WebDocument.h" | 14 #include "public/web/WebDocument.h" |
| 16 #include "public/web/WebFrameOwnerProperties.h" | 15 #include "public/web/WebFrameOwnerProperties.h" |
| 17 #include "public/web/WebPerformance.h" | 16 #include "public/web/WebPerformance.h" |
| 18 #include "public/web/WebRange.h" | 17 #include "public/web/WebRange.h" |
| 19 #include "public/web/WebTreeScopeType.h" | 18 #include "public/web/WebTreeScopeType.h" |
| 20 #include "web/RemoteBridgeFrameOwner.h" | 19 #include "web/RemoteBridgeFrameOwner.h" |
| 21 #include "web/WebViewImpl.h" | 20 #include "web/WebViewImpl.h" |
| 22 #include <v8/include/v8.h> | 21 #include <v8/include/v8.h> |
| 23 | 22 |
| 24 namespace blink { | 23 namespace blink { |
| 25 | 24 |
| 26 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, WebRemoteFrameCli
ent* client) | 25 WebRemoteFrame* WebRemoteFrame::create(WebTreeScopeType scope, WebRemoteFrameCli
ent* client) |
| 27 { | 26 { |
| 28 return WebRemoteFrameImpl::create(scope, client); | 27 return WebRemoteFrameImpl::create(scope, client); |
| 29 } | 28 } |
| 30 | 29 |
| 31 WebRemoteFrame* WebRemoteFrameImpl::create(WebTreeScopeType scope, WebRemoteFram
eClient* client) | 30 WebRemoteFrameImpl* WebRemoteFrameImpl::create(WebTreeScopeType scope, WebRemote
FrameClient* client) |
| 32 { | 31 { |
| 33 WebRemoteFrameImpl* frame = new WebRemoteFrameImpl(scope, client); | 32 WebRemoteFrameImpl* frame = new WebRemoteFrameImpl(scope, client); |
| 34 #if ENABLE(OILPAN) | 33 #if ENABLE(OILPAN) |
| 35 return frame; | 34 return frame; |
| 36 #else | 35 #else |
| 37 return adoptRef(frame).leakRef(); | 36 return adoptRef(frame).leakRef(); |
| 38 #endif | 37 #endif |
| 39 } | 38 } |
| 40 | 39 |
| 41 WebRemoteFrameImpl::~WebRemoteFrameImpl() | 40 WebRemoteFrameImpl::~WebRemoteFrameImpl() |
| 42 { | 41 { |
| 43 } | 42 } |
| 44 | 43 |
| 45 #if ENABLE(OILPAN) | 44 #if ENABLE(OILPAN) |
| 46 DEFINE_TRACE(WebRemoteFrameImpl) | 45 DEFINE_TRACE(WebRemoteFrameImpl) |
| 47 { | 46 { |
| 48 visitor->trace(m_frameClient); | 47 visitor->trace(m_frameClient); |
| 49 visitor->trace(m_frame); | 48 visitor->trace(m_frame); |
| 50 visitor->trace(m_ownersForChildren); | 49 visitor->trace(m_ownersForChildren); |
| 51 visitor->template registerWeakMembers<WebFrame, &WebFrame::clearWeakFrames>(
this); | 50 visitor->template registerWeakMembers<WebFrame, &WebFrame::clearWeakFrames>(
this); |
| 52 WebFrame::traceFrames(visitor, this); | 51 WebFrame::traceFrames(visitor, this); |
| 52 WebFrameImplBase::trace(visitor); |
| 53 } | 53 } |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 bool WebRemoteFrameImpl::isWebLocalFrame() const | 56 bool WebRemoteFrameImpl::isWebLocalFrame() const |
| 57 { | 57 { |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 WebLocalFrame* WebRemoteFrameImpl::toWebLocalFrame() | 61 WebLocalFrame* WebRemoteFrameImpl::toWebLocalFrame() |
| 62 { | 62 { |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // frame creation, and one from swapping it into the remote process). FrameL
oader might | 710 // frame creation, and one from swapping it into the remote process). FrameL
oader might |
| 711 // need a special initialization function for this case to avoid that duplic
ate navigation. | 711 // need a special initialization function for this case to avoid that duplic
ate navigation. |
| 712 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); | 712 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 713 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, | 713 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, |
| 714 // if the parent is remote, it should never be detached synchronously... | 714 // if the parent is remote, it should never be detached synchronously... |
| 715 ASSERT(child->frame()); | 715 ASSERT(child->frame()); |
| 716 return child; | 716 return child; |
| 717 } | 717 } |
| 718 | 718 |
| 719 | 719 |
| 720 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name) | 720 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& fallbackName) |
| 721 { | 721 { |
| 722 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 722 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
| 723 frame()->createView(); | 723 frame()->createView(); |
| 724 m_frame->tree().setName(name, nullAtom); | 724 m_frame->tree().setName(name, fallbackName); |
| 725 } | 725 } |
| 726 | 726 |
| 727 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) | 727 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) |
| 728 { | 728 { |
| 729 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); | 729 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); |
| 730 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = | 730 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
| 731 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); | 731 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); |
| 732 appendChild(child); | 732 appendChild(child); |
| 733 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name); | 733 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 734 return child; | 734 return child; |
| 735 } | 735 } |
| 736 | 736 |
| 737 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 737 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) |
| 738 { | 738 { |
| 739 m_frame = frame; | 739 m_frame = frame; |
| 740 } | 740 } |
| 741 | 741 |
| 742 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 742 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 743 { | 743 { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 : WebRemoteFrame(scope) | 799 : WebRemoteFrame(scope) |
| 800 , m_frameClient(RemoteFrameClientImpl::create(this)) | 800 , m_frameClient(RemoteFrameClientImpl::create(this)) |
| 801 , m_client(client) | 801 , m_client(client) |
| 802 #if ENABLE(OILPAN) | 802 #if ENABLE(OILPAN) |
| 803 , m_selfKeepAlive(this) | 803 , m_selfKeepAlive(this) |
| 804 #endif | 804 #endif |
| 805 { | 805 { |
| 806 } | 806 } |
| 807 | 807 |
| 808 } // namespace blink | 808 } // namespace blink |
| OLD | NEW |