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

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

Issue 660343006: Standardize usage of virtual/override/final in chrome/browser/media_galleries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h" 13 #include "chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h"
14 14
15 class MediaFileValidatorFactory; 15 class MediaFileValidatorFactory;
16 class SafeAudioVideoChecker; 16 class SafeAudioVideoChecker;
17 17
18 // Uses SafeAudioVideoChecker to validate supported audio and video files in 18 // Uses SafeAudioVideoChecker to validate supported audio and video files in
19 // the utility process and then uses AVScanningFileValidator to ask the OS to 19 // the utility process and then uses AVScanningFileValidator to ask the OS to
20 // virus scan them. The entire file is not decoded so a positive result from 20 // virus scan them. The entire file is not decoded so a positive result from
21 // this class does not make the file safe to use in the browser process. 21 // this class does not make the file safe to use in the browser process.
22 class SupportedAudioVideoChecker : public AVScanningFileValidator { 22 class SupportedAudioVideoChecker : public AVScanningFileValidator {
23 public: 23 public:
24 virtual ~SupportedAudioVideoChecker(); 24 ~SupportedAudioVideoChecker() override;
25 25
26 static bool SupportsFileType(const base::FilePath& path); 26 static bool SupportsFileType(const base::FilePath& path);
27 27
28 virtual void StartPreWriteValidation( 28 void StartPreWriteValidation(const ResultCallback& result_callback) override;
29 const ResultCallback& result_callback) override;
30 29
31 private: 30 private:
32 friend class MediaFileValidatorFactory; 31 friend class MediaFileValidatorFactory;
33 32
34 explicit SupportedAudioVideoChecker(const base::FilePath& file); 33 explicit SupportedAudioVideoChecker(const base::FilePath& file);
35 34
36 void OnFileOpen(base::File file); 35 void OnFileOpen(base::File file);
37 36
38 base::FilePath path_; 37 base::FilePath path_;
39 storage::CopyOrMoveFileValidator::ResultCallback callback_; 38 storage::CopyOrMoveFileValidator::ResultCallback callback_;
40 scoped_refptr<SafeAudioVideoChecker> safe_checker_; 39 scoped_refptr<SafeAudioVideoChecker> safe_checker_;
41 base::WeakPtrFactory<SupportedAudioVideoChecker> weak_factory_; 40 base::WeakPtrFactory<SupportedAudioVideoChecker> weak_factory_;
42 41
43 DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoChecker); 42 DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoChecker);
44 }; 43 };
45 44
46 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_ H_ 45 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SUPPORTED_AUDIO_VIDEO_CHECKER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698