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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2521823008: Migrate chrome_net_benchmarking_message_filter to mojo (Closed)
Patch Set: Do not add NetBenchmaring interface if benchmarking is disabled Created 4 years 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/browser/BUILD.gn ('k') | chrome/browser/chrome_content_browser_manifest_overlay.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 9a39f749f390f2e987c6f02cd97539b6aa694d6f..b9b18e82813b8d058f899e0a57a90220bc7148ae 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -41,7 +41,6 @@
#include "chrome/browser/budget_service/budget_service_impl.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/chrome_content_browser_client_parts.h"
-#include "chrome/browser/chrome_net_benchmarking_message_filter.h"
#include "chrome/browser/chrome_quota_permission_context.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -54,6 +53,7 @@
#include "chrome/browser/memory/chrome_memory_coordinator_delegate.h"
#include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
#include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
+#include "chrome/browser/net_benchmarking.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
@@ -1038,9 +1038,6 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
int id = host->GetID();
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
- net::URLRequestContextGetter* context =
- host->GetStoragePartition()->GetURLRequestContext();
-
host->AddFilter(new ChromeRenderMessageFilter(
id, profile, host->GetStoragePartition()->GetServiceWorkerContext()));
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -1055,7 +1052,6 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
host->AddFilter(new SpellCheckMessageFilterPlatform(id));
#endif
- host->AddFilter(new ChromeNetBenchmarkingMessageFilter(profile, context));
host->AddFilter(new prerender::PrerenderMessageFilter(id, profile));
host->AddFilter(new TtsMessageFilter(host->GetBrowserContext()));
#if BUILDFLAG(ENABLE_WEBRTC)
@@ -1076,6 +1072,8 @@ void ChromeContentBrowserClient::RenderProcessWillLaunch(
#endif
#if !defined(DISABLE_NACL)
+ net::URLRequestContextGetter* context =
+ host->GetStoragePartition()->GetURLRequestContext();
host->AddFilter(new nacl::NaClHostMessageFilter(
id, profile->IsOffTheRecord(),
profile->GetPath(),
@@ -2963,7 +2961,14 @@ void ChromeContentBrowserClient::ExposeInterfacesToRenderer(
base::Bind(&rappor::RapporRecorderImpl::Create,
g_browser_process->rappor_service()),
ui_task_runner);
-
+ if (NetBenchmarking::CheckBenchmarkingEnabled()) {
+ Profile* profile =
+ Profile::FromBrowserContext(render_process_host->GetBrowserContext());
+ net::URLRequestContextGetter* context =
+ render_process_host->GetStoragePartition()->GetURLRequestContext();
+ registry->AddInterface(
+ base::Bind(&NetBenchmarking::Create, profile, context));
+ }
#if defined(OS_CHROMEOS)
registry->AddInterface<metrics::mojom::LeakDetector>(
base::Bind(&metrics::LeakDetectorRemoteController::Create),
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/chrome_content_browser_manifest_overlay.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698