| 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 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 // At this point, the |entries| is full of empty scoped_ptrs, so it can be | 259 // At this point, the |entries| is full of empty scoped_ptrs, so it can be |
| 260 // cleared out safely. | 260 // cleared out safely. |
| 261 entries->clear(); | 261 entries->clear(); |
| 262 | 262 |
| 263 // And finish the restore. | 263 // And finish the restore. |
| 264 FinishRestore(selected_navigation, type); | 264 FinishRestore(selected_navigation, type); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void NavigationControllerImpl::Reload(bool check_for_repost) { | 267 void NavigationControllerImpl::Reload(bool check_for_repost) { |
| 268 ReloadInternal(check_for_repost, ReloadType::MAIN_RESOURCE); | 268 ReloadInternal(check_for_repost, ReloadType::NORMAL); |
| 269 } | 269 } |
| 270 void NavigationControllerImpl::ReloadBypassingCache(bool check_for_repost) { | 270 void NavigationControllerImpl::ReloadBypassingCache(bool check_for_repost) { |
| 271 ReloadInternal(check_for_repost, ReloadType::BYPASSING_CACHE); | 271 ReloadInternal(check_for_repost, ReloadType::BYPASSING_CACHE); |
| 272 } | 272 } |
| 273 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) { | 273 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) { |
| 274 ReloadInternal(check_for_repost, ReloadType::ORIGINAL_REQUEST_URL); | 274 ReloadInternal(check_for_repost, ReloadType::ORIGINAL_REQUEST_URL); |
| 275 } | 275 } |
| 276 void NavigationControllerImpl::ReloadDisableLoFi(bool check_for_repost) { | 276 void NavigationControllerImpl::ReloadDisableLoFi(bool check_for_repost) { |
| 277 ReloadInternal(check_for_repost, ReloadType::DISABLE_LOFI_MODE); | 277 ReloadInternal(check_for_repost, ReloadType::DISABLE_LOFI_MODE); |
| 278 } | 278 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 if (last_committed_reload_type_ != ReloadType::NONE) { | 320 if (last_committed_reload_type_ != ReloadType::NONE) { |
| 321 DCHECK(!last_committed_reload_time_.is_null()); | 321 DCHECK(!last_committed_reload_time_.is_null()); |
| 322 base::Time now = | 322 base::Time now = |
| 323 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run()); | 323 time_smoother_.GetSmoothedTime(get_timestamp_callback_.Run()); |
| 324 DCHECK_GT(now, last_committed_reload_time_); | 324 DCHECK_GT(now, last_committed_reload_time_); |
| 325 if (!last_committed_reload_time_.is_null() && | 325 if (!last_committed_reload_time_.is_null() && |
| 326 now > last_committed_reload_time_) { | 326 now > last_committed_reload_time_) { |
| 327 base::TimeDelta delta = now - last_committed_reload_time_; | 327 base::TimeDelta delta = now - last_committed_reload_time_; |
| 328 UMA_HISTOGRAM_MEDIUM_TIMES("Navigation.Reload.ReloadToReloadDuration", | 328 UMA_HISTOGRAM_MEDIUM_TIMES("Navigation.Reload.ReloadToReloadDuration", |
| 329 delta); | 329 delta); |
| 330 if (last_committed_reload_type_ == ReloadType::MAIN_RESOURCE) { | 330 if (last_committed_reload_type_ == ReloadType::NORMAL) { |
| 331 UMA_HISTOGRAM_MEDIUM_TIMES( | 331 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 332 "Navigation.Reload.ReloadMainResourceToReloadDuration", delta); | 332 "Navigation.Reload.ReloadMainResourceToReloadDuration", delta); |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 // Set ReloadType for |entry| in order to check it at commit time. | 337 // Set ReloadType for |entry| in order to check it at commit time. |
| 338 entry->set_reload_type(reload_type); | 338 entry->set_reload_type(reload_type); |
| 339 | 339 |
| 340 if (g_check_for_repost && check_for_repost && | 340 if (g_check_for_repost && check_for_repost && |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 } | 2077 } |
| 2078 } | 2078 } |
| 2079 } | 2079 } |
| 2080 | 2080 |
| 2081 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2081 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2082 const base::Callback<base::Time()>& get_timestamp_callback) { | 2082 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2083 get_timestamp_callback_ = get_timestamp_callback; | 2083 get_timestamp_callback_ = get_timestamp_callback; |
| 2084 } | 2084 } |
| 2085 | 2085 |
| 2086 } // namespace content | 2086 } // namespace content |
| OLD | NEW |