| OLD | NEW | 
|---|
| 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  Loading... | 
| 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 987           CSPDirective::FrameSrc, common_params_.url, is_redirect, | 985           CSPDirective::FrameSrc, common_params_.url, is_redirect, | 
| 988           common_params_.source_location.value_or(SourceLocation()), | 986           common_params_.source_location.value_or(SourceLocation()), | 
| 989           CSPContext::CHECK_ENFORCED_CSP)) { | 987           CSPContext::CHECK_ENFORCED_CSP)) { | 
| 990     return CONTENT_SECURITY_POLICY_CHECK_PASSED; | 988     return CONTENT_SECURITY_POLICY_CHECK_PASSED; | 
| 991   } | 989   } | 
| 992 | 990 | 
| 993   return CONTENT_SECURITY_POLICY_CHECK_FAILED; | 991   return CONTENT_SECURITY_POLICY_CHECK_FAILED; | 
| 994 } | 992 } | 
| 995 | 993 | 
| 996 }  // namespace content | 994 }  // namespace content | 
| OLD | NEW | 
|---|