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

Side by Side Diff: components/history/core/browser/download_row.cc

Issue 2665243003: add a download slices table into history download db (Closed)
Patch Set: add test file to BUILD.gn Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 "components/history/core/browser/download_row.h" 5 #include "components/history/core/browser/download_row.h"
6 6
7 #include "components/history/core/browser/download_constants.h" 7 #include "components/history/core/browser/download_constants.h"
8 8
9 namespace history { 9 namespace history {
10 10
11 DownloadRow::DownloadRow() 11 DownloadRow::DownloadRow()
12 : received_bytes(0), 12 : received_bytes(0),
13 total_bytes(0), 13 total_bytes(0),
14 state(DownloadState::IN_PROGRESS), 14 state(DownloadState::IN_PROGRESS),
15 danger_type(DownloadDangerType::NOT_DANGEROUS), 15 danger_type(DownloadDangerType::NOT_DANGEROUS),
16 interrupt_reason(0), 16 interrupt_reason(0),
17 id(kInvalidDownloadId), 17 id(kInvalidDownloadId),
18 opened(false) { 18 opened(false) {
19 // |interrupt_reason| is left undefined by this constructor as the value 19 // |interrupt_reason| is left undefined by this constructor as the value
20 // has no meaning unless |state| is equal to kStateInterrupted. 20 // has no meaning unless |state| is equal to kStateInterrupted.
21 } 21 }
22 22
23 DownloadRow::DownloadRow(const base::FilePath& current_path, 23 DownloadRow::DownloadRow(
24 const base::FilePath& target_path, 24 const base::FilePath& current_path,
25 const std::vector<GURL>& url_chain, 25 const base::FilePath& target_path,
26 const GURL& referrer_url, 26 const std::vector<GURL>& url_chain,
27 const GURL& site_url, 27 const GURL& referrer_url,
28 const GURL& tab_url, 28 const GURL& site_url,
29 const GURL& tab_referrer_url, 29 const GURL& tab_url,
30 const std::string& http_method, 30 const GURL& tab_referrer_url,
31 const std::string& mime_type, 31 const std::string& http_method,
32 const std::string& original_mime_type, 32 const std::string& mime_type,
33 const base::Time& start, 33 const std::string& original_mime_type,
34 const base::Time& end, 34 const base::Time& start,
35 const std::string& etag, 35 const base::Time& end,
36 const std::string& last_modified, 36 const std::string& etag,
37 int64_t received, 37 const std::string& last_modified,
38 int64_t total, 38 int64_t received,
39 DownloadState download_state, 39 int64_t total,
40 DownloadDangerType danger_type, 40 DownloadState download_state,
41 DownloadInterruptReason interrupt_reason, 41 DownloadDangerType danger_type,
42 const std::string& hash, 42 DownloadInterruptReason interrupt_reason,
43 DownloadId id, 43 const std::string& hash,
44 const std::string& guid, 44 DownloadId id,
45 bool download_opened, 45 const std::string& guid,
46 const std::string& ext_id, 46 bool download_opened,
47 const std::string& ext_name) 47 const std::string& ext_id,
48 const std::string& ext_name,
49 const std::vector<DownloadSliceInfo>& download_slice_info)
48 : current_path(current_path), 50 : current_path(current_path),
49 target_path(target_path), 51 target_path(target_path),
50 url_chain(url_chain), 52 url_chain(url_chain),
51 referrer_url(referrer_url), 53 referrer_url(referrer_url),
52 site_url(site_url), 54 site_url(site_url),
53 tab_url(tab_url), 55 tab_url(tab_url),
54 tab_referrer_url(tab_referrer_url), 56 tab_referrer_url(tab_referrer_url),
55 http_method(http_method), 57 http_method(http_method),
56 mime_type(mime_type), 58 mime_type(mime_type),
57 original_mime_type(original_mime_type), 59 original_mime_type(original_mime_type),
58 start_time(start), 60 start_time(start),
59 end_time(end), 61 end_time(end),
60 etag(etag), 62 etag(etag),
61 last_modified(last_modified), 63 last_modified(last_modified),
62 received_bytes(received), 64 received_bytes(received),
63 total_bytes(total), 65 total_bytes(total),
64 state(download_state), 66 state(download_state),
65 danger_type(danger_type), 67 danger_type(danger_type),
66 interrupt_reason(interrupt_reason), 68 interrupt_reason(interrupt_reason),
67 hash(hash), 69 hash(hash),
68 id(id), 70 id(id),
69 guid(guid), 71 guid(guid),
70 opened(download_opened), 72 opened(download_opened),
71 by_ext_id(ext_id), 73 by_ext_id(ext_id),
72 by_ext_name(ext_name) {} 74 by_ext_name(ext_name),
75 download_slice_info(download_slice_info) {}
73 76
74 DownloadRow::DownloadRow(const DownloadRow& other) = default; 77 DownloadRow::DownloadRow(const DownloadRow& other) = default;
75 78
76 DownloadRow::~DownloadRow() {} 79 DownloadRow::~DownloadRow() {}
77 80
78 bool DownloadRow::operator==(const DownloadRow& rhs) const { 81 bool DownloadRow::operator==(const DownloadRow& rhs) const {
79 return current_path == rhs.current_path && target_path == rhs.target_path && 82 return current_path == rhs.current_path && target_path == rhs.target_path &&
80 url_chain == rhs.url_chain && referrer_url == rhs.referrer_url && 83 url_chain == rhs.url_chain && referrer_url == rhs.referrer_url &&
81 site_url == rhs.site_url && tab_url == rhs.tab_url && 84 site_url == rhs.site_url && tab_url == rhs.tab_url &&
82 tab_referrer_url == rhs.tab_referrer_url && 85 tab_referrer_url == rhs.tab_referrer_url &&
83 http_method == rhs.http_method && mime_type == rhs.mime_type && 86 http_method == rhs.http_method && mime_type == rhs.mime_type &&
84 original_mime_type == rhs.original_mime_type && 87 original_mime_type == rhs.original_mime_type &&
85 start_time == rhs.start_time && end_time == rhs.end_time && 88 start_time == rhs.start_time && end_time == rhs.end_time &&
86 etag == rhs.etag && last_modified == rhs.last_modified && 89 etag == rhs.etag && last_modified == rhs.last_modified &&
87 received_bytes == rhs.received_bytes && 90 received_bytes == rhs.received_bytes &&
88 total_bytes == rhs.total_bytes && state == rhs.state && 91 total_bytes == rhs.total_bytes && state == rhs.state &&
89 danger_type == rhs.danger_type && 92 danger_type == rhs.danger_type &&
90 interrupt_reason == rhs.interrupt_reason && hash == rhs.hash && 93 interrupt_reason == rhs.interrupt_reason && hash == rhs.hash &&
91 id == rhs.id && guid == rhs.guid && opened == rhs.opened && 94 id == rhs.id && guid == rhs.guid && opened == rhs.opened &&
92 by_ext_id == rhs.by_ext_id && by_ext_name == rhs.by_ext_name; 95 by_ext_id == rhs.by_ext_id && by_ext_name == rhs.by_ext_name &&
96 download_slice_info == rhs.download_slice_info;
93 } 97 }
94 98
95 } // namespace history 99 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/download_row.h ('k') | components/history/core/browser/download_slice_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698