OLD | NEW |
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/font_cache_dispatcher_win.h" | 5 #include "content/common/font_cache_dispatcher_win.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "content/common/child_process_messages.h" | 12 #include "content/common/child_process_messages.h" |
| 13 #include "ipc/ipc_channel.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 namespace { | 16 namespace { |
16 typedef std::vector<base::string16> FontNameVector; | 17 typedef std::vector<base::string16> FontNameVector; |
17 typedef std::map<FontCacheDispatcher*, FontNameVector> DispatcherToFontNames; | 18 typedef std::map<FontCacheDispatcher*, FontNameVector> DispatcherToFontNames; |
18 | 19 |
19 class FontCache { | 20 class FontCache { |
20 public: | 21 public: |
21 static FontCache* GetInstance() { | 22 static FontCache* GetInstance() { |
22 return Singleton<FontCache>::get(); | 23 return Singleton<FontCache>::get(); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 FontCache::GetInstance()->PreCacheFont(font, this); | 186 FontCache::GetInstance()->PreCacheFont(font, this); |
186 } | 187 } |
187 | 188 |
188 void FontCacheDispatcher::OnReleaseCachedFonts() { | 189 void FontCacheDispatcher::OnReleaseCachedFonts() { |
189 // Release cached fonts that requested from a pid by decrementing the ref | 190 // Release cached fonts that requested from a pid by decrementing the ref |
190 // count. When ref count is zero, the handles are released. | 191 // count. When ref count is zero, the handles are released. |
191 FontCache::GetInstance()->ReleaseCachedFonts(this); | 192 FontCache::GetInstance()->ReleaseCachedFonts(this); |
192 } | 193 } |
193 | 194 |
194 } // namespace content | 195 } // namespace content |
OLD | NEW |