OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util_proxy.h" | 12 #include "base/file_util_proxy.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/process.h" | 16 #include "base/process.h" |
17 #include "chrome/common/nacl_types.h" | 17 #include "chrome/common/nacl_types.h" |
18 #include "content/public/browser/browser_child_process_host_delegate.h" | 18 #include "content/public/browser/browser_child_process_host_delegate.h" |
19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 #include "ipc/ipc_channel_handle.h" |
20 | 21 |
21 class ChromeRenderMessageFilter; | 22 class ChromeRenderMessageFilter; |
22 class CommandLine; | 23 class CommandLine; |
23 class ExtensionInfoMap; | 24 class ExtensionInfoMap; |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 class BrowserChildProcessHost; | 27 class BrowserChildProcessHost; |
27 } | 28 } |
28 | 29 |
29 // Represents the browser side of the browser <--> NaCl communication | 30 // Represents the browser side of the browser <--> NaCl communication |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool LaunchSelLdr(); | 80 bool LaunchSelLdr(); |
80 | 81 |
81 // BrowserChildProcessHostDelegate implementation: | 82 // BrowserChildProcessHostDelegate implementation: |
82 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 83 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
83 virtual void OnProcessLaunched() OVERRIDE; | 84 virtual void OnProcessLaunched() OVERRIDE; |
84 | 85 |
85 void OnResourcesReady(); | 86 void OnResourcesReady(); |
86 | 87 |
87 // Sends the reply message to the renderer who is waiting for the plugin | 88 // Sends the reply message to the renderer who is waiting for the plugin |
88 // to load. Returns true on success. | 89 // to load. Returns true on success. |
89 bool ReplyToRenderer(); | 90 bool ReplyToRenderer(const IPC::ChannelHandle& channel_handle); |
90 | 91 |
91 // Sends the message to the NaCl process to load the plugin. Returns true | 92 // Sends the message to the NaCl process to load the plugin. Returns true |
92 // on success. | 93 // on success. |
93 bool StartNaClExecution(); | 94 bool StartNaClExecution(); |
94 | 95 |
95 // Called once all initialization is complete and the NaCl process is | 96 // Called once all initialization is complete and the NaCl process is |
96 // ready to go. Returns true on success. | 97 // ready to go. Returns true on success. |
97 bool SendStart(); | 98 bool SendStart(); |
98 | 99 |
99 // Does post-process-launching tasks for starting the NaCl process once | 100 // Does post-process-launching tasks for starting the NaCl process once |
100 // we have a connection. | 101 // we have a connection. |
101 // | 102 // |
102 // Returns false on failure. | 103 // Returns false on failure. |
103 bool StartWithLaunchedProcess(); | 104 bool StartWithLaunchedProcess(); |
104 | 105 |
105 // Message handlers for validation caching. | 106 // Message handlers for validation caching. |
106 void OnQueryKnownToValidate(const std::string& signature, bool* result); | 107 void OnQueryKnownToValidate(const std::string& signature, bool* result); |
107 void OnSetKnownToValidate(const std::string& signature); | 108 void OnSetKnownToValidate(const std::string& signature); |
108 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
109 // Message handler for Windows hardware exception handling. | 110 // Message handler for Windows hardware exception handling. |
110 void OnAttachDebugExceptionHandler(const std::string& info, | 111 void OnAttachDebugExceptionHandler(const std::string& info, |
111 IPC::Message* reply_msg); | 112 IPC::Message* reply_msg); |
112 bool AttachDebugExceptionHandler(const std::string& info, | 113 bool AttachDebugExceptionHandler(const std::string& info, |
113 IPC::Message* reply_msg); | 114 IPC::Message* reply_msg); |
114 #endif | 115 #endif |
115 | 116 |
| 117 void OnPpapiChannelCreated(const IPC::ChannelHandle& channel_handle); |
| 118 |
116 GURL manifest_url_; | 119 GURL manifest_url_; |
117 | 120 |
118 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
119 // This field becomes true when the broker successfully launched | 122 // This field becomes true when the broker successfully launched |
120 // the NaCl loader. | 123 // the NaCl loader. |
121 bool process_launched_by_broker_; | 124 bool process_launched_by_broker_; |
122 #elif defined(OS_LINUX) | 125 #elif defined(OS_LINUX) |
123 bool wait_for_nacl_gdb_; | 126 bool wait_for_nacl_gdb_; |
124 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; | 127 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; |
125 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; | 128 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; |
(...skipping 19 matching lines...) Expand all Loading... |
145 scoped_ptr<NaClInternal> internal_; | 148 scoped_ptr<NaClInternal> internal_; |
146 | 149 |
147 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 150 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
148 | 151 |
149 scoped_ptr<content::BrowserChildProcessHost> process_; | 152 scoped_ptr<content::BrowserChildProcessHost> process_; |
150 | 153 |
151 bool enable_exception_handling_; | 154 bool enable_exception_handling_; |
152 | 155 |
153 bool off_the_record_; | 156 bool off_the_record_; |
154 | 157 |
| 158 bool enable_ipc_proxy_; |
| 159 |
155 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 160 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
156 }; | 161 }; |
157 | 162 |
158 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 163 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
OLD | NEW |