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

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

Issue 2475693002: Do not reset NavigationHandle when navigating same-page (Closed)
Patch Set: Rebase + removed DCHECK Created 4 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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 RenderFrameHostImpl* render_frame_host = 76 RenderFrameHostImpl* render_frame_host =
77 RenderFrameHostImpl::FromID(render_process_id, render_frame_host_id); 77 RenderFrameHostImpl::FromID(render_process_id, render_frame_host_id);
78 if (!render_frame_host) { 78 if (!render_frame_host) {
79 SendCheckResultToIOThread(callback, NavigationThrottle::CANCEL); 79 SendCheckResultToIOThread(callback, NavigationThrottle::CANCEL);
80 return nullptr; 80 return nullptr;
81 } 81 }
82 82
83 NavigationHandleImpl* navigation_handle = 83 NavigationHandleImpl* navigation_handle =
84 render_frame_host->frame_tree_node() 84 render_frame_host->navigation_handle();
85 ->navigator()
86 ->GetNavigationHandleForFrameHost(render_frame_host);
87 if (!navigation_handle) { 85 if (!navigation_handle) {
88 SendCheckResultToIOThread(callback, NavigationThrottle::PROCEED); 86 SendCheckResultToIOThread(callback, NavigationThrottle::CANCEL);
89 return nullptr; 87 return nullptr;
90 } 88 }
91 return navigation_handle; 89 return navigation_handle;
92 } 90 }
93 91
94 void CheckWillStartRequestOnUIThread( 92 void CheckWillStartRequestOnUIThread(
95 UIChecksPerformedCallback callback, 93 UIChecksPerformedCallback callback,
96 int render_process_id, 94 int render_process_id,
97 int render_frame_host_id, 95 int render_frame_host_id,
98 const std::string& method, 96 const std::string& method,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 369
372 // If the results of the checks on the UI thread are known, unblock the 370 // If the results of the checks on the UI thread are known, unblock the
373 // navigation. Otherwise, wait until the callback has executed. 371 // navigation. Otherwise, wait until the callback has executed.
374 if (on_transfer_done_result_ != NavigationThrottle::DEFER) { 372 if (on_transfer_done_result_ != NavigationThrottle::DEFER) {
375 OnUIChecksPerformed(on_transfer_done_result_); 373 OnUIChecksPerformed(on_transfer_done_result_);
376 on_transfer_done_result_ = NavigationThrottle::DEFER; 374 on_transfer_done_result_ = NavigationThrottle::DEFER;
377 } 375 }
378 } 376 }
379 377
380 } // namespace content 378 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698