This source file includes following definitions.
- task_runner_
- GetDriveService
- GetDriveUploader
- GetMetadataDatabase
- PassMetadataDatabase
- GetRemoteChangeProcessor
- GetBlockingTaskRunner
- SetMetadataDatabase
- SetRemoteChangeProcessor
#include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h"
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/drive/drive_service_interface.h"
#include "chrome/browser/drive/drive_uploader.h"
#include "chrome/browser/sync_file_system/drive_backend/metadata_database.h"
#include "chrome/browser/sync_file_system/remote_change_processor.h"
namespace sync_file_system {
namespace drive_backend {
SyncEngineContext::SyncEngineContext(
scoped_ptr<drive::DriveServiceInterface> drive_service,
scoped_ptr<drive::DriveUploaderInterface> drive_uploader,
base::SequencedTaskRunner* task_runner)
: drive_service_(drive_service.Pass()),
drive_uploader_(drive_uploader.Pass()),
remote_change_processor_(NULL),
task_runner_(task_runner) {}
SyncEngineContext::~SyncEngineContext() {}
drive::DriveServiceInterface* SyncEngineContext::GetDriveService() {
return drive_service_.get();
}
drive::DriveUploaderInterface* SyncEngineContext::GetDriveUploader() {
return drive_uploader_.get();
}
MetadataDatabase* SyncEngineContext::GetMetadataDatabase() {
return metadata_database_.get();
}
scoped_ptr<MetadataDatabase> SyncEngineContext::PassMetadataDatabase() {
return metadata_database_.Pass();
}
RemoteChangeProcessor* SyncEngineContext::GetRemoteChangeProcessor() {
return remote_change_processor_;
}
base::SequencedTaskRunner* SyncEngineContext::GetBlockingTaskRunner() {
return task_runner_.get();
}
void SyncEngineContext::SetMetadataDatabase(
scoped_ptr<MetadataDatabase> metadata_database) {
if (metadata_database)
metadata_database_ = metadata_database.Pass();
}
void SyncEngineContext::SetRemoteChangeProcessor(
RemoteChangeProcessor* remote_change_processor) {
remote_change_processor_ = remote_change_processor;
}
}
}