Chromium Code Reviews| Index: crash_collector.cc |
| diff --git a/crash_collector.cc b/crash_collector.cc |
| index afd72d1e129757c3a5f992abac0171d47d826057..5f6bf4728b5f5b9f4a64149bc26a006bad46014d 100644 |
| --- a/crash_collector.cc |
| +++ b/crash_collector.cc |
| @@ -410,3 +410,24 @@ void CrashCollector::WriteCrashMetaData(const FilePath &meta_path, |
| logger_->LogError("Unable to write %s", meta_path.value().c_str()); |
| } |
| } |
| + |
| +bool |
| +CrashCollector::IsOfficialBuild() { |
| + std::map<std::string, std::string> contents; |
| + if (!ReadKeyValueFile(FilePath(std::string(lsb_release_)), '=', &contents)) { |
| + logger_->LogError("Problem parsing %s", lsb_release_); |
| + // Even though there was some failure, take as much as we could read. |
| + } |
| + std::string version_description("unknown"); |
| + std::map<std::string, std::string>::iterator i; |
| + if ((i = contents.find("CHROMEOS_VERSION_DESCRIPTION")) != contents.end()) { |
| + version_description = i->second; |
| + } |
| + |
| + return (version_description.find("Official") != std::string::npos); |
| +} |
| + |
| +bool CrashCollector::IsCrashTestInProgress() { |
|
kmixter1
2011/02/23 04:49:02
Use file_util::PathExists.
thieule
2011/02/23 21:03:04
Done.
|
| + struct stat statbuf; |
| + return (stat("/tmp/crash-test-in-progress", &statbuf) == 0); |
| +} |