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

Side by Side Diff: content/common/mac/font_loader.mm

Issue 109043002: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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/common/mac/font_loader.h" 5 #include "content/common/mac/font_loader.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 DLOG(ERROR) << "Bad size for font file " << font_path.value(); 133 DLOG(ERROR) << "Bad size for font file " << font_path.value();
134 return; 134 return;
135 } 135 }
136 136
137 int32 font_file_size_32 = static_cast<int32>(font_file_size_64); 137 int32 font_file_size_32 = static_cast<int32>(font_file_size_64);
138 if (!result->font_data.CreateAndMapAnonymous(font_file_size_32)) { 138 if (!result->font_data.CreateAndMapAnonymous(font_file_size_32)) {
139 DLOG(ERROR) << "Failed to create shmem area for " << font_name; 139 DLOG(ERROR) << "Failed to create shmem area for " << font_name;
140 return; 140 return;
141 } 141 }
142 142
143 int32 amt_read = file_util::ReadFile(font_path, 143 int32 amt_read = base::ReadFile(font_path,
144 reinterpret_cast<char*>(result->font_data.memory()), 144 reinterpret_cast<char*>(result->font_data.memory()),
145 font_file_size_32); 145 font_file_size_32);
146 if (amt_read != font_file_size_32) { 146 if (amt_read != font_file_size_32) {
147 DLOG(ERROR) << "Failed to read font data for " << font_path.value(); 147 DLOG(ERROR) << "Failed to read font data for " << font_path.value();
148 return; 148 return;
149 } 149 }
150 150
151 result->font_data_size = font_file_size_32; 151 result->font_data_size = font_file_size_32;
152 result->font_id = GetFontIDForFont(font_path); 152 result->font_id = GetFontIDForFont(font_path);
153 } 153 }
154 154
155 // static 155 // static
(...skipping 17 matching lines...) Expand all
173 if (!provider) 173 if (!provider)
174 return false; 174 return false;
175 175
176 *out = CGFontCreateWithDataProvider(provider.get()); 176 *out = CGFontCreateWithDataProvider(provider.get());
177 177
178 if (*out == NULL) 178 if (*out == NULL)
179 return false; 179 return false;
180 180
181 return true; 181 return true;
182 } 182 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/gl_helper_benchmark.cc ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698