| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } else { | 242 } else { |
| 243 result->font_data.GiveToProcess(base::GetCurrentProcessHandle(), &handle); | 243 handle = result->font_data.handle().Duplicate(); |
| 244 result->font_data.Unmap(); |
| 245 result->font_data.Close(); |
| 244 } | 246 } |
| 245 RenderProcessHostMsg_LoadFont::WriteReplyParams( | 247 RenderProcessHostMsg_LoadFont::WriteReplyParams( |
| 246 reply, result->font_data_size, handle, result->font_id); | 248 reply, result->font_data_size, handle, result->font_id); |
| 247 Send(reply); | 249 Send(reply); |
| 248 } | 250 } |
| 249 | 251 |
| 250 #endif // defined(OS_MACOSX) | 252 #endif // defined(OS_MACOSX) |
| 251 | 253 |
| 252 #if defined(OS_LINUX) | 254 #if defined(OS_LINUX) |
| 253 void RenderMessageFilter::SetThreadPriorityOnFileThread( | 255 void RenderMessageFilter::SetThreadPriorityOnFileThread( |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 353 } |
| 352 | 354 |
| 353 void RenderMessageFilter::GetHasGpuProcessCallback( | 355 void RenderMessageFilter::GetHasGpuProcessCallback( |
| 354 std::unique_ptr<IPC::Message> reply, | 356 std::unique_ptr<IPC::Message> reply, |
| 355 bool has_gpu) { | 357 bool has_gpu) { |
| 356 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); | 358 ChildProcessHostMsg_HasGpuProcess::WriteReplyParams(reply.get(), has_gpu); |
| 357 Send(reply.release()); | 359 Send(reply.release()); |
| 358 } | 360 } |
| 359 | 361 |
| 360 } // namespace content | 362 } // namespace content |
| OLD | NEW |