Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/browser/renderer_host/render_message_filter.cc

Issue 2847033003: Get rid of SharedMemory::GiveToProcess. (Closed)
Patch Set: Comments from avi. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | content/renderer/pepper/ppb_image_data_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/memory/shared_memory_win.cc ('k') | content/renderer/pepper/ppb_image_data_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698