1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_
6 #define CHROME_RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/platform_file.h"
11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/host/instance_message_filter.h"
15 class RendererPpapiHost;
20 class SerializedHandle;
24 // Implements the backend for shared memory messages from a plugin process.
25 class PepperSharedMemoryMessageFilter
26 : public ppapi::host::InstanceMessageFilter {
28 explicit PepperSharedMemoryMessageFilter(content::RendererPpapiHost* host);
29 virtual ~PepperSharedMemoryMessageFilter();
31 // InstanceMessageFilter:
32 virtual bool OnInstanceMessageReceived(const IPC::Message& msg) OVERRIDE;
34 bool Send(IPC::Message* msg);
38 void OnHostMsgCreateSharedMemory(
41 int* host_shm_handle_id,
42 ppapi::proxy::SerializedHandle* plugin_shm_handle);
44 content::RendererPpapiHost* host_;
46 DISALLOW_COPY_AND_ASSIGN(PepperSharedMemoryMessageFilter);
49 #endif // CHROME_RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_