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 "ppapi/c/pp_instance.h"
11 #include "ppapi/host/instance_message_filter.h"
14 class RendererPpapiHost;
19 class SerializedHandle;
23 // Implements the backend for shared memory messages from a plugin process.
24 class PepperSharedMemoryMessageFilter
25 : public ppapi::host::InstanceMessageFilter {
27 explicit PepperSharedMemoryMessageFilter(content::RendererPpapiHost* host);
28 ~PepperSharedMemoryMessageFilter() override;
30 // InstanceMessageFilter:
31 bool OnInstanceMessageReceived(const IPC::Message& msg) override;
33 bool Send(IPC::Message* msg);
37 void OnHostMsgCreateSharedMemory(
40 int* host_shm_handle_id,
41 ppapi::proxy::SerializedHandle* plugin_shm_handle);
43 content::RendererPpapiHost* host_;
45 DISALLOW_COPY_AND_ASSIGN(PepperSharedMemoryMessageFilter);
48 #endif // CHROME_RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_