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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: leave empty check Created 4 years, 5 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 "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 const blink::WebURL& top_origin) { 836 const blink::WebURL& top_origin) {
837 std::string signed_public_key; 837 std::string signed_public_key;
838 RenderThread::Get()->Send(new RenderProcessHostMsg_Keygen( 838 RenderThread::Get()->Send(new RenderProcessHostMsg_Keygen(
839 static_cast<uint32_t>(key_size_index), challenge.utf8(), GURL(url), 839 static_cast<uint32_t>(key_size_index), challenge.utf8(), GURL(url),
840 GURL(top_origin), &signed_public_key)); 840 GURL(top_origin), &signed_public_key));
841 return WebString::fromUTF8(signed_public_key); 841 return WebString::fromUTF8(signed_public_key);
842 } 842 }
843 843
844 //------------------------------------------------------------------------------ 844 //------------------------------------------------------------------------------
845 845
846 void RendererBlinkPlatformImpl::screenColorProfile(
847 WebVector<char>* to_profile) {
848 #if defined(OS_WIN)
849 // On Windows screen color profile is only available in the browser.
850 std::vector<char> profile;
851 // This Send() can be called from any impl-side thread. Use a thread
852 // safe send to avoid crashing trying to access RenderThread::Get(),
853 // which is not accessible from arbitrary threads.
854 thread_safe_sender_->Send(
855 new RenderProcessHostMsg_GetMonitorColorProfile(&profile));
856 *to_profile = profile;
857 #else
858 // On other platforms, the primary monitor color profile can be read
859 // directly.
860 gfx::ColorProfile profile = gfx::ColorProfile::GetFromBestMonitor();
861 *to_profile = profile.profile();
862 #endif
863 }
864
865 //------------------------------------------------------------------------------
866
867 blink::WebScrollbarBehavior* RendererBlinkPlatformImpl::scrollbarBehavior() { 846 blink::WebScrollbarBehavior* RendererBlinkPlatformImpl::scrollbarBehavior() {
868 return web_scrollbar_behavior_.get(); 847 return web_scrollbar_behavior_.get();
869 } 848 }
870 849
871 //------------------------------------------------------------------------------ 850 //------------------------------------------------------------------------------
872 851
873 WebBlobRegistry* RendererBlinkPlatformImpl::blobRegistry() { 852 WebBlobRegistry* RendererBlinkPlatformImpl::blobRegistry() {
874 // blob_registry_ can be NULL when running some tests. 853 // blob_registry_ can be NULL when running some tests.
875 return blob_registry_.get(); 854 return blob_registry_.get();
876 } 855 }
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 return &trial_token_validator_; 1309 return &trial_token_validator_;
1331 } 1310 }
1332 1311
1333 void RendererBlinkPlatformImpl::workerContextCreated( 1312 void RendererBlinkPlatformImpl::workerContextCreated(
1334 const v8::Local<v8::Context>& worker) { 1313 const v8::Local<v8::Context>& worker) {
1335 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( 1314 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
1336 worker); 1315 worker);
1337 } 1316 }
1338 1317
1339 } // namespace content 1318 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698