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