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

Side by Side Diff: content/browser/loader/navigation_resource_throttle.cc

Issue 1414723008: Add a way to cancel deferred navigations in NavigationHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comments Created 5 years, 1 month 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
OLDNEW
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/loader/navigation_resource_throttle.h" 5 #include "content/browser/loader/navigation_resource_throttle.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "content/browser/frame_host/navigation_handle_impl.h" 8 #include "content/browser/frame_host/navigation_handle_impl.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h" 9 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/public/browser/resource_context.h" 10 #include "content/public/browser/resource_context.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 const char* NavigationResourceThrottle::GetNameForLogging() const { 156 const char* NavigationResourceThrottle::GetNameForLogging() const {
157 return "NavigationResourceThrottle"; 157 return "NavigationResourceThrottle";
158 } 158 }
159 159
160 void NavigationResourceThrottle::OnUIChecksPerformed( 160 void NavigationResourceThrottle::OnUIChecksPerformed(
161 NavigationThrottle::ThrottleCheckResult result) { 161 NavigationThrottle::ThrottleCheckResult result) {
162 DCHECK_CURRENTLY_ON(BrowserThread::IO); 162 DCHECK_CURRENTLY_ON(BrowserThread::IO);
163 if (result == NavigationThrottle::CANCEL_AND_IGNORE) { 163 if (result == NavigationThrottle::CANCEL_AND_IGNORE) {
164 controller()->CancelAndIgnore(); 164 controller()->CancelAndIgnore();
165 } else if (result == NavigationThrottle::CANCEL) {
166 controller()->Cancel();
165 } else { 167 } else {
166 controller()->Resume(); 168 controller()->Resume();
167 } 169 }
168 } 170 }
169 171
170 } // namespace content 172 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698