OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/history/download_history_info.h" |
| 6 |
| 7 #include "chrome/browser/download/download_item.h" |
| 8 |
| 9 DownloadHistoryInfo::DownloadHistoryInfo() |
| 10 : download_id(-1), |
| 11 received_bytes(0), |
| 12 total_bytes(0), |
| 13 state(0), |
| 14 db_handle(0) { |
| 15 } |
| 16 |
| 17 DownloadHistoryInfo::DownloadHistoryInfo(const std::vector<GURL>& urls, |
| 18 const GURL& referrer, |
| 19 int64 total_bytes) |
| 20 : download_id(-1), |
| 21 url_chain(urls), |
| 22 referrer_url(referrer), |
| 23 start_time(base::Time::Now()), |
| 24 received_bytes(0), |
| 25 total_bytes(total_bytes), |
| 26 state(0), |
| 27 db_handle(0) { |
| 28 } |
| 29 |
| 30 DownloadHistoryInfo::DownloadHistoryInfo(const FilePath& path, |
| 31 const GURL& url, |
| 32 const base::Time& start, |
| 33 int64 received, |
| 34 int64 total, |
| 35 int32 download_state) |
| 36 : download_id(1), |
| 37 path(path), |
| 38 url_chain(1, url), |
| 39 start_time(start), |
| 40 received_bytes(received), |
| 41 total_bytes(total), |
| 42 state(download_state), |
| 43 db_handle(0) { |
| 44 } |
| 45 |
| 46 DownloadHistoryInfo::DownloadHistoryInfo(const FilePath& path, |
| 47 const std::vector<GURL>& url, |
| 48 const GURL& referrer, |
| 49 const base::Time& start, |
| 50 int64 received, |
| 51 int64 total, |
| 52 int32 download_state, |
| 53 int64 handle, |
| 54 int32 id) |
| 55 : download_id(id), |
| 56 path(path), |
| 57 url_chain(url), |
| 58 referrer_url(referrer), |
| 59 start_time(start), |
| 60 received_bytes(received), |
| 61 total_bytes(total), |
| 62 state(download_state), |
| 63 db_handle(handle) { |
| 64 } |
| 65 |
| 66 const GURL& DownloadHistoryInfo::url() const { |
| 67 return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
| 68 } |
OLD | NEW |