| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ |
| 6 #define PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ | 6 #define PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // |seen_instance_ids| is a pointer to a set that will be used to uniquify | 33 // |seen_instance_ids| is a pointer to a set that will be used to uniquify |
| 34 // PP_Instances across all renderer channels. The same pointer should be | 34 // PP_Instances across all renderer channels. The same pointer should be |
| 35 // passed to each MessageFilter to ensure uniqueness, and the value should | 35 // passed to each MessageFilter to ensure uniqueness, and the value should |
| 36 // outlive this class. It could be NULL if this filter is for a browser | 36 // outlive this class. It could be NULL if this filter is for a browser |
| 37 // channel. | 37 // channel. |
| 38 // |thread_registrar| is used to look up handling threads for resource | 38 // |thread_registrar| is used to look up handling threads for resource |
| 39 // reply messages. It shouldn't be NULL. | 39 // reply messages. It shouldn't be NULL. |
| 40 PluginMessageFilter( | 40 PluginMessageFilter( |
| 41 std::set<PP_Instance>* seen_instance_ids, | 41 std::set<PP_Instance>* seen_instance_ids, |
| 42 scoped_refptr<ResourceReplyThreadRegistrar> thread_registrar); | 42 scoped_refptr<ResourceReplyThreadRegistrar> thread_registrar); |
| 43 virtual ~PluginMessageFilter(); | 43 ~PluginMessageFilter() override; |
| 44 | 44 |
| 45 // MessageFilter implementation. | 45 // MessageFilter implementation. |
| 46 virtual void OnFilterAdded(IPC::Sender* sender) override; | 46 void OnFilterAdded(IPC::Sender* sender) override; |
| 47 virtual void OnFilterRemoved() override; | 47 void OnFilterRemoved() override; |
| 48 virtual bool OnMessageReceived(const IPC::Message& message) override; | 48 bool OnMessageReceived(const IPC::Message& message) override; |
| 49 | 49 |
| 50 // IPC::Sender implementation. | 50 // IPC::Sender implementation. |
| 51 virtual bool Send(IPC::Message* msg) override; | 51 bool Send(IPC::Message* msg) override; |
| 52 | 52 |
| 53 void AddResourceMessageFilter( | 53 void AddResourceMessageFilter( |
| 54 const scoped_refptr<ResourceMessageFilter>& filter); | 54 const scoped_refptr<ResourceMessageFilter>& filter); |
| 55 | 55 |
| 56 // Simulates an incoming resource reply that is handled on the calling thread. | 56 // Simulates an incoming resource reply that is handled on the calling thread. |
| 57 // For testing only. | 57 // For testing only. |
| 58 static void DispatchResourceReplyForTest( | 58 static void DispatchResourceReplyForTest( |
| 59 const ResourceMessageReplyParams& reply_params, | 59 const ResourceMessageReplyParams& reply_params, |
| 60 const IPC::Message& nested_msg); | 60 const IPC::Message& nested_msg); |
| 61 | 61 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 81 | 81 |
| 82 // The IPC sender to the renderer. May be NULL if we're not currently | 82 // The IPC sender to the renderer. May be NULL if we're not currently |
| 83 // attached as a filter. | 83 // attached as a filter. |
| 84 IPC::Sender* sender_; | 84 IPC::Sender* sender_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace proxy | 87 } // namespace proxy |
| 88 } // namespace ppapi | 88 } // namespace ppapi |
| 89 | 89 |
| 90 #endif // PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ | 90 #endif // PPAPI_PROXY_PLUGIN_MESSAGE_FILTER_H_ |
| OLD | NEW |