| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_zip_analyzer.h" | 5 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 content::RenderProcessHost::run_renderer_in_process() ? | 141 content::RenderProcessHost::run_renderer_in_process() ? |
| 142 base::GetCurrentProcessHandle() : | 142 base::GetCurrentProcessHandle() : |
| 143 utility_process_host_->GetData().handle; | 143 utility_process_host_->GetData().handle; |
| 144 | 144 |
| 145 if (utility_process == base::kNullProcessHandle) { | 145 if (utility_process == base::kNullProcessHandle) { |
| 146 DLOG(ERROR) << "Child process handle is null"; | 146 DLOG(ERROR) << "Child process handle is null"; |
| 147 } | 147 } |
| 148 utility_process_host_->Send( | 148 utility_process_host_->Send( |
| 149 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection( | 149 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection( |
| 150 IPC::TakeFileHandleForProcess(std::move(zip_file_), utility_process), | 150 IPC::TakeFileHandleForProcess(std::move(zip_file_), utility_process), |
| 151 IPC::GetFileHandleForProcess(temp_file_.GetPlatformFile(), | 151 IPC::GetPlatformFileForTransit(temp_file_.GetPlatformFile(), |
| 152 utility_process, | 152 false /* !close_source_handle */))); |
| 153 false /* !close_source_handle */))); | |
| 154 } | 153 } |
| 155 | 154 |
| 156 void SandboxedZipAnalyzer::OnAnalyzeZipFileFinished( | 155 void SandboxedZipAnalyzer::OnAnalyzeZipFileFinished( |
| 157 const zip_analyzer::Results& results) { | 156 const zip_analyzer::Results& results) { |
| 158 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 157 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 159 if (callback_called_) | 158 if (callback_called_) |
| 160 return; | 159 return; |
| 161 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 160 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 162 base::Bind(callback_, results)); | 161 base::Bind(callback_, results)); |
| 163 callback_called_ = true; | 162 callback_called_ = true; |
| 164 CloseTemporaryFile(); | 163 CloseTemporaryFile(); |
| 165 } | 164 } |
| 166 | 165 |
| 167 } // namespace safe_browsing | 166 } // namespace safe_browsing |
| OLD | NEW |