| OLD | NEW |
| 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.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 11 #include "base/stats_counters.h" | 11 #include "base/stats_counters.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/base/upload_data.h" | 15 #include "net/base/upload_data.h" |
| 16 #include "net/url_request/url_request_job.h" | 16 #include "net/url_request/url_request_job.h" |
| 17 #include "net/url_request/url_request_job_manager.h" | 17 #include "net/url_request/url_request_job_manager.h" |
| 18 | 18 |
| 19 #ifndef NDEBUG | 19 #ifndef NDEBUG |
| 20 URLRequestMetrics url_request_metrics; | 20 URLRequestMetrics url_request_metrics; |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 using base::Time; |
| 23 using net::UploadData; | 24 using net::UploadData; |
| 24 using std::string; | 25 using std::string; |
| 25 using std::wstring; | 26 using std::wstring; |
| 26 | 27 |
| 27 // Max number of http redirects to follow. Same number as gecko. | 28 // Max number of http redirects to follow. Same number as gecko. |
| 28 const static int kMaxRedirects = 20; | 29 const static int kMaxRedirects = 20; |
| 29 | 30 |
| 30 static URLRequestJobManager* GetJobManager() { | 31 static URLRequestJobManager* GetJobManager() { |
| 31 return Singleton<URLRequestJobManager>::get(); | 32 return Singleton<URLRequestJobManager>::get(); |
| 32 } | 33 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return net::OK; | 329 return net::OK; |
| 329 } | 330 } |
| 330 | 331 |
| 331 int64 URLRequest::GetExpectedContentSize() const { | 332 int64 URLRequest::GetExpectedContentSize() const { |
| 332 int64 expected_content_size = -1; | 333 int64 expected_content_size = -1; |
| 333 if (job_) | 334 if (job_) |
| 334 expected_content_size = job_->expected_content_size(); | 335 expected_content_size = job_->expected_content_size(); |
| 335 | 336 |
| 336 return expected_content_size; | 337 return expected_content_size; |
| 337 } | 338 } |
| 338 | |
| OLD | NEW |