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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc

Issue 10815008: gdata: Make GDataFileSystem::ReadDirectoryByPath() much more efficient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove a blank line Created 8 years, 5 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/gdata/gdata_file_system_proxy.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
index 6f4c18623196c6bf0d90366f5d790e77da9bef6b..3ab8e60d90acff0dc4251addf8bc8ea6b19ad69e 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
@@ -677,7 +677,7 @@ void GDataFileSystemProxy::OnReadDirectory(
callback,
GDataFileError error,
bool hide_hosted_documents,
- scoped_ptr<gdata::GDataDirectoryProto> directory_proto) {
+ scoped_ptr<gdata::GDataEntryProtoVector> proto_entries) {
achuithb 2012/07/21 22:34:19 same
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (error != GDATA_FILE_OK) {
@@ -686,18 +686,17 @@ void GDataFileSystemProxy::OnReadDirectory(
false);
return;
}
+ DCHECK(proto_entries.get());
+
std::vector<base::FileUtilProxy::Entry> entries;
// Convert gdata files to something File API stack can understand.
- for (int i = 0; i < directory_proto->child_directories_size(); ++i) {
- const GDataDirectoryProto& proto = directory_proto->child_directories(i);
- entries.push_back(
- GDataEntryProtoToFileUtilProxyEntry(proto.gdata_entry()));
- }
- for (int i = 0; i < directory_proto->child_files_size(); ++i) {
- const GDataEntryProto& proto = directory_proto->child_files(i);
- if (hide_hosted_documents &&
- proto.file_specific_info().is_hosted_document())
- continue;
+ for (size_t i = 0; i < proto_entries->size(); ++i) {
+ const GDataEntryProto& proto = (*proto_entries)[i];
+ if (proto.has_file_specific_info() &&
+ proto.file_specific_info().is_hosted_document() &&
+ hide_hosted_documents) {
+ continue;
+ }
entries.push_back(GDataEntryProtoToFileUtilProxyEntry(proto));
}

Powered by Google App Engine
This is Rietveld 408576698