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

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

Issue 2113453006: [Sync] Stop purging sync data on restart for users who haven't finished setup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 350
351 // If sync isn't allowed, the only thing to do is to turn it off. 351 // If sync isn't allowed, the only thing to do is to turn it off.
352 if (!IsSyncAllowed()) { 352 if (!IsSyncAllowed()) {
353 // Only clear data if disallowed by policy. 353 // Only clear data if disallowed by policy.
354 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA); 354 RequestStop(IsManaged() ? CLEAR_DATA : KEEP_DATA);
355 return; 355 return;
356 } 356 }
357 357
358 RegisterAuthNotifications(); 358 RegisterAuthNotifications();
359 359
360 if (!IsFirstSetupComplete() || !IsSignedIn()) { 360 if (!IsSignedIn()) {
361 // Clean up in case of previous crash / setup abort / signout. 361 // Clean up in case of previous crash during signout.
362 StopImpl(CLEAR_DATA); 362 StopImpl(CLEAR_DATA);
363 } 363 }
364 364
365 #if defined(OS_CHROMEOS) 365 #if defined(OS_CHROMEOS)
366 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken(); 366 std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken();
367 if (bootstrap_token.empty()) { 367 if (bootstrap_token.empty()) {
368 sync_prefs_.SetEncryptionBootstrapToken( 368 sync_prefs_.SetEncryptionBootstrapToken(
369 sync_prefs_.GetSpareBootstrapToken()); 369 sync_prefs_.GetSpareBootstrapToken());
370 } 370 }
371 #endif 371 #endif
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2526 if (--outstanding_setup_in_progress_handles_ != 0) 2526 if (--outstanding_setup_in_progress_handles_ != 0)
2527 return; 2527 return;
2528 2528
2529 DCHECK(startup_controller_->IsSetupInProgress()); 2529 DCHECK(startup_controller_->IsSetupInProgress());
2530 startup_controller_->SetSetupInProgress(false); 2530 startup_controller_->SetSetupInProgress(false);
2531 2531
2532 if (IsBackendInitialized()) 2532 if (IsBackendInitialized())
2533 ReconfigureDatatypeManager(); 2533 ReconfigureDatatypeManager();
2534 NotifyObservers(); 2534 NotifyObservers();
2535 } 2535 }
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