| 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.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 << " characters."; | 306 << " characters."; |
| 307 return false; | 307 return false; |
| 308 } | 308 } |
| 309 | 309 |
| 310 // This will be used to set the Navigation Timing API navigationStart | 310 // This will be used to set the Navigation Timing API navigationStart |
| 311 // parameter for browser navigations in new tabs (intents, tabs opened through | 311 // parameter for browser navigations in new tabs (intents, tabs opened through |
| 312 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to | 312 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to |
| 313 // capture the time needed for the RenderFrameHost initialization. | 313 // capture the time needed for the RenderFrameHost initialization. |
| 314 base::TimeTicks navigation_start = base::TimeTicks::Now(); | 314 base::TimeTicks navigation_start = base::TimeTicks::Now(); |
| 315 TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( | 315 TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( |
| 316 "navigation", "NavigationTiming navigationStart", | 316 "navigation,rail", "NavigationTiming navigationStart", |
| 317 TRACE_EVENT_SCOPE_GLOBAL, navigation_start.ToInternalValue()); | 317 TRACE_EVENT_SCOPE_GLOBAL, navigation_start.ToInternalValue()); |
| 318 | 318 |
| 319 // Determine if LoFi should be used for the navigation. | 319 // Determine if LoFi should be used for the navigation. |
| 320 LoFiState lofi_state = LOFI_UNSPECIFIED; | 320 LoFiState lofi_state = LOFI_UNSPECIFIED; |
| 321 if (!frame_tree_node->IsMainFrame()) { | 321 if (!frame_tree_node->IsMainFrame()) { |
| 322 // For subframes, use the state of the top-level frame. | 322 // For subframes, use the state of the top-level frame. |
| 323 lofi_state = frame_tree_node->frame_tree() | 323 lofi_state = frame_tree_node->frame_tree() |
| 324 ->root() | 324 ->root() |
| 325 ->current_frame_host() | 325 ->current_frame_host() |
| 326 ->last_navigation_lofi_state(); | 326 ->last_navigation_lofi_state(); |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 if (pending_entry != controller_->GetVisibleEntry() || | 1190 if (pending_entry != controller_->GetVisibleEntry() || |
| 1191 !should_preserve_entry) { | 1191 !should_preserve_entry) { |
| 1192 controller_->DiscardPendingEntry(true); | 1192 controller_->DiscardPendingEntry(true); |
| 1193 | 1193 |
| 1194 // Also force the UI to refresh. | 1194 // Also force the UI to refresh. |
| 1195 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1195 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1196 } | 1196 } |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 } // namespace content | 1199 } // namespace content |
| OLD | NEW |