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

Side by Side Diff: content/browser/download/download_item_impl.cc

Issue 102683004: Add mime type information to the download database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // File method ordering: Methods in this file are in the same order as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // The maximum number of attempts we will make to resume automatically. 95 // The maximum number of attempts we will make to resume automatically.
96 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5; 96 const int DownloadItemImpl::kMaxAutoResumeAttempts = 5;
97 97
98 // Constructor for reading from the history service. 98 // Constructor for reading from the history service.
99 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate, 99 DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate,
100 uint32 download_id, 100 uint32 download_id,
101 const base::FilePath& current_path, 101 const base::FilePath& current_path,
102 const base::FilePath& target_path, 102 const base::FilePath& target_path,
103 const std::vector<GURL>& url_chain, 103 const std::vector<GURL>& url_chain,
104 const GURL& referrer_url, 104 const GURL& referrer_url,
105 const std::string& mime_type,
106 const std::string& original_mime_type,
105 const base::Time& start_time, 107 const base::Time& start_time,
106 const base::Time& end_time, 108 const base::Time& end_time,
107 const std::string& etag, 109 const std::string& etag,
108 const std::string& last_modified, 110 const std::string& last_modified,
109 int64 received_bytes, 111 int64 received_bytes,
110 int64 total_bytes, 112 int64 total_bytes,
111 DownloadItem::DownloadState state, 113 DownloadItem::DownloadState state,
112 DownloadDangerType danger_type, 114 DownloadDangerType danger_type,
113 DownloadInterruptReason interrupt_reason, 115 DownloadInterruptReason interrupt_reason,
114 bool opened, 116 bool opened,
115 const net::BoundNetLog& bound_net_log) 117 const net::BoundNetLog& bound_net_log)
116 : is_save_package_download_(false), 118 : is_save_package_download_(false),
117 download_id_(download_id), 119 download_id_(download_id),
118 current_path_(current_path), 120 current_path_(current_path),
119 target_path_(target_path), 121 target_path_(target_path),
120 target_disposition_(TARGET_DISPOSITION_OVERWRITE), 122 target_disposition_(TARGET_DISPOSITION_OVERWRITE),
121 url_chain_(url_chain), 123 url_chain_(url_chain),
122 referrer_url_(referrer_url), 124 referrer_url_(referrer_url),
123 transition_type_(PAGE_TRANSITION_LINK), 125 transition_type_(PAGE_TRANSITION_LINK),
124 has_user_gesture_(false), 126 has_user_gesture_(false),
127 mime_type_(mime_type),
128 original_mime_type_(original_mime_type),
125 total_bytes_(total_bytes), 129 total_bytes_(total_bytes),
126 received_bytes_(received_bytes), 130 received_bytes_(received_bytes),
127 bytes_per_sec_(0), 131 bytes_per_sec_(0),
128 last_modified_time_(last_modified), 132 last_modified_time_(last_modified),
129 etag_(etag), 133 etag_(etag),
130 last_reason_(interrupt_reason), 134 last_reason_(interrupt_reason),
131 start_tick_(base::TimeTicks()), 135 start_tick_(base::TimeTicks()),
132 state_(ExternalToInternalState(state)), 136 state_(ExternalToInternalState(state)),
133 danger_type_(danger_type), 137 danger_type_(danger_type),
134 start_time_(start_time), 138 start_time_(start_time),
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 case RESUME_MODE_USER_CONTINUE: 1708 case RESUME_MODE_USER_CONTINUE:
1705 return "USER_CONTINUE"; 1709 return "USER_CONTINUE";
1706 case RESUME_MODE_USER_RESTART: 1710 case RESUME_MODE_USER_RESTART:
1707 return "USER_RESTART"; 1711 return "USER_RESTART";
1708 } 1712 }
1709 NOTREACHED() << "Unknown resume mode " << mode; 1713 NOTREACHED() << "Unknown resume mode " << mode;
1710 return "unknown"; 1714 return "unknown";
1711 } 1715 }
1712 1716
1713 } // namespace content 1717 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698