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

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

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.cc
diff --git a/chrome/browser/sync/sessions/sync_session.cc b/chrome/browser/sync/sessions/sync_session.cc
index f399d7d7904ed1fee8a5425a8641cfaaab04675e..492abc1e796a9b8ddc53e60c58a609b9881d9a70 100644
--- a/chrome/browser/sync/sessions/sync_session.cc
+++ b/chrome/browser/sync/sessions/sync_session.cc
@@ -9,6 +9,8 @@
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/model_type.h"
+
+#include "chrome/browser/sync/sessions/unrecoverable_error_info.cc"
namespace browser_sync {
namespace sessions {
@@ -21,7 +23,8 @@ SyncSession::SyncSession(SyncSessionContext* context, Delegate* delegate,
write_transaction_(NULL),
delegate_(delegate),
workers_(workers),
- routing_info_(routing_info) {
+ routing_info_(routing_info),
+ unrecoverable_error_(false) {
status_controller_.reset(new StatusController(routing_info_));
std::sort(workers_.begin(), workers_.end());
}
@@ -133,6 +136,18 @@ SyncSourceInfo SyncSession::TestAndSetSource() {
return old_source;
}
+void SyncSession::SetUnrecoverableError(
+ const tracked_objects::Location& location,
+ const std::string& message,
+ syncable::BaseTransaction* trans) {
+ unrecoverable_error_ = true;
+ unrecoverable_error_info_.reset(new UnrecoverableErrorInfo(location,
+ message));
+ // If a transaction if provided then make sure it does not check tree
+ // invariants. We know it is corrupted.
+ trans->set_unrecoverable_error();
+}
+
bool SyncSession::HasMoreToSync() const {
const StatusController* status = status_controller_.get();
return ((status->commit_ids().size() < status->unsynced_handles().size()) &&

Powered by Google App Engine
This is Rietveld 408576698