| 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/browser_main.h" | 5 #include "chrome/browser/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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 50 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 51 #include "chrome/browser/metrics/histogram_synchronizer.h" | 51 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 52 #include "chrome/browser/metrics/metrics_log.h" | 52 #include "chrome/browser/metrics/metrics_log.h" |
| 53 #include "chrome/browser/metrics/metrics_service.h" | 53 #include "chrome/browser/metrics/metrics_service.h" |
| 54 #include "chrome/browser/metrics/thread_watcher.h" | 54 #include "chrome/browser/metrics/thread_watcher.h" |
| 55 #include "chrome/browser/net/chrome_dns_cert_provenance_checker.h" | 55 #include "chrome/browser/net/chrome_dns_cert_provenance_checker.h" |
| 56 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" | 56 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" |
| 57 #include "chrome/browser/net/chrome_net_log.h" | 57 #include "chrome/browser/net/chrome_net_log.h" |
| 58 #include "chrome/browser/net/predictor_api.h" | 58 #include "chrome/browser/net/predictor_api.h" |
| 59 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 59 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 60 #include "chrome/browser/net/websocket_experiment/websocket_experiment_runner.h" | |
| 61 #include "chrome/browser/plugin_updater.h" | 60 #include "chrome/browser/plugin_updater.h" |
| 62 #include "chrome/browser/policy/browser_policy_connector.h" | 61 #include "chrome/browser/policy/browser_policy_connector.h" |
| 63 #include "chrome/browser/prefs/pref_service.h" | 62 #include "chrome/browser/prefs/pref_service.h" |
| 64 #include "chrome/browser/prefs/pref_value_store.h" | 63 #include "chrome/browser/prefs/pref_value_store.h" |
| 65 #include "chrome/browser/prerender/prerender_field_trial.h" | 64 #include "chrome/browser/prerender/prerender_field_trial.h" |
| 66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| 67 #include "chrome/browser/process_singleton.h" | 66 #include "chrome/browser/process_singleton.h" |
| 68 #include "chrome/browser/profiles/profile.h" | 67 #include "chrome/browser/profiles/profile.h" |
| 69 #include "chrome/browser/profiles/profile_manager.h" | 68 #include "chrome/browser/profiles/profile_manager.h" |
| 70 #include "chrome/browser/search_engines/search_engine_type.h" | 69 #include "chrome/browser/search_engines/search_engine_type.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 if (enabled) { | 625 if (enabled) { |
| 627 metrics->Start(); | 626 metrics->Start(); |
| 628 } | 627 } |
| 629 #endif // defined(GOOGLE_CHROME_BUILD) | 628 #endif // defined(GOOGLE_CHROME_BUILD) |
| 630 | 629 |
| 631 return metrics; | 630 return metrics; |
| 632 } | 631 } |
| 633 | 632 |
| 634 void BrowserMainParts::SetupFieldTrials(bool metrics_recording_enabled, | 633 void BrowserMainParts::SetupFieldTrials(bool metrics_recording_enabled, |
| 635 bool proxy_policy_is_set) { | 634 bool proxy_policy_is_set) { |
| 636 if (metrics_recording_enabled) | |
| 637 chrome_browser_net_websocket_experiment::WebSocketExperimentRunner::Start(); | |
| 638 | |
| 639 // Note: make sure to call ConnectionFieldTrial() before | 635 // Note: make sure to call ConnectionFieldTrial() before |
| 640 // ProxyConnectionsFieldTrial(). | 636 // ProxyConnectionsFieldTrial(). |
| 641 ConnectionFieldTrial(); | 637 ConnectionFieldTrial(); |
| 642 SocketTimeoutFieldTrial(); | 638 SocketTimeoutFieldTrial(); |
| 643 // If a policy is defining the number of active connections this field test | 639 // If a policy is defining the number of active connections this field test |
| 644 // shoud not be performed. | 640 // shoud not be performed. |
| 645 if (!proxy_policy_is_set) | 641 if (!proxy_policy_is_set) |
| 646 ProxyConnectionsFieldTrial(); | 642 ProxyConnectionsFieldTrial(); |
| 647 prerender::ConfigurePrefetchAndPrerender(parsed_command_line()); | 643 prerender::ConfigurePrefetchAndPrerender(parsed_command_line()); |
| 648 InstantFieldTrial::Activate(); | 644 InstantFieldTrial::Activate(); |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 } | 2079 } |
| 2084 #endif | 2080 #endif |
| 2085 | 2081 |
| 2086 // Some tests don't set parameters.ui_task, so they started translate | 2082 // Some tests don't set parameters.ui_task, so they started translate |
| 2087 // language fetch that was never completed so we need to cleanup here | 2083 // language fetch that was never completed so we need to cleanup here |
| 2088 // otherwise it will be done by the destructor in a wrong thread. | 2084 // otherwise it will be done by the destructor in a wrong thread. |
| 2089 if (parameters.ui_task == NULL && translate_manager != NULL) | 2085 if (parameters.ui_task == NULL && translate_manager != NULL) |
| 2090 translate_manager->CleanupPendingUlrFetcher(); | 2086 translate_manager->CleanupPendingUlrFetcher(); |
| 2091 | 2087 |
| 2092 | 2088 |
| 2093 chrome_browser_net_websocket_experiment::WebSocketExperimentRunner::Stop(); | |
| 2094 | |
| 2095 process_singleton.Cleanup(); | 2089 process_singleton.Cleanup(); |
| 2096 | 2090 |
| 2097 // Stop all tasks that might run on WatchDogThread. | 2091 // Stop all tasks that might run on WatchDogThread. |
| 2098 ThreadWatcherList::StopWatchingAll(); | 2092 ThreadWatcherList::StopWatchingAll(); |
| 2099 | 2093 |
| 2100 metrics->Stop(); | 2094 metrics->Stop(); |
| 2101 | 2095 |
| 2102 // browser_shutdown takes care of deleting browser_process, so we need to | 2096 // browser_shutdown takes care of deleting browser_process, so we need to |
| 2103 // release it. | 2097 // release it. |
| 2104 ignore_result(browser_process.release()); | 2098 ignore_result(browser_process.release()); |
| 2105 browser_shutdown::Shutdown(); | 2099 browser_shutdown::Shutdown(); |
| 2106 | 2100 |
| 2107 #if defined(OS_CHROMEOS) | 2101 #if defined(OS_CHROMEOS) |
| 2108 // To be precise, logout (browser shutdown) is not yet done, but the | 2102 // To be precise, logout (browser shutdown) is not yet done, but the |
| 2109 // remaining work is negligible, hence we say LogoutDone here. | 2103 // remaining work is negligible, hence we say LogoutDone here. |
| 2110 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 2104 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 2111 false); | 2105 false); |
| 2112 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 2106 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 2113 #endif | 2107 #endif |
| 2114 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 2108 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
| 2115 return result_code; | 2109 return result_code; |
| 2116 } | 2110 } |
| OLD | NEW |