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

Unified Diff: components/sync/model/model_error.cc

Issue 2618483003: [Sync] Introduce ModelError for USS error handling. (Closed)
Patch Set: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/model/model_error.h ('k') | components/sync/model/model_type_change_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/model/model_error.cc
diff --git a/components/sync/model/model_error.cc b/components/sync/model/model_error.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6ae66101d8ba9a10276d368fba12559882c40165
--- /dev/null
+++ b/components/sync/model/model_error.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync/model/model_error.h"
+
+namespace syncer {
+
+ModelError::ModelError() : is_set_(false) {}
+
+ModelError::ModelError(const tracked_objects::Location& location,
+ const std::string& message)
+ : is_set_(true), location_(location), message_(message) {}
+
+ModelError::~ModelError() = default;
+
+bool ModelError::IsSet() const {
+ return is_set_;
+}
+
+const tracked_objects::Location& ModelError::location() const {
+ DCHECK(IsSet());
+ return location_;
+}
+
+const std::string& ModelError::message() const {
+ DCHECK(IsSet());
+ return message_;
+}
+
+} // namespace syncer
« no previous file with comments | « components/sync/model/model_error.h ('k') | components/sync/model/model_type_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698