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

Side by Side Diff: ppapi/shared_impl/ppb_font_shared.cc

Issue 8790004: Rename the shared impl files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 years 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
« no previous file with comments | « ppapi/shared_impl/ppb_font_shared.h ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.h » ('j') | 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) 2011 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 "ppapi/shared_impl/font_impl.h" 5 #include "ppapi/shared_impl/ppb_font_shared.h"
6 6
7 #include "ppapi/c/dev/ppb_font_dev.h" 7 #include "ppapi/c/dev/ppb_font_dev.h"
8 8
9 namespace ppapi { 9 namespace ppapi {
10 10
11 // static 11 // static
12 bool FontImpl::IsPPFontDescriptionValid(const PP_FontDescription_Dev& desc) { 12 bool PPB_Font_Shared::IsPPFontDescriptionValid(
13 const PP_FontDescription_Dev& desc) {
13 // Check validity of string. We can't check the actual text since we could 14 // Check validity of string. We can't check the actual text since we could
14 // be on the wrong thread and don't know if we're in the plugin or the host. 15 // be on the wrong thread and don't know if we're in the plugin or the host.
15 if (desc.face.type != PP_VARTYPE_STRING && 16 if (desc.face.type != PP_VARTYPE_STRING &&
16 desc.face.type != PP_VARTYPE_UNDEFINED) 17 desc.face.type != PP_VARTYPE_UNDEFINED)
17 return false; 18 return false;
18 19
19 // Check enum ranges. 20 // Check enum ranges.
20 if (static_cast<int>(desc.family) < PP_FONTFAMILY_DEFAULT || 21 if (static_cast<int>(desc.family) < PP_FONTFAMILY_DEFAULT ||
21 static_cast<int>(desc.family) > PP_FONTFAMILY_MONOSPACE) 22 static_cast<int>(desc.family) > PP_FONTFAMILY_MONOSPACE)
22 return false; 23 return false;
23 if (static_cast<int>(desc.weight) < PP_FONTWEIGHT_100 || 24 if (static_cast<int>(desc.weight) < PP_FONTWEIGHT_100 ||
24 static_cast<int>(desc.weight) > PP_FONTWEIGHT_900) 25 static_cast<int>(desc.weight) > PP_FONTWEIGHT_900)
25 return false; 26 return false;
26 27
27 // Check for excessive sizes which may cause layout to get confused. 28 // Check for excessive sizes which may cause layout to get confused.
28 if (desc.size > 200) 29 if (desc.size > 200)
29 return false; 30 return false;
30 31
31 return true; 32 return true;
32 } 33 }
33 34
34 } // namespace ppapi 35 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_font_shared.h ('k') | ppapi/shared_impl/ppb_graphics_3d_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698