| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tools/crash_service/crash_service.h" | 5 #include "chrome/tools/crash_service/crash_service.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #include <fstream> | 10 #include <fstream> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 if (!PathService::Get(chrome::DIR_USER_DATA, &report_path_)) { | 187 if (!PathService::Get(chrome::DIR_USER_DATA, &report_path_)) { |
| 188 LOG(ERROR) << "could not get DIR_USER_DATA"; | 188 LOG(ERROR) << "could not get DIR_USER_DATA"; |
| 189 return false; | 189 return false; |
| 190 } | 190 } |
| 191 file_util::AppendToPath(&report_path_, chrome::kCrashReportLog); | 191 file_util::AppendToPath(&report_path_, chrome::kCrashReportLog); |
| 192 if (!PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) { | 192 if (!PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) { |
| 193 LOG(ERROR) << "could not get DIR_CRASH_DUMPS"; | 193 LOG(ERROR) << "could not get DIR_CRASH_DUMPS"; |
| 194 return false; | 194 return false; |
| 195 } | 195 } |
| 196 | 196 |
| 197 CommandLine cmd_line(L""); | 197 CommandLine cmd_line = CommandLine::FromString(command_line); |
| 198 cmd_line.ParseFromString(command_line); | |
| 199 | 198 |
| 200 // We can override the send reports quota with a command line switch. | 199 // We can override the send reports quota with a command line switch. |
| 201 if (cmd_line.HasSwitch(kMaxReports)) | 200 if (cmd_line.HasSwitch(kMaxReports)) |
| 202 max_reports = _wtoi(cmd_line.GetSwitchValue(kMaxReports).c_str()); | 201 max_reports = _wtoi(cmd_line.GetSwitchValue(kMaxReports).c_str()); |
| 203 | 202 |
| 204 if (max_reports > 0) { | 203 if (max_reports > 0) { |
| 205 // Create the http sender object. | 204 // Create the http sender object. |
| 206 sender_ = new CrashReportSender(checkpoint_path); | 205 sender_ = new CrashReportSender(checkpoint_path); |
| 207 if (!sender_) { | 206 if (!sender_) { |
| 208 LOG(ERROR) << "could not create sender"; | 207 LOG(ERROR) << "could not create sender"; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 ::Sleep(50); | 419 ::Sleep(50); |
| 421 } | 420 } |
| 422 | 421 |
| 423 LOG(INFO) << "clients connected :" << clients_connected_; | 422 LOG(INFO) << "clients connected :" << clients_connected_; |
| 424 LOG(INFO) << "clients terminated :" << clients_terminated_; | 423 LOG(INFO) << "clients terminated :" << clients_terminated_; |
| 425 LOG(INFO) << "dumps serviced :" << requests_handled_; | 424 LOG(INFO) << "dumps serviced :" << requests_handled_; |
| 426 LOG(INFO) << "dumps reported :" << requests_sent_; | 425 LOG(INFO) << "dumps reported :" << requests_sent_; |
| 427 | 426 |
| 428 return static_cast<int>(msg.wParam); | 427 return static_cast<int>(msg.wParam); |
| 429 } | 428 } |
| OLD | NEW |