Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
| index bb48a3cf55886e608712358f5ca4abb320be4057..ec9525a679327798545defff3f20bf58f4d7ebfc 100644 |
| --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
| @@ -1475,7 +1475,7 @@ WebLocalFrameImpl* WebLocalFrameImpl::createProvisional(WebFrameClient* client, |
| RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner.get()); |
| // Set the name and unique name directly, bypassing any of the normal logic |
| // to calculate unique name. |
| - frame->tree().setNameForReplacementFrame(toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); |
| + frame->tree().setReplicatedName(toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); |
| webFrame->setCoreFrame(frame); |
| frame->setOwner(oldFrame->owner()); |
| @@ -1584,10 +1584,10 @@ void WebLocalFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame> frame) |
| } |
| } |
| -void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& fallbackName) |
| +void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName) |
| { |
| setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner)); |
| - frame()->tree().setName(name, fallbackName); |
| + frame()->tree().setReplicatedName(name, uniqueName); |
|
dcheng
2016/02/16 22:17:29
This isn't really setting the replicated name thou
Łukasz Anforowicz
2016/02/16 23:39:53
Good point - I wasn't quite happy about setReplica
|
| // We must call init() after m_frame is assigned because it is referenced |
| // during init(). Note that this may dispatch JS events; the frame may be |
| // detached after init() returns. |
| @@ -1603,7 +1603,9 @@ PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra |
| ? WebTreeScopeType::Document |
| : WebTreeScopeType::Shadow; |
| WebFrameOwnerProperties ownerProperties(ownerElement->scrollingMode(), ownerElement->marginWidth(), ownerElement->marginHeight()); |
| - RefPtrWillBeRawPtr<WebLocalFrameImpl> webframeChild = toWebLocalFrameImpl(m_client->createChildFrame(this, scope, name, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags()), ownerProperties)); |
| + AtomicString uniqueName = frame()->tree().calculateUniqueNameForNewChildFrame( |
| + name, ownerElement->getAttribute(ownerElement->subResourceAttributeName())); |
| + RefPtrWillBeRawPtr<WebLocalFrameImpl> webframeChild = toWebLocalFrameImpl(m_client->createChildFrame(this, scope, name, uniqueName, static_cast<WebSandboxFlags>(ownerElement->sandboxFlags()), ownerProperties)); |
| if (!webframeChild) |
| return nullptr; |
| @@ -1611,7 +1613,7 @@ PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra |
| // solution. subResourceAttributeName returns just one attribute name. The |
| // element might not have the attribute, and there might be other attributes |
| // which can identify the element. |
| - webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subResourceAttributeName())); |
| + webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, uniqueName); |
| // Initializing the core frame may cause the new child to be detached, since |
| // it may dispatch a load event in the parent. |
| if (!webframeChild->parent()) |