summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_resource
diff options
context:
space:
mode:
authorzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 16:03:04 +0000
committerzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 16:03:04 +0000
commit490812acd765b85de40f97147e4ccca62117601f (patch)
treed7593cd3519555a77ae7ce03f5fcf0a59e45a340 /chrome/browser/web_resource
parent82a01acfe2518e3345c57113c8f597f5cf3d2344 (diff)
downloadchromium_src-490812acd765b85de40f97147e4ccca62117601f.zip
chromium_src-490812acd765b85de40f97147e4ccca62117601f.tar.gz
chromium_src-490812acd765b85de40f97147e4ccca62117601f.tar.bz2
Move IO op from UI thread to FILE in GpuBlacklistUpdater.
BUG=95601 TEST=tree green, no thread IO op violation in debug build. Review URL: http://codereview.chromium.org/7840034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100155 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_resource')
-rw-r--r--chrome/browser/web_resource/gpu_blacklist_updater.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/web_resource/gpu_blacklist_updater.cc b/chrome/browser/web_resource/gpu_blacklist_updater.cc
index 6907d26..6637e45 100644
--- a/chrome/browser/web_resource/gpu_blacklist_updater.cc
+++ b/chrome/browser/web_resource/gpu_blacklist_updater.cc
@@ -32,26 +32,29 @@ static const int kStartGpuBlacklistFetchDelay = 6000;
static const int kCacheUpdateDelay = 48 * 60 * 60 * 1000;
std::string GetChromeVersionString() {
+ static std::string cr_version;
+ if (!cr_version.empty())
+ return cr_version;
chrome::VersionInfo version_info;
- std::string rt = version_info.is_valid() ? version_info.Version() : "0";
+ cr_version = version_info.is_valid() ? version_info.Version() : "0";
switch (version_info.GetChannel()) {
case chrome::VersionInfo::CHANNEL_STABLE:
- rt += " stable";
+ cr_version += " stable";
break;
case chrome::VersionInfo::CHANNEL_BETA:
- rt += " beta";
+ cr_version += " beta";
break;
case chrome::VersionInfo::CHANNEL_DEV:
- rt += " dev";
+ cr_version += " dev";
break;
case chrome::VersionInfo::CHANNEL_CANARY:
- rt += " canary";
+ cr_version += " canary";
break;
default:
- rt += " unknown";
+ cr_version += " unknown";
break;
}
- return rt;
+ return cr_version;
}
} // namespace anonymous
@@ -87,6 +90,10 @@ void GpuBlacklistUpdater::SetupOnFileThread() {
gfx::kGLImplementationOSMesaName))
return;
+ // Cache the chrome version string. This has to happen on FILE thread
+ // because of chrome::VersionInfo::GetChannel().
+ GetChromeVersionString();
+
// Post GpuBlacklistUpdate task on UI thread. This has to happen
// after GpuDataManager is initialized, otherwise it might be
// initialzed on UI thread.