| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_RENDERER_PLUGIN_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PLUGIN_CHANNEL_HOST_H_ |
| 6 #define CONTENT_RENDERER_PLUGIN_CHANNEL_HOST_H_ | 6 #define CONTENT_RENDERER_PLUGIN_CHANNEL_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "content/plugin/plugin_channel_base.h" | 10 #include "content/plugin/plugin_channel_base.h" |
| 11 #include "ipc/ipc_channel_handle.h" | 11 #include "ipc/ipc_channel_handle.h" |
| 12 | 12 |
| 13 class IsListeningFilter; | 13 class IsListeningFilter; |
| 14 class NPObjectBase; | 14 class NPObjectBase; |
| 15 | 15 |
| 16 // Encapsulates an IPC channel between the renderer and one plugin process. | 16 // Encapsulates an IPC channel between the renderer and one plugin process. |
| 17 // On the plugin side there's a corresponding PluginChannel. | 17 // On the plugin side there's a corresponding PluginChannel. |
| 18 class PluginChannelHost : public PluginChannelBase { | 18 class PluginChannelHost : public PluginChannelBase { |
| 19 public: | 19 public: |
| 20 static PluginChannelHost* GetPluginChannelHost( | 20 static PluginChannelHost* GetPluginChannelHost( |
| 21 const IPC::ChannelHandle& channel_handle, MessageLoop* ipc_message_loop); | 21 const IPC::ChannelHandle& channel_handle, |
| 22 base::MessageLoopProxy* ipc_message_loop); |
| 22 | 23 |
| 23 virtual bool Init(MessageLoop* ipc_message_loop, bool create_pipe_now); | 24 virtual bool Init(base::MessageLoopProxy* ipc_message_loop, |
| 25 bool create_pipe_now); |
| 24 | 26 |
| 25 virtual int GenerateRouteID(); | 27 virtual int GenerateRouteID(); |
| 26 | 28 |
| 27 void AddRoute(int route_id, IPC::Channel::Listener* listener, | 29 void AddRoute(int route_id, IPC::Channel::Listener* listener, |
| 28 NPObjectBase* npobject); | 30 NPObjectBase* npobject); |
| 29 void RemoveRoute(int route_id); | 31 void RemoveRoute(int route_id); |
| 30 | 32 |
| 31 // IPC::Channel::Listener override | 33 // IPC::Channel::Listener override |
| 32 virtual void OnChannelError(); | 34 virtual void OnChannelError(); |
| 33 | 35 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 62 scoped_refptr<IsListeningFilter> is_listening_filter_; | 64 scoped_refptr<IsListeningFilter> is_listening_filter_; |
| 63 | 65 |
| 64 // True if we are expecting the plugin process to go away - in which case, | 66 // True if we are expecting the plugin process to go away - in which case, |
| 65 // don't treat it as a crash. | 67 // don't treat it as a crash. |
| 66 bool expecting_shutdown_; | 68 bool expecting_shutdown_; |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(PluginChannelHost); | 70 DISALLOW_COPY_AND_ASSIGN(PluginChannelHost); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 #endif // CONTENT_RENDERER_PLUGIN_CHANNEL_HOST_H_ | 73 #endif // CONTENT_RENDERER_PLUGIN_CHANNEL_HOST_H_ |
| OLD | NEW |