| 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 <fstream> | 9 #include <fstream> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 file_util::AppendToPath(&report_path_, chrome::kCrashReportLog); | 193 file_util::AppendToPath(&report_path_, chrome::kCrashReportLog); |
| 194 if (!PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) { | 194 if (!PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) { |
| 195 LOG(ERROR) << "could not get DIR_CRASH_DUMPS"; | 195 LOG(ERROR) << "could not get DIR_CRASH_DUMPS"; |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 CommandLine cmd_line = CommandLine::FromString(command_line); | 199 CommandLine cmd_line = CommandLine::FromString(command_line); |
| 200 | 200 |
| 201 // We can override the send reports quota with a command line switch. | 201 // We can override the send reports quota with a command line switch. |
| 202 if (cmd_line.HasSwitch(kMaxReports)) | 202 if (cmd_line.HasSwitch(kMaxReports)) |
| 203 max_reports = _wtoi(cmd_line.GetSwitchValue(kMaxReports).c_str()); | 203 max_reports = _wtoi(cmd_line.GetSwitchValueNative(kMaxReports).c_str()); |
| 204 | 204 |
| 205 if (max_reports > 0) { | 205 if (max_reports > 0) { |
| 206 // Create the http sender object. | 206 // Create the http sender object. |
| 207 sender_ = new CrashReportSender(checkpoint_path); | 207 sender_ = new CrashReportSender(checkpoint_path); |
| 208 if (!sender_) { | 208 if (!sender_) { |
| 209 LOG(ERROR) << "could not create sender"; | 209 LOG(ERROR) << "could not create sender"; |
| 210 return false; | 210 return false; |
| 211 } | 211 } |
| 212 sender_->set_max_reports_per_day(max_reports); | 212 sender_->set_max_reports_per_day(max_reports); |
| 213 } | 213 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (!CreateTopWindow(::GetModuleHandleW(NULL), | 245 if (!CreateTopWindow(::GetModuleHandleW(NULL), |
| 246 !cmd_line.HasSwitch(kNoWindow))) { | 246 !cmd_line.HasSwitch(kNoWindow))) { |
| 247 LOG(ERROR) << "could not create window"; | 247 LOG(ERROR) << "could not create window"; |
| 248 if (security_attributes.lpSecurityDescriptor) | 248 if (security_attributes.lpSecurityDescriptor) |
| 249 LocalFree(security_attributes.lpSecurityDescriptor); | 249 LocalFree(security_attributes.lpSecurityDescriptor); |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 | 252 |
| 253 reporter_tag_ = L"crash svc"; | 253 reporter_tag_ = L"crash svc"; |
| 254 if (cmd_line.HasSwitch(kReporterTag)) | 254 if (cmd_line.HasSwitch(kReporterTag)) |
| 255 reporter_tag_ = cmd_line.GetSwitchValue(kReporterTag); | 255 reporter_tag_ = cmd_line.GetSwitchValueNative(kReporterTag); |
| 256 | 256 |
| 257 // Log basic information. | 257 // Log basic information. |
| 258 LOG(INFO) << "pipe name is " << pipe_name; | 258 LOG(INFO) << "pipe name is " << pipe_name; |
| 259 LOG(INFO) << "dumps at " << dumps_path; | 259 LOG(INFO) << "dumps at " << dumps_path; |
| 260 LOG(INFO) << "reports at " << report_path_; | 260 LOG(INFO) << "reports at " << report_path_; |
| 261 | 261 |
| 262 if (sender_) { | 262 if (sender_) { |
| 263 LOG(INFO) << "checkpoint is " << checkpoint_path; | 263 LOG(INFO) << "checkpoint is " << checkpoint_path; |
| 264 LOG(INFO) << "server is " << kCrashReportURL; | 264 LOG(INFO) << "server is " << kCrashReportURL; |
| 265 LOG(INFO) << "maximum " << sender_->max_reports_per_day() << " reports/day"; | 265 LOG(INFO) << "maximum " << sender_->max_reports_per_day() << " reports/day"; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 &sec_desc, NULL)) { | 472 &sec_desc, NULL)) { |
| 473 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl, | 473 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl, |
| 474 &sacl_defaulted)) { | 474 &sacl_defaulted)) { |
| 475 return sec_desc; | 475 return sec_desc; |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 return NULL; | 479 return NULL; |
| 480 } | 480 } |
| 481 | 481 |
| OLD | NEW |