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/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 base::Bind(&RenderMessageFilter::SendLoadFontReply, this, reply_msg, | 232 base::Bind(&RenderMessageFilter::SendLoadFontReply, this, reply_msg, |
233 base::Owned(result))); | 233 base::Owned(result))); |
234 } | 234 } |
235 | 235 |
236 void RenderMessageFilter::SendLoadFontReply(IPC::Message* reply, | 236 void RenderMessageFilter::SendLoadFontReply(IPC::Message* reply, |
237 FontLoader::Result* result) { | 237 FontLoader::Result* result) { |
238 base::SharedMemoryHandle handle; | 238 base::SharedMemoryHandle handle; |
239 if (result->font_data_size == 0 || result->font_id == 0) { | 239 if (result->font_data_size == 0 || result->font_id == 0) { |
240 result->font_data_size = 0; | 240 result->font_data_size = 0; |
241 result->font_id = 0; | 241 result->font_id = 0; |
242 handle = base::SharedMemory::NULLHandle(); | |
243 } else { | 242 } else { |
244 result->font_data.GiveToProcess(base::GetCurrentProcessHandle(), &handle); | 243 result->font_data.GiveToProcess(base::GetCurrentProcessHandle(), &handle); |
245 } | 244 } |
246 RenderProcessHostMsg_LoadFont::WriteReplyParams( | 245 RenderProcessHostMsg_LoadFont::WriteReplyParams( |
247 reply, result->font_data_size, handle, result->font_id); | 246 reply, result->font_data_size, handle, result->font_id); |
248 Send(reply); | 247 Send(reply); |
249 } | 248 } |
250 | 249 |
251 #endif // defined(OS_MACOSX) | 250 #endif // defined(OS_MACOSX) |
252 | 251 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 351 } |
353 | 352 |
354 void RenderMessageFilter::GetHasGpuProcessCallback( | 353 void RenderMessageFilter::GetHasGpuProcessCallback( |
355 std::unique_ptr<IPC::Message> reply, | 354 std::unique_ptr<IPC::Message> reply, |
356 bool has_gpu) { | 355 bool has_gpu) { |
357 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); | 356 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); |
358 Send(reply.release()); | 357 Send(reply.release()); |
359 } | 358 } |
360 | 359 |
361 } // namespace content | 360 } // namespace content |
OLD | NEW |