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

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

Issue 2496783002: gpu: Reuse existing code for shared memory allocation. (Closed)
Patch Set: . Created 4 years, 1 month 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
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 reply, result->font_data_size, handle, result->font_id); 333 reply, result->font_data_size, handle, result->font_id);
334 Send(reply); 334 Send(reply);
335 } 335 }
336 336
337 #endif // defined(OS_MACOSX) 337 #endif // defined(OS_MACOSX)
338 338
339 void RenderMessageFilter::AllocateSharedMemoryOnFileThread( 339 void RenderMessageFilter::AllocateSharedMemoryOnFileThread(
340 uint32_t buffer_size, 340 uint32_t buffer_size,
341 IPC::Message* reply_msg) { 341 IPC::Message* reply_msg) {
342 base::SharedMemoryHandle handle; 342 base::SharedMemoryHandle handle;
343 ChildProcessHostImpl::AllocateSharedMemory(buffer_size, PeerHandle(), 343 ChildProcessHostImpl::AllocateSharedMemory(buffer_size, &handle);
344 &handle);
345 ChildProcessHostMsg_SyncAllocateSharedMemory::WriteReplyParams(reply_msg, 344 ChildProcessHostMsg_SyncAllocateSharedMemory::WriteReplyParams(reply_msg,
346 handle); 345 handle);
347 Send(reply_msg); 346 Send(reply_msg);
348 } 347 }
349 348
350 void RenderMessageFilter::OnAllocateSharedMemory(uint32_t buffer_size, 349 void RenderMessageFilter::OnAllocateSharedMemory(uint32_t buffer_size,
351 IPC::Message* reply_msg) { 350 IPC::Message* reply_msg) {
352 BrowserThread::PostTask( 351 BrowserThread::PostTask(
353 BrowserThread::FILE_USER_BLOCKING, FROM_HERE, 352 BrowserThread::FILE_USER_BLOCKING, FROM_HERE,
354 base::Bind(&RenderMessageFilter::AllocateSharedMemoryOnFileThread, this, 353 base::Bind(&RenderMessageFilter::AllocateSharedMemoryOnFileThread, this,
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 void RenderMessageFilter::OnDeletedGpuMemoryBuffer( 684 void RenderMessageFilter::OnDeletedGpuMemoryBuffer(
686 gfx::GpuMemoryBufferId id, 685 gfx::GpuMemoryBufferId id,
687 const gpu::SyncToken& sync_token) { 686 const gpu::SyncToken& sync_token) {
688 DCHECK(BrowserGpuMemoryBufferManager::current()); 687 DCHECK(BrowserGpuMemoryBufferManager::current());
689 688
690 BrowserGpuMemoryBufferManager::current()->ChildProcessDeletedGpuMemoryBuffer( 689 BrowserGpuMemoryBufferManager::current()->ChildProcessDeletedGpuMemoryBuffer(
691 id, PeerHandle(), render_process_id_, sync_token); 690 id, PeerHandle(), render_process_id_, sync_token);
692 } 691 }
693 692
694 } // namespace content 693 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698