Index: chrome/browser/chromeos/gdata/gdata_file_system.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
index d083d5d34ec7ea4344cc0b2570df4fe9d55955aa..5490eac9f2c2ae498e8f33b076a43e503e3bdaa1 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc |
@@ -834,6 +834,13 @@ CallbackType CreateRelayCallback(const CallbackType& callback) { |
} // namespace |
+void ReadOnlyFindEntryCallback(GDataEntry** out, |
+ base::PlatformFileError error, |
+ GDataEntry* entry) { |
+ if (error == base::PLATFORM_FILE_OK) |
+ *out = entry; |
+} |
+ |
// GDataFileSystem::GetDocumentsParams struct implementation. |
GDataFileSystem::GetDocumentsParams::GetDocumentsParams( |
@@ -1050,11 +1057,23 @@ void GDataFileSystem::Authenticate(const AuthStatusCallback& callback) { |
documents_service_->Authenticate(callback); |
} |
-void GDataFileSystem::FindEntryByResourceIdSync( |
+void GDataFileSystem::FindEntryByResourceId(const std::string& resource_id, |
+ const FindEntryCallback& callback) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
+ BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ RunTaskOnUIThread( |
+ base::Bind(&GDataFileSystem::FindEntryByResourceIdOnUIThread, |
+ ui_weak_ptr_, |
+ resource_id, |
+ CreateRelayCallback(callback))); |
+} |
+ |
+void GDataFileSystem::FindEntryByResourceIdOnUIThread( |
const std::string& resource_id, |
const FindEntryCallback& callback) { |
- base::AutoLock lock(lock_); // To access root. |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ base::AutoLock lock(lock_); // To access root. |
GDataFile* file = NULL; |
GDataEntry* entry = root_->GetEntryByResourceId(resource_id); |
if (entry) |