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

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

Issue 833033002: Remove dependency on //content from history DownloadDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete #include Created 5 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
« no previous file with comments | « components/history/core/browser/download_row.cc ('k') | components/history/core/browser/download_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/download_types.h
diff --git a/components/history/core/browser/download_types.h b/components/history/core/browser/download_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c6650db8caad356fe259af797765aac0483d0f1
--- /dev/null
+++ b/components/history/core/browser/download_types.h
@@ -0,0 +1,62 @@
+// Copyright 2015 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_TYPES_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_TYPES_H_
+
+#include <stdint.h>
+#include <iosfwd>
+
+namespace history {
+
+// DownloadState represents the state of a DownloadRow saved into the
+// DownloadDatabase. The values must not be changed as they are saved
+// to disk in the database.
+enum class DownloadState;
+
+// Utility functions to convert between int and DownloadState for
+// serialization to the download database.
+DownloadState IntToDownloadState(int state);
+int DownloadStateToInt(DownloadState state);
+
+// operator<< is defined to allow DownloadState to work with DCHECK/EXPECT.
+std::ostream& operator<<(std::ostream& stream, DownloadState state);
+
+// DownloadDangerType represents the danger of a DownloadRow into the
+// DownloadDatabase. The values must not be changed as they are saved
+// to disk in the database.
+enum class DownloadDangerType;
+
+// Utility functions to convert between int and DownloadDangerType for
+// serialization to the download database.
+DownloadDangerType IntToDownloadDangerType(int danger_type);
+int DownloadDangerTypeToInt(DownloadDangerType danger_type);
+
+// operator<< is defined to allow DownloadDangerType to work with DCHECK/EXPECT.
+std::ostream& operator<<(std::ostream& stream, DownloadDangerType danger_type);
+
+// DownloadInterruptReason represents the reason a download was interrupted
+// of a DownloadRow into the DownloadDatabase. The values must not be changed
+// as they are saved to disk in the database. They have no meaning for the
+// history component.
+typedef int32_t DownloadInterruptReason;
+
+// Utility functions to convert between int and DownloadInterruptReason for
+// serialization to the download database.
+DownloadInterruptReason IntToDownloadInterruptReason(int interrupt_reason);
+int DownloadInterruptReasonToInt(DownloadInterruptReason interrupt_reason);
+
+// DownloadId represents the id of a DownloadRow into the DownloadDatabase.
+// The value is controlled by the embedder except for the reserved id
+// kInvalidDownloadId.
+typedef uint32_t DownloadId;
+
+// Utility functions to convert between int and DownloadId for
+// serialization to the download database.
+DownloadId IntToDownloadId(int64_t id);
+int64_t DownloadIdToInt(DownloadId id);
+
+} // namespace history
+
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_DOWNLOAD_TYPES_H_
« no previous file with comments | « components/history/core/browser/download_row.cc ('k') | components/history/core/browser/download_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698