| Index: content/browser/cancelable_request.h
|
| diff --git a/content/browser/cancelable_request.h b/content/browser/cancelable_request.h
|
| index df27cbce26421ede756289a3353571666dca0cb7..756eed58f4bba4d093a015358e78d00d93d1e76e 100644
|
| --- a/content/browser/cancelable_request.h
|
| +++ b/content/browser/cancelable_request.h
|
| @@ -238,12 +238,18 @@ class CancelableRequestConsumerTSimple : public CancelableRequestConsumerBase {
|
| // Returns true if there are any pending requests.
|
| bool HasPendingRequests() const;
|
|
|
| + // Returns true if there are any pending requests.
|
| + bool HasPendingRequestsForClientData(T client_data) const;
|
| +
|
| // Returns the number of pending requests.
|
| size_t PendingRequestCount() const;
|
|
|
| // Cancels all requests outstanding.
|
| void CancelAllRequests();
|
|
|
| + // Cancels all requests outstanding matching the client data
|
| + void CancelAllRequestsForClientData(T client_data);
|
| +
|
| // Returns the handle for the first request that has the specified client data
|
| // (in |handle|). Returns true if there is a request for the specified client
|
| // data, false otherwise.
|
| @@ -338,6 +344,18 @@ bool CancelableRequestConsumerTSimple<T>::HasPendingRequests() const {
|
| }
|
|
|
| template<class T>
|
| +bool CancelableRequestConsumerTSimple<T>::HasPendingRequestsForClientData(
|
| + T client_data) const {
|
| + for (typename PendingRequestList::const_iterator i =
|
| + pending_requests_.begin(); i != pending_requests_.end(); ++i) {
|
| + if (i->second == client_data) {
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +template<class T>
|
| size_t CancelableRequestConsumerTSimple<T>::PendingRequestCount() const {
|
| return pending_requests_.size();
|
| }
|
| @@ -358,6 +376,17 @@ void CancelableRequestConsumerTSimple<T>::CancelAllRequests() {
|
| }
|
|
|
| template<class T>
|
| +void CancelableRequestConsumerTSimple<T>::CancelAllRequestsForClientData(
|
| + T client_data) {
|
| + PendingRequestList copied_requests(pending_requests_);
|
| + for (typename PendingRequestList::const_iterator i = copied_requests.begin();
|
| + i != copied_requests.end(); ++i)
|
| + if (i->second == client_data)
|
| + i->first.provider->CancelRequest(i->first.handle);
|
| + copied_requests.clear();
|
| +}
|
| +
|
| +template<class T>
|
| bool CancelableRequestConsumerTSimple<T>::GetFirstHandleForClientData(
|
| T client_data,
|
| CancelableRequestProvider::Handle* handle) {
|
|
|