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

Side by Side Diff: chrome/browser/media_galleries/fileapi/native_media_file_util.cc

Issue 1432403003: Do not call stat() when reading directories via File API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed FSP tests. 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 "chrome/browser/media_galleries/fileapi/native_media_file_util.h" 5 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 // NativeMediaFileUtil skip criteria. 573 // NativeMediaFileUtil skip criteria.
574 if (MediaPathFilter::ShouldSkip(enum_path)) 574 if (MediaPathFilter::ShouldSkip(enum_path))
575 continue; 575 continue;
576 if (!info.IsDirectory() && !media_path_filter_->Match(enum_path)) 576 if (!info.IsDirectory() && !media_path_filter_->Match(enum_path))
577 continue; 577 continue;
578 578
579 storage::DirectoryEntry entry; 579 storage::DirectoryEntry entry;
580 entry.is_directory = info.IsDirectory(); 580 entry.is_directory = info.IsDirectory();
581 entry.name = enum_path.BaseName().value(); 581 entry.name = enum_path.BaseName().value();
582 entry.size = info.GetSize();
583 entry.last_modified_time = info.GetLastModifiedTime();
584 582
585 file_list->push_back(entry); 583 file_list->push_back(entry);
586 } 584 }
587 585
588 return base::File::FILE_OK; 586 return base::File::FILE_OK;
589 } 587 }
590 588
591 base::File::Error NativeMediaFileUtil::DeleteFileSync( 589 base::File::Error NativeMediaFileUtil::DeleteFileSync(
592 storage::FileSystemOperationContext* context, 590 storage::FileSystemOperationContext* context,
593 const storage::FileSystemURL& url) { 591 const storage::FileSystemURL& url) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 return base::File::FILE_ERROR_FAILED; 669 return base::File::FILE_ERROR_FAILED;
672 670
673 if (!file_info.is_directory && 671 if (!file_info.is_directory &&
674 !media_path_filter_->Match(file_path)) { 672 !media_path_filter_->Match(file_path)) {
675 return failure_error; 673 return failure_error;
676 } 674 }
677 675
678 *local_file_path = file_path; 676 *local_file_path = file_path;
679 return base::File::FILE_OK; 677 return base::File::FILE_OK;
680 } 678 }
OLDNEW
« no previous file with comments | « chrome/browser/media_galleries/fileapi/itunes_file_util.cc ('k') | chrome/browser/media_galleries/fileapi/picasa_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698