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

Unified Diff: net/url_request/url_request.cc

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index b4f9d51f584fb7fb6a6040f06631702ec5b42ff8..10b1b12309112fbd39406bc17e3822ef061153ab 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -182,13 +182,14 @@ void URLRequest::SetExtraRequestHeaderByName(const string& name,
const string& value,
bool overwrite) {
DCHECK(!is_pending_);
- NOTREACHED() << "implement me!";
+ if (!overwrite || !extra_request_headers_.HasHeader(name))
+ extra_request_headers_.SetHeader(name, value);
}
void URLRequest::SetExtraRequestHeaders(
const net::HttpRequestHeaders& headers) {
DCHECK(!is_pending_);
- extra_request_headers_ = headers;
+ extra_request_headers_.MergeFrom(headers);
// NOTE: This method will likely become non-trivial once the other setters
// for request headers are implemented.
« chrome/browser/download/download_file_manager.cc ('K') | « net/base/file_stream_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698