| OLD | NEW |
| 1 // Copyright (c) 2011 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 #include "content/browser/download/download_create_info.h" | 5 #include "content/browser/download/download_create_info.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| 11 | 11 |
| 12 using content::DownloadId; | 12 using content::DownloadId; |
| 13 | 13 |
| 14 DownloadCreateInfo::DownloadCreateInfo( | 14 DownloadCreateInfo::DownloadCreateInfo( |
| 15 const FilePath& path, | 15 const FilePath& path, |
| 16 const GURL& url, | 16 const GURL& url, |
| 17 const base::Time& start_time, | 17 const base::Time& start_time, |
| 18 int64 received_bytes, | 18 int64 received_bytes, |
| 19 int64 total_bytes, | 19 int64 total_bytes, |
| 20 int32 state, | 20 int32 state, |
| 21 const net::BoundNetLog& bound_net_log, |
| 21 bool has_user_gesture, | 22 bool has_user_gesture, |
| 22 content::PageTransition transition_type) | 23 content::PageTransition transition_type) |
| 23 : path(path), | 24 : path(path), |
| 24 url_chain(1, url), | 25 url_chain(1, url), |
| 25 start_time(start_time), | 26 start_time(start_time), |
| 26 received_bytes(received_bytes), | 27 received_bytes(received_bytes), |
| 27 total_bytes(total_bytes), | 28 total_bytes(total_bytes), |
| 28 state(state), | 29 state(state), |
| 29 download_id(DownloadId::Invalid()), | 30 download_id(DownloadId::Invalid()), |
| 30 has_user_gesture(has_user_gesture), | 31 has_user_gesture(has_user_gesture), |
| 31 transition_type(transition_type), | 32 transition_type(transition_type), |
| 32 db_handle(0), | 33 db_handle(0), |
| 33 prompt_user_for_save_location(false) { | 34 prompt_user_for_save_location(false), |
| 35 request_bound_net_log(bound_net_log) { |
| 34 } | 36 } |
| 35 | 37 |
| 36 DownloadCreateInfo::DownloadCreateInfo() | 38 DownloadCreateInfo::DownloadCreateInfo() |
| 37 : received_bytes(0), | 39 : received_bytes(0), |
| 38 total_bytes(0), | 40 total_bytes(0), |
| 39 state(-1), | 41 state(-1), |
| 40 download_id(DownloadId::Invalid()), | 42 download_id(DownloadId::Invalid()), |
| 41 has_user_gesture(false), | 43 has_user_gesture(false), |
| 42 transition_type(content::PAGE_TRANSITION_LINK), | 44 transition_type(content::PAGE_TRANSITION_LINK), |
| 43 db_handle(0), | 45 db_handle(0), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 60 url().spec().c_str(), | 62 url().spec().c_str(), |
| 61 path.value().c_str(), | 63 path.value().c_str(), |
| 62 received_bytes, | 64 received_bytes, |
| 63 total_bytes, | 65 total_bytes, |
| 64 prompt_user_for_save_location ? 'T' : 'F'); | 66 prompt_user_for_save_location ? 'T' : 'F'); |
| 65 } | 67 } |
| 66 | 68 |
| 67 const GURL& DownloadCreateInfo::url() const { | 69 const GURL& DownloadCreateInfo::url() const { |
| 68 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); | 70 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
| 69 } | 71 } |
| OLD | NEW |