| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // CancelableRequestProviders and Consumers work together to make requests that | 5 // CancelableRequestProviders and Consumers work together to make requests that |
| 6 // execute on a background thread in the provider and return data to the | 6 // execute on a background thread in the provider and return data to the |
| 7 // consumer. These classes collaborate to keep a list of open requests and to | 7 // consumer. These classes collaborate to keep a list of open requests and to |
| 8 // make sure that requests do not outlive either of the objects involved in the | 8 // make sure that requests do not outlive either of the objects involved in the |
| 9 // transaction. | 9 // transaction. |
| 10 // | 10 // |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 #include "base/basictypes.h" | 95 #include "base/basictypes.h" |
| 96 #include "base/bind.h" | 96 #include "base/bind.h" |
| 97 #include "base/callback.h" | 97 #include "base/callback.h" |
| 98 #include "base/callback_internal.h" | 98 #include "base/callback_internal.h" |
| 99 #include "base/logging.h" | 99 #include "base/logging.h" |
| 100 #include "base/memory/ref_counted.h" | 100 #include "base/memory/ref_counted.h" |
| 101 #include "base/memory/scoped_ptr.h" | 101 #include "base/memory/scoped_ptr.h" |
| 102 #include "base/message_loop.h" | 102 #include "base/message_loop.h" |
| 103 #include "base/synchronization/cancellation_flag.h" | 103 #include "base/synchronization/cancellation_flag.h" |
| 104 #include "base/synchronization/lock.h" | 104 #include "base/synchronization/lock.h" |
| 105 #include "base/task.h" | |
| 106 #include "build/build_config.h" | 105 #include "build/build_config.h" |
| 107 | 106 |
| 108 class CancelableRequestBase; | 107 class CancelableRequestBase; |
| 109 class CancelableRequestConsumerBase; | 108 class CancelableRequestConsumerBase; |
| 110 | 109 |
| 111 // CancelableRequestProvider -------------------------------------------------- | 110 // CancelableRequestProvider -------------------------------------------------- |
| 112 // | 111 // |
| 113 // This class is threadsafe. Requests may be added or canceled from any thread, | 112 // This class is threadsafe. Requests may be added or canceled from any thread, |
| 114 // but a task must only be canceled from the same thread it was initially run | 113 // but a task must only be canceled from the same thread it was initially run |
| 115 // on. | 114 // on. |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 } | 1012 } |
| 1014 | 1013 |
| 1015 // The value. | 1014 // The value. |
| 1016 Type value; | 1015 Type value; |
| 1017 | 1016 |
| 1018 protected: | 1017 protected: |
| 1019 virtual ~CancelableRequest1() {} | 1018 virtual ~CancelableRequest1() {} |
| 1020 }; | 1019 }; |
| 1021 | 1020 |
| 1022 #endif // CHROME_BROWSER_CANCELABLE_REQUEST_H_ | 1021 #endif // CHROME_BROWSER_CANCELABLE_REQUEST_H_ |
| OLD | NEW |