Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1141553006: Update Blink to use the tree scope info on WebFrame for scoping checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const 1578 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const
1579 { 1579 {
1580 if (!frame()) 1580 if (!frame())
1581 return WebString(); 1581 return WebString();
1582 1582
1583 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal)); 1583 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal));
1584 } 1584 }
1585 1585
1586 // WebLocalFrameImpl public ---------------------------------------------------- ----- 1586 // WebLocalFrameImpl public ---------------------------------------------------- -----
1587 1587
1588 WebLocalFrame* WebLocalFrame::create(WebFrameClient* client)
1589 {
1590 return WebLocalFrame::create(WebTreeScopeType::Document, client);
1591 }
1592
1593 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent) 1588 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent)
1594 { 1589 {
1595 return WebLocalFrameImpl::create(scope, client); 1590 return WebLocalFrameImpl::create(scope, client);
1596 } 1591 }
1597 1592
1598 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client) 1593 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client)
1599 { 1594 {
1600 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client); 1595 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client);
1601 #if ENABLE(OILPAN) 1596 #if ENABLE(OILPAN)
1602 return frame; 1597 return frame;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 // during init(). Note that this may dispatch JS events; the frame may be 1679 // during init(). Note that this may dispatch JS events; the frame may be
1685 // detached after init() returns. 1680 // detached after init() returns.
1686 frame->init(); 1681 frame->init();
1687 return frame; 1682 return frame;
1688 } 1683 }
1689 1684
1690 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra meLoadRequest& request, 1685 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra meLoadRequest& request,
1691 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) 1686 const AtomicString& name, HTMLFrameOwnerElement* ownerElement)
1692 { 1687 {
1693 ASSERT(m_client); 1688 ASSERT(m_client);
1694 WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChild Frame(this, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags()))); 1689 WebTreeScopeType scope = frame()->document() == ownerElement->treeScope()
dcheng 2015/05/21 22:50:10 This is probably the most significant change in th
1690 ? WebTreeScopeType::Document
1691 : WebTreeScopeType::Shadow;
1692 WebLocalFrameImpl* webframeChild = toWebLocalFrameImpl(m_client->createChild Frame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags ())));
1695 if (!webframeChild) 1693 if (!webframeChild)
1696 return nullptr; 1694 return nullptr;
1697 1695
1698 // FIXME: Using subResourceAttributeName as fallback is not a perfect 1696 // FIXME: Using subResourceAttributeName as fallback is not a perfect
1699 // solution. subResourceAttributeName returns just one attribute name. The 1697 // solution. subResourceAttributeName returns just one attribute name. The
1700 // element might not have the attribute, and there might be other attributes 1698 // element might not have the attribute, and there might be other attributes
1701 // which can identify the element. 1699 // which can identify the element.
1702 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName())); 1700 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName()));
1703 // Initializing the core frame may cause the new child to be detached, since 1701 // Initializing the core frame may cause the new child to be detached, since
1704 // it may dispatch a load event in the parent. 1702 // it may dispatch a load event in the parent.
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 { 2093 {
2096 m_frameWidget = frameWidget; 2094 m_frameWidget = frameWidget;
2097 } 2095 }
2098 2096
2099 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const 2097 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const
2100 { 2098 {
2101 return m_frameWidget; 2099 return m_frameWidget;
2102 } 2100 }
2103 2101
2104 } // namespace blink 2102 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698