| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 mojo::MakeStrongBinding(base::MakeUnique<FilePatcherImpl>(), | 77 mojo::MakeStrongBinding(base::MakeUnique<FilePatcherImpl>(), |
| 78 std::move(request)); | 78 std::move(request)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // chrome::mojom::FilePatcher: | 82 // chrome::mojom::FilePatcher: |
| 83 void PatchFileBsdiff(base::File input_file, | 83 void PatchFileBsdiff(base::File input_file, |
| 84 base::File patch_file, | 84 base::File patch_file, |
| 85 base::File output_file, | 85 base::File output_file, |
| 86 const PatchFileBsdiffCallback& callback) override { | 86 const PatchFileBsdiffCallback& callback) override { |
| 87 DCHECK(input_file.IsValid()); |
| 88 DCHECK(patch_file.IsValid()); |
| 89 DCHECK(output_file.IsValid()); |
| 90 |
| 87 const int patch_result_status = bsdiff::ApplyBinaryPatch( | 91 const int patch_result_status = bsdiff::ApplyBinaryPatch( |
| 88 std::move(input_file), std::move(patch_file), std::move(output_file)); | 92 std::move(input_file), std::move(patch_file), std::move(output_file)); |
| 89 callback.Run(patch_result_status); | 93 callback.Run(patch_result_status); |
| 90 } | 94 } |
| 91 | 95 |
| 92 void PatchFileCourgette(base::File input_file, | 96 void PatchFileCourgette(base::File input_file, |
| 93 base::File patch_file, | 97 base::File patch_file, |
| 94 base::File output_file, | 98 base::File output_file, |
| 95 const PatchFileCourgetteCallback& callback) override { | 99 const PatchFileCourgetteCallback& callback) override { |
| 100 DCHECK(input_file.IsValid()); |
| 101 DCHECK(patch_file.IsValid()); |
| 102 DCHECK(output_file.IsValid()); |
| 103 |
| 96 const int patch_result_status = courgette::ApplyEnsemblePatch( | 104 const int patch_result_status = courgette::ApplyEnsemblePatch( |
| 97 std::move(input_file), std::move(patch_file), std::move(output_file)); | 105 std::move(input_file), std::move(patch_file), std::move(output_file)); |
| 98 callback.Run(patch_result_status); | 106 callback.Run(patch_result_status); |
| 99 } | 107 } |
| 100 | 108 |
| 101 DISALLOW_COPY_AND_ASSIGN(FilePatcherImpl); | 109 DISALLOW_COPY_AND_ASSIGN(FilePatcherImpl); |
| 102 }; | 110 }; |
| 103 | 111 |
| 104 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
| 105 class ZipFileCreatorImpl : public chrome::mojom::ZipFileCreator { | 113 class ZipFileCreatorImpl : public chrome::mojom::ZipFileCreator { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 safe_browsing::dmg::AnalyzeDMGFile( | 305 safe_browsing::dmg::AnalyzeDMGFile( |
| 298 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 306 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 299 content::UtilityThread::Get()->Send( | 307 content::UtilityThread::Get()->Send( |
| 300 new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 308 new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 301 results)); | 309 results)); |
| 302 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); | 310 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); |
| 303 } | 311 } |
| 304 #endif // defined(OS_MACOSX) | 312 #endif // defined(OS_MACOSX) |
| 305 | 313 |
| 306 #endif // defined(FULL_SAFE_BROWSING) | 314 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |