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

Side by Side Diff: webkit/fileapi/media/native_media_file_util.h

Issue 12703012: Have media gallery (through native media file util) use MIME sniffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor formatting responses. Created 7 years, 9 months 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 | Annotate | Revision Log
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 #ifndef WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ 5 #ifndef WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_
6 #define WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ 6 #define WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "webkit/fileapi/isolated_file_util.h" 9 #include "webkit/fileapi/isolated_file_util.h"
10 #include "webkit/storage/webkit_storage_export.h" 10 #include "webkit/storage/webkit_storage_export.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 const base::FilePath& src_file_path, 51 const base::FilePath& src_file_path,
52 const FileSystemURL& dest_url) OVERRIDE; 52 const FileSystemURL& dest_url) OVERRIDE;
53 virtual base::PlatformFileError DeleteFile( 53 virtual base::PlatformFileError DeleteFile(
54 FileSystemOperationContext* context, 54 FileSystemOperationContext* context,
55 const FileSystemURL& url) OVERRIDE; 55 const FileSystemURL& url) OVERRIDE;
56 virtual base::PlatformFileError GetFileInfo( 56 virtual base::PlatformFileError GetFileInfo(
57 FileSystemOperationContext* context, 57 FileSystemOperationContext* context,
58 const FileSystemURL& url, 58 const FileSystemURL& url,
59 base::PlatformFileInfo* file_info, 59 base::PlatformFileInfo* file_info,
60 base::FilePath* platform_path) OVERRIDE; 60 base::FilePath* platform_path) OVERRIDE;
61 // Uses the MIME sniffer code, which actually looks into the file,
62 // to determine if it is really a media file (to avoid exposing
63 // non-media files with a media file extension.)
64 static base::PlatformFileError IsMediaFile(const base::FilePath& path);
vandebo (ex-Chrome) 2013/03/25 19:02:11 All the othe rmethods are implementations of Isola
Kevin Bailey 2013/04/03 18:05:07 Done.
65 virtual base::PlatformFileError CreateSnapshotFile(
66 FileSystemOperationContext* context,
67 const FileSystemURL& url,
68 base::PlatformFileInfo* file_info,
69 base::FilePath* platform_path,
70 SnapshotFilePolicy* snapshot_policy) OVERRIDE;
61 71
62 private: 72 private:
63 // Like GetLocalFilePath(), but always take media_path_filter() into 73 // Like GetLocalFilePath(), but always take media_path_filter() into
64 // consideration. If the media_path_filter() check fails, return 74 // consideration. If the media_path_filter() check fails, return
65 // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist. 75 // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist.
66 base::PlatformFileError GetFilteredLocalFilePath( 76 base::PlatformFileError GetFilteredLocalFilePath(
67 FileSystemOperationContext* context, 77 FileSystemOperationContext* context,
68 const FileSystemURL& file_system_url, 78 const FileSystemURL& file_system_url,
69 base::FilePath* local_file_path); 79 base::FilePath* local_file_path);
70 80
71 // Like GetLocalFilePath(), but if the file does not exist, then return 81 // Like GetLocalFilePath(), but if the file does not exist, then return
72 // |failure_error|. 82 // |failure_error|.
73 // If |local_file_path| is a file, then take media_path_filter() into 83 // If |local_file_path| is a file, then take media_path_filter() into
74 // consideration. 84 // consideration.
75 // If the media_path_filter() check fails, return |failure_error|. 85 // If the media_path_filter() check fails, return |failure_error|.
76 // If |local_file_path| is a directory, return PLATFORM_FILE_OK. 86 // If |local_file_path| is a directory, return PLATFORM_FILE_OK.
77 base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory( 87 base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory(
78 FileSystemOperationContext* context, 88 FileSystemOperationContext* context,
79 const FileSystemURL& file_system_url, 89 const FileSystemURL& file_system_url,
80 base::PlatformFileError failure_error, 90 base::PlatformFileError failure_error,
81 base::FilePath* local_file_path); 91 base::FilePath* local_file_path);
82 92
83 DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); 93 DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil);
84 }; 94 };
85 95
86 } // namespace fileapi 96 } // namespace fileapi
87 97
88 #endif // WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ 98 #endif // WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698