| 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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 const WebURL& referrerURL) { | 915 const WebURL& referrerURL) { |
| 916 String referrer = referrerURL.isEmpty() | 916 String referrer = referrerURL.isEmpty() |
| 917 ? frame()->document()->outgoingReferrer() | 917 ? frame()->document()->outgoingReferrer() |
| 918 : String(referrerURL.string()); | 918 : String(referrerURL.string()); |
| 919 request.toMutableResourceRequest().setHTTPReferrer( | 919 request.toMutableResourceRequest().setHTTPReferrer( |
| 920 SecurityPolicy::generateReferrer(frame()->document()->getReferrerPolicy(), | 920 SecurityPolicy::generateReferrer(frame()->document()->getReferrerPolicy(), |
| 921 request.url(), referrer)); | 921 request.url(), referrer)); |
| 922 } | 922 } |
| 923 | 923 |
| 924 void WebLocalFrameImpl::dispatchWillSendRequest(WebURLRequest& request) { | 924 void WebLocalFrameImpl::dispatchWillSendRequest(WebURLRequest& request) { |
| 925 frame()->loader().client()->dispatchWillSendRequest( | 925 frame()->loader().client()->willSendRequest( |
| 926 request.toMutableResourceRequest()); | 926 request.toMutableResourceRequest(), FrameLoadTypeStandard); |
| 927 } | 927 } |
| 928 | 928 |
| 929 WebAssociatedURLLoader* WebLocalFrameImpl::createAssociatedURLLoader( | 929 WebAssociatedURLLoader* WebLocalFrameImpl::createAssociatedURLLoader( |
| 930 const WebAssociatedURLLoaderOptions& options) { | 930 const WebAssociatedURLLoaderOptions& options) { |
| 931 return new WebAssociatedURLLoaderImpl(this, options); | 931 return new WebAssociatedURLLoaderImpl(this, options); |
| 932 } | 932 } |
| 933 | 933 |
| 934 unsigned WebLocalFrameImpl::unloadListenerCount() const { | 934 unsigned WebLocalFrameImpl::unloadListenerCount() const { |
| 935 return frame()->domWindow()->pendingUnloadEventListeners(); | 935 return frame()->domWindow()->pendingUnloadEventListeners(); |
| 936 } | 936 } |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, | 1624 webframeChild->initializeCoreFrame(frame()->host(), ownerElement, name, |
| 1625 uniqueName); | 1625 uniqueName); |
| 1626 // Initializing the core frame may cause the new child to be detached, since | 1626 // Initializing the core frame may cause the new child to be detached, since |
| 1627 // it may dispatch a load event in the parent. | 1627 // it may dispatch a load event in the parent. |
| 1628 if (!webframeChild->parent()) | 1628 if (!webframeChild->parent()) |
| 1629 return nullptr; | 1629 return nullptr; |
| 1630 | 1630 |
| 1631 // If we're moving in the back/forward list, we might want to replace the | 1631 // If we're moving in the back/forward list, we might want to replace the |
| 1632 // content of this child frame with whatever was there at that point. | 1632 // content of this child frame with whatever was there at that point. |
| 1633 HistoryItem* childItem = nullptr; | 1633 HistoryItem* childItem = nullptr; |
| 1634 FrameLoadType loadType = FrameLoadTypeStandard; |
| 1634 if (isBackForwardLoadType(frame()->loader().documentLoader()->loadType()) && | 1635 if (isBackForwardLoadType(frame()->loader().documentLoader()->loadType()) && |
| 1635 !frame()->document()->loadEventFinished()) | 1636 !frame()->document()->loadEventFinished()) { |
| 1636 childItem = webframeChild->client()->historyItemForNewChildFrame(); | 1637 childItem = webframeChild->client()->historyItemForNewChildFrame(); |
| 1637 | |
| 1638 FrameLoadRequest newRequest = request; | |
| 1639 FrameLoadType loadType = FrameLoadTypeStandard; | |
| 1640 if (childItem) { | |
| 1641 newRequest = FrameLoadRequest( | |
| 1642 request.originDocument(), | |
| 1643 FrameLoader::resourceRequestFromHistoryItem( | |
| 1644 childItem, WebCachePolicy::UseProtocolCachePolicy)); | |
| 1645 loadType = FrameLoadTypeInitialHistoryLoad; | 1638 loadType = FrameLoadTypeInitialHistoryLoad; |
| 1646 } | 1639 } |
| 1640 |
| 1641 FrameLoadRequest newRequest = |
| 1642 childItem ? FrameLoadRequest( |
| 1643 request.originDocument(), |
| 1644 FrameLoader::resourceRequestFromHistoryItem( |
| 1645 childItem, WebCachePolicy::UseProtocolCachePolicy)) |
| 1646 : request; |
| 1647 webframeChild->frame()->loader().load(newRequest, loadType, childItem); | 1647 webframeChild->frame()->loader().load(newRequest, loadType, childItem); |
| 1648 | 1648 |
| 1649 // Note a synchronous navigation (about:blank) would have already processed | 1649 // Note a synchronous navigation (about:blank) would have already processed |
| 1650 // onload, so it is possible for the child frame to have already been | 1650 // onload, so it is possible for the child frame to have already been |
| 1651 // detached by script in the page. | 1651 // detached by script in the page. |
| 1652 if (!webframeChild->parent()) | 1652 if (!webframeChild->parent()) |
| 1653 return nullptr; | 1653 return nullptr; |
| 1654 return webframeChild->frame(); | 1654 return webframeChild->frame(); |
| 1655 } | 1655 } |
| 1656 | 1656 |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2377 ->frameScheduler() | 2377 ->frameScheduler() |
| 2378 ->unthrottledTaskRunner() | 2378 ->unthrottledTaskRunner() |
| 2379 ->toSingleThreadTaskRunner(); | 2379 ->toSingleThreadTaskRunner(); |
| 2380 } | 2380 } |
| 2381 | 2381 |
| 2382 WebInputMethodControllerImpl* WebLocalFrameImpl::inputMethodController() const { | 2382 WebInputMethodControllerImpl* WebLocalFrameImpl::inputMethodController() const { |
| 2383 return m_inputMethodController.get(); | 2383 return m_inputMethodController.get(); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 } // namespace blink | 2386 } // namespace blink |
| OLD | NEW |