| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 method_("GET"), | 41 method_("GET"), |
| 42 load_flags_(net::LOAD_NORMAL), | 42 load_flags_(net::LOAD_NORMAL), |
| 43 delegate_(delegate), | 43 delegate_(delegate), |
| 44 is_pending_(false), | 44 is_pending_(false), |
| 45 user_data_(NULL), | 45 user_data_(NULL), |
| 46 enable_profiling_(false), | 46 enable_profiling_(false), |
| 47 redirect_limit_(kMaxRedirects), | 47 redirect_limit_(kMaxRedirects), |
| 48 final_upload_progress_(0) { | 48 final_upload_progress_(0) { |
| 49 URLREQUEST_COUNT_CTOR(); | 49 URLREQUEST_COUNT_CTOR(); |
| 50 SIMPLE_STATS_COUNTER(L"URLRequestCount"); | 50 SIMPLE_STATS_COUNTER(L"URLRequestCount"); |
| 51 origin_pid_ = process_util::GetCurrentProcId(); | 51 origin_pid_ = base::GetCurrentProcId(); |
| 52 | 52 |
| 53 // Sanity check out environment. | 53 // Sanity check out environment. |
| 54 DCHECK(MessageLoop::current()) << | 54 DCHECK(MessageLoop::current()) << |
| 55 "The current MessageLoop must exist"; | 55 "The current MessageLoop must exist"; |
| 56 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 56 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
| 57 "The current MessageLoop must be TYPE_IO"; | 57 "The current MessageLoop must be TYPE_IO"; |
| 58 } | 58 } |
| 59 | 59 |
| 60 URLRequest::~URLRequest() { | 60 URLRequest::~URLRequest() { |
| 61 URLREQUEST_COUNT_DTOR(); | 61 URLREQUEST_COUNT_DTOR(); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return net::OK; | 329 return net::OK; |
| 330 } | 330 } |
| 331 | 331 |
| 332 int64 URLRequest::GetExpectedContentSize() const { | 332 int64 URLRequest::GetExpectedContentSize() const { |
| 333 int64 expected_content_size = -1; | 333 int64 expected_content_size = -1; |
| 334 if (job_) | 334 if (job_) |
| 335 expected_content_size = job_->expected_content_size(); | 335 expected_content_size = job_->expected_content_size(); |
| 336 | 336 |
| 337 return expected_content_size; | 337 return expected_content_size; |
| 338 } | 338 } |
| OLD | NEW |