OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 class collaborate to keep a list of open requests and to | 7 // consumer. These class collaborate to keep a list of open requests and to |
8 // make sure that requests to not outlive either of the objects involved in the | 8 // make sure that requests to not outlive either of the objects involved in the |
9 // transaction. | 9 // transaction. |
10 // | 10 // |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 #ifndef CHROME_BROWSER_CANCELABLE_REQUEST_H__ | 86 #ifndef CHROME_BROWSER_CANCELABLE_REQUEST_H__ |
87 #define CHROME_BROWSER_CANCELABLE_REQUEST_H__ | 87 #define CHROME_BROWSER_CANCELABLE_REQUEST_H__ |
88 #pragma once | 88 #pragma once |
89 | 89 |
90 #include <map> | 90 #include <map> |
91 #include <vector> | 91 #include <vector> |
92 | 92 |
93 #include "base/basictypes.h" | 93 #include "base/basictypes.h" |
94 #include "base/callback.h" | 94 #include "base/callback.h" |
95 #include "base/lock.h" | |
96 #include "base/logging.h" | 95 #include "base/logging.h" |
97 #include "base/message_loop.h" | 96 #include "base/message_loop.h" |
98 #include "base/ref_counted.h" | 97 #include "base/ref_counted.h" |
99 #include "base/scoped_ptr.h" | 98 #include "base/scoped_ptr.h" |
100 #include "base/synchronization/cancellation_flag.h" | 99 #include "base/synchronization/cancellation_flag.h" |
| 100 #include "base/synchronization/lock.h" |
101 #include "base/task.h" | 101 #include "base/task.h" |
102 #include "build/build_config.h" | 102 #include "build/build_config.h" |
103 | 103 |
104 class CancelableRequestBase; | 104 class CancelableRequestBase; |
105 class CancelableRequestConsumerBase; | 105 class CancelableRequestConsumerBase; |
106 | 106 |
107 // CancelableRequestProvider -------------------------------------------------- | 107 // CancelableRequestProvider -------------------------------------------------- |
108 // | 108 // |
109 // This class is threadsafe. Requests may be added or canceled from any thread, | 109 // This class is threadsafe. Requests may be added or canceled from any thread, |
110 // but a task must only be canceled from the same thread it was initially run | 110 // but a task must only be canceled from the same thread it was initially run |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 695 } |
696 | 696 |
697 // The value. | 697 // The value. |
698 Type value; | 698 Type value; |
699 | 699 |
700 protected: | 700 protected: |
701 virtual ~CancelableRequest1() {} | 701 virtual ~CancelableRequest1() {} |
702 }; | 702 }; |
703 | 703 |
704 #endif // CHROME_BROWSER_CANCELABLE_REQUEST_H__ | 704 #endif // CHROME_BROWSER_CANCELABLE_REQUEST_H__ |
OLD | NEW |