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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 6902101: Refactor sync passphrase setup flow and fix passphrase tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test. Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 void SyncBackendHost::Core::NotifyPassphraseFailed() { 545 void SyncBackendHost::Core::NotifyPassphraseFailed() {
546 if (!host_ || !host_->frontend_) 546 if (!host_ || !host_->frontend_)
547 return; 547 return;
548 548
549 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); 549 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_);
550 550
551 // When a passphrase fails, we just unset our waiting flag and trigger a 551 // When a passphrase fails, we just unset our waiting flag and trigger a
552 // OnPassphraseRequired(true). 552 // OnPassphraseRequired(true).
553 processing_passphrase_ = false; 553 processing_passphrase_ = false;
554 host_->frontend_->OnPassphraseRequired(true); 554 host_->frontend_->OnPassphraseFailed();
555 } 555 }
556 556
557 void SyncBackendHost::Core::NotifyPassphraseAccepted( 557 void SyncBackendHost::Core::NotifyPassphraseAccepted(
558 const std::string& bootstrap_token) { 558 const std::string& bootstrap_token) {
559 if (!host_ || !host_->frontend_) 559 if (!host_ || !host_->frontend_)
560 return; 560 return;
561 561
562 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); 562 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_);
563 563
564 processing_passphrase_ = false; 564 processing_passphrase_ = false;
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); 1154 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop());
1155 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); 1155 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender);
1156 } 1156 }
1157 1157
1158 void SyncBackendHost::Core::DeferNudgeForCleanup() { 1158 void SyncBackendHost::Core::DeferNudgeForCleanup() {
1159 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); 1159 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop());
1160 deferred_nudge_for_cleanup_requested_ = true; 1160 deferred_nudge_for_cleanup_requested_ = true;
1161 } 1161 }
1162 1162
1163 } // namespace browser_sync 1163 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698