Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 1547793004: Make gpu black list work again on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a new commandline switch to prevent full gpu info collection in the test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 // device_event_log must be initialized after the message loop. Calls to 848 // device_event_log must be initialized after the message loop. Calls to
849 // {DEVICE}_LOG prior to here will only be logged with VLOG. Some 849 // {DEVICE}_LOG prior to here will only be logged with VLOG. Some
850 // platforms (e.g. chromeos) may have already initialized this. 850 // platforms (e.g. chromeos) may have already initialized this.
851 if (!device_event_log::IsInitialized()) 851 if (!device_event_log::IsInitialized())
852 device_event_log::Initialize(0 /* default max entries */); 852 device_event_log::Initialize(0 /* default max entries */);
853 853
854 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 854 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
855 chrome_extra_parts_[i]->PostMainMessageLoopStart(); 855 chrome_extra_parts_[i]->PostMainMessageLoopStart();
856 } 856 }
857 857
858 int ChromeBrowserMainParts::PreCreateThreads() { 858 int ChromeBrowserMainParts::PreCreateThreadsBegin() {
859 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreads"); 859 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsBegin");
860 result_code_ = PreCreateThreadsImpl(); 860 result_code_ = PreCreateThreadsImpl();
861 861
862 if (result_code_ == content::RESULT_CODE_NORMAL_EXIT) { 862 if (result_code_ == content::RESULT_CODE_NORMAL_EXIT) {
863 #if !defined(OS_ANDROID) 863 #if !defined(OS_ANDROID)
864 // These members must be initialized before exiting this function normally. 864 // These members must be initialized before exiting this function normally.
865 DCHECK(master_prefs_.get()); 865 DCHECK(master_prefs_.get());
866 DCHECK(browser_creator_.get()); 866 DCHECK(browser_creator_.get());
867 #endif // !defined(OS_ANDROID) 867 #endif // !defined(OS_ANDROID)
868 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 868 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
869 chrome_extra_parts_[i]->PreCreateThreads(); 869 chrome_extra_parts_[i]->PreCreateThreadsBegin();
870 } 870 }
871 871
872 return result_code_; 872 return result_code_;
873 } 873 }
874 874
875 int ChromeBrowserMainParts::PreCreateThreadsImpl() { 875 int ChromeBrowserMainParts::PreCreateThreadsImpl() {
876 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") 876 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl")
877 run_message_loop_ = false; 877 run_message_loop_ = false;
878 #if !defined(OS_ANDROID) 878 #if !defined(OS_ANDROID)
879 chrome::MaybeShowInvalidUserDataDirWarningDialog(); 879 chrome::MaybeShowInvalidUserDataDirWarningDialog();
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 // metrics and initialize field trials. The field trials are needed by 1105 // metrics and initialize field trials. The field trials are needed by
1106 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. 1106 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads.
1107 SetupMetricsAndFieldTrials(); 1107 SetupMetricsAndFieldTrials();
1108 1108
1109 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. 1109 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this.
1110 browser_process_->PreCreateThreads(); 1110 browser_process_->PreCreateThreads();
1111 1111
1112 return content::RESULT_CODE_NORMAL_EXIT; 1112 return content::RESULT_CODE_NORMAL_EXIT;
1113 } 1113 }
1114 1114
1115 void ChromeBrowserMainParts::PreCreateThreadsEnd() {
1116 // It is important to call gl_string_manager()->Initialize() before starting
1117 // the gpu process. Internally it properly setup the black listed features.
1118 // Which it is used to decide whether to start or not the gpu process from
1119 // BrowserMainLoop::BrowserThreadsStarted.
1120
1121 // Retrieve cached GL strings from local state and use them for GPU
1122 // blacklist decisions.
1123 if (g_browser_process->gl_string_manager())
1124 g_browser_process->gl_string_manager()->Initialize();
1125
1126 // Create an instance of GpuModeManager to watch gpu mode pref change.
1127 g_browser_process->gpu_mode_manager();
1128 }
1129
1115 void ChromeBrowserMainParts::PreMainMessageLoopRun() { 1130 void ChromeBrowserMainParts::PreMainMessageLoopRun() {
1116 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); 1131 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun");
1117 TRACK_SCOPED_REGION( 1132 TRACK_SCOPED_REGION(
1118 "Startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); 1133 "Startup", "ChromeBrowserMainParts::PreMainMessageLoopRun");
1119 1134
1120 result_code_ = PreMainMessageLoopRunImpl(); 1135 result_code_ = PreMainMessageLoopRunImpl();
1121 1136
1122 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) 1137 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
1123 chrome_extra_parts_[i]->PreMainMessageLoopRun(); 1138 chrome_extra_parts_[i]->PreMainMessageLoopRun();
1124 } 1139 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 #if !defined(DISABLE_NACL) 1477 #if !defined(DISABLE_NACL)
1463 NaClBrowserDelegateImpl* delegate = 1478 NaClBrowserDelegateImpl* delegate =
1464 new NaClBrowserDelegateImpl(browser_process_->profile_manager()); 1479 new NaClBrowserDelegateImpl(browser_process_->profile_manager());
1465 nacl::NaClBrowser::SetDelegate(delegate); 1480 nacl::NaClBrowser::SetDelegate(delegate);
1466 #endif // !defined(DISABLE_NACL) 1481 #endif // !defined(DISABLE_NACL)
1467 1482
1468 // TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts. 1483 // TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts.
1469 // (requires supporting early exit). 1484 // (requires supporting early exit).
1470 PostProfileInit(); 1485 PostProfileInit();
1471 1486
1472 // Retrieve cached GL strings from local state and use them for GPU
1473 // blacklist decisions.
1474 if (g_browser_process->gl_string_manager())
1475 g_browser_process->gl_string_manager()->Initialize();
1476
1477 // Create an instance of GpuModeManager to watch gpu mode pref change.
1478 g_browser_process->gpu_mode_manager();
1479
1480 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 1487 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
1481 // Show the First Run UI if this is the first time Chrome has been run on 1488 // Show the First Run UI if this is the first time Chrome has been run on
1482 // this computer, or we're being compelled to do so by a command line flag. 1489 // this computer, or we're being compelled to do so by a command line flag.
1483 // Note that this be done _after_ the PrefService is initialized and all 1490 // Note that this be done _after_ the PrefService is initialized and all
1484 // preferences are registered, since some of the code that the importer 1491 // preferences are registered, since some of the code that the importer
1485 // touches reads preferences. 1492 // touches reads preferences.
1486 if (first_run::IsChromeFirstRun()) { 1493 if (first_run::IsChromeFirstRun()) {
1487 first_run::AutoImport(profile_, 1494 first_run::AutoImport(profile_,
1488 master_prefs_->homepage_defined, 1495 master_prefs_->homepage_defined,
1489 master_prefs_->do_import_items, 1496 master_prefs_->do_import_items,
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 chromeos::CrosSettings::Shutdown(); 1876 chromeos::CrosSettings::Shutdown();
1870 #endif // defined(OS_CHROMEOS) 1877 #endif // defined(OS_CHROMEOS)
1871 #endif // defined(OS_ANDROID) 1878 #endif // defined(OS_ANDROID)
1872 } 1879 }
1873 1880
1874 // Public members: 1881 // Public members:
1875 1882
1876 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1883 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1877 chrome_extra_parts_.push_back(parts); 1884 chrome_extra_parts_.push_back(parts);
1878 } 1885 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698