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 #include "chrome/browser/nacl_host/nacl_process_host.h" | 5 #include "chrome/browser/nacl_host/nacl_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/metrics/histogram.h" |
13 #include "base/path_service.h" | 14 #include "base/path_service.h" |
14 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
15 #include "base/string_split.h" | 16 #include "base/string_split.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
19 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/extensions/extension_info_map.h" | 23 #include "chrome/browser/extensions/extension_info_map.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 207 } |
207 | 208 |
208 // This is called at browser startup. | 209 // This is called at browser startup. |
209 // static | 210 // static |
210 void NaClProcessHost::EarlyStartup() { | 211 void NaClProcessHost::EarlyStartup() { |
211 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 212 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
212 // Open the IRT file early to make sure that it isn't replaced out from | 213 // Open the IRT file early to make sure that it isn't replaced out from |
213 // under us by autoupdate. | 214 // under us by autoupdate. |
214 NaClBrowser::GetInstance()->EnsureIrtAvailable(); | 215 NaClBrowser::GetInstance()->EnsureIrtAvailable(); |
215 #endif | 216 #endif |
| 217 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 218 UMA_HISTOGRAM_BOOLEAN( |
| 219 "NaCl.nacl-gdb", |
| 220 !cmd->GetSwitchValuePath(switches::kNaClGdb).empty()); |
| 221 UMA_HISTOGRAM_BOOLEAN( |
| 222 "NaCl.nacl-gdb-script", |
| 223 !cmd->GetSwitchValuePath(switches::kNaClGdbScript).empty()); |
| 224 UMA_HISTOGRAM_BOOLEAN( |
| 225 "NaCl.enable-nacl-debug", |
| 226 cmd->HasSwitch(switches::kEnableNaClDebug)); |
216 } | 227 } |
217 | 228 |
218 void NaClProcessHost::Launch( | 229 void NaClProcessHost::Launch( |
219 ChromeRenderMessageFilter* chrome_render_message_filter, | 230 ChromeRenderMessageFilter* chrome_render_message_filter, |
220 int socket_count, | 231 int socket_count, |
221 IPC::Message* reply_msg, | 232 IPC::Message* reply_msg, |
222 scoped_refptr<ExtensionInfoMap> extension_info_map) { | 233 scoped_refptr<ExtensionInfoMap> extension_info_map) { |
223 chrome_render_message_filter_ = chrome_render_message_filter; | 234 chrome_render_message_filter_ = chrome_render_message_filter; |
224 reply_msg_ = reply_msg; | 235 reply_msg_ = reply_msg; |
225 extension_info_map_ = extension_info_map; | 236 extension_info_map_ = extension_info_map; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 } else { | 849 } else { |
839 NaClStartDebugExceptionHandlerThread( | 850 NaClStartDebugExceptionHandlerThread( |
840 process_handle.Take(), info, | 851 process_handle.Take(), info, |
841 base::MessageLoopProxy::current(), | 852 base::MessageLoopProxy::current(), |
842 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 853 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
843 weak_factory_.GetWeakPtr())); | 854 weak_factory_.GetWeakPtr())); |
844 return true; | 855 return true; |
845 } | 856 } |
846 } | 857 } |
847 #endif | 858 #endif |
OLD | NEW |