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

Unified Diff: chrome/browser/web_resource/gpu_blacklist_updater.cc

Issue 8670004: Move GPU preliminary info collection back to UI thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_resource/gpu_blacklist_updater.h ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_resource/gpu_blacklist_updater.cc
===================================================================
--- chrome/browser/web_resource/gpu_blacklist_updater.cc (revision 111230)
+++ chrome/browser/web_resource/gpu_blacklist_updater.cc (working copy)
@@ -36,29 +36,8 @@
static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000;
std::string GetChromeVersionString() {
- CR_DEFINE_STATIC_LOCAL(std::string, cr_version, ());
- if (!cr_version.empty())
- return cr_version;
chrome::VersionInfo version_info;
- cr_version = version_info.is_valid() ? version_info.Version() : "0";
- switch (version_info.GetChannel()) {
- case chrome::VersionInfo::CHANNEL_STABLE:
- cr_version += " stable";
- break;
- case chrome::VersionInfo::CHANNEL_BETA:
- cr_version += " beta";
- break;
- case chrome::VersionInfo::CHANNEL_DEV:
- cr_version += " dev";
- break;
- case chrome::VersionInfo::CHANNEL_CANARY:
- cr_version += " canary";
- break;
- default:
- cr_version += " unknown";
- break;
- }
- return cr_version;
+ return version_info.is_valid() ? version_info.Version() : "0";
}
} // namespace anonymous
@@ -81,34 +60,18 @@
GpuBlacklistUpdater::~GpuBlacklistUpdater() { }
// static
-void GpuBlacklistUpdater::SetupOnFileThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+void GpuBlacklistUpdater::Setup() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Initialize GpuDataManager instance, which collects preliminary
- // graphics information. This has to happen on FILE thread.
+ // graphics information.
GpuDataManager::GetInstance();
- // Cache the chrome version string. This has to happen on FILE thread
- // because of chrome::VersionInfo::GetChannel().
- GetChromeVersionString();
-
// Skip auto updates in tests.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kSkipGpuDataLoading))
return;
- // Post GpuBlacklistUpdate task on UI thread. This has to happen
- // after GpuDataManager is initialized, otherwise it might be
- // initialzed on UI thread.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&GpuBlacklistUpdater::SetupOnUIThread));
-}
-
-// static
-void GpuBlacklistUpdater::SetupOnUIThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
// Initialize GpuBlacklistUpdater, which loads the current blacklist;
// then Schedule a GPU blacklist auto update.
GpuBlacklistUpdater* updater =
« no previous file with comments | « chrome/browser/web_resource/gpu_blacklist_updater.h ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698