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 <windows.h> | 7 #include <windows.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 bool FontCollectionLoader::InCollectionBuildingMode() { | 926 bool FontCollectionLoader::InCollectionBuildingMode() { |
927 return in_collection_building_mode_; | 927 return in_collection_building_mode_; |
928 } | 928 } |
929 | 929 |
930 bool FontCollectionLoader::IsFileCached(UINT32 font_key) { | 930 bool FontCollectionLoader::IsFileCached(UINT32 font_key) { |
931 if (!cache_.get() || cache_->memory() == NULL) { | 931 if (!cache_.get() || cache_->memory() == NULL) { |
932 return false; | 932 return false; |
933 } | 933 } |
934 CacheMap::iterator iter = cache_map_.find( | 934 CacheMap::iterator iter = cache_map_.find( |
935 GetFontNameFromKey(font_key).c_str()); | 935 GetFontNameFromKey(font_key).c_str()); |
936 return iter != cache_map_.end();; | 936 return iter != cache_map_.end(); |
937 } | 937 } |
938 | 938 |
939 bool FontCollectionLoader::LoadCacheFile() { | 939 bool FontCollectionLoader::LoadCacheFile() { |
940 TRACE_EVENT0("startup", "FontCollectionLoader::LoadCacheFile"); | 940 TRACE_EVENT0("startup", "FontCollectionLoader::LoadCacheFile"); |
941 | 941 |
942 std::string font_cache_handle_string = | 942 std::string font_cache_handle_string = |
943 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 943 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
944 switches::kFontCacheSharedHandle); | 944 switches::kFontCacheSharedHandle); |
945 if (font_cache_handle_string.empty()) | 945 if (font_cache_handle_string.empty()) |
946 return false; | 946 return false; |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 g_shared_font_cache.Set(mapping); | 1267 g_shared_font_cache.Set(mapping); |
1268 | 1268 |
1269 return true; | 1269 return true; |
1270 } | 1270 } |
1271 | 1271 |
1272 bool BuildFontCache(const base::FilePath& file) { | 1272 bool BuildFontCache(const base::FilePath& file) { |
1273 return BuildFontCacheInternal(file.value().c_str()); | 1273 return BuildFontCacheInternal(file.value().c_str()); |
1274 } | 1274 } |
1275 | 1275 |
1276 } // namespace content | 1276 } // namespace content |
OLD | NEW |