OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 SYNC_API_SYNC_ERROR_H_ | 5 #ifndef SYNC_API_SYNC_ERROR_H_ |
6 #define SYNC_API_SYNC_ERROR_H_ | 6 #define SYNC_API_SYNC_ERROR_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
13 #include "sync/internal_api/public/base/model_type.h" | 13 #include "sync/internal_api/public/base/model_type.h" |
14 | 14 |
15 namespace tracked_objects { | 15 namespace tracked_objects { |
16 class Location; | 16 class Location; |
17 } // namespace tracked_objects | 17 } // namespace tracked_objects |
18 | 18 |
19 namespace syncer { | 19 namespace syncer { |
20 | 20 |
21 // Sync errors are used for debug purposes and handled internally and/or | 21 // Sync errors are used for debug purposes and handled internally and/or |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // is called, IsSet() will return true. | 108 // is called, IsSet() will return true. |
109 void Init(const tracked_objects::Location& location, | 109 void Init(const tracked_objects::Location& location, |
110 const std::string& message, | 110 const std::string& message, |
111 ModelType model_type, | 111 ModelType model_type, |
112 ErrorType error_type); | 112 ErrorType error_type); |
113 | 113 |
114 // Reset the error to it's default (unset) values. | 114 // Reset the error to it's default (unset) values. |
115 void Clear(); | 115 void Clear(); |
116 | 116 |
117 // scoped_ptr is necessary because Location objects aren't assignable. | 117 // scoped_ptr is necessary because Location objects aren't assignable. |
118 scoped_ptr<tracked_objects::Location> location_; | 118 std::unique_ptr<tracked_objects::Location> location_; |
119 std::string message_; | 119 std::string message_; |
120 ModelType model_type_; | 120 ModelType model_type_; |
121 ErrorType error_type_; | 121 ErrorType error_type_; |
122 }; | 122 }; |
123 | 123 |
124 // gmock printer helper. | 124 // gmock printer helper. |
125 SYNC_EXPORT void PrintTo(const SyncError& sync_error, std::ostream* os); | 125 SYNC_EXPORT void PrintTo(const SyncError& sync_error, std::ostream* os); |
126 | 126 |
127 } // namespace syncer | 127 } // namespace syncer |
128 | 128 |
129 #endif // SYNC_API_SYNC_ERROR_H_ | 129 #endif // SYNC_API_SYNC_ERROR_H_ |
OLD | NEW |