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 CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "chrome/browser/browser_child_process_host.h" | 11 #include "chrome/browser/browser_child_process_host.h" |
12 | 12 |
13 class RenderMessageFilter; | 13 class RenderMessageFilter; |
14 | 14 |
15 class PpapiPluginProcessHost : public BrowserChildProcessHost { | 15 class PpapiPluginProcessHost : public BrowserChildProcessHost { |
16 public: | 16 public: |
17 explicit PpapiPluginProcessHost(RenderMessageFilter* filter); | 17 explicit PpapiPluginProcessHost(RenderMessageFilter* filter); |
18 virtual ~PpapiPluginProcessHost(); | 18 virtual ~PpapiPluginProcessHost(); |
19 | 19 |
20 void Init(const FilePath& path, IPC::Message* reply_msg); | 20 void Init(const FilePath& path, IPC::Message* reply_msg); |
21 | 21 |
22 private: | 22 private: |
23 virtual bool CanShutdown(); | 23 virtual bool CanShutdown(); |
24 virtual void OnProcessLaunched(); | 24 virtual void OnProcessLaunched(); |
25 | 25 |
26 virtual void OnMessageReceived(const IPC::Message& msg); | 26 virtual bool OnMessageReceived(const IPC::Message& msg); |
27 virtual void OnChannelConnected(int32 peer_pid); | 27 virtual void OnChannelConnected(int32 peer_pid); |
28 virtual void OnChannelError(); | 28 virtual void OnChannelError(); |
29 | 29 |
30 // IPC message handlers. | 30 // IPC message handlers. |
31 void OnPluginLoaded(const IPC::ChannelHandle& handle); | 31 void OnPluginLoaded(const IPC::ChannelHandle& handle); |
32 | 32 |
33 // Sends the reply_msg_ to the renderer with the given channel info. | 33 // Sends the reply_msg_ to the renderer with the given channel info. |
34 void ReplyToRenderer(base::ProcessHandle plugin_handle, | 34 void ReplyToRenderer(base::ProcessHandle plugin_handle, |
35 const IPC::ChannelHandle& channel_handle); | 35 const IPC::ChannelHandle& channel_handle); |
36 | 36 |
37 RenderMessageFilter* filter_; | 37 RenderMessageFilter* filter_; |
38 | 38 |
39 // Path to the plugin library. | 39 // Path to the plugin library. |
40 FilePath plugin_path_; | 40 FilePath plugin_path_; |
41 | 41 |
42 // When we're waiting for initialization of the plugin, this contains the | 42 // When we're waiting for initialization of the plugin, this contains the |
43 // reply message for the renderer to tell it that it can continue. | 43 // reply message for the renderer to tell it that it can continue. |
44 scoped_ptr<IPC::Message> reply_msg_; | 44 scoped_ptr<IPC::Message> reply_msg_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); | 46 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); |
47 }; | 47 }; |
48 | 48 |
49 #endif // CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 49 #endif // CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
50 | 50 |
OLD | NEW |