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_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ |
6 #define CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ | 6 #define CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "content/child/npapi/np_channel_base.h" | 9 #include "content/child/npapi/np_channel_base.h" |
10 #include "ipc/ipc_channel_handle.h" | 10 #include "ipc/ipc_channel_handle.h" |
11 | 11 |
12 namespace IPC { | |
13 class AttachmentBroker; | |
14 } | |
15 | |
16 namespace content { | 12 namespace content { |
17 class NPObjectBase; | 13 class NPObjectBase; |
18 | 14 |
19 // Encapsulates an IPC channel between the renderer and one plugin process. | 15 // Encapsulates an IPC channel between the renderer and one plugin process. |
20 // On the plugin side there's a corresponding PluginChannel. | 16 // On the plugin side there's a corresponding PluginChannel. |
21 class PluginChannelHost : public NPChannelBase { | 17 class PluginChannelHost : public NPChannelBase { |
22 public: | 18 public: |
23 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
24 // TODO(shess): Debugging for http://crbug.com/97285 . See comment | 20 // TODO(shess): Debugging for http://crbug.com/97285 . See comment |
25 // in plugin_channel_host.cc. | 21 // in plugin_channel_host.cc. |
26 static bool* GetRemoveTrackingFlag(); | 22 static bool* GetRemoveTrackingFlag(); |
27 #endif | 23 #endif |
28 static PluginChannelHost* GetPluginChannelHost( | 24 static PluginChannelHost* GetPluginChannelHost( |
29 const IPC::ChannelHandle& channel_handle, | 25 const IPC::ChannelHandle& channel_handle, |
30 base::SingleThreadTaskRunner* ipc_task_runner, | 26 base::SingleThreadTaskRunner* ipc_task_runner); |
31 IPC::AttachmentBroker* broker); | |
32 | 27 |
33 bool Init(base::SingleThreadTaskRunner* ipc_task_runner, | 28 bool Init(base::SingleThreadTaskRunner* ipc_task_runner, |
34 bool create_pipe_now, | 29 bool create_pipe_now, |
35 base::WaitableEvent* shutdown_event, | 30 base::WaitableEvent* shutdown_event) override; |
36 IPC::AttachmentBroker* broker) override; | |
37 | 31 |
38 int GenerateRouteID() override; | 32 int GenerateRouteID() override; |
39 | 33 |
40 void AddRoute(int route_id, IPC::Listener* listener, | 34 void AddRoute(int route_id, IPC::Listener* listener, |
41 NPObjectBase* npobject); | 35 NPObjectBase* npobject); |
42 void RemoveRoute(int route_id); | 36 void RemoveRoute(int route_id); |
43 | 37 |
44 // NPChannelBase override: | 38 // NPChannelBase override: |
45 bool Send(IPC::Message* msg) override; | 39 bool Send(IPC::Message* msg) override; |
46 | 40 |
(...skipping 25 matching lines...) Expand all Loading... |
72 // 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, |
73 // don't treat it as a crash. | 67 // don't treat it as a crash. |
74 bool expecting_shutdown_; | 68 bool expecting_shutdown_; |
75 | 69 |
76 DISALLOW_COPY_AND_ASSIGN(PluginChannelHost); | 70 DISALLOW_COPY_AND_ASSIGN(PluginChannelHost); |
77 }; | 71 }; |
78 | 72 |
79 } // namespace content | 73 } // namespace content |
80 | 74 |
81 #endif // CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ | 75 #endif // CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_ |
OLD | NEW |