| OLD | NEW |
| 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/url_request/url_request.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if ((load_flags_ & LOAD_IGNORE_LIMITS) != 0) | 422 if ((load_flags_ & LOAD_IGNORE_LIMITS) != 0) |
| 423 SetPriority(MAXIMUM_PRIORITY); | 423 SetPriority(MAXIMUM_PRIORITY); |
| 424 } | 424 } |
| 425 | 425 |
| 426 // static | 426 // static |
| 427 void URLRequest::SetDefaultCookiePolicyToBlock() { | 427 void URLRequest::SetDefaultCookiePolicyToBlock() { |
| 428 CHECK(!g_url_requests_started); | 428 CHECK(!g_url_requests_started); |
| 429 g_default_can_use_cookies = false; | 429 g_default_can_use_cookies = false; |
| 430 } | 430 } |
| 431 | 431 |
| 432 // TODO(mgersh): remove this and fix remaining callers once HttpProtocolHandler |
| 433 // exists |
| 432 // static | 434 // static |
| 433 bool URLRequest::IsHandledProtocol(const std::string& scheme) { | 435 bool URLRequest::IsHandledProtocol(const std::string& scheme) { |
| 434 return URLRequestJobManager::SupportsScheme(scheme); | 436 return URLRequestJobManager::SupportsScheme(scheme); |
| 435 } | 437 } |
| 436 | 438 |
| 437 // static | |
| 438 bool URLRequest::IsHandledURL(const GURL& url) { | |
| 439 if (!url.is_valid()) { | |
| 440 // We handle error cases. | |
| 441 return true; | |
| 442 } | |
| 443 | |
| 444 return IsHandledProtocol(url.scheme()); | |
| 445 } | |
| 446 | |
| 447 void URLRequest::set_first_party_for_cookies( | 439 void URLRequest::set_first_party_for_cookies( |
| 448 const GURL& first_party_for_cookies) { | 440 const GURL& first_party_for_cookies) { |
| 449 DCHECK(!is_pending_); | 441 DCHECK(!is_pending_); |
| 450 first_party_for_cookies_ = first_party_for_cookies; | 442 first_party_for_cookies_ = first_party_for_cookies; |
| 451 } | 443 } |
| 452 | 444 |
| 453 void URLRequest::set_first_party_url_policy( | 445 void URLRequest::set_first_party_url_policy( |
| 454 FirstPartyURLPolicy first_party_url_policy) { | 446 FirstPartyURLPolicy first_party_url_policy) { |
| 455 DCHECK(!is_pending_); | 447 DCHECK(!is_pending_); |
| 456 first_party_url_policy_ = first_party_url_policy; | 448 first_party_url_policy_ = first_party_url_policy; |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 } | 1192 } |
| 1201 | 1193 |
| 1202 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1194 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 1203 if (job_) | 1195 if (job_) |
| 1204 job_->GetConnectionAttempts(out); | 1196 job_->GetConnectionAttempts(out); |
| 1205 else | 1197 else |
| 1206 out->clear(); | 1198 out->clear(); |
| 1207 } | 1199 } |
| 1208 | 1200 |
| 1209 } // namespace net | 1201 } // namespace net |
| OLD | NEW |