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

Unified Diff: chrome/renderer/page_load_histograms.cc

Issue 1394283003: Move more extensions code into ChromeExtensionsRendererClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 5 years, 2 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/renderer/page_load_histograms.cc
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc
index b7fd03ec3cc5e3d03c096bf516a86d3c7a3e48d4..61367d6477edfc889f1972c677a21a0811965aed 100644
--- a/chrome/renderer/page_load_histograms.cc
+++ b/chrome/renderer/page_load_histograms.cc
@@ -18,7 +18,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/renderer/searchbox/search_bouncer.h"
#include "components/data_reduction_proxy/content/common/data_reduction_proxy_messages.h"
#include "content/public/common/content_constants.h"
@@ -36,6 +35,11 @@
#include "third_party/WebKit/public/web/WebView.h"
#include "url/gurl.h"
+#if defined(ENABLE_EXTENSIONS)
+#include "chrome/renderer/extensions/chrome_extensions_renderer_client.h"
+#include "extensions/renderer/dispatcher.h"
+#endif
+
using blink::WebDataSource;
using blink::WebFrame;
using blink::WebPerformance;
@@ -599,6 +603,15 @@ void DumpHistograms(const WebPerformance& performance,
}
}
+bool WasWebRequestUsedBySomeExtensions() {
+#if defined(ENABLE_EXTENSIONS)
+ return ChromeExtensionsRendererClient::GetInstance()->extension_dispatcher()
+ ->WasWebRequestUsedBySomeExtensions();
+#else
+ return false;
+#endif
+}
+
// These histograms are based on the timing information collected in
// DocumentState. They should be transitioned to equivalents based on the
// Navigation Timing records (see DumpPerformanceTiming()) or dropped if not
@@ -796,8 +809,7 @@ void DumpDeprecatedHistograms(const WebPerformance& performance,
begin_to_finish_all_loads);
}
- const bool use_webrequest_histogram =
- ChromeContentRendererClient::WasWebRequestUsedBySomeExtensions();
+ const bool use_webrequest_histogram = WasWebRequestUsedBySomeExtensions();
if (use_webrequest_histogram) {
switch (load_type) {
case DocumentState::NORMAL_LOAD:
« no previous file with comments | « chrome/renderer/extensions/chrome_extensions_renderer_client.cc ('k') | chrome/test/base/chrome_render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698