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

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

Issue 19613: Merge 8764 - Add support for UA spoofing, and spoof Safari's UA string when l... (Closed) Base URL: svn://chrome-svn/chrome/branches/release_154.next/src/
Patch Set: Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 referrer_mods.ClearUsername(); 82 referrer_mods.ClearUsername();
83 referrer_mods.ClearPassword(); 83 referrer_mods.ClearPassword();
84 referrer = referrer.ReplaceComponents(referrer_mods); 84 referrer = referrer.ReplaceComponents(referrer_mods);
85 } 85 }
86 86
87 request_info_.url = request_->url(); 87 request_info_.url = request_->url();
88 request_info_.referrer = referrer; 88 request_info_.referrer = referrer;
89 request_info_.method = request_->method(); 89 request_info_.method = request_->method();
90 request_info_.load_flags = request_->load_flags(); 90 request_info_.load_flags = request_->load_flags();
91 91
92 if (request_->context()) 92 if (request_->context()) {
93 request_info_.user_agent = request_->context()->user_agent(); 93 request_info_.user_agent =
94 request_->context()->GetUserAgent(request_->url());
95 }
94 96
95 AddExtraHeaders(); 97 AddExtraHeaders();
96 98
97 StartTransaction(); 99 StartTransaction();
98 } 100 }
99 101
100 void URLRequestHttpJob::Kill() { 102 void URLRequestHttpJob::Kill() {
101 if (!transaction_) 103 if (!transaction_)
102 return; 104 return;
103 105
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 DCHECK(response_cookies_.empty()); 548 DCHECK(response_cookies_.empty());
547 549
548 std::string name = "Set-Cookie"; 550 std::string name = "Set-Cookie";
549 std::string value; 551 std::string value;
550 552
551 void* iter = NULL; 553 void* iter = NULL;
552 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) 554 while (response_info_->headers->EnumerateHeader(&iter, name, &value))
553 response_cookies_.push_back(value); 555 response_cookies_.push_back(value);
554 } 556 }
555 557
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698