| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 class Client { | 36 class Client { |
| 37 public: | 37 public: |
| 38 // Gets the information about the renderer that's requesting the channel. | 38 // Gets the information about the renderer that's requesting the channel. |
| 39 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, | 39 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, |
| 40 int* renderer_id) = 0; | 40 int* renderer_id) = 0; |
| 41 | 41 |
| 42 // Called when the channel is asynchronously opened to the plugin or on | 42 // Called when the channel is asynchronously opened to the plugin or on |
| 43 // error. On error, the parameters should be: | 43 // error. On error, the parameters should be: |
| 44 // base::kNullProcessHandle | 44 // base::kNullProcessHandle |
| 45 // IPC::ChannelHandle() | 45 // IPC::ChannelHandle(), |
| 46 // 0 |
| 46 virtual void OnPpapiChannelOpened( | 47 virtual void OnPpapiChannelOpened( |
| 47 base::ProcessHandle plugin_process_handle, | 48 base::ProcessHandle plugin_process_handle, |
| 48 const IPC::ChannelHandle& channel_handle) = 0; | 49 const IPC::ChannelHandle& channel_handle, |
| 50 int plugin_child_id) = 0; |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 class PluginClient : public Client { | 53 class PluginClient : public Client { |
| 52 public: | 54 public: |
| 53 // Returns the resource context for the renderer requesting the channel. | 55 // Returns the resource context for the renderer requesting the channel. |
| 54 virtual content::ResourceContext* GetResourceContext() = 0; | 56 virtual content::ResourceContext* GetResourceContext() = 0; |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 class BrokerClient : public Client { | 59 class BrokerClient : public Client { |
| 58 }; | 60 }; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 115 |
| 114 // Channel requests that we have already sent to the plugin process, but | 116 // Channel requests that we have already sent to the plugin process, but |
| 115 // haven't heard back about yet. | 117 // haven't heard back about yet. |
| 116 std::queue<Client*> sent_requests_; | 118 std::queue<Client*> sent_requests_; |
| 117 | 119 |
| 118 // Path to the plugin library. | 120 // Path to the plugin library. |
| 119 FilePath plugin_path_; | 121 FilePath plugin_path_; |
| 120 | 122 |
| 121 const bool is_broker_; | 123 const bool is_broker_; |
| 122 | 124 |
| 123 // The unique id created for the process. | |
| 124 int process_id_; | |
| 125 | |
| 126 scoped_ptr<BrowserChildProcessHostImpl> process_; | 125 scoped_ptr<BrowserChildProcessHostImpl> process_; |
| 127 | 126 |
| 128 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); | 127 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 class PpapiPluginProcessHostIterator | 130 class PpapiPluginProcessHostIterator |
| 132 : public content::BrowserChildProcessHostTypeIterator< | 131 : public content::BrowserChildProcessHostTypeIterator< |
| 133 PpapiPluginProcessHost> { | 132 PpapiPluginProcessHost> { |
| 134 public: | 133 public: |
| 135 PpapiPluginProcessHostIterator() | 134 PpapiPluginProcessHostIterator() |
| 136 : content::BrowserChildProcessHostTypeIterator< | 135 : content::BrowserChildProcessHostTypeIterator< |
| 137 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {} | 136 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {} |
| 138 }; | 137 }; |
| 139 | 138 |
| 140 class PpapiBrokerProcessHostIterator | 139 class PpapiBrokerProcessHostIterator |
| 141 : public content::BrowserChildProcessHostTypeIterator< | 140 : public content::BrowserChildProcessHostTypeIterator< |
| 142 PpapiPluginProcessHost> { | 141 PpapiPluginProcessHost> { |
| 143 public: | 142 public: |
| 144 PpapiBrokerProcessHostIterator() | 143 PpapiBrokerProcessHostIterator() |
| 145 : content::BrowserChildProcessHostTypeIterator< | 144 : content::BrowserChildProcessHostTypeIterator< |
| 146 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} | 145 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} |
| 147 }; | 146 }; |
| 148 | 147 |
| 149 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 148 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
| 150 | 149 |
| OLD | NEW |