| 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 // 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // // Depending on your typedefs, one of these two forms will be more | 78 // // Depending on your typedefs, one of these two forms will be more |
| 79 // // convenient: | 79 // // convenient: |
| 80 // request->ForwardResult(Tuple1<int>(return_value)); | 80 // request->ForwardResult(Tuple1<int>(return_value)); |
| 81 // | 81 // |
| 82 // // -- or -- (inferior in this case) | 82 // // -- or -- (inferior in this case) |
| 83 // request->ForwardResult(Frontend::RequestCallbackType::TupleType( | 83 // request->ForwardResult(Frontend::RequestCallbackType::TupleType( |
| 84 // return_value)); | 84 // return_value)); |
| 85 // } | 85 // } |
| 86 // }; | 86 // }; |
| 87 | 87 |
| 88 #ifndef CHROME_BROWSER_CANCELABLE_REQUEST_H_ | 88 #ifndef CHROME_BROWSER_COMMON_CANCELABLE_REQUEST_H_ |
| 89 #define CHROME_BROWSER_CANCELABLE_REQUEST_H_ | 89 #define CHROME_BROWSER_COMMON_CANCELABLE_REQUEST_H_ |
| 90 | 90 |
| 91 #include <map> | 91 #include <map> |
| 92 #include <vector> | 92 #include <vector> |
| 93 | 93 |
| 94 #include "base/basictypes.h" | 94 #include "base/basictypes.h" |
| 95 #include "base/bind.h" | 95 #include "base/bind.h" |
| 96 #include "base/callback.h" | 96 #include "base/callback.h" |
| 97 #include "base/callback_internal.h" | 97 #include "base/callback_internal.h" |
| 98 #include "base/logging.h" | 98 #include "base/logging.h" |
| 99 #include "base/memory/ref_counted.h" | 99 #include "base/memory/ref_counted.h" |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 : CancelableRequest<CB>(callback), value() { | 1006 : CancelableRequest<CB>(callback), value() { |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 // The value. | 1009 // The value. |
| 1010 Type value; | 1010 Type value; |
| 1011 | 1011 |
| 1012 protected: | 1012 protected: |
| 1013 virtual ~CancelableRequest1() {} | 1013 virtual ~CancelableRequest1() {} |
| 1014 }; | 1014 }; |
| 1015 | 1015 |
| 1016 #endif // CHROME_BROWSER_CANCELABLE_REQUEST_H_ | 1016 #endif // CHROME_BROWSER_COMMON_CANCELABLE_REQUEST_H_ |
| OLD | NEW |