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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2927983004: [DevTools] Rework RFDTAH navigation tracking with browser side navigation (Closed)
Patch Set: Created 3 years, 6 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 CreateNavigationHandle(); 399 CreateNavigationHandle();
400 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT); 400 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT);
401 401
402 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has 402 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
403 // destroyed the NavigationRequest. 403 // destroyed the NavigationRequest.
404 return; 404 return;
405 } 405 }
406 406
407 CreateNavigationHandle(); 407 CreateNavigationHandle();
408 408
409 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get());
410
411 if (ShouldMakeNetworkRequestForURL(common_params_.url) && 409 if (ShouldMakeNetworkRequestForURL(common_params_.url) &&
412 !navigation_handle_->IsSameDocument()) { 410 !navigation_handle_->IsSameDocument()) {
413 // It's safe to use base::Unretained because this NavigationRequest owns 411 // It's safe to use base::Unretained because this NavigationRequest owns
414 // the NavigationHandle where the callback will be stored. 412 // the NavigationHandle where the callback will be stored.
415 // TODO(clamy): pass the method to the NavigationHandle instead of a 413 // TODO(clamy): pass the method to the NavigationHandle instead of a
416 // boolean. 414 // boolean.
417 bool is_external_protocol = 415 bool is_external_protocol =
418 !GetContentClient()->browser()->IsHandledURL(common_params_.url); 416 !GetContentClient()->browser()->IsHandledURL(common_params_.url);
419 navigation_handle_->WillStartRequest( 417 navigation_handle_->WillStartRequest(
420 common_params_.method, common_params_.post_data, 418 common_params_.method, common_params_.post_data,
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 if (parent->IsAllowedByCsp( 951 if (parent->IsAllowedByCsp(
954 CSPDirective::FrameSrc, common_params_.url, is_redirect, 952 CSPDirective::FrameSrc, common_params_.url, is_redirect,
955 common_params_.source_location.value_or(SourceLocation()))) { 953 common_params_.source_location.value_or(SourceLocation()))) {
956 return CONTENT_SECURITY_POLICY_CHECK_PASSED; 954 return CONTENT_SECURITY_POLICY_CHECK_PASSED;
957 } 955 }
958 956
959 return CONTENT_SECURITY_POLICY_CHECK_FAILED; 957 return CONTENT_SECURITY_POLICY_CHECK_FAILED;
960 } 958 }
961 959
962 } // namespace content 960 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698