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

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

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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
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 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h " 5 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h "
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } // namespace 56 } // namespace
57 57
58 SupportedAudioVideoChecker::~SupportedAudioVideoChecker() {} 58 SupportedAudioVideoChecker::~SupportedAudioVideoChecker() {}
59 59
60 // static 60 // static
61 bool SupportedAudioVideoChecker::SupportsFileType(const base::FilePath& path) { 61 bool SupportedAudioVideoChecker::SupportsFileType(const base::FilePath& path) {
62 return g_audio_video_extensions.Get().HasSupportedAudioVideoExtension(path); 62 return g_audio_video_extensions.Get().HasSupportedAudioVideoExtension(path);
63 } 63 }
64 64
65 void SupportedAudioVideoChecker::StartPreWriteValidation( 65 void SupportedAudioVideoChecker::StartPreWriteValidation(
66 const fileapi::CopyOrMoveFileValidator::ResultCallback& result_callback) { 66 const storage::CopyOrMoveFileValidator::ResultCallback& result_callback) {
67 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 67 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
68 DCHECK(callback_.is_null()); 68 DCHECK(callback_.is_null());
69 callback_ = result_callback; 69 callback_ = result_callback;
70 70
71 content::BrowserThread::PostTaskAndReplyWithResult( 71 content::BrowserThread::PostTaskAndReplyWithResult(
72 content::BrowserThread::FILE, 72 content::BrowserThread::FILE,
73 FROM_HERE, 73 FROM_HERE,
74 base::Bind(&OpenOnFileThread, path_), 74 base::Bind(&OpenOnFileThread, path_),
75 base::Bind(&SupportedAudioVideoChecker::OnFileOpen, 75 base::Bind(&SupportedAudioVideoChecker::OnFileOpen,
76 weak_factory_.GetWeakPtr())); 76 weak_factory_.GetWeakPtr()));
77 } 77 }
78 78
79 SupportedAudioVideoChecker::SupportedAudioVideoChecker( 79 SupportedAudioVideoChecker::SupportedAudioVideoChecker(
80 const base::FilePath& path) 80 const base::FilePath& path)
81 : path_(path), 81 : path_(path),
82 weak_factory_(this) { 82 weak_factory_(this) {
83 } 83 }
84 84
85 void SupportedAudioVideoChecker::OnFileOpen(base::File file) { 85 void SupportedAudioVideoChecker::OnFileOpen(base::File file) {
86 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 86 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
87 if (!file.IsValid()) { 87 if (!file.IsValid()) {
88 callback_.Run(base::File::FILE_ERROR_SECURITY); 88 callback_.Run(base::File::FILE_ERROR_SECURITY);
89 return; 89 return;
90 } 90 }
91 91
92 safe_checker_ = new SafeAudioVideoChecker(file.Pass(), callback_); 92 safe_checker_ = new SafeAudioVideoChecker(file.Pass(), callback_);
93 safe_checker_->Start(); 93 safe_checker_->Start();
94 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698