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

Side by Side Diff: net/url_request/url_request_inet_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, 11 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_inet_job.h" 5 #include "net/url_request/url_request_inet_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 URLRequestInetJob::URLRequestInetJob(URLRequest* request) 82 URLRequestInetJob::URLRequestInetJob(URLRequest* request)
83 : URLRequestJob(request), 83 : URLRequestJob(request),
84 connection_handle_(NULL), 84 connection_handle_(NULL),
85 request_handle_(NULL), 85 request_handle_(NULL),
86 last_error_(ERROR_SUCCESS), 86 last_error_(ERROR_SUCCESS),
87 is_waiting_(false), 87 is_waiting_(false),
88 read_in_progress_(false) { 88 read_in_progress_(false) {
89 // TODO(darin): we should re-create the internet if the UA string changes, 89 // TODO(darin): we should re-create the internet if the UA string changes,
90 // but we have to be careful about existing users of this internet. 90 // but we have to be careful about existing users of this internet.
91 if (!the_internet_) { 91 if (!the_internet_) {
92 InitializeTheInternet( 92 InitializeTheInternet(request->context() ?
93 request->context() ? request->context()->user_agent() : std::string()); 93 request->context()->GetUserAgent(GURL()) : std::string());
94 } 94 }
95 #ifndef NDEBUG 95 #ifndef NDEBUG
96 DCHECK(MessageLoop::current() == my_message_loop_) << 96 DCHECK(MessageLoop::current() == my_message_loop_) <<
97 "All URLRequests should happen on the same thread"; 97 "All URLRequests should happen on the same thread";
98 #endif 98 #endif
99 } 99 }
100 100
101 URLRequestInetJob::~URLRequestInetJob() { 101 URLRequestInetJob::~URLRequestInetJob() {
102 DCHECK(!request_) << "request should be detached at this point"; 102 DCHECK(!request_) << "request should be detached at this point";
103 103
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 // TODO(darin): This is probably a security problem. Do something better. 427 // TODO(darin): This is probably a security problem. Do something better.
428 ResumeSuspendedDownload(handle, 0); 428 ResumeSuspendedDownload(handle, 0);
429 break; 429 break;
430 } 430 }
431 431
432 if (message) 432 if (message)
433 PostMessage(URLRequestInetJob::message_hwnd_, message, 433 PostMessage(URLRequestInetJob::message_hwnd_, message,
434 static_cast<WPARAM>(job_id), message_param); 434 static_cast<WPARAM>(job_id), message_param);
435 } 435 }
436 436
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698