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

Unified Diff: content/browser/download/save_types.h

Issue 1529363006: Introducing SavePackageId and SaveItemId as distinct IdType<...>-based types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback from Daniel. Created 4 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 | « content/browser/download/save_package.cc ('k') | content/browser/download/save_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_types.h
diff --git a/content/browser/download/save_types.h b/content/browser/download/save_types.h
index 803196fc4269db6b96a32bc36b9d21a95f38dd88..83d890b8dc9e0ddd3964005af048c254e88a800e 100644
--- a/content/browser/download/save_types.h
+++ b/content/browser/download/save_types.h
@@ -13,12 +13,19 @@
#include <vector>
#include "base/files/file_path.h"
+#include "content/common/id_type.h"
#include "url/gurl.h"
namespace content {
+class SavePackage;
+using SavePackageId = IdType32<SavePackage>;
+
+class SaveItem;
+using SaveItemId = IdType32<SaveItem>;
+
// Map from save_item_id into final file path.
-typedef std::map<int, base::FilePath> FinalNamesMap;
+using FinalNamesMap = std::map<SaveItemId, base::FilePath>;
// This structure is used to handle and deliver some info
// when processing each save item job.
@@ -39,8 +46,8 @@ struct SaveFileCreateInfo {
// Constructor for SAVE_FILE_FROM_DOM and/or SAVE_FILE_FROM_FILE.
SaveFileCreateInfo(const base::FilePath& path,
const GURL& url,
- int save_item_id,
- int save_package_id,
+ SaveItemId save_item_id,
+ SavePackageId save_package_id,
int render_process_id,
int render_frame_routing_id,
SaveFileSource save_source);
@@ -48,8 +55,8 @@ struct SaveFileCreateInfo {
// Constructor for SAVE_FILE_FROM_NET case.
SaveFileCreateInfo(const GURL& url,
const GURL& final_url,
- int save_item_id,
- int save_package_id,
+ SaveItemId save_item_id,
+ SavePackageId save_package_id,
int render_process_id,
int render_frame_routing_id,
int request_id,
@@ -66,9 +73,9 @@ struct SaveFileCreateInfo {
// Final URL of the saved resource since some URL might be redirected.
GURL final_url;
// The unique identifier of SaveItem object associated with this job.
- int save_item_id;
+ SaveItemId save_item_id;
// ID of SavePackage object.
- int save_package_id;
+ SavePackageId save_package_id;
// IDs for looking up the contents we are associated with.
int render_process_id;
int render_frame_routing_id;
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/download/save_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698