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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
823 return GetRequestContext(); | 823 return GetRequestContext(); |
824 } | 824 } |
825 | 825 |
826 content::ResourceContext* TestingProfile::GetResourceContext() { | 826 content::ResourceContext* TestingProfile::GetResourceContext() { |
827 if (!resource_context_) | 827 if (!resource_context_) |
828 resource_context_ = new content::MockResourceContext(); | 828 resource_context_ = new content::MockResourceContext(); |
829 return resource_context_; | 829 return resource_context_; |
830 } | 830 } |
831 | 831 |
832 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { | 832 HostContentSettingsMap* TestingProfile::GetHostContentSettingsMap() { |
833 DCHECK(!content::BrowserThread::IsThreadInitialized( | |
Paweł Hajdan Jr.
2014/10/20 09:11:51
This seems the only place in this patch where IsTh
Jun Mukai
2014/10/20 17:02:51
I copied this check from TestingProfile::Init().
Paweł Hajdan Jr.
2014/10/21 09:30:58
If it's really needed, please extract it to a comm
Jun Mukai
2014/10/22 06:30:13
Tried and I was wrong. Changed to use DCHECK_CURRE
| |
834 content::BrowserThread::UI) || | |
835 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | |
833 if (!host_content_settings_map_.get()) { | 836 if (!host_content_settings_map_.get()) { |
834 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); | 837 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); |
835 #if defined(ENABLE_EXTENSIONS) | 838 #if defined(ENABLE_EXTENSIONS) |
836 ExtensionService* extension_service = | 839 ExtensionService* extension_service = |
837 extensions::ExtensionSystem::Get(this)->extension_service(); | 840 extensions::ExtensionSystem::Get(this)->extension_service(); |
838 if (extension_service) { | 841 if (extension_service) { |
839 extension_service->RegisterContentSettings( | 842 extension_service->RegisterContentSettings( |
840 host_content_settings_map_.get()); | 843 host_content_settings_map_.get()); |
841 } | 844 } |
842 #endif | 845 #endif |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1022 #if defined(ENABLE_EXTENSIONS) | 1025 #if defined(ENABLE_EXTENSIONS) |
1023 extension_policy_, | 1026 extension_policy_, |
1024 #endif | 1027 #endif |
1025 pref_service_.Pass(), | 1028 pref_service_.Pass(), |
1026 original_profile, | 1029 original_profile, |
1027 guest_session_, | 1030 guest_session_, |
1028 supervised_user_id_, | 1031 supervised_user_id_, |
1029 policy_service_.Pass(), | 1032 policy_service_.Pass(), |
1030 testing_factories_); | 1033 testing_factories_); |
1031 } | 1034 } |
OLD | NEW |