OLD | NEW |
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 base::FilePath* local_file_path) { | 646 base::FilePath* local_file_path) { |
647 DCHECK(IsOnTaskRunnerThread(context)); | 647 DCHECK(IsOnTaskRunnerThread(context)); |
648 base::FilePath file_path; | 648 base::FilePath file_path; |
649 base::PlatformFileError error = | 649 base::PlatformFileError error = |
650 GetLocalFilePath(context, file_system_url, &file_path); | 650 GetLocalFilePath(context, file_system_url, &file_path); |
651 if (error != base::PLATFORM_FILE_OK) | 651 if (error != base::PLATFORM_FILE_OK) |
652 return error; | 652 return error; |
653 | 653 |
654 if (!base::PathExists(file_path)) | 654 if (!base::PathExists(file_path)) |
655 return failure_error; | 655 return failure_error; |
656 base::PlatformFileInfo file_info; | 656 base::File::Info file_info; |
657 if (!base::GetFileInfo(file_path, &file_info)) | 657 if (!base::GetFileInfo(file_path, &file_info)) |
658 return base::PLATFORM_FILE_ERROR_FAILED; | 658 return base::PLATFORM_FILE_ERROR_FAILED; |
659 | 659 |
660 if (!file_info.is_directory && | 660 if (!file_info.is_directory && |
661 !media_path_filter_->Match(file_path)) { | 661 !media_path_filter_->Match(file_path)) { |
662 return failure_error; | 662 return failure_error; |
663 } | 663 } |
664 | 664 |
665 *local_file_path = file_path; | 665 *local_file_path = file_path; |
666 return base::PLATFORM_FILE_OK; | 666 return base::PLATFORM_FILE_OK; |
667 } | 667 } |
OLD | NEW |