| Index: chrome/browser/chromeos/drive/file_system/truncate_operation.cc
|
| diff --git a/chrome/browser/chromeos/drive/file_system/truncate_operation.cc b/chrome/browser/chromeos/drive/file_system/truncate_operation.cc
|
| index 7b81350341119e4baba8ea79b723ae0ab5446f56..c5c7d140fa12caf94dcceab0ca52e7a62444ca9e 100644
|
| --- a/chrome/browser/chromeos/drive/file_system/truncate_operation.cc
|
| +++ b/chrome/browser/chromeos/drive/file_system/truncate_operation.cc
|
| @@ -29,19 +29,13 @@ namespace {
|
| // then marks the resource is dirty on |cache|.
|
| FileError TruncateOnBlockingPool(internal::ResourceMetadata* metadata,
|
| internal::FileCache* cache,
|
| - const std::string& resource_id,
|
| + const std::string& local_id,
|
| const base::FilePath& local_cache_path,
|
| - int64 length,
|
| - std::string* local_id) {
|
| + int64 length) {
|
| DCHECK(metadata);
|
| DCHECK(cache);
|
| - DCHECK(local_id);
|
| -
|
| - FileError error = metadata->GetIdByResourceId(resource_id, local_id);
|
| - if (error != FILE_ERROR_OK)
|
| - return error;
|
|
|
| - error = cache->MarkDirty(*local_id);
|
| + FileError error = cache->MarkDirty(local_id);
|
| if (error != FILE_ERROR_OK)
|
| return error;
|
|
|
| @@ -133,26 +127,24 @@ void TruncateOperation::TruncateAfterEnsureFileDownloadedByPath(
|
| return;
|
| }
|
|
|
| - std::string* local_id = new std::string;
|
| base::PostTaskAndReplyWithResult(
|
| blocking_task_runner_.get(),
|
| FROM_HERE,
|
| base::Bind(&TruncateOnBlockingPool,
|
| - metadata_, cache_, entry->resource_id(), local_file_path,
|
| - length, local_id),
|
| + metadata_, cache_, entry->local_id(), local_file_path, length),
|
| base::Bind(
|
| &TruncateOperation::TruncateAfterTruncateOnBlockingPool,
|
| - weak_ptr_factory_.GetWeakPtr(), base::Owned(local_id), callback));
|
| + weak_ptr_factory_.GetWeakPtr(), entry->local_id(), callback));
|
| }
|
|
|
| void TruncateOperation::TruncateAfterTruncateOnBlockingPool(
|
| - const std::string* local_id,
|
| + const std::string& local_id,
|
| const FileOperationCallback& callback,
|
| FileError error) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| DCHECK(!callback.is_null());
|
|
|
| - observer_->OnCacheFileUploadNeededByOperation(*local_id);
|
| + observer_->OnCacheFileUploadNeededByOperation(local_id);
|
|
|
| callback.Run(error);
|
| }
|
|
|