| Index: ppapi/host/resource_message_filter.h
|
| diff --git a/ppapi/host/resource_message_filter.h b/ppapi/host/resource_message_filter.h
|
| index ef00cf7ae22f7ee33430b9cfa48c46ca7f532591..b72a7df7db286fb8a2d1c7dff6c6e0d217286e45 100644
|
| --- a/ppapi/host/resource_message_filter.h
|
| +++ b/ppapi/host/resource_message_filter.h
|
| @@ -24,6 +24,15 @@ namespace ppapi {
|
| namespace host {
|
|
|
| class ResourceHost;
|
| +class ResourceMessageFilter;
|
| +
|
| +namespace internal {
|
| +
|
| +struct PPAPI_HOST_EXPORT ResourceMessageFilterDeleteTraits {
|
| + static void Destruct(const ResourceMessageFilter* filter);
|
| +};
|
| +
|
| +} // namespace internal
|
|
|
| // This is the base class of resource message filters that can handle resource
|
| // messages on another thread. ResourceHosts can handle most messages
|
| @@ -65,13 +74,15 @@ class ResourceHost;
|
| // AddFilter(make_scoped_refptr(new MyMessageFilter));
|
| class PPAPI_HOST_EXPORT ResourceMessageFilter
|
| : public ResourceMessageHandler,
|
| - public base::RefCountedThreadSafe<ResourceMessageFilter> {
|
| + public base::RefCountedThreadSafe<
|
| + ResourceMessageFilter, internal::ResourceMessageFilterDeleteTraits> {
|
| public:
|
| // This object must be constructed on the same thread that a reply message
|
| // should be sent, i.e. the IO thread when constructed in the browser process
|
| // or the main thread when constructed in the renderer process. Since
|
| // ResourceMessageFilters are usually constructed in the constructor of the
|
| // owning ResourceHost, this will almost always be the case anyway.
|
| + // The object will be deleted on the creation thread.
|
| ResourceMessageFilter();
|
| // Test constructor. Allows you to specify the message loop which will be used
|
| // to dispatch replies on.
|
| @@ -93,7 +104,6 @@ class PPAPI_HOST_EXPORT ResourceMessageFilter
|
| const IPC::Message& msg) OVERRIDE;
|
|
|
| protected:
|
| - friend class base::RefCountedThreadSafe<ResourceMessageFilter>;
|
| virtual ~ResourceMessageFilter();
|
|
|
| // If you want the message to be handled on another thread, return a non-null
|
| @@ -102,10 +112,17 @@ class PPAPI_HOST_EXPORT ResourceMessageFilter
|
| const IPC::Message& message);
|
|
|
| private:
|
| + friend class base::DeleteHelper<ResourceMessageFilter>;
|
| + friend class base::RefCountedThreadSafe<
|
| + ResourceMessageFilter, internal::ResourceMessageFilterDeleteTraits>;
|
| + friend struct internal::ResourceMessageFilterDeleteTraits;
|
| +
|
| // This method is posted to the target thread and runs the message handler.
|
| void DispatchMessage(const IPC::Message& msg,
|
| HostMessageContext context);
|
|
|
| + scoped_refptr<base::MessageLoopProxy> deletion_message_loop_proxy_;
|
| +
|
| // Message loop to send resource message replies on. This will be the message
|
| // loop proxy of the IO thread for the browser process or the main thread for
|
| // the renderer process.
|
|
|