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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 if (result_code_ == content::RESULT_CODE_NORMAL_EXIT) { | 867 if (result_code_ == content::RESULT_CODE_NORMAL_EXIT) { |
868 #if !defined(OS_ANDROID) | 868 #if !defined(OS_ANDROID) |
869 // These members must be initialized before exiting this function normally. | 869 // These members must be initialized before exiting this function normally. |
870 DCHECK(master_prefs_.get()); | 870 DCHECK(master_prefs_.get()); |
871 DCHECK(browser_creator_.get()); | 871 DCHECK(browser_creator_.get()); |
872 #endif // !defined(OS_ANDROID) | 872 #endif // !defined(OS_ANDROID) |
873 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 873 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
874 chrome_extra_parts_[i]->PreCreateThreads(); | 874 chrome_extra_parts_[i]->PreCreateThreads(); |
875 } | 875 } |
876 | 876 |
| 877 // It is important to call gl_string_manager()->Initialize() before starting |
| 878 // the gpu process. Internally it properly setup the black listed features. |
| 879 // Which it is used to decide whether to start or not the gpu process from |
| 880 // BrowserMainLoop::BrowserThreadsStarted. |
| 881 |
| 882 // Retrieve cached GL strings from local state and use them for GPU |
| 883 // blacklist decisions. |
| 884 |
| 885 if (g_browser_process->gl_string_manager()) |
| 886 g_browser_process->gl_string_manager()->Initialize(); |
| 887 |
| 888 // Create an instance of GpuModeManager to watch gpu mode pref change. |
| 889 g_browser_process->gpu_mode_manager(); |
| 890 |
877 return result_code_; | 891 return result_code_; |
878 } | 892 } |
879 | 893 |
880 int ChromeBrowserMainParts::PreCreateThreadsImpl() { | 894 int ChromeBrowserMainParts::PreCreateThreadsImpl() { |
881 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") | 895 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") |
882 run_message_loop_ = false; | 896 run_message_loop_ = false; |
883 #if !defined(OS_ANDROID) | 897 #if !defined(OS_ANDROID) |
884 chrome::MaybeShowInvalidUserDataDirWarningDialog(); | 898 chrome::MaybeShowInvalidUserDataDirWarningDialog(); |
885 #endif // !defined(OS_ANDROID) | 899 #endif // !defined(OS_ANDROID) |
886 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) | 900 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 #if !defined(DISABLE_NACL) | 1493 #if !defined(DISABLE_NACL) |
1480 NaClBrowserDelegateImpl* delegate = | 1494 NaClBrowserDelegateImpl* delegate = |
1481 new NaClBrowserDelegateImpl(browser_process_->profile_manager()); | 1495 new NaClBrowserDelegateImpl(browser_process_->profile_manager()); |
1482 nacl::NaClBrowser::SetDelegate(delegate); | 1496 nacl::NaClBrowser::SetDelegate(delegate); |
1483 #endif // !defined(DISABLE_NACL) | 1497 #endif // !defined(DISABLE_NACL) |
1484 | 1498 |
1485 // TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts. | 1499 // TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts. |
1486 // (requires supporting early exit). | 1500 // (requires supporting early exit). |
1487 PostProfileInit(); | 1501 PostProfileInit(); |
1488 | 1502 |
1489 // Retrieve cached GL strings from local state and use them for GPU | |
1490 // blacklist decisions. | |
1491 if (g_browser_process->gl_string_manager()) | |
1492 g_browser_process->gl_string_manager()->Initialize(); | |
1493 | |
1494 // Create an instance of GpuModeManager to watch gpu mode pref change. | |
1495 g_browser_process->gpu_mode_manager(); | |
1496 | |
1497 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1503 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
1498 // Show the First Run UI if this is the first time Chrome has been run on | 1504 // Show the First Run UI if this is the first time Chrome has been run on |
1499 // this computer, or we're being compelled to do so by a command line flag. | 1505 // this computer, or we're being compelled to do so by a command line flag. |
1500 // Note that this be done _after_ the PrefService is initialized and all | 1506 // Note that this be done _after_ the PrefService is initialized and all |
1501 // preferences are registered, since some of the code that the importer | 1507 // preferences are registered, since some of the code that the importer |
1502 // touches reads preferences. | 1508 // touches reads preferences. |
1503 if (first_run::IsChromeFirstRun()) { | 1509 if (first_run::IsChromeFirstRun()) { |
1504 first_run::AutoImport(profile_, | 1510 first_run::AutoImport(profile_, |
1505 master_prefs_->homepage_defined, | 1511 master_prefs_->homepage_defined, |
1506 master_prefs_->do_import_items, | 1512 master_prefs_->do_import_items, |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 chromeos::CrosSettings::Shutdown(); | 1892 chromeos::CrosSettings::Shutdown(); |
1887 #endif // defined(OS_CHROMEOS) | 1893 #endif // defined(OS_CHROMEOS) |
1888 #endif // defined(OS_ANDROID) | 1894 #endif // defined(OS_ANDROID) |
1889 } | 1895 } |
1890 | 1896 |
1891 // Public members: | 1897 // Public members: |
1892 | 1898 |
1893 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1899 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1894 chrome_extra_parts_.push_back(parts); | 1900 chrome_extra_parts_.push_back(parts); |
1895 } | 1901 } |
OLD | NEW |