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

Unified Diff: chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc

Issue 18565002: [FileSystem] Add another copy-or-move validation hook for post-write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix flakey test Created 7 years, 5 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: chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
index 00c601d8644ccc9ea2abcac68cce3def5925de1d..466b5f99d2cec4119df80c72162679da3e7cb3a7 100644
--- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
+++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
@@ -111,8 +111,8 @@ bool SupportedImageTypeValidator::SupportsFileType(const base::FilePath& path) {
extension == FILE_PATH_LITERAL(".webp");
}
-void SupportedImageTypeValidator::StartValidation(
- const fileapi::CopyOrMoveFileValidator::ResultCallback& result_callback) {
+void SupportedImageTypeValidator::StartPreWriteValidation(
+ const ResultCallback& result_callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(callback_.is_null());
callback_ = result_callback;
@@ -125,6 +125,19 @@ void SupportedImageTypeValidator::StartValidation(
weak_factory_.GetWeakPtr()));
}
+void SupportedImageTypeValidator::StartPostWriteValidation(
+ const base::FilePath& dest_platform_path,
+ const ResultCallback& result_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ post_write_callback_ = result_callback;
+
+ // TODO(gbillock): Insert AV call here in the right validator.
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(post_write_callback_, base::PLATFORM_FILE_OK));
+}
+
SupportedImageTypeValidator::SupportedImageTypeValidator(
const base::FilePath& path)
: path_(path),

Powered by Google App Engine
This is Rietveld 408576698