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

Side by Side Diff: chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_browsing/sandboxed_dmg_analyzer_mac.h" 5 #include "chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chrome/common/chrome_utility_messages.h" 10 #include "chrome/common/chrome_utility_messages.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 IPC_MESSAGE_HANDLER( 84 IPC_MESSAGE_HANDLER(
85 ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished, 85 ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished,
86 OnAnalysisFinished) 86 OnAnalysisFinished)
87 IPC_MESSAGE_UNHANDLED(handled = false) 87 IPC_MESSAGE_UNHANDLED(handled = false)
88 IPC_END_MESSAGE_MAP() 88 IPC_END_MESSAGE_MAP()
89 return handled; 89 return handled;
90 } 90 }
91 91
92 void SandboxedDMGAnalyzer::OnUtilityProcessStarted() { 92 void SandboxedDMGAnalyzer::OnUtilityProcessStarted() {
93 DCHECK_CURRENTLY_ON(BrowserThread::IO); 93 DCHECK_CURRENTLY_ON(BrowserThread::IO);
94
95 base::ProcessHandle utility_process =
96 content::RenderProcessHost::run_renderer_in_process() ?
97 base::GetCurrentProcessHandle() :
98 utility_process_host_->GetData().handle;
99 if (utility_process == base::kNullProcessHandle) {
100 DLOG(ERROR) << "Child process handle is null";
101 }
102
103 utility_process_host_->Send( 94 utility_process_host_->Send(
104 new ChromeUtilityMsg_AnalyzeDmgFileForDownloadProtection( 95 new ChromeUtilityMsg_AnalyzeDmgFileForDownloadProtection(
105 IPC::TakeFileHandleForProcess(std::move(file_), utility_process))); 96 IPC::TakePlatformFileForTransit(std::move(file_))));
106 } 97 }
107 98
108 void SandboxedDMGAnalyzer::OnAnalysisFinished( 99 void SandboxedDMGAnalyzer::OnAnalysisFinished(
109 const zip_analyzer::Results& results) { 100 const zip_analyzer::Results& results) {
110 DCHECK_CURRENTLY_ON(BrowserThread::IO); 101 DCHECK_CURRENTLY_ON(BrowserThread::IO);
111 if (callback_called_) 102 if (callback_called_)
112 return; 103 return;
113 104
114 callback_called_ = true; 105 callback_called_ = true;
115 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 106 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
116 base::Bind(callback_, results)); 107 base::Bind(callback_, results));
117 } 108 }
118 109
119 } // namespace safe_browsing 110 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/printing/pwg_raster_converter.cc ('k') | chrome/browser/safe_browsing/sandboxed_zip_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698