| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/browser/download/download_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 info.prompt_user_for_save_location), | 205 info.prompt_user_for_save_location), |
| 206 request_handle_(request_handle), | 206 request_handle_(request_handle), |
| 207 download_id_(info.download_id), | 207 download_id_(info.download_id), |
| 208 full_path_(info.path), | 208 full_path_(info.path), |
| 209 url_chain_(info.url_chain), | 209 url_chain_(info.url_chain), |
| 210 referrer_url_(info.referrer_url), | 210 referrer_url_(info.referrer_url), |
| 211 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), | 211 suggested_filename_(UTF16ToUTF8(info.save_info.suggested_name)), |
| 212 content_disposition_(info.content_disposition), | 212 content_disposition_(info.content_disposition), |
| 213 mime_type_(info.mime_type), | 213 mime_type_(info.mime_type), |
| 214 original_mime_type_(info.original_mime_type), | 214 original_mime_type_(info.original_mime_type), |
| 215 referrer_charset_(info.referrer_charset), | 215 default_charset_(info.default_charset), |
| 216 remote_address_(info.remote_address), | 216 remote_address_(info.remote_address), |
| 217 total_bytes_(info.total_bytes), | 217 total_bytes_(info.total_bytes), |
| 218 received_bytes_(0), | 218 received_bytes_(0), |
| 219 bytes_per_sec_(0), | 219 bytes_per_sec_(0), |
| 220 last_reason_(DOWNLOAD_INTERRUPT_REASON_NONE), | 220 last_reason_(DOWNLOAD_INTERRUPT_REASON_NONE), |
| 221 start_tick_(base::TimeTicks::Now()), | 221 start_tick_(base::TimeTicks::Now()), |
| 222 state_(IN_PROGRESS), | 222 state_(IN_PROGRESS), |
| 223 start_time_(info.start_time), | 223 start_time_(info.start_time), |
| 224 db_handle_(DownloadItem::kUninitializedHandle), | 224 db_handle_(DownloadItem::kUninitializedHandle), |
| 225 delegate_(delegate), | 225 delegate_(delegate), |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 std::string DownloadItemImpl::GetSuggestedFilename() const { | 922 std::string DownloadItemImpl::GetSuggestedFilename() const { |
| 923 return suggested_filename_; | 923 return suggested_filename_; |
| 924 } | 924 } |
| 925 std::string DownloadItemImpl::GetContentDisposition() const { | 925 std::string DownloadItemImpl::GetContentDisposition() const { |
| 926 return content_disposition_; | 926 return content_disposition_; |
| 927 } | 927 } |
| 928 std::string DownloadItemImpl::GetMimeType() const { return mime_type_; } | 928 std::string DownloadItemImpl::GetMimeType() const { return mime_type_; } |
| 929 std::string DownloadItemImpl::GetOriginalMimeType() const { | 929 std::string DownloadItemImpl::GetOriginalMimeType() const { |
| 930 return original_mime_type_; | 930 return original_mime_type_; |
| 931 } | 931 } |
| 932 std::string DownloadItemImpl::GetReferrerCharset() const { | 932 std::string DownloadItemImpl::GetDefaultCharset() const { |
| 933 return referrer_charset_; | 933 return default_charset_; |
| 934 } | 934 } |
| 935 std::string DownloadItemImpl::GetRemoteAddress() const { | 935 std::string DownloadItemImpl::GetRemoteAddress() const { |
| 936 return remote_address_; | 936 return remote_address_; |
| 937 } | 937 } |
| 938 int64 DownloadItemImpl::GetTotalBytes() const { return total_bytes_; } | 938 int64 DownloadItemImpl::GetTotalBytes() const { return total_bytes_; } |
| 939 void DownloadItemImpl::SetTotalBytes(int64 total_bytes) { | 939 void DownloadItemImpl::SetTotalBytes(int64 total_bytes) { |
| 940 total_bytes_ = total_bytes; | 940 total_bytes_ = total_bytes; |
| 941 } | 941 } |
| 942 const std::string& DownloadItemImpl::GetHash() const { return hash_; } | 942 const std::string& DownloadItemImpl::GetHash() const { return hash_; } |
| 943 int64 DownloadItemImpl::GetReceivedBytes() const { return received_bytes_; } | 943 int64 DownloadItemImpl::GetReceivedBytes() const { return received_bytes_; } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 std::map<const void*, ExternalData*>::iterator it = | 1002 std::map<const void*, ExternalData*>::iterator it = |
| 1003 external_data_map_.find(key); | 1003 external_data_map_.find(key); |
| 1004 | 1004 |
| 1005 if (it == external_data_map_.end()) { | 1005 if (it == external_data_map_.end()) { |
| 1006 external_data_map_[key] = data; | 1006 external_data_map_[key] = data; |
| 1007 } else if (it->second != data) { | 1007 } else if (it->second != data) { |
| 1008 delete it->second; | 1008 delete it->second; |
| 1009 it->second = data; | 1009 it->second = data; |
| 1010 } | 1010 } |
| 1011 } | 1011 } |
| OLD | NEW |