| 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 "web/WebRemoteFrameImpl.h" | 5 #include "web/WebRemoteFrameImpl.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/LayoutObject.h" | 10 #include "core/layout/LayoutObject.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const | 576 WebString WebRemoteFrameImpl::layerTreeAsText(bool showDebugInfo) const |
| 577 { | 577 { |
| 578 ASSERT_NOT_REACHED(); | 578 ASSERT_NOT_REACHED(); |
| 579 return WebString(); | 579 return WebString(); |
| 580 } | 580 } |
| 581 | 581 |
| 582 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons
t WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, We
bFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties&
frameOwnerProperties, WebFrame* opener) | 582 WebLocalFrame* WebRemoteFrameImpl::createLocalChild(WebTreeScopeType scope, cons
t WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, We
bFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties&
frameOwnerProperties, WebFrame* opener) |
| 583 { | 583 { |
| 584 WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener); | 584 WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener); |
| 585 insertAfter(child, previousSibling); | 585 insertAfter(child, previousSibling); |
| 586 RawPtr<RemoteFrameOwner> owner = RemoteFrameOwner::create(static_cast<Sandbo
xFlags>(sandboxFlags), frameOwnerProperties); | 586 RemoteFrameOwner* owner = RemoteFrameOwner::create(static_cast<SandboxFlags>
(sandboxFlags), frameOwnerProperties); |
| 587 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may | 587 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame,
which may |
| 588 // result in the browser observing two navigations to about:blank (one from
the initial | 588 // result in the browser observing two navigations to about:blank (one from
the initial |
| 589 // frame creation, and one from swapping it into the remote process). FrameL
oader might | 589 // frame creation, and one from swapping it into the remote process). FrameL
oader might |
| 590 // need a special initialization function for this case to avoid that duplic
ate navigation. | 590 // need a special initialization function for this case to avoid that duplic
ate navigation. |
| 591 child->initializeCoreFrame(frame()->host(), owner.get(), name, uniqueName); | 591 child->initializeCoreFrame(frame()->host(), owner, name, uniqueName); |
| 592 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, | 592 // Partially related with the above FIXME--the init() call may trigger JS di
spatch. However, |
| 593 // if the parent is remote, it should never be detached synchronously... | 593 // if the parent is remote, it should never be detached synchronously... |
| 594 DCHECK(child->frame()); | 594 DCHECK(child->frame()); |
| 595 return child; | 595 return child; |
| 596 } | 596 } |
| 597 | 597 |
| 598 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) | 598 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) |
| 599 { | 599 { |
| 600 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 600 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
| 601 frame()->createView(); | 601 frame()->createView(); |
| 602 m_frame->tree().setPrecalculatedName(name, uniqueName); | 602 m_frame->tree().setPrecalculatedName(name, uniqueName); |
| 603 } | 603 } |
| 604 | 604 |
| 605 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags,
WebRemoteFrameClient* client, WebFrame* opener) | 605 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild(WebTreeScopeType scope, co
nst WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags,
WebRemoteFrameClient* client, WebFrame* opener) |
| 606 { | 606 { |
| 607 WebRemoteFrameImpl* child = WebRemoteFrameImpl::create(scope, client, opener
); | 607 WebRemoteFrameImpl* child = WebRemoteFrameImpl::create(scope, client, opener
); |
| 608 appendChild(child); | 608 appendChild(child); |
| 609 RawPtr<RemoteFrameOwner> owner = RemoteFrameOwner::create(static_cast<Sandbo
xFlags>(sandboxFlags), WebFrameOwnerProperties()); | 609 RemoteFrameOwner* owner = RemoteFrameOwner::create(static_cast<SandboxFlags>
(sandboxFlags), WebFrameOwnerProperties()); |
| 610 child->initializeCoreFrame(frame()->host(), owner.get(), name, uniqueName); | 610 child->initializeCoreFrame(frame()->host(), owner, name, uniqueName); |
| 611 return child; | 611 return child; |
| 612 } | 612 } |
| 613 | 613 |
| 614 void WebRemoteFrameImpl::setCoreFrame(RawPtr<RemoteFrame> frame) | 614 void WebRemoteFrameImpl::setCoreFrame(RemoteFrame* frame) |
| 615 { | 615 { |
| 616 m_frame = frame; | 616 m_frame = frame; |
| 617 } | 617 } |
| 618 | 618 |
| 619 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) | 619 WebRemoteFrameImpl* WebRemoteFrameImpl::fromFrame(RemoteFrame& frame) |
| 620 { | 620 { |
| 621 if (!frame.client()) | 621 if (!frame.client()) |
| 622 return nullptr; | 622 return nullptr; |
| 623 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); | 623 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); |
| 624 } | 624 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 : WebRemoteFrame(scope) | 712 : WebRemoteFrame(scope) |
| 713 , m_frameClient(RemoteFrameClientImpl::create(this)) | 713 , m_frameClient(RemoteFrameClientImpl::create(this)) |
| 714 , m_client(client) | 714 , m_client(client) |
| 715 #if ENABLE(OILPAN) | 715 #if ENABLE(OILPAN) |
| 716 , m_selfKeepAlive(this) | 716 , m_selfKeepAlive(this) |
| 717 #endif | 717 #endif |
| 718 { | 718 { |
| 719 } | 719 } |
| 720 | 720 |
| 721 } // namespace blink | 721 } // namespace blink |
| OLD | NEW |