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

Side by Side Diff: content/public/test/mock_download_manager.cc

Issue 1751603002: [Downloads] Rework how hashes are calculated for download files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try to appease MSVC Created 4 years, 9 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) 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 #include "content/public/test/mock_download_manager.h" 5 #include "content/public/test/mock_download_manager.h"
6 6
7 #include "content/browser/byte_stream.h" 7 #include "content/browser/byte_stream.h"
8 #include "content/browser/download/download_create_info.h" 8 #include "content/browser/download/download_create_info.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( 12 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
13 uint32_t id, 13 uint32_t id,
14 const base::FilePath& current_path, 14 const base::FilePath& current_path,
15 const base::FilePath& target_path, 15 const base::FilePath& target_path,
16 const std::vector<GURL>& url_chain, 16 const std::vector<GURL>& url_chain,
17 const GURL& referrer_url, 17 const GURL& referrer_url,
18 const std::string& mime_type, 18 const std::string& mime_type,
19 const std::string& original_mime_type, 19 const std::string& original_mime_type,
20 const base::Time& start_time, 20 const base::Time& start_time,
21 const base::Time& end_time, 21 const base::Time& end_time,
22 const std::string& etag, 22 const std::string& etag,
23 const std::string& last_modified, 23 const std::string& last_modified,
24 int64_t received_bytes, 24 int64_t received_bytes,
25 int64_t total_bytes, 25 int64_t total_bytes,
26 const std::string& hash,
26 DownloadItem::DownloadState state, 27 DownloadItem::DownloadState state,
27 DownloadDangerType danger_type, 28 DownloadDangerType danger_type,
28 DownloadInterruptReason interrupt_reason, 29 DownloadInterruptReason interrupt_reason,
29 bool opened) 30 bool opened)
30 : id(id), 31 : id(id),
31 current_path(current_path), 32 current_path(current_path),
32 target_path(target_path), 33 target_path(target_path),
33 url_chain(url_chain), 34 url_chain(url_chain),
34 referrer_url(referrer_url), 35 referrer_url(referrer_url),
35 mime_type(mime_type), 36 mime_type(mime_type),
36 original_mime_type(original_mime_type), 37 original_mime_type(original_mime_type),
37 start_time(start_time), 38 start_time(start_time),
38 end_time(end_time), 39 end_time(end_time),
39 received_bytes(received_bytes), 40 received_bytes(received_bytes),
40 total_bytes(total_bytes), 41 total_bytes(total_bytes),
42 hash(hash),
41 state(state), 43 state(state),
42 danger_type(danger_type), 44 danger_type(danger_type),
43 interrupt_reason(interrupt_reason), 45 interrupt_reason(interrupt_reason),
44 opened(opened) {} 46 opened(opened) {}
45 47
46 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter( 48 MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
47 const CreateDownloadItemAdapter& rhs) 49 const CreateDownloadItemAdapter& rhs)
48 : id(rhs.id), 50 : id(rhs.id),
49 current_path(rhs.current_path), 51 current_path(rhs.current_path),
50 target_path(rhs.target_path), 52 target_path(rhs.target_path),
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const std::vector<GURL>& url_chain, 104 const std::vector<GURL>& url_chain,
103 const GURL& referrer_url, 105 const GURL& referrer_url,
104 const std::string& mime_type, 106 const std::string& mime_type,
105 const std::string& original_mime_type, 107 const std::string& original_mime_type,
106 const base::Time& start_time, 108 const base::Time& start_time,
107 const base::Time& end_time, 109 const base::Time& end_time,
108 const std::string& etag, 110 const std::string& etag,
109 const std::string& last_modified, 111 const std::string& last_modified,
110 int64_t received_bytes, 112 int64_t received_bytes,
111 int64_t total_bytes, 113 int64_t total_bytes,
114 const std::string& hash,
112 DownloadItem::DownloadState state, 115 DownloadItem::DownloadState state,
113 DownloadDangerType danger_type, 116 DownloadDangerType danger_type,
114 DownloadInterruptReason interrupt_reason, 117 DownloadInterruptReason interrupt_reason,
115 bool opened) { 118 bool opened) {
116 CreateDownloadItemAdapter adapter( 119 CreateDownloadItemAdapter adapter(id, current_path, target_path, url_chain,
117 id, current_path, target_path, url_chain, referrer_url, mime_type, 120 referrer_url, mime_type, original_mime_type,
118 original_mime_type, start_time, end_time, etag, last_modified, 121 start_time, end_time, etag, last_modified,
119 received_bytes, total_bytes, state, danger_type, interrupt_reason, 122 received_bytes, total_bytes, hash, state,
120 opened); 123 danger_type, interrupt_reason, opened);
121 return MockCreateDownloadItem(adapter); 124 return MockCreateDownloadItem(adapter);
122 } 125 }
123 126
124 } // namespace content 127 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698