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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Get path to manifest on local disk if possible. | 78 // Get path to manifest on local disk if possible. |
78 FilePath GetManifestPath(); | 79 FilePath GetManifestPath(); |
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 // to load. Returns true on success. | |
89 bool ReplyToRenderer(); | |
90 | |
91 // Sends the message to the NaCl process to load the plugin. Returns true | |
92 // on success. | |
93 bool StartNaClExecution(); | |
94 | |
95 // Called once all initialization is complete and the NaCl process is | 88 // Called once all initialization is complete and the NaCl process is |
96 // ready to go. Returns true on success. | 89 // ready to go. Returns true on success. |
97 bool SendStart(); | 90 bool SendStart(); |
98 | 91 |
99 // Does post-process-launching tasks for starting the NaCl process once | 92 // Does post-process-launching tasks for starting the NaCl process once |
100 // we have a connection. | 93 // we have a connection. |
101 // | 94 // |
102 // Returns false on failure. | 95 // Returns false on failure. |
103 bool StartWithLaunchedProcess(); | 96 bool StartWithLaunchedProcess(); |
104 | 97 |
105 // Message handlers for validation caching. | 98 // Message handlers for validation caching. |
106 void OnQueryKnownToValidate(const std::string& signature, bool* result); | 99 void OnQueryKnownToValidate(const std::string& signature, bool* result); |
107 void OnSetKnownToValidate(const std::string& signature); | 100 void OnSetKnownToValidate(const std::string& signature); |
108 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
109 // Message handler for Windows hardware exception handling. | 102 // Message handler for Windows hardware exception handling. |
110 void OnAttachDebugExceptionHandler(const std::string& info, | 103 void OnAttachDebugExceptionHandler(const std::string& info, |
111 IPC::Message* reply_msg); | 104 IPC::Message* reply_msg); |
112 bool AttachDebugExceptionHandler(const std::string& info, | 105 bool AttachDebugExceptionHandler(const std::string& info, |
113 IPC::Message* reply_msg); | 106 IPC::Message* reply_msg); |
114 #endif | 107 #endif |
115 | 108 |
| 109 void OnPpapiChannelCreated(const IPC::ChannelHandle& channel_handle); |
| 110 |
116 GURL manifest_url_; | 111 GURL manifest_url_; |
117 | 112 |
118 #if defined(OS_WIN) | 113 #if defined(OS_WIN) |
119 // This field becomes true when the broker successfully launched | 114 // This field becomes true when the broker successfully launched |
120 // the NaCl loader. | 115 // the NaCl loader. |
121 bool process_launched_by_broker_; | 116 bool process_launched_by_broker_; |
122 #elif defined(OS_LINUX) | 117 #elif defined(OS_LINUX) |
123 bool wait_for_nacl_gdb_; | 118 bool wait_for_nacl_gdb_; |
124 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; | 119 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; |
125 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; | 120 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; |
(...skipping 23 matching lines...) Expand all Loading... |
149 scoped_ptr<content::BrowserChildProcessHost> process_; | 144 scoped_ptr<content::BrowserChildProcessHost> process_; |
150 | 145 |
151 bool enable_exception_handling_; | 146 bool enable_exception_handling_; |
152 | 147 |
153 bool off_the_record_; | 148 bool off_the_record_; |
154 | 149 |
155 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 150 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
156 }; | 151 }; |
157 | 152 |
158 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 153 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
OLD | NEW |