| 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 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (command_line->HasSwitch(switches::kUtilityProcessRunningElevated)) { | 145 if (command_line->HasSwitch(switches::kUtilityProcessRunningElevated)) { |
| 146 message_id_whitelist_.insert(kMessageWhitelist, | 146 message_id_whitelist_.insert(kMessageWhitelist, |
| 147 kMessageWhitelist + kMessageWhitelistSize); | 147 kMessageWhitelist + kMessageWhitelistSize); |
| 148 filter_messages_ = true; | 148 filter_messages_ = true; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool ChromeContentUtilityClient::OnMessageReceived( | 153 bool ChromeContentUtilityClient::OnMessageReceived( |
| 154 const IPC::Message& message) { | 154 const IPC::Message& message) { |
| 155 if (filter_messages_ && !ContainsKey(message_id_whitelist_, message.type())) | 155 if (filter_messages_ && |
| 156 !base::ContainsKey(message_id_whitelist_, message.type())) { |
| 156 return false; | 157 return false; |
| 158 } |
| 157 | 159 |
| 158 bool handled = true; | 160 bool handled = true; |
| 159 IPC_BEGIN_MESSAGE_MAP(ChromeContentUtilityClient, message) | 161 IPC_BEGIN_MESSAGE_MAP(ChromeContentUtilityClient, message) |
| 160 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileBsdiff, | 162 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileBsdiff, |
| 161 OnPatchFileBsdiff) | 163 OnPatchFileBsdiff) |
| 162 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileCourgette, | 164 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileCourgette, |
| 163 OnPatchFileCourgette) | 165 OnPatchFileCourgette) |
| 164 #if defined(FULL_SAFE_BROWSING) | 166 #if defined(FULL_SAFE_BROWSING) |
| 165 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection, | 167 IPC_MESSAGE_HANDLER(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection, |
| 166 OnAnalyzeZipFileForDownloadProtection) | 168 OnAnalyzeZipFileForDownloadProtection) |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 safe_browsing::zip_analyzer::Results results; | 311 safe_browsing::zip_analyzer::Results results; |
| 310 safe_browsing::dmg::AnalyzeDMGFile( | 312 safe_browsing::dmg::AnalyzeDMGFile( |
| 311 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 313 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 312 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 314 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 313 results)); | 315 results)); |
| 314 ReleaseProcessIfNeeded(); | 316 ReleaseProcessIfNeeded(); |
| 315 } | 317 } |
| 316 #endif // defined(OS_MACOSX) | 318 #endif // defined(OS_MACOSX) |
| 317 | 319 |
| 318 #endif // defined(FULL_SAFE_BROWSING) | 320 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |