| 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 <string> |
| 10 |
| 9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 10 | 12 |
| 11 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 12 #include "base/file_util_proxy.h" | 14 #include "base/file_util_proxy.h" |
| 13 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 15 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
| 16 #include "base/process.h" | 18 #include "base/process.h" |
| 17 #include "chrome/common/nacl_types.h" | 19 #include "chrome/common/nacl_types.h" |
| 18 #include "content/public/browser/browser_child_process_host_delegate.h" | 20 #include "content/public/browser/browser_child_process_host_delegate.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 FilePath GetManifestPath(); | 79 FilePath GetManifestPath(); |
| 78 bool LaunchSelLdr(); | 80 bool LaunchSelLdr(); |
| 79 | 81 |
| 80 // BrowserChildProcessHostDelegate implementation: | 82 // BrowserChildProcessHostDelegate implementation: |
| 81 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 83 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 82 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 84 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
| 83 virtual void OnProcessLaunched() OVERRIDE; | 85 virtual void OnProcessLaunched() OVERRIDE; |
| 84 | 86 |
| 85 void IrtReady(); | 87 void IrtReady(); |
| 86 | 88 |
| 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 | 89 // Called once all initialization is complete and the NaCl process is |
| 96 // ready to go. Returns true on success. | 90 // ready to go. Returns true on success. |
| 97 bool SendStart(); | 91 bool SendStart(); |
| 98 | 92 |
| 99 // Does post-process-launching tasks for starting the NaCl process once | 93 // Does post-process-launching tasks for starting the NaCl process once |
| 100 // we have a connection. | 94 // we have a connection. |
| 101 // | 95 // |
| 102 // Returns false on failure. | 96 // Returns false on failure. |
| 103 bool StartWithLaunchedProcess(); | 97 bool StartWithLaunchedProcess(); |
| 104 | 98 |
| 105 // Message handlers for validation caching. | 99 // Message handlers for validation caching. |
| 106 void OnQueryKnownToValidate(const std::string& signature, bool* result); | 100 void OnQueryKnownToValidate(const std::string& signature, bool* result); |
| 107 void OnSetKnownToValidate(const std::string& signature); | 101 void OnSetKnownToValidate(const std::string& signature); |
| 108 | 102 |
| 103 void OnPpapiChannelCreated(const IPC::ChannelHandle& channel_handle); |
| 104 |
| 109 GURL manifest_url_; | 105 GURL manifest_url_; |
| 110 | 106 |
| 111 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
| 112 class DebugContext; | 108 class DebugContext; |
| 113 | 109 |
| 114 scoped_refptr<DebugContext> debug_context_; | 110 scoped_refptr<DebugContext> debug_context_; |
| 115 | 111 |
| 116 // This field becomes true when the broker successfully launched | 112 // This field becomes true when the broker successfully launched |
| 117 // the NaCl loader. | 113 // the NaCl loader. |
| 118 bool process_launched_by_broker_; | 114 bool process_launched_by_broker_; |
| 115 |
| 119 #elif defined(OS_LINUX) | 116 #elif defined(OS_LINUX) |
| 120 bool wait_for_nacl_gdb_; | 117 bool wait_for_nacl_gdb_; |
| 121 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; | 118 MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; |
| 122 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; | 119 scoped_ptr<MessageLoopForIO::Watcher> nacl_gdb_watcher_delegate_; |
| 123 #endif | 120 #endif |
| 124 // The ChromeRenderMessageFilter that requested this NaCl process. We use | 121 // The ChromeRenderMessageFilter that requested this NaCl process. We use |
| 125 // this for sending the reply once the process has started. | 122 // this for sending the reply once the process has started. |
| 126 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; | 123 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; |
| 127 | 124 |
| 128 // The reply message to send. We must always send this message when the | 125 // The reply message to send. We must always send this message when the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 140 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 137 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
| 141 | 138 |
| 142 scoped_ptr<content::BrowserChildProcessHost> process_; | 139 scoped_ptr<content::BrowserChildProcessHost> process_; |
| 143 | 140 |
| 144 bool enable_exception_handling_; | 141 bool enable_exception_handling_; |
| 145 | 142 |
| 146 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 143 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 147 }; | 144 }; |
| 148 | 145 |
| 149 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 146 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
| OLD | NEW |