| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sessions/session_restore.h" | 5 #include "chrome/browser/sessions/session_restore.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 UMA_HISTOGRAM_CUSTOM_TIMES( | 293 UMA_HISTOGRAM_CUSTOM_TIMES( |
| 294 "SessionRestore.FirstTabPainted", | 294 "SessionRestore.FirstTabPainted", |
| 295 time_to_paint, | 295 time_to_paint, |
| 296 base::TimeDelta::FromMilliseconds(10), | 296 base::TimeDelta::FromMilliseconds(10), |
| 297 base::TimeDelta::FromSeconds(100), | 297 base::TimeDelta::FromSeconds(100), |
| 298 100); | 298 100); |
| 299 // Record a time for the number of tabs, to help track down | 299 // Record a time for the number of tabs, to help track down |
| 300 // contention. | 300 // contention. |
| 301 std::string time_for_count = | 301 std::string time_for_count = |
| 302 StringPrintf("SessionRestore.FirstTabPainted_%d", tab_count_); | 302 StringPrintf("SessionRestore.FirstTabPainted_%d", tab_count_); |
| 303 scoped_refptr<base::Histogram> counter_for_count = | 303 base::Histogram* counter_for_count = |
| 304 base::Histogram::FactoryTimeGet( | 304 base::Histogram::FactoryTimeGet( |
| 305 time_for_count, | 305 time_for_count, |
| 306 base::TimeDelta::FromMilliseconds(10), | 306 base::TimeDelta::FromMilliseconds(10), |
| 307 base::TimeDelta::FromSeconds(100), | 307 base::TimeDelta::FromSeconds(100), |
| 308 100, | 308 100, |
| 309 base::Histogram::kUmaTargetedHistogramFlag); | 309 base::Histogram::kUmaTargetedHistogramFlag); |
| 310 counter_for_count->AddTime(time_to_paint); | 310 counter_for_count->AddTime(time_to_paint); |
| 311 } else if (render_widget_hosts_loading_.find(render_widget_host) == | 311 } else if (render_widget_hosts_loading_.find(render_widget_host) == |
| 312 render_widget_hosts_loading_.end()) { | 312 render_widget_hosts_loading_.end()) { |
| 313 // If this is a host for a tab we're not loading some other tab | 313 // If this is a host for a tab we're not loading some other tab |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 base::TimeTicks::Now() - restore_started_; | 381 base::TimeTicks::Now() - restore_started_; |
| 382 UMA_HISTOGRAM_CUSTOM_TIMES( | 382 UMA_HISTOGRAM_CUSTOM_TIMES( |
| 383 "SessionRestore.AllTabsLoaded", | 383 "SessionRestore.AllTabsLoaded", |
| 384 time_to_load, | 384 time_to_load, |
| 385 base::TimeDelta::FromMilliseconds(10), | 385 base::TimeDelta::FromMilliseconds(10), |
| 386 base::TimeDelta::FromSeconds(100), | 386 base::TimeDelta::FromSeconds(100), |
| 387 100); | 387 100); |
| 388 // Record a time for the number of tabs, to help track down contention. | 388 // Record a time for the number of tabs, to help track down contention. |
| 389 std::string time_for_count = | 389 std::string time_for_count = |
| 390 StringPrintf("SessionRestore.AllTabsLoaded_%d", tab_count_); | 390 StringPrintf("SessionRestore.AllTabsLoaded_%d", tab_count_); |
| 391 scoped_refptr<base::Histogram> counter_for_count = | 391 base::Histogram* counter_for_count = |
| 392 base::Histogram::FactoryTimeGet( | 392 base::Histogram::FactoryTimeGet( |
| 393 time_for_count, | 393 time_for_count, |
| 394 base::TimeDelta::FromMilliseconds(10), | 394 base::TimeDelta::FromMilliseconds(10), |
| 395 base::TimeDelta::FromSeconds(100), | 395 base::TimeDelta::FromSeconds(100), |
| 396 100, | 396 100, |
| 397 base::Histogram::kUmaTargetedHistogramFlag); | 397 base::Histogram::kUmaTargetedHistogramFlag); |
| 398 counter_for_count->AddTime(time_to_load); | 398 counter_for_count->AddTime(time_to_load); |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 Browser* SessionRestore::RestoreSessionSynchronously( | 839 Browser* SessionRestore::RestoreSessionSynchronously( |
| 840 Profile* profile, | 840 Profile* profile, |
| 841 const std::vector<GURL>& urls_to_open) { | 841 const std::vector<GURL>& urls_to_open) { |
| 842 return Restore(profile, NULL, true, false, true, urls_to_open); | 842 return Restore(profile, NULL, true, false, true, urls_to_open); |
| 843 } | 843 } |
| 844 | 844 |
| 845 // static | 845 // static |
| 846 bool SessionRestore::IsRestoring() { | 846 bool SessionRestore::IsRestoring() { |
| 847 return restoring; | 847 return restoring; |
| 848 } | 848 } |
| OLD | NEW |