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

Side by Side Diff: components/browser_sync/browser/profile_sync_service.cc

Issue 2126923002: [Sync] Stop purging sync data on restart for users who haven't finished setup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service_unittest.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 "components/browser_sync/browser/profile_sync_service.h" 5 #include "components/browser_sync/browser/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 // If sync isn't allowed, the only thing to do is to turn it off. 348 // If sync isn't allowed, the only thing to do is to turn it off.
349 if (!IsSyncAllowed()) { 349 if (!IsSyncAllowed()) {
350 // Only clear data if disallowed by policy. 350 // Only clear data if disallowed by policy.
351 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); 351 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA);
352 return; 352 return;
353 } 353 }
354 354
355 RegisterAuthNotifications(); 355 RegisterAuthNotifications();
356 356
357 if (!IsFirstSetupComplete() || !IsSignedIn()) { 357 if (!IsSignedIn()) {
358 // Clean up in case of previous crash / setup abort / signout. 358 // Clean up in case of previous crash during signout.
359 StopImpl(CLEAR_DATA); 359 StopImpl(CLEAR_DATA);
360 } 360 }
361 361
362 TrySyncDatatypePrefRecovery(); 362 TrySyncDatatypePrefRecovery();
363 363
364 #if defined(OS_CHROMEOS) 364 #if defined(OS_CHROMEOS)
365 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); 365 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken();
366 if (bootstrap_token.empty()) { 366 if (bootstrap_token.empty()) {
367 sync_prefs_.SetEncryptionBootstrapToken( 367 sync_prefs_.SetEncryptionBootstrapToken(
368 sync_prefs_.GetSpareBootstrapToken()); 368 sync_prefs_.GetSpareBootstrapToken());
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 } 2532 }
2533 2533
2534 std::string ProfileSyncService::unrecoverable_error_message() const { 2534 std::string ProfileSyncService::unrecoverable_error_message() const {
2535 return unrecoverable_error_message_; 2535 return unrecoverable_error_message_;
2536 } 2536 }
2537 2537
2538 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2538 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2539 const { 2539 const {
2540 return unrecoverable_error_location_; 2540 return unrecoverable_error_location_;
2541 } 2541 }
OLDNEW
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698