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 namespace IPC { | |
16 struct ChannelHandle; | |
17 class Message; | |
18 } | |
19 | |
20 class PpapiPluginProcessHost : public BrowserChildProcessHost { | 15 class PpapiPluginProcessHost : public BrowserChildProcessHost { |
21 public: | 16 public: |
22 explicit PpapiPluginProcessHost(RenderMessageFilter* filter); | 17 explicit PpapiPluginProcessHost(RenderMessageFilter* filter); |
23 virtual ~PpapiPluginProcessHost(); | 18 virtual ~PpapiPluginProcessHost(); |
24 | 19 |
25 void Init(const FilePath& path, IPC::Message* reply_msg); | 20 void Init(const FilePath& path, IPC::Message* reply_msg); |
26 | 21 |
27 private: | 22 private: |
28 virtual bool CanShutdown() { return true; } | 23 virtual bool CanShutdown() { return true; } |
29 virtual void OnProcessLaunched(); | 24 virtual void OnProcessLaunched(); |
30 virtual URLRequestContext* GetRequestContext( | |
31 uint32 request_id, | |
32 const ViewHostMsg_Resource_Request& request_data); | |
33 | 25 |
34 virtual void OnMessageReceived(const IPC::Message& msg); | 26 virtual void OnMessageReceived(const IPC::Message& msg); |
35 virtual void OnChannelConnected(int32 peer_pid); | 27 virtual void OnChannelConnected(int32 peer_pid); |
36 virtual void OnChannelError(); | 28 virtual void OnChannelError(); |
37 | 29 |
38 // IPC message handlers. | 30 // IPC message handlers. |
39 void OnPluginLoaded(const IPC::ChannelHandle& handle); | 31 void OnPluginLoaded(const IPC::ChannelHandle& handle); |
40 | 32 |
41 // 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. |
42 void ReplyToRenderer(base::ProcessHandle plugin_handle, | 34 void ReplyToRenderer(base::ProcessHandle plugin_handle, |
43 const IPC::ChannelHandle& channel_handle); | 35 const IPC::ChannelHandle& channel_handle); |
44 | 36 |
45 RenderMessageFilter* filter_; | 37 RenderMessageFilter* filter_; |
46 | 38 |
47 // Path to the plugin library. | 39 // Path to the plugin library. |
48 FilePath plugin_path_; | 40 FilePath plugin_path_; |
49 | 41 |
50 // 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 |
51 // 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. |
52 scoped_ptr<IPC::Message> reply_msg_; | 44 scoped_ptr<IPC::Message> reply_msg_; |
53 | 45 |
54 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); | 46 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); |
55 }; | 47 }; |
56 | 48 |
57 #endif // CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 49 #endif // CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
58 | 50 |
OLD | NEW |