OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 7 #include <algorithm> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 << " -- ProfileSyncService unusable: " << message; | 542 << " -- ProfileSyncService unusable: " << message; |
543 | 543 |
544 // Shut all data types down. | 544 // Shut all data types down. |
545 MessageLoop::current()->PostTask(FROM_HERE, | 545 MessageLoop::current()->PostTask(FROM_HERE, |
546 scoped_runnable_method_factory_.NewRunnableMethod( | 546 scoped_runnable_method_factory_.NewRunnableMethod( |
547 &ProfileSyncService::Shutdown, true)); | 547 &ProfileSyncService::Shutdown, true)); |
548 } | 548 } |
549 | 549 |
550 void ProfileSyncService::OnBackendInitialized( | 550 void ProfileSyncService::OnBackendInitialized( |
551 const WeakHandle<JsBackend>& js_backend, bool success) { | 551 const WeakHandle<JsBackend>& js_backend, bool success) { |
552 if (HasSyncSetupCompleted()) { | 552 if (!HasSyncSetupCompleted()) { |
553 UMA_HISTOGRAM_BOOLEAN("Sync.FirstBackendInitializeSuccess", success); | 553 UMA_HISTOGRAM_BOOLEAN("Sync.BackendInitializeFirstTimeSuccess", success); |
554 } else { | 554 } else { |
555 UMA_HISTOGRAM_BOOLEAN("Sync.RestoreBackendInitializeSuccess", success); | 555 UMA_HISTOGRAM_BOOLEAN("Sync.BackendInitializeRestoreSuccess", success); |
556 } | 556 } |
557 | 557 |
558 if (!success) { | 558 if (!success) { |
559 // Something went unexpectedly wrong. Play it safe: nuke our current state | 559 // Something went unexpectedly wrong. Play it safe: nuke our current state |
560 // and prepare ourselves to try again later. | 560 // and prepare ourselves to try again later. |
561 DisableForUser(); | 561 DisableForUser(); |
562 return; | 562 return; |
563 } | 563 } |
564 | 564 |
565 backend_initialized_ = true; | 565 backend_initialized_ = true; |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 << "Unrecoverable error."; | 1536 << "Unrecoverable error."; |
1537 } else { | 1537 } else { |
1538 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " | 1538 VLOG(0) << "ConfigureDataTypeManager not invoked because backend is not " |
1539 << "initialized"; | 1539 << "initialized"; |
1540 } | 1540 } |
1541 } | 1541 } |
1542 | 1542 |
1543 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { | 1543 const FailedDatatypesHandler& ProfileSyncService::failed_datatypes_handler() { |
1544 return failed_datatypes_handler_; | 1544 return failed_datatypes_handler_; |
1545 } | 1545 } |
OLD | NEW |