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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 SandboxedZipAnalyzer::~SandboxedZipAnalyzer() { | 45 SandboxedZipAnalyzer::~SandboxedZipAnalyzer() { |
46 // If we're using UtilityProcessHost, we may not be destroyed on | 46 // If we're using UtilityProcessHost, we may not be destroyed on |
47 // the UI or IO thread. | 47 // the UI or IO thread. |
48 } | 48 } |
49 | 49 |
50 void SandboxedZipAnalyzer::AnalyzeInSandbox() { | 50 void SandboxedZipAnalyzer::AnalyzeInSandbox() { |
51 zip_file_.Initialize(zip_file_name_, | 51 zip_file_.Initialize(zip_file_name_, |
52 base::File::FLAG_OPEN | base::File::FLAG_READ); | 52 base::File::FLAG_OPEN | base::File::FLAG_READ); |
53 if (!zip_file_.IsValid()) { | 53 if (!zip_file_.IsValid()) { |
54 VLOG(1) << "Could not open zip file: " << zip_file_name_.value(); | 54 DVLOG(1) << "Could not open zip file: " << zip_file_name_.value(); |
55 if (!BrowserThread::PostTask( | 55 if (!BrowserThread::PostTask( |
56 BrowserThread::IO, FROM_HERE, | 56 BrowserThread::IO, FROM_HERE, |
57 base::Bind(&SandboxedZipAnalyzer::OnAnalyzeZipFileFinished, this, | 57 base::Bind(&SandboxedZipAnalyzer::OnAnalyzeZipFileFinished, this, |
58 zip_analyzer::Results()))) { | 58 zip_analyzer::Results()))) { |
59 NOTREACHED(); | 59 NOTREACHED(); |
60 } | 60 } |
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
64 BrowserThread::PostTask( | 64 BrowserThread::PostTask( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 if (utility_process == base::kNullProcessHandle) { | 112 if (utility_process == base::kNullProcessHandle) { |
113 DLOG(ERROR) << "Child process handle is null"; | 113 DLOG(ERROR) << "Child process handle is null"; |
114 } | 114 } |
115 utility_process_host_->Send( | 115 utility_process_host_->Send( |
116 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection( | 116 new ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection( |
117 IPC::TakeFileHandleForProcess(zip_file_.Pass(), utility_process))); | 117 IPC::TakeFileHandleForProcess(zip_file_.Pass(), utility_process))); |
118 } | 118 } |
119 | 119 |
120 } // namespace safe_browsing | 120 } // namespace safe_browsing |
OLD | NEW |