| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 for (const auto& report : all_reports) { | 52 for (const auto& report : all_reports) { |
| 53 if (condition->ShouldPruneReport(report)) { | 53 if (condition->ShouldPruneReport(report)) { |
| 54 status = database->DeleteReport(report.uuid); | 54 status = database->DeleteReport(report.uuid); |
| 55 if (status != CrashReportDatabase::kNoError) { | 55 if (status != CrashReportDatabase::kNoError) { |
| 56 LOG(ERROR) << "Database Pruning: Failed to remove report " | 56 LOG(ERROR) << "Database Pruning: Failed to remove report " |
| 57 << report.uuid.ToString(); | 57 << report.uuid.ToString(); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 // TODO(rsesek): For databases that do not use a directory structure, | 62 // TODO(rsesek): For databases that do not use a directory structure, it is |
| 63 // it is possible for the metadata sidecar to become corrupted and thus | 63 // possible for the metadata sidecar to become corrupted and thus leave |
| 64 // leave orphaned crash report files on-disk. | 64 // orphaned crash report files on-disk. https://crashpad.chromium.org/bug/66 |
| 65 // https://code.google.com/p/crashpad/issues/detail?id=66 | |
| 66 } | 65 } |
| 67 | 66 |
| 68 // static | 67 // static |
| 69 scoped_ptr<PruneCondition> PruneCondition::GetDefault() { | 68 scoped_ptr<PruneCondition> PruneCondition::GetDefault() { |
| 70 // DatabaseSizePruneCondition must be the LHS so that it is always evaluated, | 69 // DatabaseSizePruneCondition must be the LHS so that it is always evaluated, |
| 71 // due to the short-circuting behavior of BinaryPruneCondition. | 70 // due to the short-circuting behavior of BinaryPruneCondition. |
| 72 return make_scoped_ptr(new BinaryPruneCondition(BinaryPruneCondition::OR, | 71 return make_scoped_ptr(new BinaryPruneCondition(BinaryPruneCondition::OR, |
| 73 new DatabaseSizePruneCondition(1024 * 128), new AgePruneCondition(365))); | 72 new DatabaseSizePruneCondition(1024 * 128), new AgePruneCondition(365))); |
| 74 } | 73 } |
| 75 | 74 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return lhs_->ShouldPruneReport(report) && rhs_->ShouldPruneReport(report); | 122 return lhs_->ShouldPruneReport(report) && rhs_->ShouldPruneReport(report); |
| 124 case OR: | 123 case OR: |
| 125 return lhs_->ShouldPruneReport(report) || rhs_->ShouldPruneReport(report); | 124 return lhs_->ShouldPruneReport(report) || rhs_->ShouldPruneReport(report); |
| 126 default: | 125 default: |
| 127 NOTREACHED(); | 126 NOTREACHED(); |
| 128 return false; | 127 return false; |
| 129 } | 128 } |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace crashpad | 131 } // namespace crashpad |
| OLD | NEW |