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