| 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 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ | 5 #ifndef COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ |
| 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ | 6 #define COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "components/webdata/common/webdata_export.h" | 10 #include "components/webdata/common/webdata_export.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 return value_; | 107 return value_; |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 T value_; | 111 T value_; |
| 112 DestroyCallback callback_; | 112 DestroyCallback callback_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(WDDestroyableResult); | 114 DISALLOW_COPY_AND_ASSIGN(WDDestroyableResult); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 template <class T> class WDObjectResult : public WDTypedResult { | |
| 118 public: | |
| 119 explicit WDObjectResult(WDResultType type) | |
| 120 : WDTypedResult(type) { | |
| 121 } | |
| 122 | |
| 123 T* GetValue() const { | |
| 124 return &value_; | |
| 125 } | |
| 126 | |
| 127 private: | |
| 128 // mutable to keep GetValue() const. | |
| 129 mutable T value_; | |
| 130 DISALLOW_COPY_AND_ASSIGN(WDObjectResult); | |
| 131 }; | |
| 132 | |
| 133 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ | 117 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ |
| OLD | NEW |