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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 148243013: Add shared bitmap managers for browser and renderer processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 575a1c9b7ef6f066f2484a0012e3f5604e087690..67dac0f5af1b97e6cafba97ded33639c17b6962a 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -35,6 +35,7 @@
#include "content/common/desktop_notification_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
+#include "content/common/host_shared_bitmap_manager.h"
#include "content/common/media/media_param_traits.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_child_process_host.h"
@@ -346,6 +347,7 @@ RenderMessageFilter::~RenderMessageFilter() {
}
void RenderMessageFilter::OnChannelClosing() {
+ HostSharedBitmapManager::current()->ProcessRemoved(PeerHandle());
#if defined(ENABLE_PLUGINS)
for (std::set<OpenChannelToNpapiPluginCallback*>::iterator it =
plugin_host_clients_.begin(); it != plugin_host_clients_.end(); ++it) {
@@ -422,8 +424,14 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
OnAllocateSharedMemory)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedBitmap,
+ OnAllocateSharedBitmap)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer,
OnAllocateGpuMemoryBuffer)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_AllocatedSharedBitmap,
+ OnAllocatedSharedBitmap)
+ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_DeletedSharedBitmap,
+ OnDeletedSharedBitmap)
#if defined(OS_POSIX) && !defined(TOOLKIT_GTK) && !defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB)
IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB)
@@ -907,6 +915,25 @@ void RenderMessageFilter::OnAllocateSharedMemory(
buffer_size, PeerHandle(), handle);
}
+void RenderMessageFilter::OnAllocateSharedBitmap(
+ uint32 buffer_size,
+ const cc::SharedBitmapId& id,
+ base::SharedMemoryHandle* handle) {
+ HostSharedBitmapManager::current()->AllocateSharedBitmapForChild(
+ PeerHandle(), buffer_size, id, handle);
+}
+
+void RenderMessageFilter::OnAllocatedSharedBitmap(
+ const base::SharedMemoryHandle& handle,
+ const cc::SharedBitmapId& id) {
+ HostSharedBitmapManager::current()->ChildAllocatedSharedBitmap(
+ handle, PeerHandle(), id);
+}
+
+void RenderMessageFilter::OnDeletedSharedBitmap(const cc::SharedBitmapId& id) {
+ HostSharedBitmapManager::current()->ChildDeletedSharedBitmap(id);
+}
+
net::URLRequestContext* RenderMessageFilter::GetRequestContextForURL(
const GURL& url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));

Powered by Google App Engine
This is Rietveld 408576698