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

Unified Diff: chrome/browser/chromeos/drive/file_system/open_file_operation.cc

Issue 23816002: drive: Stop using resource ID to access local metadata in OpenFileOperation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new Created 7 years, 3 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/chromeos/drive/file_system/open_file_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/open_file_operation.cc b/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
index 95fedf3b168db185749b202324857bb85c2aa939..9b54aa8c69686232925f02b823d3608d2a084a52 100644
--- a/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/open_file_operation.cc
@@ -126,17 +126,17 @@ void OpenFileOperation::OpenFileAfterFileDownloaded(
FROM_HERE,
base::Bind(&internal::FileCache::MarkDirty,
base::Unretained(cache_),
- entry->resource_id()),
+ entry->local_id()),
base::Bind(&OpenFileOperation::OpenFileAfterMarkDirty,
weak_ptr_factory_.GetWeakPtr(),
local_file_path,
- entry->resource_id(),
+ entry->local_id(),
callback));
}
void OpenFileOperation::OpenFileAfterMarkDirty(
const base::FilePath& local_file_path,
- const std::string& resource_id,
+ const std::string& local_id,
const OpenFileCallback& callback,
FileError error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -147,20 +147,20 @@ void OpenFileOperation::OpenFileAfterMarkDirty(
return;
}
- ++open_files_[resource_id];
+ ++open_files_[local_id];
callback.Run(error, local_file_path,
base::Bind(&OpenFileOperation::CloseFile,
- weak_ptr_factory_.GetWeakPtr(), resource_id));
+ weak_ptr_factory_.GetWeakPtr(), local_id));
}
-void OpenFileOperation::CloseFile(const std::string& resource_id) {
+void OpenFileOperation::CloseFile(const std::string& local_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_GT(open_files_[resource_id], 0);
+ DCHECK_GT(open_files_[local_id], 0);
- if (--open_files_[resource_id] == 0) {
+ if (--open_files_[local_id] == 0) {
// All clients closes this file, so notify to upload the file.
- open_files_.erase(resource_id);
- observer_->OnCacheFileUploadNeededByOperation(resource_id);
+ open_files_.erase(local_id);
+ observer_->OnCacheFileUploadNeededByOperation(local_id);
// Clients may have enlarged the file. By FreeDiskpSpaceIfNeededFor(0),
// we try to ensure (0 + the-minimum-safe-margin = 512MB as of now) space.

Powered by Google App Engine
This is Rietveld 408576698