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" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (sender_) | 144 if (sender_) |
145 return sender_->Send(message); | 145 return sender_->Send(message); |
146 | 146 |
147 delete message; | 147 delete message; |
148 return false; | 148 return false; |
149 } | 149 } |
150 | 150 |
151 FontCacheDispatcher::~FontCacheDispatcher() { | 151 FontCacheDispatcher::~FontCacheDispatcher() { |
152 } | 152 } |
153 | 153 |
154 void FontCacheDispatcher::OnFilterAdded(IPC::Sender* sender) { | 154 void FontCacheDispatcher::OnFilterAdded(IPC::Channel* channel) { |
155 sender_ = sender; | 155 sender_ = channel; |
156 } | 156 } |
157 | 157 |
158 bool FontCacheDispatcher::OnMessageReceived(const IPC::Message& message) { | 158 bool FontCacheDispatcher::OnMessageReceived(const IPC::Message& message) { |
159 bool handled = true; | 159 bool handled = true; |
160 IPC_BEGIN_MESSAGE_MAP(FontCacheDispatcher, message) | 160 IPC_BEGIN_MESSAGE_MAP(FontCacheDispatcher, message) |
161 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_PreCacheFont, OnPreCacheFont) | 161 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_PreCacheFont, OnPreCacheFont) |
162 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ReleaseCachedFonts, | 162 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ReleaseCachedFonts, |
163 OnReleaseCachedFonts) | 163 OnReleaseCachedFonts) |
164 IPC_MESSAGE_UNHANDLED(handled = false) | 164 IPC_MESSAGE_UNHANDLED(handled = false) |
165 IPC_END_MESSAGE_MAP() | 165 IPC_END_MESSAGE_MAP() |
(...skipping 21 matching lines...) Expand all Loading... |
187 FontCache::GetInstance()->PreCacheFont(font, this); | 187 FontCache::GetInstance()->PreCacheFont(font, this); |
188 } | 188 } |
189 | 189 |
190 void FontCacheDispatcher::OnReleaseCachedFonts() { | 190 void FontCacheDispatcher::OnReleaseCachedFonts() { |
191 // Release cached fonts that requested from a pid by decrementing the ref | 191 // Release cached fonts that requested from a pid by decrementing the ref |
192 // count. When ref count is zero, the handles are released. | 192 // count. When ref count is zero, the handles are released. |
193 FontCache::GetInstance()->ReleaseCachedFonts(this); | 193 FontCache::GetInstance()->ReleaseCachedFonts(this); |
194 } | 194 } |
195 | 195 |
196 } // namespace content | 196 } // namespace content |
OLD | NEW |