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

Side by Side Diff: chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h

Issue 20190002: Add a copy or move validator to that can handle support audio and video files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: to dcheck Created 7 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_
7
8 #include "base/basictypes.h"
9 #include "base/files/file_path.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/platform_file.h"
13 #include "chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h"
14
15 class SafeAudioVideoChecker;
16
17 namespace chrome {
18 class MediaFileValidatorFactory;
19 }
20
21 // Uses SafeAudioVideoChecker to validate supported audio and video files in
22 // the utility process and then uses AVScanningFileValidator to ask the OS to
23 // virus scan them. The entire file is not decoded so a positive result from
24 // this class does not make the file safe to use in the browser process.
25 class SupportedAudioVideoChecker : public chrome::AVScanningFileValidator {
26 public:
27 virtual ~SupportedAudioVideoChecker();
28
29 static bool SupportsFileType(const base::FilePath& path);
30
31 virtual void StartPreWriteValidation(
32 const ResultCallback& result_callback) OVERRIDE;
33
34 private:
35 friend class chrome::MediaFileValidatorFactory;
36
37 explicit SupportedAudioVideoChecker(const base::FilePath& file);
38
39 void OnFileOpen(const base::PlatformFile& file);
40
41 base::FilePath path_;
42 fileapi::CopyOrMoveFileValidator::ResultCallback callback_;
43 scoped_refptr<SafeAudioVideoChecker> safe_checker_;
44 base::WeakPtrFactory<SupportedAudioVideoChecker> weak_factory_;
45
46 DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoChecker);
47 };
48
49 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698