Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 NavigationHandleImpl::~NavigationHandleImpl() { | 147 NavigationHandleImpl::~NavigationHandleImpl() { |
| 148 // Transfer requests that have not matched up with another navigation request | 148 // Transfer requests that have not matched up with another navigation request |
| 149 // from the renderer need to be cleaned up. These are marked as protected in | 149 // from the renderer need to be cleaned up. These are marked as protected in |
| 150 // the RDHI, so they do not get cancelled when frames are destroyed. | 150 // the RDHI, so they do not get cancelled when frames are destroyed. |
| 151 if (is_transferring()) { | 151 if (is_transferring()) { |
| 152 BrowserThread::PostTask( | 152 BrowserThread::PostTask( |
| 153 BrowserThread::IO, FROM_HERE, | 153 BrowserThread::IO, FROM_HERE, |
| 154 base::Bind(&NotifyAbandonedTransferNavigation, GetGlobalRequestID())); | 154 base::Bind(&NotifyAbandonedTransferNavigation, GetGlobalRequestID())); |
| 155 } | 155 } |
| 156 | 156 |
| 157 if (url_.SchemeIs(url::kDataScheme) && IsInMainFrame() && | |
|
Charlie Reis
2017/02/15 23:36:43
Why is this done from the NavigationHandleImpl des
meacer
2017/02/16 01:58:42
Done, moved to DidCommitNavigation.
| |
| 158 IsRendererInitiated()) { | |
| 159 GetRenderFrameHost()->AddMessageToConsole( | |
| 160 CONSOLE_MESSAGE_LEVEL_WARNING, | |
| 161 "Upcoming versions will block content-initiated top frame navigations " | |
| 162 "to data: URLs. For more information, see https://crbug.com/594215."); | |
|
Charlie Reis
2017/02/15 23:36:43
This bug link doesn't seem like great documentatio
meacer
2017/02/16 01:58:42
Do you think blink intent to deprecate thread woul
Charlie Reis
2017/02/16 17:59:50
Yes, a link to that intent would be perfect. Than
| |
| 163 } | |
| 164 | |
| 157 if (!IsRendererDebugURL(url_)) | 165 if (!IsRendererDebugURL(url_)) |
| 158 GetDelegate()->DidFinishNavigation(this); | 166 GetDelegate()->DidFinishNavigation(this); |
| 159 | 167 |
| 160 // Cancel the navigation on the IO thread if the NavigationHandle is being | 168 // Cancel the navigation on the IO thread if the NavigationHandle is being |
| 161 // destroyed in the middle of the NavigationThrottles checks. | 169 // destroyed in the middle of the NavigationThrottles checks. |
| 162 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 170 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
| 163 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); | 171 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); |
| 164 | 172 |
| 165 if (IsInMainFrame()) { | 173 if (IsInMainFrame()) { |
| 166 TRACE_EVENT_ASYNC_END2("navigation", "Navigation StartToCommit", this, | 174 TRACE_EVENT_ASYNC_END2("navigation", "Navigation StartToCommit", this, |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 883 content::AncestorThrottle::MaybeCreateThrottleFor(this); | 891 content::AncestorThrottle::MaybeCreateThrottleFor(this); |
| 884 if (ancestor_throttle) | 892 if (ancestor_throttle) |
| 885 throttles_.push_back(std::move(ancestor_throttle)); | 893 throttles_.push_back(std::move(ancestor_throttle)); |
| 886 | 894 |
| 887 throttles_.insert(throttles_.begin(), | 895 throttles_.insert(throttles_.begin(), |
| 888 std::make_move_iterator(throttles_to_register.begin()), | 896 std::make_move_iterator(throttles_to_register.begin()), |
| 889 std::make_move_iterator(throttles_to_register.end())); | 897 std::make_move_iterator(throttles_to_register.end())); |
| 890 } | 898 } |
| 891 | 899 |
| 892 } // namespace content | 900 } // namespace content |
| OLD | NEW |