summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/util
diff options
context:
space:
mode:
authorlipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 06:34:35 +0000
committerlipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 06:34:35 +0000
commiteb64b19d27d5dee0990b5e271faa7f6bfbe6a68d (patch)
tree71b5054bf9ec3653d026a393e96d4cdbd9aa757e /chrome/browser/sync/util
parent0c783b65734b470699cbb5cc5b30031a294c8059 (diff)
downloadchromium_src-eb64b19d27d5dee0990b5e271faa7f6bfbe6a68d.zip
chromium_src-eb64b19d27d5dee0990b5e271faa7f6bfbe6a68d.tar.gz
chromium_src-eb64b19d27d5dee0990b5e271faa7f6bfbe6a68d.tar.bz2
This is the first patch in a series of patches. This patch introduces the unrecoverable error info class which is plumbed up all ModelSafeWorker subclasses.
The subclasses of ModelChangingSyncer command would be converted to return an unrecoverable error info in another CL. BUG=100374 TEST= Review URL: http://codereview.chromium.org/8366030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/util')
-rw-r--r--chrome/browser/sync/util/unrecoverable_error_info.cc44
-rw-r--r--chrome/browser/sync/util/unrecoverable_error_info.h41
2 files changed, 85 insertions, 0 deletions
diff --git a/chrome/browser/sync/util/unrecoverable_error_info.cc b/chrome/browser/sync/util/unrecoverable_error_info.cc
new file mode 100644
index 0000000..579eb38
--- /dev/null
+++ b/chrome/browser/sync/util/unrecoverable_error_info.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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 "chrome/browser/sync/util/unrecoverable_error_info.h"
+
+namespace browser_sync {
+
+UnrecoverableErrorInfo::UnrecoverableErrorInfo()
+ : is_set_(false) {
+}
+
+UnrecoverableErrorInfo::UnrecoverableErrorInfo(
+ const tracked_objects::Location& location,
+ const std::string& message)
+ : location_(location),
+ message_(message),
+ is_set_(true) {
+}
+
+UnrecoverableErrorInfo::~UnrecoverableErrorInfo() {
+}
+
+void UnrecoverableErrorInfo::Reset(
+ const tracked_objects::Location& location,
+ const std::string& message) {
+ location_ = location;
+ message_ = message;
+ is_set_ = true;
+}
+
+bool UnrecoverableErrorInfo::IsSet() const {
+ return is_set_;
+}
+
+const tracked_objects::Location& UnrecoverableErrorInfo::location() const {
+ return location_;
+}
+
+const std::string& UnrecoverableErrorInfo::message() const {
+ return message_;
+}
+
+} // namespace browser_sync
diff --git a/chrome/browser/sync/util/unrecoverable_error_info.h b/chrome/browser/sync/util/unrecoverable_error_info.h
new file mode 100644
index 0000000..dd62c30
--- /dev/null
+++ b/chrome/browser/sync/util/unrecoverable_error_info.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 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.
+
+#ifndef CHROME_BROWSER_SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_
+#define CHROME_BROWSER_SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_
+// TODO(lipalani): Figure out the right location for this class so it is
+// accessible outside of sync engine as well.
+#pragma once
+
+#include <string>
+
+#include "base/location.h"
+
+namespace browser_sync {
+
+class UnrecoverableErrorInfo {
+ public:
+ UnrecoverableErrorInfo();
+ UnrecoverableErrorInfo(
+ const tracked_objects::Location& location,
+ const std::string& message);
+ ~UnrecoverableErrorInfo();
+
+ void Reset(const tracked_objects::Location& location,
+ const std::string& message);
+
+ bool IsSet() const;
+
+ const tracked_objects::Location& location() const;
+ const std::string& message() const;
+
+ private:
+ tracked_objects::Location location_;
+ std::string message_;
+ bool is_set_;
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_UTIL_UNRECOVERABLE_ERROR_INFO_H_