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

Unified Diff: components/history/core/browser/download_slice_info.h

Issue 2665243003: add a download slices table into history download db (Closed)
Patch Set: add test file to BUILD.gn Created 3 years, 10 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_slice_info.h
diff --git a/components/history/core/browser/download_slice_info.h b/components/history/core/browser/download_slice_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..4af8efbc030806de23b38f68c98a6d0e4d7e058f
--- /dev/null
+++ b/components/history/core/browser/download_slice_info.h
@@ -0,0 +1,40 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_
+
+#include <stdint.h>
+#include <string>
+
+#include "components/history/core/browser/download_types.h"
+
+namespace history {
+
+// Contains the information for each slice of data that is written to the
+// download target file. A download file can have multiple slices and cach
+// slice will have a different offset.
+struct DownloadSliceInfo {
+ DownloadSliceInfo();
+ DownloadSliceInfo(DownloadId download_id,
+ int64_t offset,
+ int64_t received_bytes);
+ DownloadSliceInfo(const DownloadSliceInfo& other);
+ ~DownloadSliceInfo();
+
+ bool operator==(const DownloadSliceInfo&) const;
+
+ // The id of the download in the database.
+ DownloadId download_id;
+
+ // Start position of the download request.
+ int64_t offset;
+
+ // The number of bytes received (so far).
+ int64_t received_bytes;
+};
+
+} // namespace history
+
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_SLICE_INFO_H_
« no previous file with comments | « components/history/core/browser/download_row.cc ('k') | components/history/core/browser/download_slice_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698