Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9797)

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2534873005: Sandbox the component updater's patcher utility process. (Closed)
Patch Set: Through #18 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index b30f9f4661ca176184a3f719c365207ca263557a..69d3006b4d354ff6308335cbd3ba2c0351124a3b 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -268,33 +268,26 @@ void ChromeContentUtilityClient::OnCreateZipFile(
#endif // defined(OS_CHROMEOS)
void ChromeContentUtilityClient::OnPatchFileBsdiff(
- const base::FilePath& input_file,
- const base::FilePath& patch_file,
- const base::FilePath& output_file) {
- if (input_file.empty() || patch_file.empty() || output_file.empty()) {
- Send(new ChromeUtilityHostMsg_PatchFile_Finished(-1));
- } else {
- const int patch_status = bsdiff::ApplyBinaryPatch(input_file,
- patch_file,
- output_file);
- Send(new ChromeUtilityHostMsg_PatchFile_Finished(patch_status));
- }
+ const IPC::PlatformFileForTransit& input_file,
+ const IPC::PlatformFileForTransit& patch_file,
+ const IPC::PlatformFileForTransit& output_file) {
+ const int patch_status = bsdiff::ApplyBinaryPatch(
+ IPC::PlatformFileForTransitToFile(input_file),
+ IPC::PlatformFileForTransitToFile(patch_file),
+ IPC::PlatformFileForTransitToFile(output_file));
+ Send(new ChromeUtilityHostMsg_PatchFile_Finished(patch_status));
ReleaseProcessIfNeeded();
}
void ChromeContentUtilityClient::OnPatchFileCourgette(
- const base::FilePath& input_file,
- const base::FilePath& patch_file,
- const base::FilePath& output_file) {
- if (input_file.empty() || patch_file.empty() || output_file.empty()) {
- Send(new ChromeUtilityHostMsg_PatchFile_Finished(-1));
- } else {
- const int patch_status = courgette::ApplyEnsemblePatch(
- input_file.value().c_str(),
- patch_file.value().c_str(),
- output_file.value().c_str());
- Send(new ChromeUtilityHostMsg_PatchFile_Finished(patch_status));
- }
+ const IPC::PlatformFileForTransit& input_file,
+ const IPC::PlatformFileForTransit& patch_file,
+ const IPC::PlatformFileForTransit& output_file) {
+ const int patch_status = courgette::ApplyEnsemblePatch(
+ IPC::PlatformFileForTransitToFile(input_file),
+ IPC::PlatformFileForTransitToFile(patch_file),
+ IPC::PlatformFileForTransitToFile(output_file));
+ Send(new ChromeUtilityHostMsg_PatchFile_Finished(patch_status));
ReleaseProcessIfNeeded();
}

Powered by Google App Engine
This is Rietveld 408576698