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

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

Issue 19025: Add support for UA spoofing, and spoof Safari's UA string when loading URLs... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 : URLRequestJob(request), 76 : URLRequestJob(request),
77 connection_handle_(NULL), 77 connection_handle_(NULL),
78 request_handle_(NULL), 78 request_handle_(NULL),
79 last_error_(ERROR_SUCCESS), 79 last_error_(ERROR_SUCCESS),
80 is_waiting_(false), 80 is_waiting_(false),
81 read_in_progress_(false), 81 read_in_progress_(false),
82 loop_(MessageLoop::current()) { 82 loop_(MessageLoop::current()) {
83 // TODO(darin): we should re-create the internet if the UA string changes, 83 // TODO(darin): we should re-create the internet if the UA string changes,
84 // but we have to be careful about existing users of this internet. 84 // but we have to be careful about existing users of this internet.
85 if (!the_internet_) { 85 if (!the_internet_) {
86 InitializeTheInternet( 86 InitializeTheInternet(request->context() ?
wtc 2009/01/27 19:19:24 Nit: there is a lint error in one of these lines (
87 request->context() ? request->context()->user_agent() : std::string()); 87 request->context()->GetUserAgent(GURL()) : std::string());
88 } 88 }
89 #ifndef NDEBUG 89 #ifndef NDEBUG
90 DCHECK(MessageLoop::current() == my_message_loop_) << 90 DCHECK(MessageLoop::current() == my_message_loop_) <<
91 "All URLRequests should happen on the same thread"; 91 "All URLRequests should happen on the same thread";
92 #endif 92 #endif
93 } 93 }
94 94
95 URLRequestInetJob::~URLRequestInetJob() { 95 URLRequestInetJob::~URLRequestInetJob() {
96 DCHECK(!request_) << "request should be detached at this point"; 96 DCHECK(!request_) << "request should be detached at this point";
97 97
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 break; 371 break;
372 } 372 }
373 case INTERNET_STATUS_USER_INPUT_REQUIRED: 373 case INTERNET_STATUS_USER_INPUT_REQUIRED:
374 case INTERNET_STATUS_STATE_CHANGE: 374 case INTERNET_STATUS_STATE_CHANGE:
375 // TODO(darin): This is probably a security problem. Do something better. 375 // TODO(darin): This is probably a security problem. Do something better.
376 ResumeSuspendedDownload(handle, 0); 376 ResumeSuspendedDownload(handle, 0);
377 break; 377 break;
378 } 378 }
379 } 379 }
380 380
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698