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

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

Issue 21355004: [Downloads] Move client guid for AV scanning of downloaded files to chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add base class 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_SCANNING_FILE_VALIDATOR_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SCANNING_FILE_VALIDATOR_H_
7
8 #include "base/basictypes.h"
9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "webkit/browser/fileapi/copy_or_move_file_validator.h"
13
14 class ImageDecoder;
Lei Zhang 2013/08/03 00:28:26 not used
Greg Billock 2013/08/05 21:42:30 Done.
15
16 namespace chrome {
17
18 // This class supports AV scanning on post write validation.
19 class ScanningFileValidator : public fileapi::CopyOrMoveFileValidator {
vandebo (ex-Chrome) 2013/08/05 18:05:30 Scanning file validator is not a very descriptive
Greg Billock 2013/08/05 21:42:30 I meant like "FileValidator that does Validation b
20 public:
21 virtual ~ScanningFileValidator();
22
23 static bool SupportsFileType(const base::FilePath& path);
vandebo (ex-Chrome) 2013/08/05 18:05:30 No need for this method.
Greg Billock 2013/08/05 21:42:30 Done.
24
25 // This method will forward to OnFileOpen after the file has been read.
26 virtual void StartPreWriteValidation(
vandebo (ex-Chrome) 2013/08/05 18:05:30 I did not intend for this to be a fully functional
Greg Billock 2013/08/05 21:42:30 OK. I wasn't sure whether reading the whole file w
27 const ResultCallback& result_callback) OVERRIDE;
28
29 // Runs AV checks on the resulting file (Windows-only).
30 // Subclasses will not typically override this method.
31 virtual void StartPostWriteValidation(
32 const base::FilePath& dest_platform_path,
33 const ResultCallback& result_callback) OVERRIDE;
34
35 protected:
36 explicit ScanningFileValidator(const base::FilePath& file);
37
38 // Subclasses should do whatever validation they need to on the file
39 // here. When done, they may use |callback_| to schedule the
40 // validation reply. Default validation behavior is "can data be read."
41 virtual void OnFileOpen(scoped_ptr<std::string> data);
42
43 base::FilePath path_;
44 fileapi::CopyOrMoveFileValidator::ResultCallback callback_;
45 base::WeakPtrFactory<SupportedImageTypeValidator> weak_factory_;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(ScanningFileValidator);
49 };
50
51 } // namespace chrome
52
53 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SCANNING_FILE_VALIDATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698