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

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

Issue 441133003: Media Galleries: Check for invalid files before passing them to the utility process. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc
diff --git a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc
index 64c8055b8d06b2eb1309c5f90515e6fb1f8cffdf..24cc894e4021ce7a0058e4a38d7a958e8d7ad45e 100644
--- a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc
+++ b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc
@@ -56,6 +56,10 @@ void SafeAudioVideoChecker::OnProcessStarted() {
IPC::PlatformFileForTransit file_for_transit =
IPC::TakeFileHandleForProcess(file_.Pass(),
rvargas (doing something else) 2014/08/05 23:40:19 nit: seems better to see if file_.IsValid() instea
Lei Zhang 2014/08/05 23:46:38 We already do that on line 35. I suspect maybe Dup
rvargas (doing something else) 2014/08/06 00:08:03 You are absolutely right!.
utility_process_host_->GetData().handle);
+ if (file_for_transit == IPC::InvalidPlatformFileForTransit()) {
+ OnCheckingFinished(false /* valid? */);
+ return;
+ }
const int64 kFileDecodeTimeInMS = 250;
utility_process_host_->Send(new ChromeUtilityMsg_CheckMediaFile(
kFileDecodeTimeInMS, file_for_transit));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698