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

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

Issue 1862333002: ipc: Rename TakeFileHandleForProcess->TakePlatformFileForTransit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile errors. Created 4 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/safe_audio_video_checker.h" 5 #include "chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 SafeAudioVideoChecker::~SafeAudioVideoChecker() {} 53 SafeAudioVideoChecker::~SafeAudioVideoChecker() {}
54 54
55 void SafeAudioVideoChecker::OnProcessStarted() { 55 void SafeAudioVideoChecker::OnProcessStarted() {
56 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 56 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
57 if (state_ != PINGED_STATE) 57 if (state_ != PINGED_STATE)
58 return; 58 return;
59 state_ = STARTED_STATE; 59 state_ = STARTED_STATE;
60 60
61 if (utility_process_host_->GetData().handle == base::kNullProcessHandle) 61 IPC::PlatformFileForTransit file_for_transit =
62 DLOG(ERROR) << "Child process handle is null"; 62 IPC::TakePlatformFileForTransit(std::move(file_));
63 IPC::PlatformFileForTransit file_for_transit = IPC::TakeFileHandleForProcess(
64 std::move(file_), utility_process_host_->GetData().handle);
65 if (file_for_transit == IPC::InvalidPlatformFileForTransit()) { 63 if (file_for_transit == IPC::InvalidPlatformFileForTransit()) {
66 OnCheckingFinished(false /* valid? */); 64 OnCheckingFinished(false /* valid? */);
67 return; 65 return;
68 } 66 }
69 const int64_t kFileDecodeTimeInMS = 250; 67 const int64_t kFileDecodeTimeInMS = 250;
70 utility_process_host_->Send(new ChromeUtilityMsg_CheckMediaFile( 68 utility_process_host_->Send(new ChromeUtilityMsg_CheckMediaFile(
71 kFileDecodeTimeInMS, file_for_transit)); 69 kFileDecodeTimeInMS, file_for_transit));
72 } 70 }
73 71
74 void SafeAudioVideoChecker::OnCheckingFinished(bool valid) { 72 void SafeAudioVideoChecker::OnCheckingFinished(bool valid) {
(...skipping 14 matching lines...) Expand all
89 bool handled = true; 87 bool handled = true;
90 IPC_BEGIN_MESSAGE_MAP(SafeAudioVideoChecker, message) 88 IPC_BEGIN_MESSAGE_MAP(SafeAudioVideoChecker, message)
91 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ProcessStarted, 89 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_ProcessStarted,
92 OnProcessStarted) 90 OnProcessStarted)
93 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_CheckMediaFile_Finished, 91 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_CheckMediaFile_Finished,
94 OnCheckingFinished) 92 OnCheckingFinished)
95 IPC_MESSAGE_UNHANDLED(handled = false) 93 IPC_MESSAGE_UNHANDLED(handled = false)
96 IPC_END_MESSAGE_MAP() 94 IPC_END_MESSAGE_MAP()
97 return handled; 95 return handled;
98 } 96 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698