| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/nacl_host/nacl_process_host.h" | 7 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 8 | 8 |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 set_name(url); | 48 set_name(url); |
| 49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 50 CheckIsWow64(); | 50 CheckIsWow64(); |
| 51 #endif | 51 #endif |
| 52 } | 52 } |
| 53 | 53 |
| 54 NaClProcessHost::~NaClProcessHost() { | 54 NaClProcessHost::~NaClProcessHost() { |
| 55 if (!reply_msg_) | 55 if (!reply_msg_) |
| 56 return; | 56 return; |
| 57 | 57 |
| 58 // nacl::Close() is not available at link time if DISABLE_NACL is |
| 59 // defined, but we still compile a bunch of other code from this |
| 60 // file anyway. TODO(mseaborn): Make this less messy. |
| 61 #ifndef DISABLE_NACL |
| 58 for (size_t i = 0; i < sockets_for_renderer_.size(); i++) { | 62 for (size_t i = 0; i < sockets_for_renderer_.size(); i++) { |
| 59 nacl::Close(sockets_for_renderer_[i]); | 63 nacl::Close(sockets_for_renderer_[i]); |
| 60 } | 64 } |
| 61 for (size_t i = 0; i < sockets_for_sel_ldr_.size(); i++) { | 65 for (size_t i = 0; i < sockets_for_sel_ldr_.size(); i++) { |
| 62 nacl::Close(sockets_for_sel_ldr_[i]); | 66 nacl::Close(sockets_for_sel_ldr_[i]); |
| 63 } | 67 } |
| 68 #endif |
| 64 | 69 |
| 65 // OnProcessLaunched didn't get called because the process couldn't launch. | 70 // OnProcessLaunched didn't get called because the process couldn't launch. |
| 66 // Don't keep the renderer hanging. | 71 // Don't keep the renderer hanging. |
| 67 reply_msg_->set_reply_error(); | 72 reply_msg_->set_reply_error(); |
| 68 resource_message_filter_->Send(reply_msg_); | 73 resource_message_filter_->Send(reply_msg_); |
| 69 } | 74 } |
| 70 | 75 |
| 71 bool NaClProcessHost::Launch(ResourceMessageFilter* resource_message_filter, | 76 bool NaClProcessHost::Launch(ResourceMessageFilter* resource_message_filter, |
| 72 int socket_count, | 77 int socket_count, |
| 73 IPC::Message* reply_msg) { | 78 IPC::Message* reply_msg) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 if (fnIsWow64Process != NULL) { | 277 if (fnIsWow64Process != NULL) { |
| 273 BOOL bIsWow64 = FALSE; | 278 BOOL bIsWow64 = FALSE; |
| 274 if (fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { | 279 if (fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { |
| 275 if (bIsWow64) { | 280 if (bIsWow64) { |
| 276 running_on_wow64_ = true; | 281 running_on_wow64_ = true; |
| 277 } | 282 } |
| 278 } | 283 } |
| 279 } | 284 } |
| 280 } | 285 } |
| 281 #endif | 286 #endif |
| OLD | NEW |