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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const DestroyCallback& callback) | 91 const DestroyCallback& callback) |
92 : WDTypedResult(type), | 92 : WDTypedResult(type), |
93 value_(v), | 93 value_(v), |
94 callback_(callback) { | 94 callback_(callback) { |
95 } | 95 } |
96 | 96 |
97 virtual ~WDDestroyableResult() { | 97 virtual ~WDDestroyableResult() { |
98 } | 98 } |
99 | 99 |
100 | 100 |
101 virtual void Destroy() OVERRIDE { | 101 virtual void Destroy() override { |
102 if (!callback_.is_null()) { | 102 if (!callback_.is_null()) { |
103 callback_.Run(this); | 103 callback_.Run(this); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 // Return a single value result. | 107 // Return a single value result. |
108 T GetValue() const { | 108 T GetValue() const { |
109 return value_; | 109 return value_; |
110 } | 110 } |
111 | 111 |
(...skipping 14 matching lines...) Expand all Loading... |
126 return &value_; | 126 return &value_; |
127 } | 127 } |
128 | 128 |
129 private: | 129 private: |
130 // mutable to keep GetValue() const. | 130 // mutable to keep GetValue() const. |
131 mutable T value_; | 131 mutable T value_; |
132 DISALLOW_COPY_AND_ASSIGN(WDObjectResult); | 132 DISALLOW_COPY_AND_ASSIGN(WDObjectResult); |
133 }; | 133 }; |
134 | 134 |
135 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ | 135 #endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_ |
OLD | NEW |