| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 if ((load_flags_ & LOAD_IGNORE_LIMITS) != 0) | 434 if ((load_flags_ & LOAD_IGNORE_LIMITS) != 0) |
| 435 SetPriority(MAXIMUM_PRIORITY); | 435 SetPriority(MAXIMUM_PRIORITY); |
| 436 } | 436 } |
| 437 | 437 |
| 438 // static | 438 // static |
| 439 void URLRequest::SetDefaultCookiePolicyToBlock() { | 439 void URLRequest::SetDefaultCookiePolicyToBlock() { |
| 440 CHECK(!g_url_requests_started); | 440 CHECK(!g_url_requests_started); |
| 441 g_default_can_use_cookies = false; | 441 g_default_can_use_cookies = false; |
| 442 } | 442 } |
| 443 | 443 |
| 444 // static | |
| 445 bool URLRequest::IsHandledProtocol(const std::string& scheme) { | |
| 446 return URLRequestJobManager::SupportsScheme(scheme); | |
| 447 } | |
| 448 | |
| 449 // static | |
| 450 bool URLRequest::IsHandledURL(const GURL& url) { | |
| 451 if (!url.is_valid()) { | |
| 452 // We handle error cases. | |
| 453 return true; | |
| 454 } | |
| 455 | |
| 456 return IsHandledProtocol(url.scheme()); | |
| 457 } | |
| 458 | |
| 459 void URLRequest::set_first_party_for_cookies( | 444 void URLRequest::set_first_party_for_cookies( |
| 460 const GURL& first_party_for_cookies) { | 445 const GURL& first_party_for_cookies) { |
| 461 DCHECK(!is_pending_); | 446 DCHECK(!is_pending_); |
| 462 first_party_for_cookies_ = first_party_for_cookies; | 447 first_party_for_cookies_ = first_party_for_cookies; |
| 463 } | 448 } |
| 464 | 449 |
| 465 void URLRequest::set_first_party_url_policy( | 450 void URLRequest::set_first_party_url_policy( |
| 466 FirstPartyURLPolicy first_party_url_policy) { | 451 FirstPartyURLPolicy first_party_url_policy) { |
| 467 DCHECK(!is_pending_); | 452 DCHECK(!is_pending_); |
| 468 first_party_url_policy_ = first_party_url_policy; | 453 first_party_url_policy_ = first_party_url_policy; |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 out->clear(); | 1208 out->clear(); |
| 1224 } | 1209 } |
| 1225 | 1210 |
| 1226 void URLRequest::set_status(URLRequestStatus status) { | 1211 void URLRequest::set_status(URLRequestStatus status) { |
| 1227 DCHECK(status_.is_io_pending() || status_.is_success() || | 1212 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1228 (!status.is_success() && !status.is_io_pending())); | 1213 (!status.is_success() && !status.is_io_pending())); |
| 1229 status_ = status; | 1214 status_ = status; |
| 1230 } | 1215 } |
| 1231 | 1216 |
| 1232 } // namespace net | 1217 } // namespace net |
| OLD | NEW |