OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "chrome/browser/metrics/metrics_log.h" | 49 #include "chrome/browser/metrics/metrics_log.h" |
50 #include "chrome/browser/metrics/metrics_service.h" | 50 #include "chrome/browser/metrics/metrics_service.h" |
51 #include "chrome/browser/metrics/thread_watcher.h" | 51 #include "chrome/browser/metrics/thread_watcher.h" |
52 #include "chrome/browser/metrics/tracking_synchronizer.h" | 52 #include "chrome/browser/metrics/tracking_synchronizer.h" |
53 #include "chrome/browser/metrics/variations_service.h" | 53 #include "chrome/browser/metrics/variations_service.h" |
54 #include "chrome/browser/nacl_host/nacl_process_host.h" | 54 #include "chrome/browser/nacl_host/nacl_process_host.h" |
55 #include "chrome/browser/net/chrome_net_log.h" | 55 #include "chrome/browser/net/chrome_net_log.h" |
56 #include "chrome/browser/notifications/desktop_notification_service.h" | 56 #include "chrome/browser/notifications/desktop_notification_service.h" |
57 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 57 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
58 #include "chrome/browser/page_cycler/page_cycler.h" | 58 #include "chrome/browser/page_cycler/page_cycler.h" |
| 59 #include "chrome/browser/performance_monitor/performance_monitor.h" |
59 #include "chrome/browser/performance_monitor/startup_timer.h" | 60 #include "chrome/browser/performance_monitor/startup_timer.h" |
60 #include "chrome/browser/plugin_prefs.h" | 61 #include "chrome/browser/plugin_prefs.h" |
61 #include "chrome/browser/prefs/pref_service.h" | 62 #include "chrome/browser/prefs/pref_service.h" |
62 #include "chrome/browser/prefs/pref_value_store.h" | 63 #include "chrome/browser/prefs/pref_value_store.h" |
63 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 64 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
64 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
66 #include "chrome/browser/process_singleton.h" | 67 #include "chrome/browser/process_singleton.h" |
67 #include "chrome/browser/profiles/profile.h" | 68 #include "chrome/browser/profiles/profile.h" |
68 #include "chrome/browser/profiles/profile_manager.h" | 69 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 startup_timer_->SignalStartupComplete( | 1423 startup_timer_->SignalStartupComplete( |
1423 performance_monitor::StartupTimer::STARTUP_NORMAL); | 1424 performance_monitor::StartupTimer::STARTUP_NORMAL); |
1424 | 1425 |
1425 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 1426 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
1426 #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) | 1427 #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) |
1427 views::AcceleratorHandler accelerator_handler; | 1428 views::AcceleratorHandler accelerator_handler; |
1428 base::RunLoop run_loop(&accelerator_handler); | 1429 base::RunLoop run_loop(&accelerator_handler); |
1429 #else | 1430 #else |
1430 base::RunLoop run_loop; | 1431 base::RunLoop run_loop; |
1431 #endif | 1432 #endif |
| 1433 |
| 1434 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 1435 switches::kRunPerformanceMonitor)) { |
| 1436 performance_monitor::PerformanceMonitor::GetInstance()->Start(); |
| 1437 } |
| 1438 |
1432 run_loop.Run(); | 1439 run_loop.Run(); |
1433 | 1440 |
1434 return true; | 1441 return true; |
1435 #endif | 1442 #endif |
1436 } | 1443 } |
1437 | 1444 |
1438 void ChromeBrowserMainParts::PostMainMessageLoopRun() { | 1445 void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
1439 #if defined(OS_ANDROID) | 1446 #if defined(OS_ANDROID) |
1440 // Chrome on Android does not use default MessageLoop. It has its own | 1447 // Chrome on Android does not use default MessageLoop. It has its own |
1441 // Android specific MessageLoop | 1448 // Android specific MessageLoop |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1559 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1553 uma_name += "_XP"; | 1560 uma_name += "_XP"; |
1554 | 1561 |
1555 uma_name += "_PreRead_"; | 1562 uma_name += "_PreRead_"; |
1556 uma_name += pre_read_percentage; | 1563 uma_name += pre_read_percentage; |
1557 AddPreReadHistogramTime(uma_name.c_str(), time); | 1564 AddPreReadHistogramTime(uma_name.c_str(), time); |
1558 } | 1565 } |
1559 #endif | 1566 #endif |
1560 #endif | 1567 #endif |
1561 } | 1568 } |
OLD | NEW |