root/chrome/browser/sync_file_system/drive_backend/sync_engine_context.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. task_runner_
  2. GetDriveService
  3. GetDriveUploader
  4. GetMetadataDatabase
  5. PassMetadataDatabase
  6. GetRemoteChangeProcessor
  7. GetBlockingTaskRunner
  8. SetMetadataDatabase
  9. SetRemoteChangeProcessor

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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;
}

}  // namespace drive_backend
}  // namespace sync_file_system

/* [<][>][^][v][top][bottom][index][help] */