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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10828342: Per-host V8 histograms. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 8 years, 4 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: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 3c1526682498c7356cdf5601f31cba94d9534be8..2a61a12671cabda22cd7ad0fa7290b766253c43e 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3171,6 +3171,21 @@ void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame,
// Check whether we have new encoding name.
UpdateEncoding(frame, frame->view()->pageEncoding().utf8());
+
+ if (!frame->parent()) { // Only for top frames.
+ // Check if all RenderViewImpls are displaying a page from the same host,
+ // and update RenderThreadImpl's view on that. If this is the only
+ // RenderViewImpl, the common host is this view's host. If there are many,
+ // check if this one shares the common host of the other
+ // RenderViewImpls. It's ok to not detect some cases where the
+ // RenderViewImpls share a common host.
+ std::string host = GURL(frame->document().url()).host();
+ RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();
+ if (g_view_map.Get().size() == 1)
+ render_thread_impl->SetCommonHost(host);
+ else if (host != render_thread_impl->CommonHost())
+ render_thread_impl->SetCommonHost(std::string());
+ }
}
void RenderViewImpl::didClearWindowObject(WebFrame* frame) {
« content/renderer/render_thread_impl.cc ('K') | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698