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

Unified Diff: content/browser/site_instance_impl.cc

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ForTesting to SetRenderProcessHostFactory Created 7 years, 8 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/browser/site_instance_impl.cc
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 3a93f25c9fa5de8db5c3b77772fed47daedd22bd..802efef6586669fb6c9b7306e1f26d877bde68cb 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -191,7 +191,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
}
SiteInstance* SiteInstanceImpl::GetRelatedSiteInstance(const GURL& url) {
- return browsing_instance_->GetSiteInstanceForURL(url);
+ SiteInstance* result = browsing_instance_->GetSiteInstanceForURL(url);
+ if (render_process_host_factory_)
+ result->SetRenderProcessHostFactoryForTesting(render_process_host_factory_);
Jeffrey Yasskin 2013/04/08 16:30:48 I got a "calling functions intended only for testi
jam 2013/04/08 16:54:53 ah, since there's a call path in a non-test file,
Paweł Hajdan Jr. 2013/04/08 20:03:51 By the way, calling Set, a mutating method in a me
Jeffrey Yasskin 2013/04/08 22:09:38 What? The Set() is on the newly-constructed result
Jeffrey Yasskin 2013/04/08 22:09:38 Well, I could put back the changes to browsing_ins
Paweł Hajdan Jr. 2013/04/08 22:17:38 Oops, this makes more sense. Please ignore my earl
Jeffrey Yasskin 2013/04/08 22:38:02 Done, although I can switch to directly modifying
+ return result;
}
bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) {
@@ -224,6 +227,11 @@ BrowserContext* SiteInstanceImpl::GetBrowserContext() const {
return browsing_instance_->browser_context();
}
+void SiteInstanceImpl::SetRenderProcessHostFactoryForTesting(
+ const RenderProcessHostFactory* rph_factory) {
+ render_process_host_factory_ = rph_factory;
+}
+
/*static*/
SiteInstance* SiteInstance::Create(BrowserContext* browser_context) {
return new SiteInstanceImpl(new BrowsingInstance(browser_context));

Powered by Google App Engine
This is Rietveld 408576698