Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: components/sync/model/model_error.h

Issue 2620773002: [Sync] Use ModelError all the way through to ModelTypeController. (Closed)
Patch Set: const& everything and use a typedef. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/sync/model/fake_model_type_change_processor.cc ('k') | components/sync/model/model_type_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698