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 16 matching lines...) Expand all Loading... |
27 #include "base/threading/platform_thread.h" | 27 #include "base/threading/platform_thread.h" |
28 #include "base/time.h" | 28 #include "base/time.h" |
29 #include "base/utf_string_conversions.h" | 29 #include "base/utf_string_conversions.h" |
30 #include "base/values.h" | 30 #include "base/values.h" |
31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
32 #include "chrome/browser/about_flags.h" | 32 #include "chrome/browser/about_flags.h" |
33 #include "chrome/browser/browser_process.h" | 33 #include "chrome/browser/browser_process.h" |
34 #include "chrome/browser/browser_process_impl.h" | 34 #include "chrome/browser/browser_process_impl.h" |
35 #include "chrome/browser/browser_shutdown.h" | 35 #include "chrome/browser/browser_shutdown.h" |
36 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 36 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
| 37 #include "chrome/browser/chrome_gpu_util.h" |
37 #include "chrome/browser/defaults.h" | 38 #include "chrome/browser/defaults.h" |
38 #include "chrome/browser/extensions/extension_protocols.h" | 39 #include "chrome/browser/extensions/extension_protocols.h" |
39 #include "chrome/browser/extensions/extension_service.h" | 40 #include "chrome/browser/extensions/extension_service.h" |
40 #include "chrome/browser/extensions/startup_helper.h" | 41 #include "chrome/browser/extensions/startup_helper.h" |
41 #include "chrome/browser/first_run/upgrade_util.h" | 42 #include "chrome/browser/first_run/upgrade_util.h" |
42 #include "chrome/browser/google/google_search_counter.h" | 43 #include "chrome/browser/google/google_search_counter.h" |
43 #include "chrome/browser/google/google_util.h" | 44 #include "chrome/browser/google/google_util.h" |
44 #include "chrome/browser/gpu_blacklist.h" | |
45 #include "chrome/browser/jankometer.h" | 45 #include "chrome/browser/jankometer.h" |
46 #include "chrome/browser/language_usage_metrics.h" | 46 #include "chrome/browser/language_usage_metrics.h" |
47 #include "chrome/browser/managed_mode.h" | 47 #include "chrome/browser/managed_mode.h" |
48 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 48 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
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/variations_service.h" | 53 #include "chrome/browser/metrics/variations/variations_service.h" |
54 #include "chrome/browser/nacl_host/nacl_process_host.h" | 54 #include "chrome/browser/nacl_host/nacl_process_host.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 #else | 417 #else |
418 // TODO(port): fix this. See comments near the definition of | 418 // TODO(port): fix this. See comments near the definition of |
419 // user_data_dir. It is better to CHECK-fail here than it is to | 419 // user_data_dir. It is better to CHECK-fail here than it is to |
420 // silently exit because of missing code in the above test. | 420 // silently exit because of missing code in the above test. |
421 CHECK(profile) << "Cannot get default profile."; | 421 CHECK(profile) << "Cannot get default profile."; |
422 #endif | 422 #endif |
423 | 423 |
424 return NULL; | 424 return NULL; |
425 } | 425 } |
426 | 426 |
427 // Load GPU Blacklist, collect preliminary gpu info, and compute preliminary | |
428 // gpu feature flags. | |
429 void InitializeGpuDataManager(const CommandLine& parsed_command_line) { | |
430 content::GpuDataManager::GetInstance()->InitializeGpuInfo(); | |
431 if (parsed_command_line.HasSwitch(switches::kSkipGpuDataLoading) || | |
432 parsed_command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { | |
433 return; | |
434 } | |
435 | |
436 const base::StringPiece gpu_blacklist_json( | |
437 ResourceBundle::GetSharedInstance().GetRawDataResource( | |
438 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE)); | |
439 GpuBlacklist* gpu_blacklist = GpuBlacklist::GetInstance(); | |
440 bool succeed = gpu_blacklist->LoadGpuBlacklist( | |
441 gpu_blacklist_json.as_string(), GpuBlacklist::kCurrentOsOnly); | |
442 DCHECK(succeed); | |
443 gpu_blacklist->UpdateGpuDataManager(); | |
444 } | |
445 | |
446 #if defined(OS_MACOSX) | 427 #if defined(OS_MACOSX) |
447 OSStatus KeychainCallback(SecKeychainEvent keychain_event, | 428 OSStatus KeychainCallback(SecKeychainEvent keychain_event, |
448 SecKeychainCallbackInfo* info, void* context) { | 429 SecKeychainCallbackInfo* info, void* context) { |
449 return noErr; | 430 return noErr; |
450 } | 431 } |
451 #endif | 432 #endif |
452 | 433 |
453 // This code is specific to the Windows-only PreReadExperiment field-trial. | 434 // This code is specific to the Windows-only PreReadExperiment field-trial. |
454 void AddPreReadHistogramTime(const char* name, base::TimeDelta time) { | 435 void AddPreReadHistogramTime(const char* name, base::TimeDelta time) { |
455 const base::TimeDelta kMin(base::TimeDelta::FromMilliseconds(1)); | 436 const base::TimeDelta kMin(base::TimeDelta::FromMilliseconds(1)); |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 | 1329 |
1349 // Create the instance of the cloud print proxy service so that it can launch | 1330 // Create the instance of the cloud print proxy service so that it can launch |
1350 // the service process if needed. This is needed because the service process | 1331 // the service process if needed. This is needed because the service process |
1351 // might have shutdown because an update was available. | 1332 // might have shutdown because an update was available. |
1352 // TODO(torne): this should maybe be done with | 1333 // TODO(torne): this should maybe be done with |
1353 // ProfileKeyedServiceFactory::ServiceIsCreatedWithProfile() instead? | 1334 // ProfileKeyedServiceFactory::ServiceIsCreatedWithProfile() instead? |
1354 #if !defined(OS_ANDROID) | 1335 #if !defined(OS_ANDROID) |
1355 CloudPrintProxyServiceFactory::GetForProfile(profile_); | 1336 CloudPrintProxyServiceFactory::GetForProfile(profile_); |
1356 #endif | 1337 #endif |
1357 | 1338 |
1358 // Load GPU Blacklist. | 1339 // Load GPU Blacklist; load preliminary GPU info. |
1359 InitializeGpuDataManager(parsed_command_line()); | 1340 gpu_util::InitializeGpuDataManager(parsed_command_line()); |
1360 | 1341 |
1361 // Start watching all browser threads for responsiveness. | 1342 // Start watching all browser threads for responsiveness. |
1362 ThreadWatcherList::StartWatchingAll(parsed_command_line()); | 1343 ThreadWatcherList::StartWatchingAll(parsed_command_line()); |
1363 | 1344 |
1364 #if !defined(DISABLE_NACL) | 1345 #if !defined(DISABLE_NACL) |
1365 if (parsed_command_line().HasSwitch(switches::kPnaclDir)) { | 1346 if (parsed_command_line().HasSwitch(switches::kPnaclDir)) { |
1366 PathService::Override(chrome::DIR_PNACL_BASE, | 1347 PathService::Override(chrome::DIR_PNACL_BASE, |
1367 parsed_command_line().GetSwitchValuePath( | 1348 parsed_command_line().GetSwitchValuePath( |
1368 switches::kPnaclDir)); | 1349 switches::kPnaclDir)); |
1369 } | 1350 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1608 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1628 uma_name += "_XP"; | 1609 uma_name += "_XP"; |
1629 | 1610 |
1630 uma_name += "_PreRead_"; | 1611 uma_name += "_PreRead_"; |
1631 uma_name += pre_read_percentage; | 1612 uma_name += pre_read_percentage; |
1632 AddPreReadHistogramTime(uma_name.c_str(), time); | 1613 AddPreReadHistogramTime(uma_name.c_str(), time); |
1633 } | 1614 } |
1634 #endif | 1615 #endif |
1635 #endif | 1616 #endif |
1636 } | 1617 } |
OLD | NEW |