| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual ~NaClProcessHost(); | 29 virtual ~NaClProcessHost(); |
| 30 | 30 |
| 31 // Do any minimal work that must be done at browser startup. | 31 // Do any minimal work that must be done at browser startup. |
| 32 static void EarlyStartup(); | 32 static void EarlyStartup(); |
| 33 | 33 |
| 34 // Initialize the new NaCl process, returning true on success. | 34 // Initialize the new NaCl process, returning true on success. |
| 35 bool Launch(ChromeRenderMessageFilter* chrome_render_message_filter, | 35 bool Launch(ChromeRenderMessageFilter* chrome_render_message_filter, |
| 36 int socket_count, | 36 int socket_count, |
| 37 IPC::Message* reply_msg); | 37 IPC::Message* reply_msg); |
| 38 | 38 |
| 39 virtual bool OnMessageReceived(const IPC::Message& msg); | 39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 40 | 40 |
| 41 void OnProcessLaunchedByBroker(base::ProcessHandle handle); | 41 void OnProcessLaunchedByBroker(base::ProcessHandle handle); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); | 44 virtual base::TerminationStatus GetChildTerminationStatus( |
| 45 virtual void OnChildDied(); | 45 int* exit_code) OVERRIDE; |
| 46 virtual void OnChildDied() OVERRIDE; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 // Internal class that holds the nacl::Handle objecs so that | 49 // Internal class that holds the nacl::Handle objecs so that |
| 49 // nacl_process_host.h doesn't include NaCl headers. Needed since it's | 50 // nacl_process_host.h doesn't include NaCl headers. Needed since it's |
| 50 // included by src\content, which can't depend on the NaCl gyp file because it | 51 // included by src\content, which can't depend on the NaCl gyp file because it |
| 51 // depends on chrome.gyp (circular dependency). | 52 // depends on chrome.gyp (circular dependency). |
| 52 struct NaClInternal; | 53 struct NaClInternal; |
| 53 | 54 |
| 54 bool LaunchSelLdr(); | 55 bool LaunchSelLdr(); |
| 55 | 56 |
| 56 virtual void OnProcessLaunched(); | 57 virtual void OnProcessLaunched() OVERRIDE; |
| 57 | 58 |
| 58 void IrtReady(); | 59 void IrtReady(); |
| 59 void SendStart(base::PlatformFile irt_file); | 60 void SendStart(base::PlatformFile irt_file); |
| 60 | 61 |
| 61 virtual bool CanShutdown(); | 62 virtual bool CanShutdown() OVERRIDE; |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 // The ChromeRenderMessageFilter that requested this NaCl process. We use | 65 // The ChromeRenderMessageFilter that requested this NaCl process. We use |
| 65 // this for sending the reply once the process has started. | 66 // this for sending the reply once the process has started. |
| 66 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; | 67 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; |
| 67 | 68 |
| 68 // The reply message to send. | 69 // The reply message to send. |
| 69 IPC::Message* reply_msg_; | 70 IPC::Message* reply_msg_; |
| 70 | 71 |
| 71 // Socket pairs for the NaCl process and renderer. | 72 // Socket pairs for the NaCl process and renderer. |
| 72 scoped_ptr<NaClInternal> internal_; | 73 scoped_ptr<NaClInternal> internal_; |
| 73 | 74 |
| 74 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 75 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 77 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ | 80 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ |
| OLD | NEW |