| 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 COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const NaClFileToken& nexe_token, | 62 const NaClFileToken& nexe_token, |
| 63 ppapi::PpapiPermissions permissions, | 63 ppapi::PpapiPermissions permissions, |
| 64 int render_view_id, | 64 int render_view_id, |
| 65 uint32 permission_bits, | 65 uint32 permission_bits, |
| 66 bool uses_nonsfi_mode, | 66 bool uses_nonsfi_mode, |
| 67 bool off_the_record, | 67 bool off_the_record, |
| 68 NaClAppProcessType process_type, | 68 NaClAppProcessType process_type, |
| 69 const base::FilePath& profile_directory); | 69 const base::FilePath& profile_directory); |
| 70 virtual ~NaClProcessHost(); | 70 virtual ~NaClProcessHost(); |
| 71 | 71 |
| 72 virtual void OnProcessCrashed(int exit_status) OVERRIDE; | 72 virtual void OnProcessCrashed(int exit_status) override; |
| 73 | 73 |
| 74 // Do any minimal work that must be done at browser startup. | 74 // Do any minimal work that must be done at browser startup. |
| 75 static void EarlyStartup(); | 75 static void EarlyStartup(); |
| 76 | 76 |
| 77 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. | 77 // Specifies throttling time in milliseconds for PpapiHostMsg_Keepalive IPCs. |
| 78 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); | 78 static void SetPpapiKeepAliveThrottleForTesting(unsigned milliseconds); |
| 79 | 79 |
| 80 // Initialize the new NaCl process. Result is returned by sending ipc | 80 // Initialize the new NaCl process. Result is returned by sending ipc |
| 81 // message reply_msg. | 81 // message reply_msg. |
| 82 void Launch(NaClHostMessageFilter* nacl_host_message_filter, | 82 void Launch(NaClHostMessageFilter* nacl_host_message_filter, |
| 83 IPC::Message* reply_msg, | 83 IPC::Message* reply_msg, |
| 84 const base::FilePath& manifest_path); | 84 const base::FilePath& manifest_path); |
| 85 | 85 |
| 86 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 86 virtual void OnChannelConnected(int32 peer_pid) override; |
| 87 | 87 |
| 88 #if defined(OS_WIN) | 88 #if defined(OS_WIN) |
| 89 void OnProcessLaunchedByBroker(base::ProcessHandle handle); | 89 void OnProcessLaunchedByBroker(base::ProcessHandle handle); |
| 90 void OnDebugExceptionHandlerLaunchedByBroker(bool success); | 90 void OnDebugExceptionHandlerLaunchedByBroker(bool success); |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 bool Send(IPC::Message* msg); | 93 bool Send(IPC::Message* msg); |
| 94 | 94 |
| 95 content::BrowserChildProcessHost* process() { return process_.get(); } | 95 content::BrowserChildProcessHost* process() { return process_.get(); } |
| 96 content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); } | 96 content::BrowserPpapiHost* browser_ppapi_host() { return ppapi_host_.get(); } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 #if defined(OS_WIN) | 112 #if defined(OS_WIN) |
| 113 // Called when the debug stub port has been selected. | 113 // Called when the debug stub port has been selected. |
| 114 void OnDebugStubPortSelected(uint16_t debug_stub_port); | 114 void OnDebugStubPortSelected(uint16_t debug_stub_port); |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 bool LaunchSelLdr(); | 117 bool LaunchSelLdr(); |
| 118 | 118 |
| 119 // BrowserChildProcessHostDelegate implementation: | 119 // BrowserChildProcessHostDelegate implementation: |
| 120 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 120 virtual bool OnMessageReceived(const IPC::Message& msg) override; |
| 121 virtual void OnProcessLaunched() OVERRIDE; | 121 virtual void OnProcessLaunched() override; |
| 122 | 122 |
| 123 void OnResourcesReady(); | 123 void OnResourcesReady(); |
| 124 | 124 |
| 125 // Enable the PPAPI proxy only for NaCl processes corresponding to a renderer. | 125 // Enable the PPAPI proxy only for NaCl processes corresponding to a renderer. |
| 126 bool enable_ppapi_proxy() { return render_view_id_ != 0; } | 126 bool enable_ppapi_proxy() { return render_view_id_ != 0; } |
| 127 | 127 |
| 128 // Sends the reply message to the renderer who is waiting for the plugin | 128 // Sends the reply message to the renderer who is waiting for the plugin |
| 129 // to load. Returns true on success. | 129 // to load. Returns true on success. |
| 130 bool ReplyToRenderer( | 130 bool ReplyToRenderer( |
| 131 const IPC::ChannelHandle& ppapi_channel_handle, | 131 const IPC::ChannelHandle& ppapi_channel_handle, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 base::File socket_for_sel_ldr_; | 236 base::File socket_for_sel_ldr_; |
| 237 | 237 |
| 238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 238 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
| 239 | 239 |
| 240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 240 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace nacl | 243 } // namespace nacl |
| 244 | 244 |
| 245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 245 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
| OLD | NEW |