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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 2092533002: Clean up gfx::ColorProfile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl try Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index aab4ef993663dd98e107a57e2d7a7f32593e17f0..2b792a7f163d21a994138b7a09089edbf8fa75c6 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -99,14 +99,6 @@ const uint32_t kFilteredMessageClasses[] = {
ChildProcessMsgStart, RenderProcessMsgStart, ViewMsgStart,
};
-#if defined(OS_WIN)
-// On Windows, |g_color_profile| can run on an arbitrary background thread.
-// We avoid races by using LazyInstance's constructor lock to initialize the
-// object.
-base::LazyInstance<gfx::ColorProfile>::Leaky g_color_profile =
- LAZY_INSTANCE_INITIALIZER;
-#endif
-
#if defined(OS_MACOSX)
void ResizeHelperHandleMsgOnUIThread(int render_process_id,
const IPC::Message& message) {
@@ -392,8 +384,12 @@ void RenderMessageFilter::OnPreCacheFontCharacters(
}
void RenderMessageFilter::OnGetMonitorColorProfile(std::vector<char>* profile) {
+ // TODO(ccameron): Remove this synchronous IPC and push the color profile
+ // to the renderer. https://crbug.com/622133
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
- *profile = g_color_profile.Get().profile();
+ if (gfx::ColorProfile::CachedProfilesNeedUpdate())
+ gfx::ColorProfile::UpdateCachedProfilesOnBackgroundThread();
+ *profile = gfx::ColorProfile::GetFromBestMonitor().profile();
}
#endif // OS_*
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698