Index: components/history/core/browser/download_types.cc |
diff --git a/components/history/core/browser/download_types.cc b/components/history/core/browser/download_types.cc |
index ccc20186d6373787fd514c05711835ae15ef650a..e75081e5b1c8f6a062e2c1af4919cfb1edd3cfc5 100644 |
--- a/components/history/core/browser/download_types.cc |
+++ b/components/history/core/browser/download_types.cc |
@@ -115,10 +115,11 @@ int DownloadInterruptReasonToInt(DownloadInterruptReason interrupt_reason) { |
const DownloadId kInvalidDownloadId = 0; |
-DownloadId IntToDownloadId(int64_t id) { |
- DCHECK_GE(id, static_cast<int64_t>(0)); |
- DCHECK_NE(id, static_cast<int64_t>(kInvalidDownloadId)); |
- return static_cast<DownloadId>(id); |
+bool ConvertIntToDownloadId(int64_t id, DownloadId* out) { |
+ if (id <= static_cast<int64_t>(kInvalidDownloadId)) |
+ return false; |
+ *out = static_cast<DownloadId>(id); |
+ return true; |
} |
int64_t DownloadIdToInt(DownloadId id) { |