| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 #include "base/stats_counters.h" | 10 #include "base/stats_counters.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 468 } |
| 469 | 469 |
| 470 int64 URLRequest::GetExpectedContentSize() const { | 470 int64 URLRequest::GetExpectedContentSize() const { |
| 471 int64 expected_content_size = -1; | 471 int64 expected_content_size = -1; |
| 472 if (job_) | 472 if (job_) |
| 473 expected_content_size = job_->expected_content_size(); | 473 expected_content_size = job_->expected_content_size(); |
| 474 | 474 |
| 475 return expected_content_size; | 475 return expected_content_size; |
| 476 } | 476 } |
| 477 | 477 |
| 478 URLRequest::UserData* URLRequest::GetUserData(void* key) const { | 478 URLRequest::UserData* URLRequest::GetUserData(const void* key) const { |
| 479 UserDataMap::const_iterator found = user_data_.find(key); | 479 UserDataMap::const_iterator found = user_data_.find(key); |
| 480 if (found != user_data_.end()) | 480 if (found != user_data_.end()) |
| 481 return found->second.get(); | 481 return found->second.get(); |
| 482 return NULL; | 482 return NULL; |
| 483 } | 483 } |
| 484 | 484 |
| 485 void URLRequest::SetUserData(void* key, UserData* data) { | 485 void URLRequest::SetUserData(const void* key, UserData* data) { |
| 486 user_data_[key] = linked_ptr<UserData>(data); | 486 user_data_[key] = linked_ptr<UserData>(data); |
| 487 } | 487 } |
| 488 | 488 |
| 489 #ifndef NDEBUG | 489 #ifndef NDEBUG |
| 490 | 490 |
| 491 URLRequestMetrics::~URLRequestMetrics() { | 491 URLRequestMetrics::~URLRequestMetrics() { |
| 492 DLOG_IF(WARNING, object_count != 0) << | 492 DLOG_IF(WARNING, object_count != 0) << |
| 493 "Leaking " << object_count << " URLRequest object(s)"; | 493 "Leaking " << object_count << " URLRequest object(s)"; |
| 494 } | 494 } |
| 495 | 495 |
| 496 #endif | 496 #endif |
| OLD | NEW |