| 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() |
| (...skipping 668 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 | 709 // 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. | 710 // 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); | 711 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, | 712 // 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... | 713 // if the parent is remote, it should never be detached synchronously... |
| 715 ASSERT(child->frame()); | 714 ASSERT(child->frame()); |
| 716 return child; | 715 return child; |
| 717 } | 716 } |
| 718 | 717 |
| 719 | 718 |
| 720 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name) | 719 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& fallbackName) |
| 721 { | 720 { |
| 722 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 721 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
| 723 frame()->createView(); | 722 frame()->createView(); |
| 724 m_frame->tree().setName(name, nullAtom); | 723 m_frame->tree().setName(name, fallbackName); |
| 725 } | 724 } |
| 726 | 725 |
| 727 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) | 726 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, WebSandboxFlags sandboxFlags, WebRemoteFrameClient* client) |
| 728 { | 727 { |
| 729 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); | 728 WebRemoteFrameImpl* child = toWebRemoteFrameImpl(WebRemoteFrame::create(scop
e, client)); |
| 730 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = | 729 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner>>::AddResult resu
lt = |
| 731 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); | 730 m_ownersForChildren.add(child, RemoteBridgeFrameOwner::create(nullptr, s
tatic_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties())); |
| 732 appendChild(child); | 731 appendChild(child); |
| 733 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name); | 732 child->initializeCoreFrame(frame()->host(), result.storedValue->value.get(),
name, nullAtom); |
| 734 return child; | 733 return child; |
| 735 } | 734 } |
| 736 | 735 |
| 737 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) | 736 void WebRemoteFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame> frame) |
| 738 { | 737 { |
| 739 m_frame = frame; | 738 m_frame = frame; |
| 740 } | 739 } |
| 741 | 740 |
| 742 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 741 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 743 { | 742 { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 : WebRemoteFrame(scope) | 798 : WebRemoteFrame(scope) |
| 800 , m_frameClient(RemoteFrameClientImpl::create(this)) | 799 , m_frameClient(RemoteFrameClientImpl::create(this)) |
| 801 , m_client(client) | 800 , m_client(client) |
| 802 #if ENABLE(OILPAN) | 801 #if ENABLE(OILPAN) |
| 803 , m_selfKeepAlive(this) | 802 , m_selfKeepAlive(this) |
| 804 #endif | 803 #endif |
| 805 { | 804 { |
| 806 } | 805 } |
| 807 | 806 |
| 808 } // namespace blink | 807 } // namespace blink |
| OLD | NEW |