| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/cancelable_request.h" | 5 #include "chrome/browser/common/cancelable_request.h" |
| 6 | 6 |
| 7 CancelableRequestProvider::CancelableRequestProvider() | 7 CancelableRequestProvider::CancelableRequestProvider() |
| 8 : next_handle_(1) { | 8 : next_handle_(1) { |
| 9 } | 9 } |
| 10 | 10 |
| 11 CancelableRequestProvider::Handle CancelableRequestProvider::AddRequest( | 11 CancelableRequestProvider::Handle CancelableRequestProvider::AddRequest( |
| 12 CancelableRequestBase* request, | 12 CancelableRequestBase* request, |
| 13 CancelableRequestConsumerBase* consumer) { | 13 CancelableRequestConsumerBase* consumer) { |
| 14 Handle handle; | 14 Handle handle; |
| 15 { | 15 { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Execute the callback. | 131 // Execute the callback. |
| 132 forwarded_call.Run(); | 132 forwarded_call.Run(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Notify the provider that the request is complete. The provider will | 135 // Notify the provider that the request is complete. The provider will |
| 136 // notify the consumer for us. Note that it is possible for the callback to | 136 // notify the consumer for us. Note that it is possible for the callback to |
| 137 // cancel this request; we must check canceled again. | 137 // cancel this request; we must check canceled again. |
| 138 if (!canceled_.IsSet()) | 138 if (!canceled_.IsSet()) |
| 139 NotifyCompleted(); | 139 NotifyCompleted(); |
| 140 } | 140 } |
| OLD | NEW |