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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10821121: sync: Attempt to recover from directory corruption (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix other win compile warning Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/syncable/directory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 } 693 }
694 start_up_time_ = base::Time(); 694 start_up_time_ = base::Time();
695 } 695 }
696 696
697 if (!success) { 697 if (!success) {
698 // Something went unexpectedly wrong. Play it safe: stop syncing at once 698 // Something went unexpectedly wrong. Play it safe: stop syncing at once
699 // and surface error UI to alert the user sync has stopped. 699 // and surface error UI to alert the user sync has stopped.
700 // Keep the directory around for now so that on restart we will retry 700 // Keep the directory around for now so that on restart we will retry
701 // again and potentially succeed in presence of transient file IO failures 701 // again and potentially succeed in presence of transient file IO failures
702 // or permissions issues, etc. 702 // or permissions issues, etc.
703 //
704 // TODO(rlarocque): Consider making this UnrecoverableError less special.
705 // Unlike every other UnrecoverableError, it does not delete our sync data.
706 // This exception made sense at the time it was implemented, but our new
707 // directory corruption recovery mechanism makes it obsolete. By the time
708 // we get here, we will have already tried and failed to delete the
709 // directory. It would be no big deal if we tried to delete it again.
703 OnInternalUnrecoverableError(FROM_HERE, 710 OnInternalUnrecoverableError(FROM_HERE,
704 "BackendInitialize failure", 711 "BackendInitialize failure",
705 false, 712 false,
706 ERROR_REASON_BACKEND_INIT_FAILURE); 713 ERROR_REASON_BACKEND_INIT_FAILURE);
707 return; 714 return;
708 } 715 }
709 716
710 backend_initialized_ = true; 717 backend_initialized_ = true;
711 718
712 sync_js_controller_.AttachJsBackend(js_backend); 719 sync_js_controller_.AttachJsBackend(js_backend);
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 1799 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
1793 ProfileSyncService* old_this = this; 1800 ProfileSyncService* old_this = this;
1794 this->~ProfileSyncService(); 1801 this->~ProfileSyncService();
1795 new(old_this) ProfileSyncService( 1802 new(old_this) ProfileSyncService(
1796 new ProfileSyncComponentsFactoryImpl(profile, 1803 new ProfileSyncComponentsFactoryImpl(profile,
1797 CommandLine::ForCurrentProcess()), 1804 CommandLine::ForCurrentProcess()),
1798 profile, 1805 profile,
1799 signin, 1806 signin,
1800 behavior); 1807 behavior);
1801 } 1808 }
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698