| 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> |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 // If destroyed after Start() has been called but while IO is pending, | 206 // If destroyed after Start() has been called but while IO is pending, |
| 207 // then the request will be effectively canceled and the delegate | 207 // then the request will be effectively canceled and the delegate |
| 208 // will not have any more of its methods called. | 208 // will not have any more of its methods called. |
| 209 ~URLRequest(); | 209 ~URLRequest(); |
| 210 | 210 |
| 211 // The user data allows the clients to associate data with this request. | 211 // The user data allows the clients to associate data with this request. |
| 212 // Multiple user data values can be stored under different keys. | 212 // Multiple user data values can be stored under different keys. |
| 213 // This request will TAKE OWNERSHIP of the given data pointer, and will | 213 // This request will TAKE OWNERSHIP of the given data pointer, and will |
| 214 // delete the object if it is changed or the request is destroyed. | 214 // delete the object if it is changed or the request is destroyed. |
| 215 UserData* GetUserData(void* key) const; | 215 UserData* GetUserData(const void* key) const; |
| 216 void SetUserData(void* key, UserData* data); | 216 void SetUserData(const void* key, UserData* data); |
| 217 | 217 |
| 218 // Registers a new protocol handler for the given scheme. If the scheme is | 218 // Registers a new protocol handler for the given scheme. If the scheme is |
| 219 // already handled, this will overwrite the given factory. To delete the | 219 // already handled, this will overwrite the given factory. To delete the |
| 220 // protocol factory, use NULL for the factory BUT this WILL NOT put back | 220 // protocol factory, use NULL for the factory BUT this WILL NOT put back |
| 221 // any previously registered protocol factory. It will have returned | 221 // any previously registered protocol factory. It will have returned |
| 222 // the previously registered factory (or NULL if none is registered) when | 222 // the previously registered factory (or NULL if none is registered) when |
| 223 // the scheme was first registered so that the caller can manually put it | 223 // the scheme was first registered so that the caller can manually put it |
| 224 // back if desired. | 224 // back if desired. |
| 225 // | 225 // |
| 226 // The scheme must be all-lowercase ASCII. See the ProtocolFactory | 226 // The scheme must be all-lowercase ASCII. See the ProtocolFactory |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 563 |
| 564 // The HTTP response info, lazily initialized. | 564 // The HTTP response info, lazily initialized. |
| 565 net::HttpResponseInfo response_info_; | 565 net::HttpResponseInfo response_info_; |
| 566 | 566 |
| 567 // Tells us whether the job is outstanding. This is true from the time | 567 // Tells us whether the job is outstanding. This is true from the time |
| 568 // Start() is called to the time we dispatch RequestComplete and indicates | 568 // Start() is called to the time we dispatch RequestComplete and indicates |
| 569 // whether the job is active. | 569 // whether the job is active. |
| 570 bool is_pending_; | 570 bool is_pending_; |
| 571 | 571 |
| 572 // Externally-defined data accessible by key | 572 // Externally-defined data accessible by key |
| 573 typedef std::map<void*, linked_ptr<UserData> > UserDataMap; | 573 typedef std::map<const void*, linked_ptr<UserData> > UserDataMap; |
| 574 UserDataMap user_data_; | 574 UserDataMap user_data_; |
| 575 | 575 |
| 576 // Whether to enable performance profiling on the job serving this request. | 576 // Whether to enable performance profiling on the job serving this request. |
| 577 bool enable_profiling_; | 577 bool enable_profiling_; |
| 578 | 578 |
| 579 // Number of times we're willing to redirect. Used to guard against | 579 // Number of times we're willing to redirect. Used to guard against |
| 580 // infinite redirects. | 580 // infinite redirects. |
| 581 int redirect_limit_; | 581 int redirect_limit_; |
| 582 | 582 |
| 583 // Cached value for use after we've orphaned the job handling the | 583 // Cached value for use after we've orphaned the job handling the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 610 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- | 610 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- |
| 611 | 611 |
| 612 #else // disable leak checking in release builds... | 612 #else // disable leak checking in release builds... |
| 613 | 613 |
| 614 #define URLREQUEST_COUNT_CTOR() | 614 #define URLREQUEST_COUNT_CTOR() |
| 615 #define URLREQUEST_COUNT_DTOR() | 615 #define URLREQUEST_COUNT_DTOR() |
| 616 | 616 |
| 617 #endif // #ifndef NDEBUG | 617 #endif // #ifndef NDEBUG |
| 618 | 618 |
| 619 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 619 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |