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

Unified Diff: chrome/browser/site_details.h

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 | « chrome/browser/memory_details.cc ('k') | chrome/browser/site_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/site_details.h
diff --git a/chrome/browser/site_details.h b/chrome/browser/site_details.h
new file mode 100644
index 0000000000000000000000000000000000000000..4eb99b97eeba1cb4c3fdfc1d742e84df4a3a5ffa
--- /dev/null
+++ b/chrome/browser/site_details.h
@@ -0,0 +1,53 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SITE_DETAILS_H_
+#define CHROME_BROWSER_SITE_DETAILS_H_
+
+#include "base/containers/hash_tables.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/site_instance.h"
+#include "content/public/browser/web_contents.h"
+
+// Maps an ID representing each BrowsingInstance to a set of site URLs.
+typedef base::hash_map<int32, std::set<GURL> > BrowsingInstanceSiteMap;
+
+// Information about the sites and SiteInstances in each BrowsingInstance, for
+// use in estimating the number of processes needed for various process models.
+struct SiteData {
+ SiteData();
+ ~SiteData();
+
+ std::set<GURL> sites;
+ std::set<GURL> https_sites;
+ std::vector<content::SiteInstance*> instances;
+ BrowsingInstanceSiteMap instance_site_map;
+ BrowsingInstanceSiteMap instance_https_site_map;
+};
+
+// Maps a BrowserContext to information about the SiteInstances it contains.
+typedef base::hash_map<content::BrowserContext*, SiteData>
+ BrowserContextSiteDataMap;
+
+class SiteDetails {
+ public:
+ // Collect information about all committed sites in the given WebContents
+ // on the UI thread.
+ static void CollectSiteInfo(content::WebContents* contents,
+ SiteData* site_data);
+
+ // Updates the global histograms for tracking memory usage.
+ static void UpdateHistograms(const BrowserContextSiteDataMap& site_data_map,
+ int all_renderer_process_count,
+ int non_renderer_process_count);
+
+ private:
+ // Never needs to be constructed.
+ SiteDetails();
+ ~SiteDetails();
+
+ DISALLOW_COPY_AND_ASSIGN(SiteDetails);
+};
+
+#endif // CHROME_BROWSER_SITE_DETAILS_H_
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/site_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698