OLD | NEW |
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/browser/download/download_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 "Range", | 94 "Range", |
95 base::StringPrintf("bytes=%" PRId64 "-", params->offset()), | 95 base::StringPrintf("bytes=%" PRId64 "-", params->offset()), |
96 true); | 96 true); |
97 | 97 |
98 if (has_last_modified) { | 98 if (has_last_modified) { |
99 request->SetExtraRequestHeaderByName("If-Unmodified-Since", | 99 request->SetExtraRequestHeaderByName("If-Unmodified-Since", |
100 params->last_modified(), | 100 params->last_modified(), |
101 true); | 101 true); |
102 } | 102 } |
103 if (has_etag) { | 103 if (has_etag) { |
104 request->SetExtraRequestHeaderByName("If-Match", params->etag(), true); | 104 request->SetExtraRequestHeaderByName("If-Range", params->etag(), true); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 for (DownloadUrlParameters::RequestHeadersType::const_iterator iter | 108 for (DownloadUrlParameters::RequestHeadersType::const_iterator iter |
109 = params->request_headers_begin(); | 109 = params->request_headers_begin(); |
110 iter != params->request_headers_end(); | 110 iter != params->request_headers_end(); |
111 ++iter) { | 111 ++iter) { |
112 request->SetExtraRequestHeaderByName( | 112 request->SetExtraRequestHeaderByName( |
113 iter->first, iter->second, false /*overwrite*/); | 113 iter->first, iter->second, false /*overwrite*/); |
114 } | 114 } |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 if (delegate_) | 749 if (delegate_) |
750 delegate_->OpenDownload(download); | 750 delegate_->OpenDownload(download); |
751 } | 751 } |
752 | 752 |
753 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 753 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
754 if (delegate_) | 754 if (delegate_) |
755 delegate_->ShowDownloadInShell(download); | 755 delegate_->ShowDownloadInShell(download); |
756 } | 756 } |
757 | 757 |
758 } // namespace content | 758 } // namespace content |
OLD | NEW |