| 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/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "chrome/utility/extensions/extensions_handler.h" | 51 #include "chrome/utility/extensions/extensions_handler.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ | 54 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ |
| 55 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) | 55 (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) |
| 56 #include "chrome/utility/printing_handler.h" | 56 #include "chrome/utility/printing_handler.h" |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 #if defined(FULL_SAFE_BROWSING) | 59 #if defined(FULL_SAFE_BROWSING) |
| 60 #include "chrome/common/safe_archive_analyzer.mojom.h" | 60 #include "chrome/common/safe_archive_analyzer.mojom.h" |
| 61 #include "chrome/common/safe_browsing/archive_analyzer_results.h" |
| 61 #include "chrome/common/safe_browsing/zip_analyzer.h" | 62 #include "chrome/common/safe_browsing/zip_analyzer.h" |
| 62 #include "chrome/common/safe_browsing/zip_analyzer_results.h" | |
| 63 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
| 64 #include "chrome/utility/safe_browsing/mac/dmg_analyzer.h" | 64 #include "chrome/utility/safe_browsing/mac/dmg_analyzer.h" |
| 65 #endif | 65 #endif |
| 66 #endif | 66 #endif |
| 67 | 67 |
| 68 namespace { | 68 namespace { |
| 69 | 69 |
| 70 class FilePatcherImpl : public chrome::mojom::FilePatcher { | 70 class FilePatcherImpl : public chrome::mojom::FilePatcher { |
| 71 public: | 71 public: |
| 72 FilePatcherImpl() = default; | 72 FilePatcherImpl() = default; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 // chrome::mojom::SafeArchiveAnalyzer: | 160 // chrome::mojom::SafeArchiveAnalyzer: |
| 161 void AnalyzeZipFile(base::File zip_file, | 161 void AnalyzeZipFile(base::File zip_file, |
| 162 base::File temporary_file, | 162 base::File temporary_file, |
| 163 const AnalyzeZipFileCallback& callback) override { | 163 const AnalyzeZipFileCallback& callback) override { |
| 164 DCHECK(temporary_file.IsValid()); | 164 DCHECK(temporary_file.IsValid()); |
| 165 DCHECK(zip_file.IsValid()); | 165 DCHECK(zip_file.IsValid()); |
| 166 | 166 |
| 167 safe_browsing::zip_analyzer::Results results; | 167 safe_browsing::ArchiveAnalyzerResults results; |
| 168 safe_browsing::zip_analyzer::AnalyzeZipFile( | 168 safe_browsing::zip_analyzer::AnalyzeZipFile( |
| 169 std::move(zip_file), std::move(temporary_file), &results); | 169 std::move(zip_file), std::move(temporary_file), &results); |
| 170 callback.Run(results); | 170 callback.Run(results); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void AnalyzeDmgFile(base::File dmg_file, | 173 void AnalyzeDmgFile(base::File dmg_file, |
| 174 const AnalyzeDmgFileCallback& callback) override { | 174 const AnalyzeDmgFileCallback& callback) override { |
| 175 #if defined(OS_MACOSX) | 175 #if defined(OS_MACOSX) |
| 176 DCHECK(dmg_file.IsValid()); | 176 DCHECK(dmg_file.IsValid()); |
| 177 safe_browsing::zip_analyzer::Results results; | 177 safe_browsing::ArchiveAnalyzerResults results; |
| 178 safe_browsing::dmg::AnalyzeDMGFile(std::move(dmg_file), &results); | 178 safe_browsing::dmg::AnalyzeDMGFile(std::move(dmg_file), &results); |
| 179 callback.Run(results); | 179 callback.Run(results); |
| 180 #else | 180 #else |
| 181 NOTREACHED(); | 181 NOTREACHED(); |
| 182 #endif | 182 #endif |
| 183 } | 183 } |
| 184 | 184 |
| 185 DISALLOW_COPY_AND_ASSIGN(SafeArchiveAnalyzerImpl); | 185 DISALLOW_COPY_AND_ASSIGN(SafeArchiveAnalyzerImpl); |
| 186 }; | 186 }; |
| 187 #endif // defined(FULL_SAFE_BROWSING) | 187 #endif // defined(FULL_SAFE_BROWSING) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 return false; | 320 return false; |
| 321 } | 321 } |
| 322 | 322 |
| 323 // static | 323 // static |
| 324 void ChromeContentUtilityClient::PreSandboxStartup() { | 324 void ChromeContentUtilityClient::PreSandboxStartup() { |
| 325 #if BUILDFLAG(ENABLE_EXTENSIONS) | 325 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 326 extensions::ExtensionsHandler::PreSandboxStartup(); | 326 extensions::ExtensionsHandler::PreSandboxStartup(); |
| 327 #endif | 327 #endif |
| 328 } | 328 } |
| OLD | NEW |