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

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

Issue 6981001: Make the Pepper proxy support in-process font rendering. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_webkitclient_impl.h" 5 #include "content/renderer/renderer_webkitclient_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
11 #include "base/shared_memory.h" 11 #include "base/shared_memory.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "content/common/font_descriptor_mac.h" 54 #include "content/common/font_descriptor_mac.h"
55 #include "content/common/font_loader_mac.h" 55 #include "content/common/font_loader_mac.h"
56 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSandboxSupport .h" 56 #include "third_party/WebKit/Source/WebKit/chromium/public/mac/WebSandboxSupport .h"
57 #endif 57 #endif
58 58
59 #if defined(OS_LINUX) 59 #if defined(OS_LINUX)
60 #include <string> 60 #include <string>
61 #include <map> 61 #include <map>
62 62
63 #include "base/synchronization/lock.h" 63 #include "base/synchronization/lock.h"
64 #include "content/renderer/renderer_sandbox_support_linux.h" 64 #include "content/common/child_process_sandbox_support_linux.h"
65 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebSandboxSuppo rt.h" 65 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebSandboxSuppo rt.h"
66 #endif 66 #endif
67 67
68 #if defined(OS_POSIX) 68 #if defined(OS_POSIX)
69 #include "base/file_descriptor_posix.h" 69 #include "base/file_descriptor_posix.h"
70 #endif 70 #endif
71 71
72 using WebKit::WebAudioDevice; 72 using WebKit::WebAudioDevice;
73 using WebKit::WebBlobRegistry; 73 using WebKit::WebBlobRegistry;
74 using WebKit::WebFileSystem; 74 using WebKit::WebFileSystem;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const char* preferred_locale) { 441 const char* preferred_locale) {
442 base::AutoLock lock(unicode_font_families_mutex_); 442 base::AutoLock lock(unicode_font_families_mutex_);
443 const std::string key(reinterpret_cast<const char*>(characters), 443 const std::string key(reinterpret_cast<const char*>(characters),
444 num_characters * sizeof(characters[0])); 444 num_characters * sizeof(characters[0]));
445 const std::map<std::string, std::string>::const_iterator iter = 445 const std::map<std::string, std::string>::const_iterator iter =
446 unicode_font_families_.find(key); 446 unicode_font_families_.find(key);
447 if (iter != unicode_font_families_.end()) 447 if (iter != unicode_font_families_.end())
448 return WebString::fromUTF8(iter->second); 448 return WebString::fromUTF8(iter->second);
449 449
450 const std::string family_name = 450 const std::string family_name =
451 renderer_sandbox_support::getFontFamilyForCharacters(characters, 451 child_process_sandbox_support::getFontFamilyForCharacters(
452 num_characters, 452 characters,
453 preferred_locale); 453 num_characters,
454 preferred_locale);
454 unicode_font_families_.insert(make_pair(key, family_name)); 455 unicode_font_families_.insert(make_pair(key, family_name));
455 return WebString::fromUTF8(family_name); 456 return WebString::fromUTF8(family_name);
456 } 457 }
457 458
458 void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( 459 void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike(
459 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out) { 460 const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out) {
460 renderer_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle, out); 461 child_process_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle,
462 out);
461 } 463 }
462 464
463 #elif defined(OS_MACOSX) 465 #elif defined(OS_MACOSX)
464 466
465 bool RendererWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont, 467 bool RendererWebKitClientImpl::SandboxSupport::loadFont(NSFont* srcFont,
466 ATSFontContainerRef* out) { 468 ATSFontContainerRef* out) {
467 DCHECK(srcFont); 469 DCHECK(srcFont);
468 DCHECK(out); 470 DCHECK(out);
469 471
470 uint32 font_data_size; 472 uint32 font_data_size;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return WebString::fromUTF8(signed_public_key); 571 return WebString::fromUTF8(signed_public_key);
570 } 572 }
571 573
572 //------------------------------------------------------------------------------ 574 //------------------------------------------------------------------------------
573 575
574 WebBlobRegistry* RendererWebKitClientImpl::blobRegistry() { 576 WebBlobRegistry* RendererWebKitClientImpl::blobRegistry() {
575 if (!blob_registry_.get()) 577 if (!blob_registry_.get())
576 blob_registry_.reset(new WebBlobRegistryImpl(RenderThread::current())); 578 blob_registry_.reset(new WebBlobRegistryImpl(RenderThread::current()));
577 return blob_registry_.get(); 579 return blob_registry_.get();
578 } 580 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698