| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 } | 614 } |
| 615 | 615 |
| 616 void ProfileSyncService::DisableBrokenDatatype( | 616 void ProfileSyncService::DisableBrokenDatatype( |
| 617 syncable::ModelType type, | 617 syncable::ModelType type, |
| 618 const tracked_objects::Location& from_here, | 618 const tracked_objects::Location& from_here, |
| 619 std::string message) { | 619 std::string message) { |
| 620 // First deactivate the type so that no further server changes are | 620 // First deactivate the type so that no further server changes are |
| 621 // passed onto the change processor. | 621 // passed onto the change processor. |
| 622 DeactivateDataType(type); | 622 DeactivateDataType(type); |
| 623 | 623 |
| 624 SyncError error(from_here, message, type); | 624 csync::SyncError error(from_here, message, type); |
| 625 | 625 |
| 626 std::list<SyncError> errors; | 626 std::list<csync::SyncError> errors; |
| 627 errors.push_back(error); | 627 errors.push_back(error); |
| 628 | 628 |
| 629 // Update this before posting a task. So if a configure happens before | 629 // Update this before posting a task. So if a configure happens before |
| 630 // the task that we are going to post, this type would still be disabled. | 630 // the task that we are going to post, this type would still be disabled. |
| 631 failed_datatypes_handler_.UpdateFailedDatatypes(errors, | 631 failed_datatypes_handler_.UpdateFailedDatatypes(errors, |
| 632 FailedDatatypesHandler::RUNTIME); | 632 FailedDatatypesHandler::RUNTIME); |
| 633 | 633 |
| 634 MessageLoop::current()->PostTask(FROM_HERE, | 634 MessageLoop::current()->PostTask(FROM_HERE, |
| 635 base::Bind(&ProfileSyncService::ReconfigureDatatypeManager, | 635 base::Bind(&ProfileSyncService::ReconfigureDatatypeManager, |
| 636 weak_factory_.GetWeakPtr())); | 636 weak_factory_.GetWeakPtr())); |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 return; | 1411 return; |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 // Handle unrecoverable error. | 1414 // Handle unrecoverable error. |
| 1415 if (configure_status_ != DataTypeManager::OK && | 1415 if (configure_status_ != DataTypeManager::OK && |
| 1416 configure_status_ != DataTypeManager::PARTIAL_SUCCESS) { | 1416 configure_status_ != DataTypeManager::PARTIAL_SUCCESS) { |
| 1417 // Something catastrophic had happened. We should only have one | 1417 // Something catastrophic had happened. We should only have one |
| 1418 // error representing it. | 1418 // error representing it. |
| 1419 DCHECK_EQ(result->failed_data_types.size(), | 1419 DCHECK_EQ(result->failed_data_types.size(), |
| 1420 static_cast<unsigned int>(1)); | 1420 static_cast<unsigned int>(1)); |
| 1421 SyncError error = result->failed_data_types.front(); | 1421 csync::SyncError error = result->failed_data_types.front(); |
| 1422 DCHECK(error.IsSet()); | 1422 DCHECK(error.IsSet()); |
| 1423 std::string message = | 1423 std::string message = |
| 1424 "Sync configuration failed with status " + | 1424 "Sync configuration failed with status " + |
| 1425 DataTypeManager::ConfigureStatusToString(configure_status_) + | 1425 DataTypeManager::ConfigureStatusToString(configure_status_) + |
| 1426 " during " + syncable::ModelTypeToString(error.type()) + | 1426 " during " + syncable::ModelTypeToString(error.type()) + |
| 1427 ": " + error.message(); | 1427 ": " + error.message(); |
| 1428 LOG(ERROR) << "ProfileSyncService error: " | 1428 LOG(ERROR) << "ProfileSyncService error: " |
| 1429 << message; | 1429 << message; |
| 1430 OnInternalUnrecoverableError(error.location(), | 1430 OnInternalUnrecoverableError(error.location(), |
| 1431 message, | 1431 message, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1652 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
| 1653 ProfileSyncService* old_this = this; | 1653 ProfileSyncService* old_this = this; |
| 1654 this->~ProfileSyncService(); | 1654 this->~ProfileSyncService(); |
| 1655 new(old_this) ProfileSyncService( | 1655 new(old_this) ProfileSyncService( |
| 1656 new ProfileSyncComponentsFactoryImpl(profile, | 1656 new ProfileSyncComponentsFactoryImpl(profile, |
| 1657 CommandLine::ForCurrentProcess()), | 1657 CommandLine::ForCurrentProcess()), |
| 1658 profile, | 1658 profile, |
| 1659 signin, | 1659 signin, |
| 1660 behavior); | 1660 behavior); |
| 1661 } | 1661 } |
| OLD | NEW |