Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 #include "core/layout/LayoutPart.h" | 139 #include "core/layout/LayoutPart.h" |
| 140 #include "core/layout/LayoutTreeAsText.h" | 140 #include "core/layout/LayoutTreeAsText.h" |
| 141 #include "core/layout/LayoutView.h" | 141 #include "core/layout/LayoutView.h" |
| 142 #include "core/style/StyleInheritedData.h" | 142 #include "core/style/StyleInheritedData.h" |
| 143 #include "core/loader/DocumentLoader.h" | 143 #include "core/loader/DocumentLoader.h" |
| 144 #include "core/loader/FrameLoadRequest.h" | 144 #include "core/loader/FrameLoadRequest.h" |
| 145 #include "core/loader/FrameLoader.h" | 145 #include "core/loader/FrameLoader.h" |
| 146 #include "core/loader/HistoryItem.h" | 146 #include "core/loader/HistoryItem.h" |
| 147 #include "core/loader/MixedContentChecker.h" | 147 #include "core/loader/MixedContentChecker.h" |
| 148 #include "core/loader/NavigationScheduler.h" | 148 #include "core/loader/NavigationScheduler.h" |
| 149 #include "core/loader/ProgressTracker.h" | |
| 149 #include "core/page/FocusController.h" | 150 #include "core/page/FocusController.h" |
| 150 #include "core/page/FrameTree.h" | 151 #include "core/page/FrameTree.h" |
| 151 #include "core/page/Page.h" | 152 #include "core/page/Page.h" |
| 152 #include "core/page/PrintContext.h" | 153 #include "core/page/PrintContext.h" |
| 153 #include "core/paint/PaintLayer.h" | 154 #include "core/paint/PaintLayer.h" |
| 154 #include "core/paint/ScopeRecorder.h" | 155 #include "core/paint/ScopeRecorder.h" |
| 155 #include "core/paint/TransformRecorder.h" | 156 #include "core/paint/TransformRecorder.h" |
| 156 #include "core/timing/DOMWindowPerformance.h" | 157 #include "core/timing/DOMWindowPerformance.h" |
| 157 #include "core/timing/Performance.h" | 158 #include "core/timing/Performance.h" |
| 158 #include "modules/app_banner/AppBannerController.h" | 159 #include "modules/app_banner/AppBannerController.h" |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1750 // solution. subResourceAttributeName returns just one attribute name. The | 1751 // solution. subResourceAttributeName returns just one attribute name. The |
| 1751 // element might not have the attribute, and there might be other attributes | 1752 // element might not have the attribute, and there might be other attributes |
| 1752 // which can identify the element. | 1753 // which can identify the element. |
| 1753 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName())); | 1754 RefPtrWillBeRawPtr<LocalFrame> child = webframeChild->initializeCoreFrame(fr ame()->host(), ownerElement, name, ownerElement->getAttribute(ownerElement->subR esourceAttributeName())); |
| 1754 // Initializing the core frame may cause the new child to be detached, since | 1755 // Initializing the core frame may cause the new child to be detached, since |
| 1755 // it may dispatch a load event in the parent. | 1756 // it may dispatch a load event in the parent. |
| 1756 if (!child->tree().parent()) | 1757 if (!child->tree().parent()) |
| 1757 return nullptr; | 1758 return nullptr; |
| 1758 | 1759 |
| 1759 // If we're moving in the back/forward list, we might want to replace the co ntent | 1760 // If we're moving in the back/forward list, we might want to replace the co ntent |
| 1760 // of this child frame with whatever was there at that point. | 1761 // of this child frame with whatever was there at that point. The client may want |
| 1762 // to do this asynchronously, in which case shouldLoadRequest will be set to false. | |
| 1763 bool shouldLoadRequest = true; | |
| 1761 RefPtrWillBeRawPtr<HistoryItem> childItem = nullptr; | 1764 RefPtrWillBeRawPtr<HistoryItem> childItem = nullptr; |
| 1762 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished()) | 1765 if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->documen t()->loadEventFinished()) { |
| 1763 childItem = PassRefPtrWillBeRawPtr<HistoryItem>(webframeChild->client()- >historyItemForNewChildFrame(webframeChild)); | 1766 childItem = PassRefPtrWillBeRawPtr<HistoryItem>(webframeChild->client()- >historyItemForNewChildFrame(&shouldLoadRequest)); |
| 1767 if (!shouldLoadRequest) { | |
| 1768 // The load will start in the browser process, so let the progress t racker | |
| 1769 // know about it. | |
| 1770 child->loader().progress().progressStarted(); | |
|
dcheng
2015/11/25 06:18:55
I feel a bit sad about this: we added NavigationPo
Charlie Reis
2015/11/25 18:41:15
Hmm. That's in shouldContinueForNavigationPolicy,
| |
| 1771 return child; | |
| 1772 } | |
| 1773 } | |
| 1764 | 1774 |
| 1765 FrameLoadRequest newRequest = request; | 1775 FrameLoadRequest newRequest = request; |
| 1766 FrameLoadType loadType = FrameLoadTypeStandard; | 1776 FrameLoadType loadType = FrameLoadTypeStandard; |
| 1767 if (childItem) { | 1777 if (childItem) { |
| 1768 newRequest = FrameLoadRequest(request.originDocument(), | 1778 newRequest = FrameLoadRequest(request.originDocument(), |
| 1769 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), UseProt ocolCachePolicy)); | 1779 FrameLoader::resourceRequestFromHistoryItem(childItem.get(), UseProt ocolCachePolicy)); |
| 1770 loadType = FrameLoadTypeInitialHistoryLoad; | 1780 loadType = FrameLoadTypeInitialHistoryLoad; |
| 1771 } | 1781 } |
| 1772 child->loader().load(newRequest, loadType, childItem.get()); | 1782 child->loader().load(newRequest, loadType, childItem.get()); |
| 1773 | 1783 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1985 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties& frameOwnerProperties) | 1995 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties& frameOwnerProperties) |
| 1986 { | 1996 { |
| 1987 Frame* oldFrame = toCoreFrame(oldWebFrame); | 1997 Frame* oldFrame = toCoreFrame(oldWebFrame); |
| 1988 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1998 // Note: this *always* temporarily sets a frame owner, even for main frames! |
| 1989 // When a core Frame is created with no owner, it attempts to set itself as | 1999 // When a core Frame is created with no owner, it attempts to set itself as |
| 1990 // the main frame of the Page. However, this is a provisional frame, and may | 2000 // the main frame of the Page. However, this is a provisional frame, and may |
| 1991 // disappear, so Page::m_mainFrame can't be updated just yet. | 2001 // disappear, so Page::m_mainFrame can't be updated just yet. |
| 1992 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone, WebFrameOwnerProperties()); | 2002 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone, WebFrameOwnerProperties()); |
| 1993 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get()); | 2003 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien tImpl.get(), oldFrame->host(), tempOwner.get()); |
| 1994 frame->setOwner(oldFrame->owner()); | 2004 frame->setOwner(oldFrame->owner()); |
| 1995 frame->tree().setName(name); | |
| 1996 setParent(oldWebFrame->parent()); | 2005 setParent(oldWebFrame->parent()); |
| 1997 setOpener(oldWebFrame->opener()); | 2006 setOpener(oldWebFrame->opener()); |
| 2007 frame->tree().setName(name); | |
| 1998 setCoreFrame(frame); | 2008 setCoreFrame(frame); |
| 1999 | 2009 |
| 2000 if (frame->owner() && !frame->owner()->isLocal()) { | 2010 if (frame->owner() && !frame->owner()->isLocal()) { |
| 2001 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags)); | 2011 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa ndboxFlags>(flags)); |
| 2002 // Since a remote frame doesn't get the notifications about frame owner | 2012 // Since a remote frame doesn't get the notifications about frame owner |
| 2003 // property modifications, we need to sync up those properties here. | 2013 // property modifications, we need to sync up those properties here. |
| 2004 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame OwnerProperties); | 2014 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame OwnerProperties); |
| 2005 } | 2015 } |
| 2006 | 2016 |
| 2007 // We must call init() after m_frame is assigned because it is referenced | 2017 // We must call init() after m_frame is assigned because it is referenced |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2212 } | 2222 } |
| 2213 | 2223 |
| 2214 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2224 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
| 2215 { | 2225 { |
| 2216 if (!frame()) | 2226 if (!frame()) |
| 2217 return WebSandboxFlags::None; | 2227 return WebSandboxFlags::None; |
| 2218 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); | 2228 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); |
| 2219 } | 2229 } |
| 2220 | 2230 |
| 2221 } // namespace blink | 2231 } // namespace blink |
| OLD | NEW |