diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 21:17:48 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 21:17:48 +0000 |
commit | 7a1f7c6f6c982287b3f6bb2acded619f3824416c (patch) | |
tree | 82ff404c4bcf84520c21ea7f0526ad5a40661641 /content/renderer/renderer_webkitclient_impl.cc | |
parent | bafaee12825a06890f114a282880e135a8b0b1ae (diff) | |
download | chromium_src-7a1f7c6f6c982287b3f6bb2acded619f3824416c.zip chromium_src-7a1f7c6f6c982287b3f6bb2acded619f3824416c.tar.gz chromium_src-7a1f7c6f6c982287b3f6bb2acded619f3824416c.tar.bz2 |
Make the Pepper proxy support in-process font rendering.
This implements a WebKit thread in the PPAPI plugin process so we can do the
font calls without IPC. The existing font support was refactored into
a virtual class (to prevent PPAPI from depending on WebKit and creating a
circular GYP dependency).
This moves the renderer sandbox support into content/common so that it can
be used by the PPAPI process.
Review URL: http://codereview.chromium.org/6981001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/renderer_webkitclient_impl.cc')
-rw-r--r-- | content/renderer/renderer_webkitclient_impl.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/content/renderer/renderer_webkitclient_impl.cc b/content/renderer/renderer_webkitclient_impl.cc index 99746c9..c68cc58 100644 --- a/content/renderer/renderer_webkitclient_impl.cc +++ b/content/renderer/renderer_webkitclient_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -61,7 +61,7 @@ #include <map> #include "base/synchronization/lock.h" -#include "content/renderer/renderer_sandbox_support_linux.h" +#include "content/common/child_process_sandbox_support_linux.h" #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebSandboxSupport.h" #endif @@ -128,7 +128,7 @@ class RendererWebKitClientImpl::SandboxSupport // here. The key in this map is an array of 16-bit UTF16 values from WebKit. // The value is a string containing the correct font family. base::Lock unicode_font_families_mutex_; - std::map<std::string, std::string> unicode_font_families_; + std::map<string16, std::string> unicode_font_families_; #endif }; @@ -440,24 +440,25 @@ WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( size_t num_characters, const char* preferred_locale) { base::AutoLock lock(unicode_font_families_mutex_); - const std::string key(reinterpret_cast<const char*>(characters), - num_characters * sizeof(characters[0])); - const std::map<std::string, std::string>::const_iterator iter = + const string16 key(characters, num_characters); + const std::map<string16, std::string>::const_iterator iter = unicode_font_families_.find(key); if (iter != unicode_font_families_.end()) return WebString::fromUTF8(iter->second); const std::string family_name = - renderer_sandbox_support::getFontFamilyForCharacters(characters, - num_characters, - preferred_locale); + child_process_sandbox_support::getFontFamilyForCharacters( + characters, + num_characters, + preferred_locale); unicode_font_families_.insert(make_pair(key, family_name)); return WebString::fromUTF8(family_name); } void RendererWebKitClientImpl::SandboxSupport::getRenderStyleForStrike( const char* family, int sizeAndStyle, WebKit::WebFontRenderStyle* out) { - renderer_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle, out); + child_process_sandbox_support::getRenderStyleForStrike(family, sizeAndStyle, + out); } #elif defined(OS_MACOSX) |