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

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

Issue 551843003: Persist Directory to disk when the app is backgrounded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test and use SyncBackendHostCore::SaveChanges(). Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/glue/sync_backend_host_impl.h" 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 void SyncBackendHostImpl::GetModelSafeRoutingInfo( 500 void SyncBackendHostImpl::GetModelSafeRoutingInfo(
501 syncer::ModelSafeRoutingInfo* out) const { 501 syncer::ModelSafeRoutingInfo* out) const {
502 if (initialized()) { 502 if (initialized()) {
503 CHECK(registrar_.get()); 503 CHECK(registrar_.get());
504 registrar_->GetModelSafeRoutingInfo(out); 504 registrar_->GetModelSafeRoutingInfo(out);
505 } else { 505 } else {
506 NOTREACHED(); 506 NOTREACHED();
507 } 507 }
508 } 508 }
509 509
510 void SyncBackendHostImpl::FlushDirectory() const {
511 DCHECK(initialized());
512 registrar_->sync_thread()->message_loop()->PostTask(FROM_HERE,
513 base::Bind(&SyncBackendHostCore::SaveChanges, core_));
514 }
515
510 void SyncBackendHostImpl::RequestBufferedProtocolEventsAndEnableForwarding() { 516 void SyncBackendHostImpl::RequestBufferedProtocolEventsAndEnableForwarding() {
511 registrar_->sync_thread()->message_loop()->PostTask( 517 registrar_->sync_thread()->message_loop()->PostTask(
512 FROM_HERE, 518 FROM_HERE,
513 base::Bind( 519 base::Bind(
514 &SyncBackendHostCore::SendBufferedProtocolEventsAndEnableForwarding, 520 &SyncBackendHostCore::SendBufferedProtocolEventsAndEnableForwarding,
515 core_)); 521 core_));
516 } 522 }
517 523
518 void SyncBackendHostImpl::DisableProtocolEventForwarding() { 524 void SyncBackendHostImpl::DisableProtocolEventForwarding() {
519 registrar_->sync_thread()->message_loop()->PostTask( 525 registrar_->sync_thread()->message_loop()->PostTask(
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 877
872 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { 878 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() {
873 return registrar_->sync_thread()->message_loop(); 879 return registrar_->sync_thread()->message_loop();
874 } 880 }
875 881
876 } // namespace browser_sync 882 } // namespace browser_sync
877 883
878 #undef SDVLOG 884 #undef SDVLOG
879 885
880 #undef SLOG 886 #undef SLOG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698