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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 11187021: Add RemoteFileSyncService interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/sync_file_system_service.cc
diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc
index 3e2d7070aa9f90acc149ba24c63895e006721256..6e7ed7ff0f1165c32049d065583e00bc766608e9 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
#include "chrome/browser/sync_file_system/local_file_sync_service.h"
+#include "chrome/browser/sync_file_system/remote_file_sync_service.h"
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
#include "webkit/fileapi/file_system_context.h"
@@ -25,6 +26,8 @@ void SyncFileSystemService::Shutdown() {
local_file_service_->Shutdown();
local_file_service_.reset();
+ remote_file_service_.reset();
+
profile_ = NULL;
}
@@ -38,15 +41,17 @@ void SyncFileSystemService::InitializeForApp(
const std::string& service_name,
const GURL& app_url,
const StatusCallback& callback) {
- DCHECK(local_file_service_.get());
+ DCHECK(local_file_service_);
// TODO(kinuko,tzik): Instantiate the remote_file_service for the given
// |service_name| if it hasn't been initialized.
local_file_service_->MaybeInitializeFileSystemContext(
- app_url, file_system_context, callback);
+ app_url.GetOrigin(), file_system_context, callback);
- // TODO(tzik): Hook up remote service initialization code.
+ // TODO(tzik): Uncomment this line after its implementation lands.
+ // remote_file_service_->RegisterOriginForTrackingChanges(
+ // app_url.GetOrigin());
}
void SyncFileSystemService::OnLocalChangeAvailable(int64 pending_changes) {
@@ -67,12 +72,17 @@ SyncFileSystemService::SyncFileSystemService(Profile* profile)
pending_remote_changes_(0) {}
void SyncFileSystemService::Initialize(
- scoped_ptr<LocalFileSyncService> local_file_service) {
+ scoped_ptr<LocalFileSyncService> local_file_service,
+ scoped_ptr<RemoteFileSyncService> remote_file_service) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(local_file_service.get());
DCHECK(profile_);
local_file_service_ = local_file_service.Pass();
+ remote_file_service_ = remote_file_service.Pass();
+
+ // TODO(tzik): Uncomment this line after RemoteChangeObserver lands.
+ // remote_file_service_->AddObserver(this);
}
// SyncFileSystemServiceFactory -----------------------------------------------
@@ -105,8 +115,12 @@ ProfileKeyedService* SyncFileSystemServiceFactory::BuildServiceInstanceFor(
scoped_ptr<LocalFileSyncService> local_file_service(
new LocalFileSyncService);
- service->Initialize(local_file_service.Pass());
+ scoped_ptr<RemoteFileSyncService> remote_file_service;
+ // TODO(tzik): Instantiate DriveFileSyncService.
+
+ service->Initialize(local_file_service.Pass(),
+ remote_file_service.Pass());
return service;
}
-} // namespace chrome
+} // namespace sync_file_system
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698