| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_SYNC_MODEL_MODEL_ERROR_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_ | 6 #define COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" |
| 10 #include "base/location.h" | 11 #include "base/location.h" |
| 11 | 12 |
| 12 namespace syncer { | 13 namespace syncer { |
| 13 | 14 |
| 14 // A minimal error object for use by USS model type code. | 15 // A minimal error object for use by USS model type code. |
| 15 class ModelError { | 16 class ModelError { |
| 16 public: | 17 public: |
| 17 // Creates an un-set error object (indicating an operation was successful). | 18 // Creates an un-set error object (indicating an operation was successful). |
| 18 ModelError(); | 19 ModelError(); |
| 19 | 20 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 33 // The message explaining the error this object represents. Can only be called | 34 // The message explaining the error this object represents. Can only be called |
| 34 // if the error is set. | 35 // if the error is set. |
| 35 const std::string& message() const; | 36 const std::string& message() const; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 bool is_set_; | 39 bool is_set_; |
| 39 tracked_objects::Location location_; | 40 tracked_objects::Location location_; |
| 40 std::string message_; | 41 std::string message_; |
| 41 }; | 42 }; |
| 42 | 43 |
| 44 // Typedef for a simple error handler callback. |
| 45 using ModelErrorHandler = base::RepeatingCallback<void(const ModelError&)>; |
| 46 |
| 43 } // namespace syncer | 47 } // namespace syncer |
| 44 | 48 |
| 45 #endif // COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_ | 49 #endif // COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_ |
| OLD | NEW |