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

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: 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') | ui/gfx/color_profile.h » ('J')
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..b5ba4ba05a3692bdc87bef8aaa418d41839f7b3b 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,11 @@ void RenderMessageFilter::OnPreCacheFontCharacters(
}
void RenderMessageFilter::OnGetMonitorColorProfile(std::vector<char>* profile) {
+ // TODO(ccameron): Remove this synchronous IPC and push the color profile
+ // to the renderer.
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
- *profile = g_color_profile.Get().profile();
+ gfx::ColorProfile::UpdateCachedProfilesOnBackgroundThread();
+ *profile = gfx::ColorProfile::GetFromDeepestMonitor().profile();
}
#endif // OS_*
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.cc » ('j') | ui/gfx/color_profile.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698