| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 BrowserThread::PostTask( | 99 BrowserThread::PostTask( |
| 100 BrowserThread::IO, FROM_HERE, | 100 BrowserThread::IO, FROM_HERE, |
| 101 base::Bind(&SandboxedZipAnalyzer::StartProcessOnIOThread, this)); | 101 base::Bind(&SandboxedZipAnalyzer::StartProcessOnIOThread, this)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void SandboxedZipAnalyzer::OnProcessCrashed(int exit_code) { | 104 void SandboxedZipAnalyzer::OnProcessCrashed(int exit_code) { |
| 105 OnAnalyzeZipFileFinished(zip_analyzer::Results()); | 105 OnAnalyzeZipFileFinished(zip_analyzer::Results()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void SandboxedZipAnalyzer::OnProcessLaunchFailed() { | 108 void SandboxedZipAnalyzer::OnProcessLaunchFailed(int error_code) { |
| 109 OnAnalyzeZipFileFinished(zip_analyzer::Results()); | 109 OnAnalyzeZipFileFinished(zip_analyzer::Results()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool SandboxedZipAnalyzer::OnMessageReceived(const IPC::Message& message) { | 112 bool SandboxedZipAnalyzer::OnMessageReceived(const IPC::Message& message) { |
| 113 bool handled = true; | 113 bool handled = true; |
| 114 IPC_BEGIN_MESSAGE_MAP(SandboxedZipAnalyzer, message) | 114 IPC_BEGIN_MESSAGE_MAP(SandboxedZipAnalyzer, message) |
| 115 IPC_MESSAGE_HANDLER( | 115 IPC_MESSAGE_HANDLER( |
| 116 ChromeUtilityHostMsg_AnalyzeZipFileForDownloadProtection_Finished, | 116 ChromeUtilityHostMsg_AnalyzeZipFileForDownloadProtection_Finished, |
| 117 OnAnalyzeZipFileFinished) | 117 OnAnalyzeZipFileFinished) |
| 118 IPC_MESSAGE_UNHANDLED(handled = false) | 118 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 140 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 140 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 141 if (callback_called_) | 141 if (callback_called_) |
| 142 return; | 142 return; |
| 143 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 143 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 144 base::Bind(callback_, results)); | 144 base::Bind(callback_, results)); |
| 145 callback_called_ = true; | 145 callback_called_ = true; |
| 146 CloseTemporaryFile(); | 146 CloseTemporaryFile(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace safe_browsing | 149 } // namespace safe_browsing |
| OLD | NEW |