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

Side by Side Diff: chrome/browser/nacl_host/nacl_process_host.h

Issue 11368019: Add support for external out-of-process PPAPI plugins in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_NACL_HOST_NACL_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/file_util_proxy.h" 11 #include "base/file_util_proxy.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/process.h" 15 #include "base/process.h"
16 #include "chrome/common/nacl_types.h" 16 #include "chrome/common/nacl_types.h"
17 #include "content/public/browser/browser_child_process_host_delegate.h" 17 #include "content/public/browser/browser_child_process_host_delegate.h"
18 #include "content/public/browser/browser_child_process_host_iterator.h"
18 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
19 #include "ipc/ipc_channel_handle.h" 20 #include "ipc/ipc_channel_handle.h"
20 #include "net/base/tcp_listen_socket.h" 21 #include "net/base/tcp_listen_socket.h"
21 #include "ppapi/shared_impl/ppapi_permissions.h" 22 #include "ppapi/shared_impl/ppapi_permissions.h"
22 23
23 class ChromeRenderMessageFilter; 24 class ChromeRenderMessageFilter;
24 class CommandLine; 25 class CommandLine;
25 class ExtensionInfoMap; 26 class ExtensionInfoMap;
26 27
27 namespace content { 28 namespace content {
28 class BrowserChildProcessHost; 29 class BrowserChildProcessHost;
30 class BrowserPpapiHost;
29 } 31 }
30 32
31 namespace IPC { 33 namespace IPC {
32 class ChannelProxy; 34 class ChannelProxy;
33 } 35 }
34 36
35 // Represents the browser side of the browser <--> NaCl communication 37 // Represents the browser side of the browser <--> NaCl communication
36 // channel. There will be one NaClProcessHost per NaCl process 38 // channel. There will be one NaClProcessHost per NaCl process
37 // The browser is responsible for starting the NaCl process 39 // The browser is responsible for starting the NaCl process
38 // when requested by the renderer. 40 // when requested by the renderer.
(...skipping 19 matching lines...) Expand all
58 60
59 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; 61 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
60 62
61 #if defined(OS_WIN) 63 #if defined(OS_WIN)
62 void OnProcessLaunchedByBroker(base::ProcessHandle handle); 64 void OnProcessLaunchedByBroker(base::ProcessHandle handle);
63 void OnDebugExceptionHandlerLaunchedByBroker(bool success); 65 void OnDebugExceptionHandlerLaunchedByBroker(bool success);
64 #endif 66 #endif
65 67
66 bool Send(IPC::Message* msg); 68 bool Send(IPC::Message* msg);
67 69
70 content::BrowserChildProcessHost* process() { return process_.get(); }
71 content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); }
72
68 private: 73 private:
69 friend class PluginListener; 74 friend class PluginListener;
70 75
71 // Internal class that holds the nacl::Handle objecs so that 76 // Internal class that holds the nacl::Handle objecs so that
72 // nacl_process_host.h doesn't include NaCl headers. Needed since it's 77 // nacl_process_host.h doesn't include NaCl headers. Needed since it's
73 // included by src\content, which can't depend on the NaCl gyp file because it 78 // included by src\content, which can't depend on the NaCl gyp file because it
74 // depends on chrome.gyp (circular dependency). 79 // depends on chrome.gyp (circular dependency).
75 struct NaClInternal; 80 struct NaClInternal;
76 81
77 // PluginListener that forwards any messages from untrusted code that aren't 82 // PluginListener that forwards any messages from untrusted code that aren't
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 bool enable_debug_stub_; 191 bool enable_debug_stub_;
187 192
188 bool off_the_record_; 193 bool off_the_record_;
189 194
190 bool enable_ipc_proxy_; 195 bool enable_ipc_proxy_;
191 196
192 // Channel proxy to terminate the NaCl-Browser PPAPI channel. 197 // Channel proxy to terminate the NaCl-Browser PPAPI channel.
193 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_; 198 scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_;
194 // Plugin listener, to forward browser channel messages to us. 199 // Plugin listener, to forward browser channel messages to us.
195 PluginListener ipc_plugin_listener_; 200 PluginListener ipc_plugin_listener_;
201 // Browser host for plugin process.
202 scoped_ptr<content::BrowserPpapiHost> ppapi_host_;
196 203
197 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); 204 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
198 }; 205 };
199 206
207 class NaClProcessHostIterator
208 : public content::BrowserChildProcessHostTypeIterator<NaClProcessHost> {
209 public:
210 NaClProcessHostIterator()
211 : content::BrowserChildProcessHostTypeIterator<NaClProcessHost>(
212 content::PROCESS_TYPE_NACL_LOADER) {}
213 };
214
200 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ 215 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698