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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 940813003: Use a utility process for the Mojo v8 proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-pac-in-process-enable
Patch Set: Remove unneeded forward decl. Created 5 years, 9 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/utility/chrome_content_utility_client.h ('k') | content/browser/utility_process_host_impl.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 843b1f37ea88030b14df9df1bb7689375d07486c..d82c23bf5479e1b7cf85f27b64a0953c7d635c47 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -15,6 +15,7 @@
#include "chrome/utility/utility_message_handler.h"
#include "content/public/child/image_decoder_utils.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/service_registry.h"
#include "content/public/utility/utility_thread.h"
#include "courgette/courgette.h"
#include "courgette/third_party/bsdiff.h"
@@ -27,6 +28,7 @@
#if !defined(OS_ANDROID)
#include "chrome/utility/profile_import_handler.h"
+#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
#endif
#if defined(OS_WIN)
@@ -71,6 +73,17 @@ void FinishParseMediaMetadata(
}
#endif
+#if !defined(OS_ANDROID)
+void CreateProxyResolverFactory(
+ mojo::InterfaceRequest<net::interfaces::ProxyResolverFactory> request) {
+ // MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it
+ // is connected to. When that message pipe is closed, either explicitly on the
+ // other end (in the browser process), or by a connection error, this object
+ // will be destroyed.
+ new net::MojoProxyResolverFactoryImpl(request.Pass());
+}
+#endif // OS_ANDROID
+
} // namespace
int64_t ChromeContentUtilityClient::max_ipc_message_size_ =
@@ -160,6 +173,14 @@ bool ChromeContentUtilityClient::OnMessageReceived(
return handled;
}
+void ChromeContentUtilityClient::RegisterMojoServices(
+ content::ServiceRegistry* registry) {
+#if !defined(OS_ANDROID)
+ registry->AddService<net::interfaces::ProxyResolverFactory>(
+ base::Bind(CreateProxyResolverFactory));
+#endif
+}
+
// static
void ChromeContentUtilityClient::PreSandboxStartup() {
#if defined(ENABLE_EXTENSIONS)
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | content/browser/utility_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698