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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2611283002: [mojo talk demo] Convert utility process CheckMediaFile IPC to mojo (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « chrome/common/extensions/media_parser.mojom ('k') | chrome/utility/extensions/extensions_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2fea5c2f9ca90654d7990acc0bc056474a4c20e7..fef73ced84c32cf0b6e0d37975509a509e5d78e7 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -192,13 +192,16 @@ bool ChromeContentUtilityClient::OnMessageReceived(
void ChromeContentUtilityClient::ExposeInterfacesToBrowser(
service_manager::InterfaceRegistry* registry) {
- // When the utility process is running with elevated privileges, we need to
- // filter messages so that only a whitelist of IPCs can run. In Mojo, there's
- // no way of filtering individual messages. Instead, we can avoid adding
- // non-whitelisted Mojo services to the service_manager::InterfaceRegistry.
- // TODO(amistry): Use a whitelist once the whistlisted IPCs have been
- // converted to Mojo.
- if (filter_messages_)
+ const bool running_elevated =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUtilityProcessRunningElevated);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ extensions::ExtensionsHandler::ExposeInterfacesToBrowser(registry,
+ running_elevated);
+#endif
+ // If our process runs with elevated privileges, only add elevated
+ // Mojo services to the service_manager::InterfaceRegistry.
+ if (running_elevated)
return;
#if !defined(OS_ANDROID)
« no previous file with comments | « chrome/common/extensions/media_parser.mojom ('k') | chrome/utility/extensions/extensions_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698