OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/common/dwrite_font_platform_win.h" | 5 #include "content/public/common/dwrite_font_platform_win.h" |
6 | 6 |
7 #include <dwrite.h> | 7 #include <dwrite.h> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 DISALLOW_COPY_AND_ASSIGN(FontCollectionLoader); | 253 DISALLOW_COPY_AND_ASSIGN(FontCollectionLoader); |
254 }; | 254 }; |
255 | 255 |
256 mswr::ComPtr<FontCollectionLoader> g_font_loader; | 256 mswr::ComPtr<FontCollectionLoader> g_font_loader; |
257 base::win::ScopedHandle g_shared_font_cache; | 257 base::win::ScopedHandle g_shared_font_cache; |
258 | 258 |
259 // Class responsible for handling font cache file format details as well as | 259 // Class responsible for handling font cache file format details as well as |
260 // tracking various cache region requests by direct write. | 260 // tracking various cache region requests by direct write. |
261 class FontCacheWriter { | 261 class FontCacheWriter { |
262 public: | 262 public: |
263 FontCacheWriter() | 263 FontCacheWriter() : count_font_entries_ignored_(0), cookie_counter_(0) {} |
264 : cookie_counter_(0), | |
265 count_font_entries_ignored_(0) { | |
266 } | |
267 | 264 |
268 ~FontCacheWriter() { | 265 ~FontCacheWriter() { |
269 if (static_cache_.get()) { | 266 if (static_cache_.get()) { |
270 static_cache_->Close(); | 267 static_cache_->Close(); |
271 } | 268 } |
272 } | 269 } |
273 | 270 |
274 public: | 271 public: |
275 // Holds data related to individual region as requested by direct write. | 272 // Holds data related to individual region as requested by direct write. |
276 struct CacheRegion { | 273 struct CacheRegion { |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 g_shared_font_cache.Set(mapping); | 1227 g_shared_font_cache.Set(mapping); |
1231 | 1228 |
1232 return true; | 1229 return true; |
1233 } | 1230 } |
1234 | 1231 |
1235 bool BuildFontCache(const base::FilePath& file) { | 1232 bool BuildFontCache(const base::FilePath& file) { |
1236 return BuildFontCacheInternal(file.value().c_str()); | 1233 return BuildFontCacheInternal(file.value().c_str()); |
1237 } | 1234 } |
1238 | 1235 |
1239 } // namespace content | 1236 } // namespace content |
OLD | NEW |