Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 bool URLRequest::IsHandledURL(const GURL& url) { | 330 bool URLRequest::IsHandledURL(const GURL& url) { |
| 331 if (!url.is_valid()) { | 331 if (!url.is_valid()) { |
| 332 // We handle error cases. | 332 // We handle error cases. |
| 333 return true; | 333 return true; |
| 334 } | 334 } |
| 335 | 335 |
| 336 return IsHandledProtocol(url.scheme()); | 336 return IsHandledProtocol(url.scheme()); |
| 337 } | 337 } |
| 338 | 338 |
| 339 // static | 339 // static |
| 340 void URLRequest::AllowFileAccess() { | 340 void URLRequest::AllowAccessToAllFiles() { |
| 341 URLRequestJobManager::GetInstance()->set_enable_file_access(true); | 341 URLRequestJobManager::GetInstance()->set_file_access_allowed(true); |
| 342 } | 342 } |
| 343 | 343 |
| 344 // static | 344 bool URLRequest::IsFileAccessAllowed(const FilePath& path) { |
| 345 bool URLRequest::IsFileAccessAllowed() { | 345 if (URLRequestJobManager::GetInstance()->file_access_allowed()) |
|
willchan no longer on Chromium
2012/04/19 21:12:24
From what I can tell, all this code was added pure
Greg Spencer (Chromium)
2012/04/20 00:05:54
Yeah, you're right. I've moved almost all of it e
willchan no longer on Chromium
2012/04/20 00:14:03
Can you get rid of that and just set a NetworkDele
Greg Spencer (Chromium)
2012/04/20 19:21:28
Duh, that would be better. :-) Done.
| |
| 346 return URLRequestJobManager::GetInstance()->enable_file_access(); | 346 return true; |
| 347 if (context_ && context_->network_delegate()) | |
| 348 return context_->network_delegate()->NotifyFileAccessRequested(this, path); | |
| 349 return false; | |
| 347 } | 350 } |
| 348 | 351 |
| 349 void URLRequest::set_first_party_for_cookies( | 352 void URLRequest::set_first_party_for_cookies( |
| 350 const GURL& first_party_for_cookies) { | 353 const GURL& first_party_for_cookies) { |
| 351 first_party_for_cookies_ = first_party_for_cookies; | 354 first_party_for_cookies_ = first_party_for_cookies; |
| 352 } | 355 } |
| 353 | 356 |
| 354 void URLRequest::set_method(const std::string& method) { | 357 void URLRequest::set_method(const std::string& method) { |
| 355 DCHECK(!is_pending_); | 358 DCHECK(!is_pending_); |
| 356 method_ = method; | 359 method_ = method; |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 876 | 879 |
| 877 void URLRequest::SetUnblockedOnDelegate() { | 880 void URLRequest::SetUnblockedOnDelegate() { |
| 878 if (!blocked_on_delegate_) | 881 if (!blocked_on_delegate_) |
| 879 return; | 882 return; |
| 880 blocked_on_delegate_ = false; | 883 blocked_on_delegate_ = false; |
| 881 load_state_param_.clear(); | 884 load_state_param_.clear(); |
| 882 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); | 885 net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL); |
| 883 } | 886 } |
| 884 | 887 |
| 885 } // namespace net | 888 } // namespace net |
| OLD | NEW |