| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/browsing_instance.h" | 10 #include "content/browser/browsing_instance.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 DrainMessageLoops(); | 542 DrainMessageLoops(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 static SiteInstanceImpl* CreateSiteInstance( | 545 static SiteInstanceImpl* CreateSiteInstance( |
| 546 BrowserContext* browser_context, | 546 BrowserContext* browser_context, |
| 547 RenderProcessHostFactory* factory, | 547 RenderProcessHostFactory* factory, |
| 548 const GURL& url) { | 548 const GURL& url) { |
| 549 SiteInstanceImpl* instance = | 549 SiteInstanceImpl* instance = |
| 550 reinterpret_cast<SiteInstanceImpl*>( | 550 reinterpret_cast<SiteInstanceImpl*>( |
| 551 SiteInstance::CreateForURL(browser_context, url)); | 551 SiteInstance::CreateForURL(browser_context, url)); |
| 552 instance->set_render_process_host_factory(factory); | 552 instance->SetRenderProcessHostFactory(factory); |
| 553 return instance; | 553 return instance; |
| 554 } | 554 } |
| 555 | 555 |
| 556 // Test to ensure that pages that require certain privileges are grouped | 556 // Test to ensure that pages that require certain privileges are grouped |
| 557 // in processes with similar pages. | 557 // in processes with similar pages. |
| 558 TEST_F(SiteInstanceTest, ProcessSharingByType) { | 558 TEST_F(SiteInstanceTest, ProcessSharingByType) { |
| 559 MockRenderProcessHostFactory rph_factory; | 559 MockRenderProcessHostFactory rph_factory; |
| 560 ChildProcessSecurityPolicyImpl* policy = | 560 ChildProcessSecurityPolicyImpl* policy = |
| 561 ChildProcessSecurityPolicyImpl::GetInstance(); | 561 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 562 | 562 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 EXPECT_TRUE(instance->GetSiteURL().is_empty()); | 755 EXPECT_TRUE(instance->GetSiteURL().is_empty()); |
| 756 host.reset(instance->GetProcess()); | 756 host.reset(instance->GetProcess()); |
| 757 | 757 |
| 758 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( | 758 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( |
| 759 browser_context.get(), GURL())); | 759 browser_context.get(), GURL())); |
| 760 | 760 |
| 761 DrainMessageLoops(); | 761 DrainMessageLoops(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 } // namespace content | 764 } // namespace content |
| OLD | NEW |