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

Side by Side Diff: chrome/browser/renderer_host/site_instance.h

Issue 2928004: Add unit test and supporting code to test process overflow case. (Closed)
Patch Set: linux compile error Created 10 years, 5 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_
7 7
8 #include "chrome/browser/renderer_host/render_process_host.h" 8 #include "chrome/browser/renderer_host/render_process_host.h"
9 #include "chrome/common/notification_registrar.h" 9 #include "chrome/common/notification_registrar.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Return whether both URLs are part of the same web site, for the purpose of 125 // Return whether both URLs are part of the same web site, for the purpose of
126 // assigning them to processes accordingly. The decision is currently based 126 // assigning them to processes accordingly. The decision is currently based
127 // on the registered domain of the URLs (google.com, bbc.co.uk), as well as 127 // on the registered domain of the URLs (google.com, bbc.co.uk), as well as
128 // the scheme (https, http). This ensures that two pages will be in 128 // the scheme (https, http). This ensures that two pages will be in
129 // the same process if they can communicate with other via JavaScript. 129 // the same process if they can communicate with other via JavaScript.
130 // (e.g., docs.google.com and mail.google.com have DOM access to each other 130 // (e.g., docs.google.com and mail.google.com have DOM access to each other
131 // if they both set their document.domain properties to google.com.) 131 // if they both set their document.domain properties to google.com.)
132 static bool IsSameWebSite(Profile* profile, 132 static bool IsSameWebSite(Profile* profile,
133 const GURL& url1, const GURL& url2); 133 const GURL& url1, const GURL& url2);
134 134
135 // Returns the renderer type for this URL.
136 static RenderProcessHost::Type RendererTypeForURL(const GURL& url);
137
135 protected: 138 protected:
136 friend class base::RefCounted<SiteInstance>; 139 friend class base::RefCounted<SiteInstance>;
137 friend class BrowsingInstance; 140 friend class BrowsingInstance;
138 141
139 // Virtual to allow tests to extend it. 142 // Virtual to allow tests to extend it.
140 virtual ~SiteInstance(); 143 virtual ~SiteInstance();
141 144
142 // Create a new SiteInstance. Protected to give access to BrowsingInstance 145 // Create a new SiteInstance. Protected to give access to BrowsingInstance
143 // and tests; most callers should use CreateSiteInstance or 146 // and tests; most callers should use CreateSiteInstance or
144 // GetRelatedSiteInstance instead. 147 // GetRelatedSiteInstance instead.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // The web site that this SiteInstance is rendering pages for. 186 // The web site that this SiteInstance is rendering pages for.
184 GURL site_; 187 GURL site_;
185 188
186 // Whether SetSite has been called. 189 // Whether SetSite has been called.
187 bool has_site_; 190 bool has_site_;
188 191
189 DISALLOW_COPY_AND_ASSIGN(SiteInstance); 192 DISALLOW_COPY_AND_ASSIGN(SiteInstance);
190 }; 193 };
191 194
192 #endif // CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_ 195 #endif // CHROME_BROWSER_RENDERER_HOST_SITE_INSTANCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_process_host.cc ('k') | chrome/browser/renderer_host/site_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698