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

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: rebased onto separate CL 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 e4df2aa917bdf65d93ee6fde6f7831edf4c15180..2526f271bebf50a47d03f6e824f55f63a065dc58 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,27 +41,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());
kinuko 2012/10/24 05:17:21 I think this line should be added when you add imp
tzik 2012/10/24 05:32:52 Done.
}
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 +100,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