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

Side by Side Diff: net/url_request/url_request.cc

Issue 7192016: chrome.experimental.downloads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Bearings Before Woods Created 9 years, 6 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 | Annotate | Revision Log
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 "net/url_request/url_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/stats_counters.h" 10 #include "base/metrics/stats_counters.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 void URLRequest::SetExtraRequestHeaderById(int id, const string& value, 216 void URLRequest::SetExtraRequestHeaderById(int id, const string& value,
217 bool overwrite) { 217 bool overwrite) {
218 DCHECK(!is_pending_); 218 DCHECK(!is_pending_);
219 NOTREACHED() << "implement me!"; 219 NOTREACHED() << "implement me!";
220 } 220 }
221 221
222 void URLRequest::SetExtraRequestHeaderByName(const string& name, 222 void URLRequest::SetExtraRequestHeaderByName(const string& name,
223 const string& value, 223 const string& value,
224 bool overwrite) { 224 bool overwrite) {
225 DCHECK(!is_pending_); 225 DCHECK(!is_pending_);
226 NOTREACHED() << "implement me!"; 226 if (overwrite) {
227 extra_request_headers_.SetHeader(name, value);
228 } else {
229 extra_request_headers_.SetHeaderIfMissing(name, value);
230 }
227 } 231 }
228 232
229 void URLRequest::SetExtraRequestHeaders( 233 void URLRequest::SetExtraRequestHeaders(
230 const HttpRequestHeaders& headers) { 234 const HttpRequestHeaders& headers) {
231 DCHECK(!is_pending_); 235 DCHECK(!is_pending_);
232 extra_request_headers_ = headers; 236 extra_request_headers_ = headers;
233 237
234 // NOTE: This method will likely become non-trivial once the other setters 238 // NOTE: This method will likely become non-trivial once the other setters
235 // for request headers are implemented. 239 // for request headers are implemented.
236 } 240 }
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 if (found != user_data_.end()) 688 if (found != user_data_.end())
685 return found->second.get(); 689 return found->second.get();
686 return NULL; 690 return NULL;
687 } 691 }
688 692
689 void URLRequest::SetUserData(const void* key, UserData* data) { 693 void URLRequest::SetUserData(const void* key, UserData* data) {
690 user_data_[key] = linked_ptr<UserData>(data); 694 user_data_[key] = linked_ptr<UserData>(data);
691 } 695 }
692 696
693 } // namespace net 697 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698