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

Unified Diff: chrome/browser/sync/sessions/sync_session.h

Issue 8366030: Introduce the plumbing necessary to report Unrecoverable error from model safe workers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For a high level review. Created 9 years, 2 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
Index: chrome/browser/sync/sessions/sync_session.h
diff --git a/chrome/browser/sync/sessions/sync_session.h b/chrome/browser/sync/sessions/sync_session.h
index 04b1a1a15b06104e0106e7f2cc8d1307aba2b85b..8fd949567e6df9c87c4452e5a762c7a759771ddf 100644
--- a/chrome/browser/sync/sessions/sync_session.h
+++ b/chrome/browser/sync/sessions/sync_session.h
@@ -22,12 +22,14 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/location.h"
#include "base/time.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/sessions/ordered_commit_set.h"
#include "chrome/browser/sync/sessions/session_state.h"
#include "chrome/browser/sync/sessions/status_controller.h"
#include "chrome/browser/sync/sessions/sync_session_context.h"
+#include "chrome/browser/sync/sessions/unrecoverable_error_info.h"
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/util/extensions_activity_monitor.h"
@@ -90,6 +92,11 @@ class SyncSession {
virtual void OnSyncProtocolError(
const sessions::SyncSessionSnapshot& snapshot) = 0;
+ // Called when the syncer encounters an unrecoverable error.
+ virtual void OnUnrecoverableError(
+ const tracked_objects::Location& from_here,
+ const std::string& message) = 0;
+
protected:
virtual ~Delegate() {}
};
@@ -146,6 +153,18 @@ class SyncSession {
const ModelSafeRoutingInfo& routing_info() const { return routing_info_; }
const SyncSourceInfo& source() const { return source_; }
+ // This can be called from any thread. We just cache the value of
+ // unrecoverable error info. When on the correct thread using this info
+ // delegate's OnUnrecoverableError method should be called.
+ void SetUnrecoverableError(const tracked_objects::Location& location,
+ const std::string& message,
+ syncable::BaseTransaction* trans);
+
+ bool unrecoverable_error() const { return unrecoverable_error_; }
+ UnrecoverableErrorInfo* unrecoverable_error_info() {
+ return unrecoverable_error_info_.get();
+ }
+
private:
// Extend the encapsulation boundary to utilities for internal member
// assignments. This way, the scope of these actions is explicit, they can't
@@ -179,6 +198,9 @@ class SyncSession {
// on those datatypes.
ModelSafeRoutingInfo routing_info_;
+ scoped_ptr<UnrecoverableErrorInfo> unrecoverable_error_info_;
+ bool unrecoverable_error_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSession);
};

Powered by Google App Engine
This is Rietveld 408576698