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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_core.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 thread check and fix a comment. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/sync_backend_host_core.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_core.cc b/chrome/browser/sync/glue/sync_backend_host_core.cc
index 2a78040131e0e7894375a1f11fa40c2e0285eb66..ff5a09962f2c987061b5e67e72e4bc0fd71eb893 100644
--- a/chrome/browser/sync/glue/sync_backend_host_core.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_core.cc
@@ -23,6 +23,7 @@
#include "sync/internal_api/public/sync_context_proxy.h"
#include "sync/internal_api/public/sync_manager.h"
#include "sync/internal_api/public/sync_manager_factory.h"
+#include "sync/syncable/directory.h"
#include "url/gurl.h"
// Helper macros to log with the syncer thread name; useful when there
@@ -662,6 +663,15 @@ void SyncBackendHostCore::DoRetryConfiguration(
retry_callback);
}
+void SyncBackendHostCore::DoFlushDirectory() {
+ DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
+ syncer::syncable::Directory* directory =
Nicolas Zea 2014/09/15 22:38:59 What will this do if the SBH isn't initialized yet
maxbogue 2014/09/16 15:34:31 Which part will currently crash? How would the cal
Nicolas Zea 2014/09/18 16:52:17 The SyncManager is only created when DoInitialize
maxbogue 2014/09/22 17:23:25 Fixed this in PSS.
+ sync_manager()->GetUserShare()->directory.get();
+ if (directory != NULL) {
+ directory->SaveChanges();
+ }
+}
+
void SyncBackendHostCore::SendBufferedProtocolEventsAndEnableForwarding() {
DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
forward_protocol_events_ = true;

Powered by Google App Engine
This is Rietveld 408576698