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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 original_url_(url), | 42 original_url_(url), |
43 method_("GET"), | 43 method_("GET"), |
44 load_flags_(net::LOAD_NORMAL), | 44 load_flags_(net::LOAD_NORMAL), |
45 delegate_(delegate), | 45 delegate_(delegate), |
46 is_pending_(false), | 46 is_pending_(false), |
47 user_data_(NULL), | 47 user_data_(NULL), |
48 enable_profiling_(false), | 48 enable_profiling_(false), |
49 redirect_limit_(kMaxRedirects), | 49 redirect_limit_(kMaxRedirects), |
50 final_upload_progress_(0) { | 50 final_upload_progress_(0) { |
51 URLREQUEST_COUNT_CTOR(); | 51 URLREQUEST_COUNT_CTOR(); |
52 SIMPLE_STATS_COUNTER(L"URLRequestCount"); | 52 SIMPLE_STATS_COUNTER("URLRequestCount"); |
53 origin_pid_ = base::GetCurrentProcId(); | 53 origin_pid_ = base::GetCurrentProcId(); |
54 | 54 |
55 // Sanity check out environment. | 55 // Sanity check out environment. |
56 DCHECK(MessageLoop::current()) << | 56 DCHECK(MessageLoop::current()) << |
57 "The current MessageLoop must exist"; | 57 "The current MessageLoop must exist"; |
58 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << | 58 DCHECK_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()) << |
59 "The current MessageLoop must be TYPE_IO"; | 59 "The current MessageLoop must be TYPE_IO"; |
60 } | 60 } |
61 | 61 |
62 URLRequest::~URLRequest() { | 62 URLRequest::~URLRequest() { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 return net::OK; | 374 return net::OK; |
375 } | 375 } |
376 | 376 |
377 int64 URLRequest::GetExpectedContentSize() const { | 377 int64 URLRequest::GetExpectedContentSize() const { |
378 int64 expected_content_size = -1; | 378 int64 expected_content_size = -1; |
379 if (job_) | 379 if (job_) |
380 expected_content_size = job_->expected_content_size(); | 380 expected_content_size = job_->expected_content_size(); |
381 | 381 |
382 return expected_content_size; | 382 return expected_content_size; |
383 } | 383 } |
OLD | NEW |