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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/task_runner_util.h" | 14 #include "base/task_runner_util.h" |
15 #include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_p
rovider.h" | 15 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
16 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" | 16 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "net/base/mime_sniffer.h" | 18 #include "net/base/mime_sniffer.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 #include "webkit/browser/fileapi/file_system_context.h" | 20 #include "webkit/browser/fileapi/file_system_context.h" |
21 #include "webkit/browser/fileapi/file_system_operation_context.h" | 21 #include "webkit/browser/fileapi/file_system_operation_context.h" |
22 #include "webkit/browser/fileapi/file_system_task_runners.h" | 22 #include "webkit/browser/fileapi/file_system_task_runners.h" |
23 #include "webkit/browser/fileapi/native_file_util.h" | 23 #include "webkit/browser/fileapi/native_file_util.h" |
24 #include "webkit/common/blob/shareable_file_reference.h" | 24 #include "webkit/common/blob/shareable_file_reference.h" |
25 | 25 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 // Returns true if the current thread is capable of doing IO. | 85 // Returns true if the current thread is capable of doing IO. |
86 bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) { | 86 bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) { |
87 return context->task_runner()->RunsTasksOnCurrentThread(); | 87 return context->task_runner()->RunsTasksOnCurrentThread(); |
88 } | 88 } |
89 | 89 |
90 MediaPathFilter* GetMediaPathFilter( | 90 MediaPathFilter* GetMediaPathFilter( |
91 fileapi::FileSystemOperationContext* context) { | 91 fileapi::FileSystemOperationContext* context) { |
92 return context->GetUserValue<MediaPathFilter*>( | 92 return context->GetUserValue<MediaPathFilter*>( |
93 MediaFileSystemMountPointProvider::kMediaPathFilterKey); | 93 MediaFileSystemBackend::kMediaPathFilterKey); |
94 } | 94 } |
95 | 95 |
96 } // namespace | 96 } // namespace |
97 | 97 |
98 NativeMediaFileUtil::NativeMediaFileUtil() : weak_factory_(this) { | 98 NativeMediaFileUtil::NativeMediaFileUtil() : weak_factory_(this) { |
99 } | 99 } |
100 | 100 |
101 NativeMediaFileUtil::~NativeMediaFileUtil() { | 101 NativeMediaFileUtil::~NativeMediaFileUtil() { |
102 } | 102 } |
103 | 103 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 if (!file_info.is_directory && | 657 if (!file_info.is_directory && |
658 !GetMediaPathFilter(context)->Match(file_path)) { | 658 !GetMediaPathFilter(context)->Match(file_path)) { |
659 return failure_error; | 659 return failure_error; |
660 } | 660 } |
661 | 661 |
662 *local_file_path = file_path; | 662 *local_file_path = file_path; |
663 return base::PLATFORM_FILE_OK; | 663 return base::PLATFORM_FILE_OK; |
664 } | 664 } |
665 | 665 |
666 } // namespace chrome | 666 } // namespace chrome |
OLD | NEW |