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

Side by Side Diff: skia/ext/SkFontHost_fontconfig_ipc.cpp

Issue 507037: Returns an error immediately without sending IPC message when a font family n... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « skia/ext/SkFontHost_fontconfig_impl.h ('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 /* libs/graphics/ports/SkFontHost_fontconfig_direct.cpp 1 /* libs/graphics/ports/SkFontHost_fontconfig_direct.cpp
2 ** 2 **
3 ** Copyright 2009, Google Inc. 3 ** Copyright 2009, Google Inc.
4 ** 4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License"); 5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License. 6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at 7 ** You may obtain a copy of the License at
8 ** 8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0 9 ** http://www.apache.org/licenses/LICENSE-2.0
10 ** 10 **
(...skipping 23 matching lines...) Expand all
34 34
35 FontConfigIPC::~FontConfigIPC() { 35 FontConfigIPC::~FontConfigIPC() {
36 close(fd_); 36 close(fd_);
37 } 37 }
38 38
39 bool FontConfigIPC::Match(std::string* result_family, 39 bool FontConfigIPC::Match(std::string* result_family,
40 unsigned* result_fileid, 40 unsigned* result_fileid,
41 bool fileid_valid, unsigned fileid, 41 bool fileid_valid, unsigned fileid,
42 const std::string& family, bool* is_bold, 42 const std::string& family, bool* is_bold,
43 bool* is_italic) { 43 bool* is_italic) {
44 if (family.length() > kMaxFontFamilyLength)
45 return false;
46
44 Pickle request; 47 Pickle request;
45 request.WriteInt(METHOD_MATCH); 48 request.WriteInt(METHOD_MATCH);
46 request.WriteBool(fileid_valid); 49 request.WriteBool(fileid_valid);
47 if (fileid_valid) 50 if (fileid_valid)
48 request.WriteUInt32(fileid); 51 request.WriteUInt32(fileid);
49 52
50 request.WriteBool(is_bold && *is_bold); 53 request.WriteBool(is_bold && *is_bold);
51 request.WriteBool(is_bold && *is_italic); 54 request.WriteBool(is_bold && *is_italic);
52 55
53 request.WriteString(family); 56 request.WriteString(family);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void* iter = NULL; 109 void* iter = NULL;
107 if (!reply.ReadBool(&iter, &result) || 110 if (!reply.ReadBool(&iter, &result) ||
108 !result) { 111 !result) {
109 if (result_fd) 112 if (result_fd)
110 close(result_fd); 113 close(result_fd);
111 return -1; 114 return -1;
112 } 115 }
113 116
114 return result_fd; 117 return result_fd;
115 } 118 }
OLDNEW
« no previous file with comments | « skia/ext/SkFontHost_fontconfig_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698