| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 DrainMessageLoops(); | 541 DrainMessageLoops(); |
| 542 } | 542 } |
| 543 | 543 |
| 544 static SiteInstanceImpl* CreateSiteInstance( | 544 static SiteInstanceImpl* CreateSiteInstance( |
| 545 BrowserContext* browser_context, | 545 BrowserContext* browser_context, |
| 546 RenderProcessHostFactory* factory, | 546 RenderProcessHostFactory* factory, |
| 547 const GURL& url) { | 547 const GURL& url) { |
| 548 SiteInstanceImpl* instance = | 548 SiteInstanceImpl* instance = |
| 549 reinterpret_cast<SiteInstanceImpl*>( | 549 reinterpret_cast<SiteInstanceImpl*>( |
| 550 SiteInstance::CreateForURL(browser_context, url)); | 550 SiteInstance::CreateForURL(browser_context, url)); |
| 551 instance->set_render_process_host_factory(factory); | 551 instance->SetRenderProcessHostFactory(factory); |
| 552 return instance; | 552 return instance; |
| 553 } | 553 } |
| 554 | 554 |
| 555 // Test to ensure that pages that require certain privileges are grouped | 555 // Test to ensure that pages that require certain privileges are grouped |
| 556 // in processes with similar pages. | 556 // in processes with similar pages. |
| 557 TEST_F(SiteInstanceTest, ProcessSharingByType) { | 557 TEST_F(SiteInstanceTest, ProcessSharingByType) { |
| 558 MockRenderProcessHostFactory rph_factory; | 558 MockRenderProcessHostFactory rph_factory; |
| 559 ChildProcessSecurityPolicyImpl* policy = | 559 ChildProcessSecurityPolicyImpl* policy = |
| 560 ChildProcessSecurityPolicyImpl::GetInstance(); | 560 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 561 | 561 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 EXPECT_TRUE(instance->GetSiteURL().is_empty()); | 754 EXPECT_TRUE(instance->GetSiteURL().is_empty()); |
| 755 host.reset(instance->GetProcess()); | 755 host.reset(instance->GetProcess()); |
| 756 | 756 |
| 757 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( | 757 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( |
| 758 browser_context.get(), GURL())); | 758 browser_context.get(), GURL())); |
| 759 | 759 |
| 760 DrainMessageLoops(); | 760 DrainMessageLoops(); |
| 761 } | 761 } |
| 762 | 762 |
| 763 } // namespace content | 763 } // namespace content |
| OLD | NEW |