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

Unified Diff: webkit/fileapi/media/device_media_async_file_util.cc

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: More code review response, added device_media_async_file_util. 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 side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/media/device_media_async_file_util.cc
diff --git a/webkit/fileapi/media/device_media_async_file_util.cc b/webkit/fileapi/media/device_media_async_file_util.cc
index 6235696ded0ad7a8fa692d1d1da720dfc779978b..a6675c8bbb3564b7e5f7eb01f98108682b96dd5d 100644
--- a/webkit/fileapi/media/device_media_async_file_util.cc
+++ b/webkit/fileapi/media/device_media_async_file_util.cc
@@ -17,6 +17,7 @@
#include "webkit/fileapi/media/mtp_device_async_delegate.h"
#include "webkit/fileapi/media/mtp_device_file_system_config.h"
#include "webkit/fileapi/media/mtp_device_map_service.h"
+#include "webkit/fileapi/media/native_media_file_util.h"
namespace fileapi {
@@ -312,9 +313,11 @@ void DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile(
const AsyncFileUtil::CreateSnapshotFileCallback& callback,
const base::PlatformFileInfo& file_info,
const base::FilePath& platform_path) {
- if (!callback.is_null())
- callback.Run(base::PLATFORM_FILE_OK, file_info, platform_path,
- kSnapshotFileTemporary);
+ if (!callback.is_null()) {
+ base::PlatformFileError error =
+ NativeMediaFileUtil::IsMediaFile(platform_path);
vandebo (ex-Chrome) 2013/03/21 16:51:12 nit: two more spaces.
+ callback.Run(error, file_info, platform_path, kSnapshotFileTemporary);
+ }
}
void DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError(
« no previous file with comments | « no previous file | webkit/fileapi/media/native_media_file_util.h » ('j') | webkit/fileapi/media/native_media_file_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698