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

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

Issue 327643002: Complete Chromium side rename of WebFontFamily to WebFallbackFont (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ren_step2
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_webkitplatformsupport_impl.h" 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 virtual ~SandboxSupport() {} 200 virtual ~SandboxSupport() {}
201 201
202 #if defined(OS_WIN) 202 #if defined(OS_WIN)
203 virtual bool ensureFontLoaded(HFONT); 203 virtual bool ensureFontLoaded(HFONT);
204 #elif defined(OS_MACOSX) 204 #elif defined(OS_MACOSX)
205 virtual bool loadFont( 205 virtual bool loadFont(
206 NSFont* src_font, 206 NSFont* src_font,
207 CGFontRef* container, 207 CGFontRef* container,
208 uint32* font_id); 208 uint32* font_id);
209 #elif defined(OS_POSIX) 209 #elif defined(OS_POSIX)
210 // TODO(dro): crbug.com/382411 Remove this function, once the blink side
211 // does not need it anymore.
212 virtual void getFontFamilyForCharacter(
213 blink::WebUChar32 character,
214 const char* preferred_locale,
215 blink::WebFontFamily* family);
216 virtual void getFallbackFontForCharacter( 210 virtual void getFallbackFontForCharacter(
217 blink::WebUChar32 character, 211 blink::WebUChar32 character,
218 const char* preferred_locale, 212 const char* preferred_locale,
219 blink::WebFallbackFont* fallbackFont); 213 blink::WebFallbackFont* fallbackFont);
220 virtual void getRenderStyleForStrike( 214 virtual void getRenderStyleForStrike(
221 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out); 215 const char* family, int sizeAndStyle, blink::WebFontRenderStyle* out);
222 216
223 private: 217 private:
224 // WebKit likes to ask us for the correct font family to use for a set of 218 // WebKit likes to ask us for the correct font family to use for a set of
225 // unicode code points. It needs this information frequently so we cache it 219 // unicode code points. It needs this information frequently so we cache it
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 601
608 #elif defined(OS_ANDROID) 602 #elif defined(OS_ANDROID)
609 603
610 // WebKit doesn't use WebSandboxSupport on android so we don't need to 604 // WebKit doesn't use WebSandboxSupport on android so we don't need to
611 // implement anything here. This is cleaner to support than excluding the 605 // implement anything here. This is cleaner to support than excluding the
612 // whole class for android. 606 // whole class for android.
613 607
614 #elif defined(OS_POSIX) 608 #elif defined(OS_POSIX)
615 609
616 void 610 void
617 RendererWebKitPlatformSupportImpl::SandboxSupport::getFontFamilyForCharacter(
618 blink::WebUChar32 character,
619 const char* preferred_locale,
620 blink::WebFontFamily* family) {
621 base::AutoLock lock(unicode_font_families_mutex_);
622 const std::map<int32_t, blink::WebFallbackFont>::const_iterator iter =
623 unicode_font_families_.find(character);
624 if (iter != unicode_font_families_.end()) {
625 family->name = iter->second.name;
626 family->isBold = iter->second.isBold;
627 family->isItalic = iter->second.isItalic;
628 return;
629 }
630
631 blink::WebFallbackFont fallbackFont;
632 GetFallbackFontForCharacter(character, preferred_locale, &fallbackFont);
633 unicode_font_families_.insert(std::make_pair(character, fallbackFont));
634 family->name = fallbackFont.name;
635 family->isBold = fallbackFont.isBold;
636 family->isItalic = fallbackFont.isItalic;
637 }
638
639
640 void
641 RendererWebKitPlatformSupportImpl::SandboxSupport::getFallbackFontForCharacter( 611 RendererWebKitPlatformSupportImpl::SandboxSupport::getFallbackFontForCharacter(
642 blink::WebUChar32 character, 612 blink::WebUChar32 character,
643 const char* preferred_locale, 613 const char* preferred_locale,
644 blink::WebFallbackFont* fallbackFont) { 614 blink::WebFallbackFont* fallbackFont) {
645 base::AutoLock lock(unicode_font_families_mutex_); 615 base::AutoLock lock(unicode_font_families_mutex_);
646 const std::map<int32_t, blink::WebFallbackFont>::const_iterator iter = 616 const std::map<int32_t, blink::WebFallbackFont>::const_iterator iter =
647 unicode_font_families_.find(character); 617 unicode_font_families_.find(character);
648 if (iter != unicode_font_families_.end()) { 618 if (iter != unicode_font_families_.end()) {
649 fallbackFont->name = iter->second.name; 619 fallbackFont->name = iter->second.name;
650 fallbackFont->filename = iter->second.filename; 620 fallbackFont->filename = iter->second.filename;
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 battery_status_dispatcher_->SetListener(listener); 1220 battery_status_dispatcher_->SetListener(listener);
1251 } 1221 }
1252 1222
1253 // static 1223 // static
1254 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting( 1224 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting(
1255 const blink::WebBatteryStatus& status) { 1225 const blink::WebBatteryStatus& status) {
1256 g_test_battery_status_dispatcher.Get().PostBatteryStatusChange(status); 1226 g_test_battery_status_dispatcher.Get().PostBatteryStatusChange(status);
1257 } 1227 }
1258 1228
1259 } // namespace content 1229 } // namespace content
OLDNEW
« no previous file with comments | « content/ppapi_plugin/ppapi_webkitplatformsupport_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698