| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 379 } |
| 380 | 380 |
| 381 void NavigationRequest::BeginNavigation() { | 381 void NavigationRequest::BeginNavigation() { |
| 382 DCHECK(!loader_); | 382 DCHECK(!loader_); |
| 383 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); | 383 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); |
| 384 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationRequest", this, | 384 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationRequest", this, |
| 385 "BeginNavigation"); | 385 "BeginNavigation"); |
| 386 state_ = STARTED; | 386 state_ = STARTED; |
| 387 CreateNavigationHandle(); | 387 CreateNavigationHandle(); |
| 388 | 388 |
| 389 if (nav_entry_id_) { | |
| 390 NavigationEntryImpl* nav_entry = | |
| 391 static_cast<NavigationControllerImpl*>( | |
| 392 frame_tree_node_->navigator()->GetController()) | |
| 393 ->GetEntryWithUniqueID(nav_entry_id_); | |
| 394 if (nav_entry) { | |
| 395 navigation_handle_->set_base_url_for_data_url( | |
| 396 nav_entry->GetBaseURLForDataURL()); | |
| 397 } | |
| 398 } | |
| 399 | |
| 400 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get()); | 389 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get()); |
| 401 | 390 |
| 402 if (ShouldMakeNetworkRequestForURL(common_params_.url) && | 391 if (ShouldMakeNetworkRequestForURL(common_params_.url) && |
| 403 !navigation_handle_->IsSameDocument()) { | 392 !navigation_handle_->IsSameDocument()) { |
| 404 // It's safe to use base::Unretained because this NavigationRequest owns | 393 // It's safe to use base::Unretained because this NavigationRequest owns |
| 405 // the NavigationHandle where the callback will be stored. | 394 // the NavigationHandle where the callback will be stored. |
| 406 // TODO(clamy): pass the method to the NavigationHandle instead of a | 395 // TODO(clamy): pass the method to the NavigationHandle instead of a |
| 407 // boolean. | 396 // boolean. |
| 408 bool is_external_protocol = | 397 bool is_external_protocol = |
| 409 !GetContentClient()->browser()->IsHandledURL(common_params_.url); | 398 !GetContentClient()->browser()->IsHandledURL(common_params_.url); |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 887 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
| 899 | 888 |
| 900 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 889 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 901 std::move(handle_), common_params_, | 890 std::move(handle_), common_params_, |
| 902 request_params_, is_view_source_); | 891 request_params_, is_view_source_); |
| 903 | 892 |
| 904 frame_tree_node_->ResetNavigationRequest(true, true); | 893 frame_tree_node_->ResetNavigationRequest(true, true); |
| 905 } | 894 } |
| 906 | 895 |
| 907 } // namespace content | 896 } // namespace content |
| OLD | NEW |