| 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 "bindings/core/v8/DOMWrapperWorld.h" | 7 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 8 #include "bindings/core/v8/WindowProxy.h" | 8 #include "bindings/core/v8/WindowProxy.h" |
| 9 #include "core/dom/Fullscreen.h" | 9 #include "core/dom/Fullscreen.h" |
| 10 #include "core/dom/RemoteSecurityContext.h" | 10 #include "core/dom/RemoteSecurityContext.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 WebLocalFrame* WebRemoteFrameImpl::createLocalChild( | 319 WebLocalFrame* WebRemoteFrameImpl::createLocalChild( |
| 320 WebTreeScopeType scope, | 320 WebTreeScopeType scope, |
| 321 const WebString& name, | 321 const WebString& name, |
| 322 WebSandboxFlags sandboxFlags, | 322 WebSandboxFlags sandboxFlags, |
| 323 WebFrameClient* client, | 323 WebFrameClient* client, |
| 324 blink::InterfaceProvider* interfaceProvider, | 324 blink::InterfaceProvider* interfaceProvider, |
| 325 blink::InterfaceRegistry* interfaceRegistry, | 325 blink::InterfaceRegistry* interfaceRegistry, |
| 326 WebFrame* previousSibling, | 326 WebFrame* previousSibling, |
| 327 const WebParsedFeaturePolicy& containerPolicy, |
| 327 const WebFrameOwnerProperties& frameOwnerProperties, | 328 const WebFrameOwnerProperties& frameOwnerProperties, |
| 328 WebFrame* opener) { | 329 WebFrame* opener) { |
| 329 WebLocalFrameImpl* child = WebLocalFrameImpl::create( | 330 WebLocalFrameImpl* child = WebLocalFrameImpl::create( |
| 330 scope, client, interfaceProvider, interfaceRegistry, opener); | 331 scope, client, interfaceProvider, interfaceRegistry, opener); |
| 331 insertAfter(child, previousSibling); | 332 insertAfter(child, previousSibling); |
| 332 RemoteFrameOwner* owner = RemoteFrameOwner::create( | 333 RemoteFrameOwner* owner = |
| 333 static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties); | 334 RemoteFrameOwner::create(static_cast<SandboxFlags>(sandboxFlags), |
| 335 containerPolicy, frameOwnerProperties); |
| 334 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, | 336 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, |
| 335 // which may result in the browser observing two navigations to about:blank | 337 // which may result in the browser observing two navigations to about:blank |
| 336 // (one from the initial frame creation, and one from swapping it into the | 338 // (one from the initial frame creation, and one from swapping it into the |
| 337 // remote process). FrameLoader might need a special initialization function | 339 // remote process). FrameLoader might need a special initialization function |
| 338 // for this case to avoid that duplicate navigation. | 340 // for this case to avoid that duplicate navigation. |
| 339 child->initializeCoreFrame(*frame()->page(), owner, name); | 341 child->initializeCoreFrame(*frame()->page(), owner, name); |
| 340 // Partially related with the above FIXME--the init() call may trigger JS | 342 // Partially related with the above FIXME--the init() call may trigger JS |
| 341 // dispatch. However, | 343 // dispatch. However, |
| 342 // if the parent is remote, it should never be detached synchronously... | 344 // if the parent is remote, it should never be detached synchronously... |
| 343 DCHECK(child->frame()); | 345 DCHECK(child->frame()); |
| 344 return child; | 346 return child; |
| 345 } | 347 } |
| 346 | 348 |
| 347 void WebRemoteFrameImpl::initializeCoreFrame(Page& page, | 349 void WebRemoteFrameImpl::initializeCoreFrame(Page& page, |
| 348 FrameOwner* owner, | 350 FrameOwner* owner, |
| 349 const AtomicString& name) { | 351 const AtomicString& name) { |
| 350 setCoreFrame(RemoteFrame::create(m_frameClient.get(), page, owner)); | 352 setCoreFrame(RemoteFrame::create(m_frameClient.get(), page, owner)); |
| 351 frame()->createView(); | 353 frame()->createView(); |
| 352 m_frame->tree().setName(name); | 354 m_frame->tree().setName(name); |
| 353 } | 355 } |
| 354 | 356 |
| 355 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild( | 357 WebRemoteFrame* WebRemoteFrameImpl::createRemoteChild( |
| 356 WebTreeScopeType scope, | 358 WebTreeScopeType scope, |
| 357 const WebString& name, | 359 const WebString& name, |
| 358 WebSandboxFlags sandboxFlags, | 360 WebSandboxFlags sandboxFlags, |
| 361 const WebParsedFeaturePolicy& containerPolicy, |
| 359 WebRemoteFrameClient* client, | 362 WebRemoteFrameClient* client, |
| 360 WebFrame* opener) { | 363 WebFrame* opener) { |
| 361 WebRemoteFrameImpl* child = WebRemoteFrameImpl::create(scope, client, opener); | 364 WebRemoteFrameImpl* child = WebRemoteFrameImpl::create(scope, client, opener); |
| 362 appendChild(child); | 365 appendChild(child); |
| 363 RemoteFrameOwner* owner = RemoteFrameOwner::create( | 366 RemoteFrameOwner* owner = |
| 364 static_cast<SandboxFlags>(sandboxFlags), WebFrameOwnerProperties()); | 367 RemoteFrameOwner::create(static_cast<SandboxFlags>(sandboxFlags), |
| 368 containerPolicy, WebFrameOwnerProperties()); |
| 365 child->initializeCoreFrame(*frame()->page(), owner, name); | 369 child->initializeCoreFrame(*frame()->page(), owner, name); |
| 366 return child; | 370 return child; |
| 367 } | 371 } |
| 368 | 372 |
| 369 void WebRemoteFrameImpl::setWebLayer(WebLayer* layer) { | 373 void WebRemoteFrameImpl::setWebLayer(WebLayer* layer) { |
| 370 if (!frame()) | 374 if (!frame()) |
| 371 return; | 375 return; |
| 372 | 376 |
| 373 frame()->setWebLayer(layer); | 377 frame()->setWebLayer(layer); |
| 374 } | 378 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 } | 531 } |
| 528 | 532 |
| 529 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 533 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
| 530 WebRemoteFrameClient* client) | 534 WebRemoteFrameClient* client) |
| 531 : WebRemoteFrame(scope), | 535 : WebRemoteFrame(scope), |
| 532 m_frameClient(RemoteFrameClientImpl::create(this)), | 536 m_frameClient(RemoteFrameClientImpl::create(this)), |
| 533 m_client(client), | 537 m_client(client), |
| 534 m_selfKeepAlive(this) {} | 538 m_selfKeepAlive(this) {} |
| 535 | 539 |
| 536 } // namespace blink | 540 } // namespace blink |
| OLD | NEW |