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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 1399853004: Collect separate V8 histograms for Top10 non-Google sites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Master changes included 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 5fe2984fd116ddc99da82aac920e70bef0775dce..551f59134b639eafd368fd2fe36dbb469d459a68 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -22,6 +22,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
@@ -288,6 +289,28 @@ std::string HostToCustomHistogramSuffix(const std::string& host) {
return ".inbox";
if (host == "www.youtube.com")
return ".youtube";
+
+ // The Top10 sites have different TLD and/or subdomains
+ // depending on the localization
+ if (host == "sina.com.cn")
+ return ".top10";
+
+ std::vector<base::StringPiece> host_tokens = base::SplitStringPiece(
+ host, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+
+ if (host_tokens.size() == 3) {
+ if ((host_tokens[1] == "facebook") ||
+ (host_tokens[1] == "baidu") ||
+ (host_tokens[1] == "yahoo") ||
+ (host_tokens[1] == "amazon") ||
+ (host_tokens[1] == "qq") ||
+ (host_tokens[1] == "twitter") ||
+ (host_tokens[1] == "taobao") ||
+ (host_tokens[1] == "live") ||
+ (host_tokens[1] == "linkedin"))
jochen (gone - plz use gerrit) 2015/10/21 13:17:57 according to http://www.alexa.com/topsites linkedi
Michael Hablich 2015/10/22 13:16:35 You are right: Removed linkedin, added wikipedia
+ return ".top10";
+ }
+
return std::string();
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698