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

Side by Side Diff: net/proxy/proxy_script_fetcher_impl.cc

Issue 10873056: Added URLRequestContext::CreateRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed android bug Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/test/spawner_communicator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/proxy/proxy_script_fetcher_impl.h" 5 #include "net/proxy/proxy_script_fetcher_impl.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/i18n/icu_string_conversions.h" 8 #include "base/i18n/icu_string_conversions.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 std::string mime_type; 127 std::string mime_type;
128 std::string charset; 128 std::string charset;
129 std::string data; 129 std::string data;
130 if (!DataURL::Parse(url, &mime_type, &charset, &data)) 130 if (!DataURL::Parse(url, &mime_type, &charset, &data))
131 return ERR_FAILED; 131 return ERR_FAILED;
132 132
133 ConvertResponseToUTF16(charset, data, text); 133 ConvertResponseToUTF16(charset, data, text);
134 return OK; 134 return OK;
135 } 135 }
136 136
137 cur_request_.reset(new URLRequest(url, this, url_request_context_)); 137 cur_request_.reset(url_request_context_->CreateRequest(url, this));
138 cur_request_->set_method("GET"); 138 cur_request_->set_method("GET");
139 139
140 // Make sure that the PAC script is downloaded using a direct connection, 140 // Make sure that the PAC script is downloaded using a direct connection,
141 // to avoid circular dependencies (fetching is a part of proxy resolution). 141 // to avoid circular dependencies (fetching is a part of proxy resolution).
142 // Also disable the use of the disk cache. The cache is disabled so that if 142 // Also disable the use of the disk cache. The cache is disabled so that if
143 // the user switches networks we don't potentially use the cached response 143 // the user switches networks we don't potentially use the cached response
144 // from old network when we should in fact be re-fetching on the new network. 144 // from old network when we should in fact be re-fetching on the new network.
145 // If the PAC script is hosted on an HTTPS server we bypass revocation 145 // If the PAC script is hosted on an HTTPS server we bypass revocation
146 // checking in order to avoid a circular dependency when attempting to fetch 146 // checking in order to avoid a circular dependency when attempting to fetch
147 // the OCSP response or CRL. We could make the revocation check go direct but 147 // the OCSP response or CRL. We could make the revocation check go direct but
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // is still applicable. 312 // is still applicable.
313 if (cur_request_id_ != id) 313 if (cur_request_id_ != id)
314 return; 314 return;
315 315
316 DCHECK(cur_request_.get()); 316 DCHECK(cur_request_.get());
317 result_code_ = ERR_TIMED_OUT; 317 result_code_ = ERR_TIMED_OUT;
318 cur_request_->Cancel(); 318 cur_request_->Cancel();
319 } 319 }
320 320
321 } // namespace net 321 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/test/spawner_communicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698