| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // RenderFrameHost as loading. This ensures that the RenderFrameHost gets | 371 // RenderFrameHost as loading. This ensures that the RenderFrameHost gets |
| 372 // in a loading state without emitting a spurious DidStartLoading | 372 // in a loading state without emitting a spurious DidStartLoading |
| 373 // notification at the FrameTreeNode level (since the FrameTreeNode was | 373 // notification at the FrameTreeNode level (since the FrameTreeNode was |
| 374 // already loading). Note that this works both for a transfer to a | 374 // already loading). Note that this works both for a transfer to a |
| 375 // different RenderFrameHost and in the rare case where the navigation is | 375 // different RenderFrameHost and in the rare case where the navigation is |
| 376 // transferred back to the same RenderFrameHost. | 376 // transferred back to the same RenderFrameHost. |
| 377 bool is_transfer = entry.transferred_global_request_id().child_id != -1; | 377 bool is_transfer = entry.transferred_global_request_id().child_id != -1; |
| 378 if (is_transfer) | 378 if (is_transfer) |
| 379 dest_render_frame_host->set_is_loading(true); | 379 dest_render_frame_host->set_is_loading(true); |
| 380 | 380 |
| 381 // A session history navigation should have been accompanied by state. |
| 382 // TODO(creis): This is known to be failing in UseSubframeNavigationEntries |
| 383 // in https://crbug.com/568703, when the PageState on a FrameNavigationEntry |
| 384 // is unexpectedly empty. Until the cause is found, keep this as a DCHECK |
| 385 // and load the URL without PageState. |
| 386 if (is_pending_entry && controller_->GetPendingEntryIndex() != -1) |
| 387 DCHECK(frame_entry.page_state().IsValid()); |
| 388 |
| 381 // Navigate in the desired RenderFrameHost. | 389 // Navigate in the desired RenderFrameHost. |
| 382 // We can skip this step in the rare case that this is a transfer navigation | 390 // We can skip this step in the rare case that this is a transfer navigation |
| 383 // which began in the chosen RenderFrameHost, since the request has already | 391 // which began in the chosen RenderFrameHost, since the request has already |
| 384 // been issued. In that case, simply resume the response. | 392 // been issued. In that case, simply resume the response. |
| 385 bool is_transfer_to_same = | 393 bool is_transfer_to_same = |
| 386 is_transfer && | 394 is_transfer && |
| 387 entry.transferred_global_request_id().child_id == | 395 entry.transferred_global_request_id().child_id == |
| 388 dest_render_frame_host->GetProcess()->GetID(); | 396 dest_render_frame_host->GetProcess()->GetID(); |
| 389 if (!is_transfer_to_same) { | 397 if (!is_transfer_to_same) { |
| 390 navigation_data_.reset(new NavigationMetricsData( | 398 navigation_data_.reset(new NavigationMetricsData( |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 if (navigation_handle) | 1209 if (navigation_handle) |
| 1202 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1210 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1203 | 1211 |
| 1204 controller_->SetPendingEntry(std::move(entry)); | 1212 controller_->SetPendingEntry(std::move(entry)); |
| 1205 if (delegate_) | 1213 if (delegate_) |
| 1206 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1214 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1207 } | 1215 } |
| 1208 } | 1216 } |
| 1209 | 1217 |
| 1210 } // namespace content | 1218 } // namespace content |
| OLD | NEW |