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

Side by Side Diff: media/base/media_file_checker.h

Issue 109273002: Convert base::MemoryMappedFile to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Posix GetSize Created 6 years, 12 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MEDIA_BASE_MEDIA_FILE_CHECKER_H_ 5 #ifndef MEDIA_BASE_MEDIA_FILE_CHECKER_H_
6 #define MEDIA_BASE_MEDIA_FILE_CHECKER_H_ 6 #define MEDIA_BASE_MEDIA_FILE_CHECKER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/scoped_platform_file_closer.h" 9 #include "base/files/file.h"
10 #include "base/platform_file.h"
11 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
12 11
13 namespace base { 12 namespace base {
14 class TimeDelta; 13 class TimeDelta;
15 } 14 }
16 15
17 namespace media { 16 namespace media {
18 17
19 // This class tries to determine if a file is a valid media file. The entire 18 // This class tries to determine if a file is a valid media file. The entire
20 // file is not decoded so a positive result from this class does not make the 19 // file is not decoded so a positive result from this class does not make the
21 // file safe to use in the browser process. 20 // file safe to use in the browser process.
22 class MEDIA_EXPORT MediaFileChecker { 21 class MEDIA_EXPORT MediaFileChecker {
23 public: 22 public:
24 explicit MediaFileChecker(const base::PlatformFile& file); 23 explicit MediaFileChecker(base::File file);
25 ~MediaFileChecker(); 24 ~MediaFileChecker();
26 25
27 // After opening |file|, up to |check_time| amount of wall-clock time is spent 26 // After opening |file|, up to |check_time| amount of wall-clock time is spent
28 // decoding the file. The amount of audio/video data decoded will depend on 27 // decoding the file. The amount of audio/video data decoded will depend on
29 // the bitrate of the file and the speed of the CPU. 28 // the bitrate of the file and the speed of the CPU.
30 bool Start(base::TimeDelta check_time); 29 bool Start(base::TimeDelta check_time);
31 30
32 private: 31 private:
33 base::PlatformFile file_; 32 base::File file_;
34 base::ScopedPlatformFileCloser file_closer_;
cpu_(ooo_6.6-7.5) 2013/12/28 01:40:52 33 + 34 above look awful. Shame on us.
35 33
36 DISALLOW_COPY_AND_ASSIGN(MediaFileChecker); 34 DISALLOW_COPY_AND_ASSIGN(MediaFileChecker);
37 }; 35 };
38 36
39 } // namespace media 37 } // namespace media
40 38
41 #endif // MEDIA_BASE_MEDIA_FILE_CHECKER_H_ 39 #endif // MEDIA_BASE_MEDIA_FILE_CHECKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698