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

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: '' 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
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 e4df2aa917bdf65d93ee6fde6f7831edf4c15180..492a4001cb7e62a28eb05f06d6179ecaf1c07ac2 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,10 @@ void SyncFileSystemService::Shutdown() {
local_file_service_->Shutdown();
local_file_service_.reset();
+ // TODO(tzik): Uncomment this line after RemoteChangeObserver lands.
+ // remote_file_service_->RemoveObserver(this);
kinuko 2012/10/23 08:12:14 Not sure if this line is really necessary...
tzik 2012/10/24 03:32:33 Done.
+ remote_file_service_.reset();
+
profile_ = NULL;
}
@@ -38,27 +43,33 @@ 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.
+ if (remote_file_service_)
+ remote_file_service_->RegisterOriginForTrackingChanges(app_url.GetOrigin());
}
SyncFileSystemService::SyncFileSystemService(Profile* profile)
: profile_(profile) {}
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 -----------------------------------------------
@@ -91,8 +102,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

Powered by Google App Engine
This is Rietveld 408576698