OLD | NEW |
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 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
9 | 9 |
10 struct FrameHostMsg_BuffersSwappedACK_Params; | 10 struct FrameHostMsg_BuffersSwappedACK_Params; |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class BrowserContext; | 14 class BrowserContext; |
15 | 15 |
16 // This class filters out incoming IPC messages for the guest renderer process | 16 // This class filters out incoming IPC messages for the guest renderer process |
17 // on the IPC thread before other message filters handle them. | 17 // on the IPC thread before other message filters handle them. |
18 class BrowserPluginMessageFilter : public BrowserMessageFilter { | 18 class BrowserPluginMessageFilter : public BrowserMessageFilter { |
19 public: | 19 public: |
20 BrowserPluginMessageFilter(int render_process_id, bool is_guest); | 20 BrowserPluginMessageFilter(int render_process_id, bool is_guest); |
21 | 21 |
22 // BrowserMessageFilter implementation. | 22 // BrowserMessageFilter implementation. |
23 virtual void OverrideThreadForMessage( | 23 virtual void OverrideThreadForMessage( |
24 const IPC::Message& message, | 24 const IPC::Message& message, |
25 BrowserThread::ID* thread) OVERRIDE; | 25 BrowserThread::ID* thread) OVERRIDE; |
26 virtual bool OnMessageReceived(const IPC::Message& message, | 26 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
27 bool* message_was_ok) OVERRIDE; | |
28 virtual void OnDestruct() const OVERRIDE; | 27 virtual void OnDestruct() const OVERRIDE; |
29 | 28 |
30 private: | 29 private: |
31 friend class BrowserThread; | 30 friend class BrowserThread; |
32 friend class base::DeleteHelper<BrowserPluginMessageFilter>; | 31 friend class base::DeleteHelper<BrowserPluginMessageFilter>; |
33 | 32 |
34 virtual ~BrowserPluginMessageFilter(); | 33 virtual ~BrowserPluginMessageFilter(); |
35 | 34 |
36 void ForwardMessageToGuest(const IPC::Message& message); | 35 void ForwardMessageToGuest(const IPC::Message& message); |
37 | 36 |
38 void OnSwapBuffersACK(const FrameHostMsg_BuffersSwappedACK_Params& params); | 37 void OnSwapBuffersACK(const FrameHostMsg_BuffersSwappedACK_Params& params); |
39 | 38 |
40 int render_process_id_; | 39 int render_process_id_; |
41 int is_guest_; | 40 int is_guest_; |
42 | 41 |
43 DISALLOW_COPY_AND_ASSIGN(BrowserPluginMessageFilter); | 42 DISALLOW_COPY_AND_ASSIGN(BrowserPluginMessageFilter); |
44 }; | 43 }; |
45 | 44 |
46 } // namespace content | 45 } // namespace content |
47 | 46 |
48 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ | 47 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_MESSAGE_FILTER_H_ |
OLD | NEW |