| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // loop at this point instead of evaluating it as a loop condition (if the | 183 // loop at this point instead of evaluating it as a loop condition (if the |
| 184 // for loop was using iterators explicitly, as originally done). | 184 // for loop was using iterators explicitly, as originally done). |
| 185 if (handler->OnMessageReceived(message)) | 185 if (handler->OnMessageReceived(message)) |
| 186 return true; | 186 return true; |
| 187 } | 187 } |
| 188 | 188 |
| 189 return false; | 189 return false; |
| 190 } | 190 } |
| 191 | 191 |
| 192 void ChromeContentUtilityClient::ExposeInterfacesToBrowser( | 192 void ChromeContentUtilityClient::ExposeInterfacesToBrowser( |
| 193 shell::InterfaceRegistry* registry) { | 193 service_manager::InterfaceRegistry* registry) { |
| 194 // When the utility process is running with elevated privileges, we need to | 194 // When the utility process is running with elevated privileges, we need to |
| 195 // filter messages so that only a whitelist of IPCs can run. In Mojo, there's | 195 // filter messages so that only a whitelist of IPCs can run. In Mojo, there's |
| 196 // no way of filtering individual messages. Instead, we can avoid adding | 196 // no way of filtering individual messages. Instead, we can avoid adding |
| 197 // non-whitelisted Mojo services to the shell::InterfaceRegistry. | 197 // non-whitelisted Mojo services to the service_manager::InterfaceRegistry. |
| 198 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been | 198 // TODO(amistry): Use a whitelist once the whistlisted IPCs have been |
| 199 // converted to Mojo. | 199 // converted to Mojo. |
| 200 if (filter_messages_) | 200 if (filter_messages_) |
| 201 return; | 201 return; |
| 202 | 202 |
| 203 #if !defined(OS_ANDROID) | 203 #if !defined(OS_ANDROID) |
| 204 registry->AddInterface<net::interfaces::ProxyResolverFactory>( | 204 registry->AddInterface<net::interfaces::ProxyResolverFactory>( |
| 205 base::Bind(CreateProxyResolverFactory)); | 205 base::Bind(CreateProxyResolverFactory)); |
| 206 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); | 206 registry->AddInterface(base::Bind(CreateResourceUsageReporter)); |
| 207 #endif | 207 #endif |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 safe_browsing::zip_analyzer::Results results; | 307 safe_browsing::zip_analyzer::Results results; |
| 308 safe_browsing::dmg::AnalyzeDMGFile( | 308 safe_browsing::dmg::AnalyzeDMGFile( |
| 309 IPC::PlatformFileForTransitToFile(dmg_file), &results); | 309 IPC::PlatformFileForTransitToFile(dmg_file), &results); |
| 310 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( | 310 Send(new ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished( |
| 311 results)); | 311 results)); |
| 312 ReleaseProcessIfNeeded(); | 312 ReleaseProcessIfNeeded(); |
| 313 } | 313 } |
| 314 #endif // defined(OS_MACOSX) | 314 #endif // defined(OS_MACOSX) |
| 315 | 315 |
| 316 #endif // defined(FULL_SAFE_BROWSING) | 316 #endif // defined(FULL_SAFE_BROWSING) |
| OLD | NEW |