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 "content/public/test/test_browser_context.h" | 5 #include "content/public/test/test_browser_context.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "content/public/test/mock_resource_context.h" | 8 #include "content/public/test/mock_resource_context.h" |
9 #include "net/url_request/url_request_context.h" | 9 #include "net/url_request/url_request_context.h" |
10 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 bool TestBrowserContext::IsOffTheRecord() const { | 91 bool TestBrowserContext::IsOffTheRecord() const { |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { | 95 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { |
96 return NULL; | 96 return NULL; |
97 } | 97 } |
98 | 98 |
99 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { | 99 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { |
100 if (!request_context_.get()) { | 100 DCHECK(request_context_.get()); |
101 request_context_ = new TestContextURLRequestContextGetter( | |
102 GetResourceContext()->GetRequestContext()); | |
103 } | |
104 return request_context_.get(); | 101 return request_context_.get(); |
105 } | 102 } |
106 | 103 |
| 104 net::URLRequestContextGetter* TestBrowserContext::CreateRequestContext( |
| 105 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 106 blob_protocol_handler, |
| 107 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 108 file_system_protocol_handler, |
| 109 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 110 developer_protocol_handler) { |
| 111 DCHECK(!request_context_); |
| 112 request_context_ = new TestContextURLRequestContextGetter( |
| 113 GetResourceContext()->GetRequestContext()); |
| 114 return request_context_.get(); |
| 115 |
| 116 } |
| 117 |
107 net::URLRequestContextGetter* | 118 net::URLRequestContextGetter* |
108 TestBrowserContext::GetRequestContextForRenderProcess(int renderer_child_id) { | 119 TestBrowserContext::GetRequestContextForRenderProcess(int renderer_child_id) { |
109 return NULL; | 120 return NULL; |
110 } | 121 } |
111 | 122 |
112 | 123 |
113 net::URLRequestContextGetter* | 124 net::URLRequestContextGetter* |
114 TestBrowserContext::GetRequestContextForStoragePartition( | 125 TestBrowserContext::CreateRequestContextForStoragePartition( |
115 const FilePath& partition_path, | 126 const FilePath& partition_path, |
116 bool in_memory) { | 127 bool in_memory, |
| 128 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 129 blob_protocol_handler, |
| 130 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 131 file_system_protocol_handler, |
| 132 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 133 developer_protocol_handler) { |
117 return NULL; | 134 return NULL; |
118 } | 135 } |
119 | 136 |
120 net::URLRequestContextGetter* TestBrowserContext::GetMediaRequestContext() { | 137 net::URLRequestContextGetter* TestBrowserContext::GetMediaRequestContext() { |
121 return NULL; | 138 return NULL; |
122 } | 139 } |
123 | 140 |
124 net::URLRequestContextGetter* | 141 net::URLRequestContextGetter* |
125 TestBrowserContext::GetMediaRequestContextForRenderProcess( | 142 TestBrowserContext::GetMediaRequestContextForRenderProcess( |
126 int renderer_child_id) { | 143 int renderer_child_id) { |
(...skipping 21 matching lines...) Expand all Loading... |
148 SpeechRecognitionPreferences* | 165 SpeechRecognitionPreferences* |
149 TestBrowserContext::GetSpeechRecognitionPreferences() { | 166 TestBrowserContext::GetSpeechRecognitionPreferences() { |
150 return NULL; | 167 return NULL; |
151 } | 168 } |
152 | 169 |
153 quota::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() { | 170 quota::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() { |
154 return special_storage_policy_.get(); | 171 return special_storage_policy_.get(); |
155 } | 172 } |
156 | 173 |
157 } // namespace content | 174 } // namespace content |
OLD | NEW |