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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/site_details.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SITE_DETAILS_H_
6 #define CHROME_BROWSER_SITE_DETAILS_H_
7
8 #include "base/containers/hash_tables.h"
9 #include "content/public/browser/browser_context.h"
10 #include "content/public/browser/site_instance.h"
11 #include "content/public/browser/web_contents.h"
12
13 // Maps an ID representing each BrowsingInstance to a set of site URLs.
14 typedef base::hash_map<int32, std::set<GURL> > BrowsingInstanceSiteMap;
15
16 // Information about the sites and SiteInstances in each BrowsingInstance, for
17 // use in estimating the number of processes needed for various process models.
18 struct SiteData {
19 SiteData();
20 ~SiteData();
21
22 std::set<GURL> sites;
23 std::set<GURL> https_sites;
24 std::vector<content::SiteInstance*> instances;
25 BrowsingInstanceSiteMap instance_site_map;
26 BrowsingInstanceSiteMap instance_https_site_map;
27 };
28
29 // Maps a BrowserContext to information about the SiteInstances it contains.
30 typedef base::hash_map<content::BrowserContext*, SiteData>
31 BrowserContextSiteDataMap;
32
33 class SiteDetails {
34 public:
35 // Collect information about all committed sites in the given WebContents
36 // on the UI thread.
37 static void CollectSiteInfo(content::WebContents* contents,
38 SiteData* site_data);
39
40 // Updates the global histograms for tracking memory usage.
41 static void UpdateHistograms(const BrowserContextSiteDataMap& site_data_map,
42 int all_renderer_process_count,
43 int non_renderer_process_count);
44
45 private:
46 // Never needs to be constructed.
47 SiteDetails();
48 ~SiteDetails();
49
50 DISALLOW_COPY_AND_ASSIGN(SiteDetails);
51 };
52
53 #endif // CHROME_BROWSER_SITE_DETAILS_H_
OLDNEW
« 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