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/dom/Fullscreen.h" | 7 #include "core/dom/Fullscreen.h" |
8 #include "core/dom/RemoteSecurityContext.h" | 8 #include "core/dom/RemoteSecurityContext.h" |
9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const WebString& uniqueName, | 351 const WebString& uniqueName, |
352 WebSandboxFlags sandboxFlags, | 352 WebSandboxFlags sandboxFlags, |
353 WebFrameClient* client, | 353 WebFrameClient* client, |
354 WebFrame* previousSibling, | 354 WebFrame* previousSibling, |
355 const WebFrameOwnerProperties& frameOwnerProperties, | 355 const WebFrameOwnerProperties& frameOwnerProperties, |
356 WebFrame* opener) { | 356 WebFrame* opener) { |
357 WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener); | 357 WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener); |
358 insertAfter(child, previousSibling); | 358 insertAfter(child, previousSibling); |
359 RemoteFrameOwner* owner = RemoteFrameOwner::create( | 359 RemoteFrameOwner* owner = RemoteFrameOwner::create( |
360 static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties); | 360 static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties); |
361 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, w
hich may | 361 // FIXME: currently this calls LocalFrame::init() on the created LocalFrame, |
362 // result in the browser observing two navigations to about:blank (one from th
e initial | 362 // which may result in the browser observing two navigations to about:blank |
363 // frame creation, and one from swapping it into the remote process). FrameLoa
der might | 363 // (one from the initial frame creation, and one from swapping it into the |
364 // need a special initialization function for this case to avoid that duplicat
e navigation. | 364 // remote process). FrameLoader might need a special initialization function |
| 365 // for this case to avoid that duplicate navigation. |
365 child->initializeCoreFrame(frame()->host(), owner, name, uniqueName); | 366 child->initializeCoreFrame(frame()->host(), owner, name, uniqueName); |
366 // Partially related with the above FIXME--the init() call may trigger JS disp
atch. However, | 367 // Partially related with the above FIXME--the init() call may trigger JS |
| 368 // dispatch. However, |
367 // if the parent is remote, it should never be detached synchronously... | 369 // if the parent is remote, it should never be detached synchronously... |
368 DCHECK(child->frame()); | 370 DCHECK(child->frame()); |
369 return child; | 371 return child; |
370 } | 372 } |
371 | 373 |
372 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, | 374 void WebRemoteFrameImpl::initializeCoreFrame(FrameHost* host, |
373 FrameOwner* owner, | 375 FrameOwner* owner, |
374 const AtomicString& name, | 376 const AtomicString& name, |
375 const AtomicString& uniqueName) { | 377 const AtomicString& uniqueName) { |
376 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); | 378 setCoreFrame(RemoteFrame::create(m_frameClient.get(), host, owner)); |
(...skipping 24 matching lines...) Expand all Loading... |
401 if (!frame.client()) | 403 if (!frame.client()) |
402 return nullptr; | 404 return nullptr; |
403 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); | 405 return static_cast<RemoteFrameClientImpl*>(frame.client())->webFrame(); |
404 } | 406 } |
405 | 407 |
406 void WebRemoteFrameImpl::setReplicatedOrigin( | 408 void WebRemoteFrameImpl::setReplicatedOrigin( |
407 const WebSecurityOrigin& origin) const { | 409 const WebSecurityOrigin& origin) const { |
408 DCHECK(frame()); | 410 DCHECK(frame()); |
409 frame()->securityContext()->setReplicatedOrigin(origin); | 411 frame()->securityContext()->setReplicatedOrigin(origin); |
410 | 412 |
411 // If the origin of a remote frame changed, the accessibility object for the o
wner | 413 // If the origin of a remote frame changed, the accessibility object for the |
412 // element now points to a different child. | 414 // owner element now points to a different child. |
413 // | 415 // |
414 // TODO(dmazzoni, dcheng): there's probably a better way to solve this. | 416 // TODO(dmazzoni, dcheng): there's probably a better way to solve this. |
415 // Run SitePerProcessAccessibilityBrowserTest.TwoCrossSiteNavigations to | 417 // Run SitePerProcessAccessibilityBrowserTest.TwoCrossSiteNavigations to |
416 // ensure an alternate fix works. http://crbug.com/566222 | 418 // ensure an alternate fix works. http://crbug.com/566222 |
417 FrameOwner* owner = frame()->owner(); | 419 FrameOwner* owner = frame()->owner(); |
418 if (owner && owner->isLocal()) { | 420 if (owner && owner->isLocal()) { |
419 HTMLElement* ownerElement = toHTMLFrameOwnerElement(owner); | 421 HTMLElement* ownerElement = toHTMLFrameOwnerElement(owner); |
420 AXObjectCache* cache = ownerElement->document().existingAXObjectCache(); | 422 AXObjectCache* cache = ownerElement->document().existingAXObjectCache(); |
421 if (cache) | 423 if (cache) |
422 cache->childrenChanged(ownerElement); | 424 cache->childrenChanged(ownerElement); |
(...skipping 28 matching lines...) Expand all Loading... |
451 | 453 |
452 void WebRemoteFrameImpl::setReplicatedInsecureRequestPolicy( | 454 void WebRemoteFrameImpl::setReplicatedInsecureRequestPolicy( |
453 WebInsecureRequestPolicy policy) const { | 455 WebInsecureRequestPolicy policy) const { |
454 DCHECK(frame()); | 456 DCHECK(frame()); |
455 frame()->securityContext()->setInsecureRequestPolicy(policy); | 457 frame()->securityContext()->setInsecureRequestPolicy(policy); |
456 } | 458 } |
457 | 459 |
458 void WebRemoteFrameImpl::setReplicatedPotentiallyTrustworthyUniqueOrigin( | 460 void WebRemoteFrameImpl::setReplicatedPotentiallyTrustworthyUniqueOrigin( |
459 bool isUniqueOriginPotentiallyTrustworthy) const { | 461 bool isUniqueOriginPotentiallyTrustworthy) const { |
460 DCHECK(frame()); | 462 DCHECK(frame()); |
461 // If |isUniqueOriginPotentiallyTrustworthy| is true, then the origin must be
unique. | 463 // If |isUniqueOriginPotentiallyTrustworthy| is true, then the origin must be |
| 464 // unique. |
462 DCHECK(!isUniqueOriginPotentiallyTrustworthy || | 465 DCHECK(!isUniqueOriginPotentiallyTrustworthy || |
463 frame()->securityContext()->getSecurityOrigin()->isUnique()); | 466 frame()->securityContext()->getSecurityOrigin()->isUnique()); |
464 frame() | 467 frame() |
465 ->securityContext() | 468 ->securityContext() |
466 ->getSecurityOrigin() | 469 ->getSecurityOrigin() |
467 ->setUniqueOriginIsPotentiallyTrustworthy( | 470 ->setUniqueOriginIsPotentiallyTrustworthy( |
468 isUniqueOriginPotentiallyTrustworthy); | 471 isUniqueOriginPotentiallyTrustworthy); |
469 } | 472 } |
470 | 473 |
471 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const { | 474 void WebRemoteFrameImpl::DispatchLoadEventForFrameOwner() const { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 522 } |
520 | 523 |
521 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, | 524 WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, |
522 WebRemoteFrameClient* client) | 525 WebRemoteFrameClient* client) |
523 : WebRemoteFrame(scope), | 526 : WebRemoteFrame(scope), |
524 m_frameClient(RemoteFrameClientImpl::create(this)), | 527 m_frameClient(RemoteFrameClientImpl::create(this)), |
525 m_client(client), | 528 m_client(client), |
526 m_selfKeepAlive(this) {} | 529 m_selfKeepAlive(this) {} |
527 | 530 |
528 } // namespace blink | 531 } // namespace blink |
OLD | NEW |