Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: components/history/core/browser/download_job_info.cc

Issue 2665243003: add a download slices table into history download db (Closed)
Patch Set: addressing comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/history/core/browser/download_job_info.cc
diff --git a/components/history/core/browser/download_job_info.cc b/components/history/core/browser/download_job_info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6387650a741db2c196eb28507f23189653f78e0b
--- /dev/null
+++ b/components/history/core/browser/download_job_info.cc
@@ -0,0 +1,46 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
sky 2017/02/03 16:02:34 no (c)
qinmin 2017/02/04 00:06:56 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/history/core/browser/download_job_info.h"
+
+#include "components/history/core/browser/download_constants.h"
+
+namespace history {
+
+DownloadJobInfo::DownloadJobInfo()
+ : download_id(0),
sky 2017/02/03 16:02:34 kInvalidDownloadId?
qinmin 2017/02/04 00:06:56 Done.
+ start_position(0),
+ length(0),
+ received_bytes(0),
+ state(DownloadState::IN_PROGRESS),
sky 2017/02/03 16:02:34 You sure you don't want interrupted?
qinmin 2017/02/04 00:06:56 When a job is created, it should always in the sta
+ interrupt_reason(0) {}
+
+DownloadJobInfo::DownloadJobInfo(DownloadId download_id,
+ int job_id,
+ int64_t start_position,
+ int64_t length,
+ int64_t received_bytes,
+ DownloadState state,
+ DownloadInterruptReason interrupt_reason)
+ : download_id(download_id),
+ job_id(job_id),
+ start_position(start_position),
+ length(length),
+ received_bytes(received_bytes),
+ state(state),
+ interrupt_reason(interrupt_reason) {}
+
+DownloadJobInfo::DownloadJobInfo(const DownloadJobInfo& other) = default;
+
+DownloadJobInfo::~DownloadJobInfo() = default;
+
+bool DownloadJobInfo::operator==(const DownloadJobInfo& rhs) const {
+ return download_id == rhs.download_id && job_id == rhs.job_id &&
+ start_position == rhs.start_position &&
+ length == rhs.length &&
+ received_bytes == rhs.received_bytes && state == rhs.state &&
+ interrupt_reason == rhs.interrupt_reason;
+}
+
+} // namespace history

Powered by Google App Engine
This is Rietveld 408576698