| 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 #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> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/metrics/nacl_histogram.h" | |
| 15 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 16 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 17 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
| 18 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
| 21 #include "chrome/common/nacl_cmd_line.h" | 20 #include "chrome/common/nacl_cmd_line.h" |
| 22 #include "chrome/common/nacl_messages.h" | 21 #include "chrome/common/nacl_messages.h" |
| 23 #include "chrome/common/render_messages.h" | 22 #include "chrome/common/render_messages.h" |
| 24 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 23 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 internal_->sockets_for_renderer.push_back(pair[0]); | 120 internal_->sockets_for_renderer.push_back(pair[0]); |
| 122 internal_->sockets_for_sel_ldr.push_back(pair[1]); | 121 internal_->sockets_for_sel_ldr.push_back(pair[1]); |
| 123 SetCloseOnExec(pair[0]); | 122 SetCloseOnExec(pair[0]); |
| 124 SetCloseOnExec(pair[1]); | 123 SetCloseOnExec(pair[1]); |
| 125 } | 124 } |
| 126 | 125 |
| 127 // Launch the process | 126 // Launch the process |
| 128 if (!LaunchSelLdr()) { | 127 if (!LaunchSelLdr()) { |
| 129 return false; | 128 return false; |
| 130 } | 129 } |
| 131 UmaNaclHistogramEnumeration(NACL_STARTED); | |
| 132 chrome_render_message_filter_ = chrome_render_message_filter; | 130 chrome_render_message_filter_ = chrome_render_message_filter; |
| 133 reply_msg_ = reply_msg; | 131 reply_msg_ = reply_msg; |
| 134 | 132 |
| 135 return true; | 133 return true; |
| 136 #endif // DISABLE_NACL | 134 #endif // DISABLE_NACL |
| 137 } | 135 } |
| 138 | 136 |
| 139 bool NaClProcessHost::LaunchSelLdr() { | 137 bool NaClProcessHost::LaunchSelLdr() { |
| 140 if (!CreateChannel()) | 138 if (!CreateChannel()) |
| 141 return false; | 139 return false; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 360 } |
| 363 | 361 |
| 364 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { | 362 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 365 NOTREACHED() << "Invalid message with type = " << msg.type(); | 363 NOTREACHED() << "Invalid message with type = " << msg.type(); |
| 366 return false; | 364 return false; |
| 367 } | 365 } |
| 368 | 366 |
| 369 bool NaClProcessHost::CanShutdown() { | 367 bool NaClProcessHost::CanShutdown() { |
| 370 return true; | 368 return true; |
| 371 } | 369 } |
| OLD | NEW |