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 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/leak_tracker.h" |
12 #include "base/linked_ptr.h" | 13 #include "base/linked_ptr.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
15 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
16 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
17 #include "net/base/load_states.h" | 18 #include "net/base/load_states.h" |
18 #include "net/http/http_response_info.h" | 19 #include "net/http/http_response_info.h" |
19 #include "net/url_request/url_request_status.h" | 20 #include "net/url_request/url_request_status.h" |
20 | 21 |
21 namespace base { | 22 namespace base { |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 int redirect_limit_; | 586 int redirect_limit_; |
586 | 587 |
587 // Cached value for use after we've orphaned the job handling the | 588 // Cached value for use after we've orphaned the job handling the |
588 // first transaction in a request involving redirects. | 589 // first transaction in a request involving redirects. |
589 uint64 final_upload_progress_; | 590 uint64 final_upload_progress_; |
590 | 591 |
591 // The priority level for this request. Objects like ClientSocketPool use | 592 // The priority level for this request. Objects like ClientSocketPool use |
592 // this to determine which URLRequest to allocate sockets to first. | 593 // this to determine which URLRequest to allocate sockets to first. |
593 int priority_; | 594 int priority_; |
594 | 595 |
| 596 base::LeakTracker<URLRequest> leak_tracker_; |
| 597 |
595 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 598 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
596 }; | 599 }; |
597 | 600 |
598 //----------------------------------------------------------------------------- | 601 //----------------------------------------------------------------------------- |
599 // To help ensure that all requests are cleaned up properly, we keep static | 602 // To help ensure that all requests are cleaned up properly, we keep static |
600 // counters of live objects. TODO(darin): Move this leak checking stuff into | 603 // counters of live objects. TODO(darin): Move this leak checking stuff into |
601 // a common place and generalize it so it can be used everywhere (Bug 566229). | 604 // a common place and generalize it so it can be used everywhere (Bug 566229). |
602 | 605 |
603 #ifndef NDEBUG | 606 #ifndef NDEBUG |
604 | 607 |
605 struct URLRequestMetrics { | 608 struct URLRequestMetrics { |
606 int object_count; | 609 int object_count; |
607 URLRequestMetrics() : object_count(0) {} | 610 URLRequestMetrics() : object_count(0) {} |
608 ~URLRequestMetrics(); | 611 ~URLRequestMetrics(); |
609 }; | 612 }; |
610 | 613 |
611 extern URLRequestMetrics url_request_metrics; | 614 extern URLRequestMetrics url_request_metrics; |
612 | 615 |
613 #define URLREQUEST_COUNT_CTOR() url_request_metrics.object_count++ | 616 #define URLREQUEST_COUNT_CTOR() url_request_metrics.object_count++ |
614 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- | 617 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- |
615 | 618 |
616 #else // disable leak checking in release builds... | 619 #else // disable leak checking in release builds... |
617 | 620 |
618 #define URLREQUEST_COUNT_CTOR() | 621 #define URLREQUEST_COUNT_CTOR() |
619 #define URLREQUEST_COUNT_DTOR() | 622 #define URLREQUEST_COUNT_DTOR() |
620 | 623 |
621 #endif // #ifndef NDEBUG | 624 #endif // #ifndef NDEBUG |
622 | 625 |
623 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 626 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |