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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 16599016: Add UMA stats for predicted process counts with out-of-process iframes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update hash_tables.h include Created 7 years, 6 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 | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6c8f28a2162495cb116ff7f6110830f190959481..b69bb165701adc8361222c6b4a94c9e6ab4bfe7e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1031,6 +1031,31 @@ uint64 WebContentsImpl::GetUploadPosition() const {
return upload_position_;
}
+std::set<GURL> WebContentsImpl::GetSitesInTab() const {
+ BrowserContext* browser_context = GetBrowserContext();
+ std::set<GURL> sites;
+ if (!frame_tree_root_.get())
+ return sites;
+
+ // Iterates over the FrameTreeNodes to find each unique site URL that is
+ // currently committed.
+ FrameTreeNode* node = NULL;
+ std::queue<FrameTreeNode*> queue;
+ queue.push(frame_tree_root_.get());
+
+ while (!queue.empty()) {
+ node = queue.front();
+ queue.pop();
+ sites.insert(SiteInstance::GetSiteForURL(browser_context,
+ node->current_url()));
+
+ for (size_t i = 0; i < node->child_count(); ++i)
+ queue.push(node->child_at(i));
+ }
+
+ return sites;
+}
+
const std::string& WebContentsImpl::GetEncoding() const {
return encoding_;
}
@@ -2940,6 +2965,13 @@ void WebContentsImpl::DidNavigate(
LoadCommittedDetails details;
bool did_navigate = controller_.RendererDidNavigate(params, &details);
+ // For now, keep track of each frame's URL in its FrameTreeNode. This lets
+ // us estimate our process count for implementing OOP iframes.
+ // TODO(creis): Remove this when we track which pages commit in each frame.
+ FrameTreeNode* node = FindFrameTreeNodeByID(params.frame_id);
+ if (node)
+ node->set_current_url(params.url);
+
// Send notification about committed provisional loads. This notification is
// different from the NAV_ENTRY_COMMITTED notification which doesn't include
// the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698