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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 (base::strncasecmp(base_name.c_str(), | 74 (base::strncasecmp(base_name.c_str(), |
75 win_vista_recycle_bin_name, | 75 win_vista_recycle_bin_name, |
76 strlen(win_vista_recycle_bin_name)) == 0)) | 76 strlen(win_vista_recycle_bin_name)) == 0)) |
77 return true; | 77 return true; |
78 #endif | 78 #endif |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
82 // Returns true if the current thread is capable of doing IO. | 82 // Returns true if the current thread is capable of doing IO. |
83 bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) { | 83 bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) { |
84 return context->file_system_context()->task_runners()-> | 84 return context->task_runner()->RunsTasksOnCurrentThread(); |
85 media_task_runner()->RunsTasksOnCurrentThread(); | |
86 } | 85 } |
87 | 86 |
88 MediaPathFilter* GetMediaPathFilter( | 87 MediaPathFilter* GetMediaPathFilter( |
89 fileapi::FileSystemOperationContext* context) { | 88 fileapi::FileSystemOperationContext* context) { |
90 return context->GetUserValue<MediaPathFilter*>( | 89 return context->GetUserValue<MediaPathFilter*>( |
91 MediaFileSystemMountPointProvider::kMediaPathFilterKey); | 90 MediaFileSystemMountPointProvider::kMediaPathFilterKey); |
92 } | 91 } |
93 | 92 |
94 } // namespace | 93 } // namespace |
95 | 94 |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 if (!file_info.is_directory && | 633 if (!file_info.is_directory && |
635 !GetMediaPathFilter(context)->Match(file_path)) { | 634 !GetMediaPathFilter(context)->Match(file_path)) { |
636 return failure_error; | 635 return failure_error; |
637 } | 636 } |
638 | 637 |
639 *local_file_path = file_path; | 638 *local_file_path = file_path; |
640 return base::PLATFORM_FILE_OK; | 639 return base::PLATFORM_FILE_OK; |
641 } | 640 } |
642 | 641 |
643 } // namespace chrome | 642 } // namespace chrome |
OLD | NEW |