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

Unified Diff: chrome/browser/sync_file_system/local/local_file_sync_service.cc

Issue 23578026: Use SNAPSHOT sync mode for LocalSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased on thread_bundle fix Created 7 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_file_system/local/local_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.cc b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
index 33fbb34757feabae27d3aacca15f3c41bc094940..8a987b85617794a3ffc417a787a14b7c8edd173d 100644
--- a/chrome/browser/sync_file_system/local/local_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/local/local_file_sync_service.cc
@@ -22,6 +22,7 @@
#include "url/gurl.h"
#include "webkit/browser/fileapi/file_system_context.h"
#include "webkit/browser/fileapi/file_system_url.h"
+#include "webkit/common/blob/scoped_file.h"
using content::BrowserThread;
using fileapi::FileSystemURL;
@@ -33,7 +34,8 @@ namespace {
void PrepareForProcessRemoteChangeCallbackAdapter(
const RemoteChangeProcessor::PrepareChangeCallback& callback,
SyncStatusCode status,
- const LocalFileSyncInfo& sync_file_info) {
+ const LocalFileSyncInfo& sync_file_info,
+ scoped_ptr<webkit_blob::ScopedFile> snapshot) {
callback.Run(status, sync_file_info.metadata, sync_file_info.changes);
}
@@ -97,6 +99,7 @@ void LocalFileSyncService::OriginChangeMap::SetOriginEnabled(
LocalFileSyncService::LocalFileSyncService(Profile* profile)
: profile_(profile),
sync_context_(new LocalFileSyncContext(
+ profile_->GetPath(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)
.get())),
@@ -362,7 +365,8 @@ void LocalFileSyncService::RunLocalSyncCallback(
void LocalFileSyncService::DidGetFileForLocalSync(
SyncStatusCode status,
- const LocalFileSyncInfo& sync_file_info) {
+ const LocalFileSyncInfo& sync_file_info,
+ scoped_ptr<webkit_blob::ScopedFile> snapshot) {
DCHECK(!local_sync_callback_.is_null());
if (status != SYNC_STATUS_OK) {
RunLocalSyncCallback(status, sync_file_info.url);
@@ -386,11 +390,12 @@ void LocalFileSyncService::DidGetFileForLocalSync(
sync_file_info.metadata,
sync_file_info.url,
base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
- AsWeakPtr(), sync_file_info,
+ AsWeakPtr(), base::Passed(&snapshot), sync_file_info,
next_change, sync_file_info.changes.PopAndGetNewList()));
}
void LocalFileSyncService::ProcessNextChangeForURL(
+ scoped_ptr<webkit_blob::ScopedFile> snapshot,
const LocalFileSyncInfo& sync_file_info,
const FileChange& processed_change,
const FileChangeList& changes,
@@ -407,7 +412,8 @@ void LocalFileSyncService::ProcessNextChangeForURL(
sync_file_info.metadata,
sync_file_info.url,
base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
- AsWeakPtr(), sync_file_info, processed_change, changes));
+ AsWeakPtr(), base::Passed(&snapshot),
+ sync_file_info, processed_change, changes));
return;
}
@@ -434,7 +440,7 @@ void LocalFileSyncService::ProcessNextChangeForURL(
sync_file_info.metadata,
url,
base::Bind(&LocalFileSyncService::ProcessNextChangeForURL,
- AsWeakPtr(), sync_file_info,
+ AsWeakPtr(), base::Passed(&snapshot), sync_file_info,
next_change, changes.PopAndGetNewList()));
}

Powered by Google App Engine
This is Rietveld 408576698