| 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 "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( | 611 net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess( |
| 612 int renderer_child_id) { | 612 int renderer_child_id) { |
| 613 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 613 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
| 614 renderer_child_id); | 614 renderer_child_id); |
| 615 return rph->GetStoragePartition()->GetURLRequestContext(); | 615 return rph->GetStoragePartition()->GetURLRequestContext(); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void TestingProfile::CreateRequestContext() { | 618 void TestingProfile::CreateRequestContext() { |
| 619 if (!request_context_) | 619 if (!request_context_) |
| 620 request_context_ = | 620 request_context_ = |
| 621 new TestURLRequestContextGetter( | 621 new net::TestURLRequestContextGetter( |
| 622 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 622 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 623 } | 623 } |
| 624 | 624 |
| 625 void TestingProfile::ResetRequestContext() { | 625 void TestingProfile::ResetRequestContext() { |
| 626 // Any objects holding live URLFetchers should be deleted before the request | 626 // Any objects holding live URLFetchers should be deleted before the request |
| 627 // context is shut down. | 627 // context is shut down. |
| 628 TemplateURLFetcherFactory::ShutdownForProfile(this); | 628 TemplateURLFetcherFactory::ShutdownForProfile(this); |
| 629 | 629 |
| 630 request_context_ = NULL; | 630 request_context_ = NULL; |
| 631 } | 631 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { | 823 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { |
| 824 DCHECK(!build_called_); | 824 DCHECK(!build_called_); |
| 825 build_called_ = true; | 825 build_called_ = true; |
| 826 return scoped_ptr<TestingProfile>(new TestingProfile( | 826 return scoped_ptr<TestingProfile>(new TestingProfile( |
| 827 path_, | 827 path_, |
| 828 delegate_, | 828 delegate_, |
| 829 extension_policy_, | 829 extension_policy_, |
| 830 pref_service_.Pass(), | 830 pref_service_.Pass(), |
| 831 user_cloud_policy_manager_.Pass())); | 831 user_cloud_policy_manager_.Pass())); |
| 832 } | 832 } |
| OLD | NEW |