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

Side by Side Diff: storage/browser/fileapi/file_system_dir_url_request_job.cc

Issue 1455403003: Add an option to specify requested fields for fetching metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "storage/browser/fileapi/file_system_dir_url_request_job.h" 5 #include "storage/browser/fileapi/file_system_dir_url_request_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 } 156 }
157 157
158 void FileSystemDirURLRequestJob::GetMetadata(size_t index) { 158 void FileSystemDirURLRequestJob::GetMetadata(size_t index) {
159 const DirectoryEntry& entry = entries_[index]; 159 const DirectoryEntry& entry = entries_[index];
160 const FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( 160 const FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
161 url_.origin(), url_.type(), 161 url_.origin(), url_.type(),
162 url_.path().Append(base::FilePath(entry.name))); 162 url_.path().Append(base::FilePath(entry.name)));
163 DCHECK(url.is_valid()); 163 DCHECK(url.is_valid());
164 file_system_context_->operation_runner()->GetMetadata( 164 file_system_context_->operation_runner()->GetMetadata(
165 url, 165 url, FileSystemOperation::GET_METADATA_FIELD_SIZE |
166 FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED,
166 base::Bind(&FileSystemDirURLRequestJob::DidGetMetadata, this, index)); 167 base::Bind(&FileSystemDirURLRequestJob::DidGetMetadata, this, index));
167 } 168 }
168 169
169 void FileSystemDirURLRequestJob::DidGetMetadata( 170 void FileSystemDirURLRequestJob::DidGetMetadata(
170 size_t index, 171 size_t index,
171 base::File::Error result, 172 base::File::Error result,
172 const base::File::Info& file_info) { 173 const base::File::Info& file_info) {
173 if (result != base::File::FILE_OK) { 174 if (result != base::File::FILE_OK) {
174 int rv = net::ERR_FILE_NOT_FOUND; 175 int rv = net::ERR_FILE_NOT_FOUND;
175 if (result == base::File::FILE_ERROR_INVALID_URL) 176 if (result == base::File::FILE_ERROR_INVALID_URL)
(...skipping 12 matching lines...) Expand all
188 189
189 if (index < entries_.size() - 1) { 190 if (index < entries_.size() - 1) {
190 GetMetadata(index + 1); 191 GetMetadata(index + 1);
191 } else { 192 } else {
192 set_expected_content_size(data_.size()); 193 set_expected_content_size(data_.size());
193 NotifyHeadersComplete(); 194 NotifyHeadersComplete();
194 } 195 }
195 } 196 }
196 197
197 } // namespace storage 198 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/file_system_context.cc ('k') | storage/browser/fileapi/file_system_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698