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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 590 |
591 return GetRequestContext(); | 591 return GetRequestContext(); |
592 } | 592 } |
593 | 593 |
594 void TestingProfile::CreateRequestContext() { | 594 void TestingProfile::CreateRequestContext() { |
595 if (!request_context_) | 595 if (!request_context_) |
596 request_context_ = new TestURLRequestContextGetter(); | 596 request_context_ = new TestURLRequestContextGetter(); |
597 } | 597 } |
598 | 598 |
599 void TestingProfile::ResetRequestContext() { | 599 void TestingProfile::ResetRequestContext() { |
| 600 // Any objects holding live URLFetchers should be deleted before the request |
| 601 // context is shut down. |
| 602 template_url_fetcher_.reset(); |
| 603 |
600 request_context_ = NULL; | 604 request_context_ = NULL; |
601 } | 605 } |
602 | 606 |
603 net::URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { | 607 net::URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { |
604 return NULL; | 608 return NULL; |
605 } | 609 } |
606 | 610 |
607 net::URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { | 611 net::URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { |
608 if (!extensions_request_context_) | 612 if (!extensions_request_context_) |
609 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); | 613 extensions_request_context_ = new TestExtensionURLRequestContextGetter(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { | 761 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { |
758 return GetExtensionSpecialStoragePolicy(); | 762 return GetExtensionSpecialStoragePolicy(); |
759 } | 763 } |
760 | 764 |
761 void TestingProfile::DestroyWebDataService() { | 765 void TestingProfile::DestroyWebDataService() { |
762 if (!web_data_service_.get()) | 766 if (!web_data_service_.get()) |
763 return; | 767 return; |
764 | 768 |
765 web_data_service_->Shutdown(); | 769 web_data_service_->Shutdown(); |
766 } | 770 } |
OLD | NEW |