Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: content/renderer/npapi/plugin_channel_host.h

Issue 1853793003: Remove content/renderer/npapi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/npapi/plugin_channel_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_
6 #define CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_
7
8 #include "base/containers/hash_tables.h"
9 #include "base/macros.h"
10 #include "build/build_config.h"
11 #include "content/child/npapi/np_channel_base.h"
12 #include "ipc/ipc_channel_handle.h"
13
14 namespace content {
15 // Encapsulates an IPC channel between the renderer and one plugin process.
16 // On the plugin side there's a corresponding PluginChannel.
17 class PluginChannelHost : public NPChannelBase {
18 public:
19 #if defined(OS_MACOSX)
20 // TODO(shess): Debugging for http://crbug.com/97285 . See comment
21 // in plugin_channel_host.cc.
22 static bool* GetRemoveTrackingFlag();
23 #endif
24 static PluginChannelHost* GetPluginChannelHost(
25 const IPC::ChannelHandle& channel_handle,
26 base::SingleThreadTaskRunner* ipc_task_runner);
27
28 bool Init(base::SingleThreadTaskRunner* ipc_task_runner,
29 bool create_pipe_now,
30 base::WaitableEvent* shutdown_event) override;
31
32 int GenerateRouteID() override;
33
34 void AddRoute(int route_id, IPC::Listener* listener);
35 void RemoveRoute(int route_id);
36
37 // NPChannelBase override:
38 bool Send(IPC::Message* msg) override;
39
40 // IPC::Listener override
41 void OnChannelError() override;
42
43 static void Broadcast(IPC::Message* message) {
44 NPChannelBase::Broadcast(message);
45 }
46
47 bool expecting_shutdown() { return expecting_shutdown_; }
48
49 private:
50 // Called on the render thread
51 PluginChannelHost();
52 ~PluginChannelHost() override;
53
54 static NPChannelBase* ClassFactory() { return new PluginChannelHost(); }
55
56 bool OnControlMessageReceived(const IPC::Message& message) override;
57 void OnPluginShuttingDown();
58
59 // Keep track of all the registered WebPluginDelegeProxies to
60 // inform about OnChannelError
61 typedef base::hash_map<int, IPC::Listener*> ProxyMap;
62 ProxyMap proxies_;
63
64 // True if we are expecting the plugin process to go away - in which case,
65 // don't treat it as a crash.
66 bool expecting_shutdown_;
67
68 DISALLOW_COPY_AND_ASSIGN(PluginChannelHost);
69 };
70
71 } // namespace content
72
73 #endif // CONTENT_RENDERER_NPAPI_PLUGIN_CHANNEL_HOST_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/npapi/plugin_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698