OLD | NEW |
---|---|
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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 } | 656 } |
657 start_up_time_ = base::Time(); | 657 start_up_time_ = base::Time(); |
658 } | 658 } |
659 | 659 |
660 if (!success) { | 660 if (!success) { |
661 // Something went unexpectedly wrong. Play it safe: stop syncing at once | 661 // Something went unexpectedly wrong. Play it safe: stop syncing at once |
662 // and surface error UI to alert the user sync has stopped. | 662 // and surface error UI to alert the user sync has stopped. |
663 // Keep the directory around for now so that on restart we will retry | 663 // Keep the directory around for now so that on restart we will retry |
664 // again and potentially succeed in presence of transient file IO failures | 664 // again and potentially succeed in presence of transient file IO failures |
665 // or permissions issues, etc. | 665 // or permissions issues, etc. |
666 // | |
667 // TODO(rlarocque): Consider making this UnrecoverableError less special. | |
668 // This exception made sense at the time it was implemented, but our new | |
669 // directory corruption recovery mechanism makes it obsolete. By the time | |
670 // we get here, we will have already tried and failed to delete the | |
671 // directory. Whether or not we try to delete it again after the error is | |
tim (not reviewing)
2012/08/02 00:31:18
Ah, maybe reword these last sentences to be explic
| |
672 // thrown likely won't make a difference. | |
666 OnInternalUnrecoverableError(FROM_HERE, | 673 OnInternalUnrecoverableError(FROM_HERE, |
667 "BackendInitialize failure", | 674 "BackendInitialize failure", |
668 false, | 675 false, |
669 ERROR_REASON_BACKEND_INIT_FAILURE); | 676 ERROR_REASON_BACKEND_INIT_FAILURE); |
670 return; | 677 return; |
671 } | 678 } |
672 | 679 |
673 backend_initialized_ = true; | 680 backend_initialized_ = true; |
674 | 681 |
675 sync_js_controller_.AttachJsBackend(js_backend); | 682 sync_js_controller_.AttachJsBackend(js_backend); |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1755 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. | 1762 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. |
1756 ProfileSyncService* old_this = this; | 1763 ProfileSyncService* old_this = this; |
1757 this->~ProfileSyncService(); | 1764 this->~ProfileSyncService(); |
1758 new(old_this) ProfileSyncService( | 1765 new(old_this) ProfileSyncService( |
1759 new ProfileSyncComponentsFactoryImpl(profile, | 1766 new ProfileSyncComponentsFactoryImpl(profile, |
1760 CommandLine::ForCurrentProcess()), | 1767 CommandLine::ForCurrentProcess()), |
1761 profile, | 1768 profile, |
1762 signin, | 1769 signin, |
1763 behavior); | 1770 behavior); |
1764 } | 1771 } |
OLD | NEW |