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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2667443002: Convert utility process ParseMediaMetadata blob reading IPC to mojo (Closed)
Patch Set: Remove the damn helper: call ReleaseProcessIfNeeded directly. Created 3 years, 10 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
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 8fcd114315a27d1afb5b2fbcc241732938c23e0f..9be3bbdef64f9e0300dce204244ab2a9fe603a31 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -210,11 +210,6 @@ bool ChromeContentUtilityClient::OnMessageReceived(
return true;
for (auto* handler : handlers_) {
- // At least one of the utility process handlers adds a new handler to
- // |handlers_| when it handles a message. This causes any iterator over
- // |handlers_| to become invalid. Therefore, it is necessary to break the
- // loop at this point instead of evaluating it as a loop condition (if the
- // for loop was using iterators explicitly, as originally done).
if (handler->OnMessageReceived(message))
return true;
}
@@ -224,17 +219,16 @@ bool ChromeContentUtilityClient::OnMessageReceived(
void ChromeContentUtilityClient::ExposeInterfacesToBrowser(
service_manager::InterfaceRegistry* registry) {
- const bool running_elevated =
+ const bool utility_process_running_elevated =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUtilityProcessRunningElevated);
#if BUILDFLAG(ENABLE_EXTENSIONS)
- ChromeContentUtilityClient* utility_client = this;
extensions::ExtensionsHandler::ExposeInterfacesToBrowser(
- registry, utility_client, running_elevated);
+ registry, utility_process_running_elevated);
#endif
// If our process runs with elevated privileges, only add elevated Mojo
// services to the interface registry.
- if (running_elevated)
+ if (utility_process_running_elevated)
return;
registry->AddInterface(base::Bind(&FilePatcherImpl::Create));
@@ -258,11 +252,6 @@ void ChromeContentUtilityClient::RegisterServices(StaticServiceMap* services) {
std::make_pair(image_decoder::mojom::kServiceName, image_decoder_info));
}
-void ChromeContentUtilityClient::AddHandler(
- std::unique_ptr<UtilityMessageHandler> handler) {
- handlers_.push_back(std::move(handler));
-}
-
// static
void ChromeContentUtilityClient::PreSandboxStartup() {
#if BUILDFLAG(ENABLE_EXTENSIONS)

Powered by Google App Engine
This is Rietveld 408576698