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 // This file contains an implementation of the ResourceLoaderBridge class. | 5 // This file contains an implementation of the ResourceLoaderBridge class. |
6 // The class is implemented using net::URLRequest, meaning it is a "simple" | 6 // The class is implemented using net::URLRequest, meaning it is a "simple" |
7 // version that directly issues requests. The more complicated one used in the | 7 // version that directly issues requests. The more complicated one used in the |
8 // browser uses IPC. | 8 // browser uses IPC. |
9 // | 9 // |
10 // Because net::URLRequest only provides an asynchronous resource loading API, | 10 // Because net::URLRequest only provides an asynchronous resource loading API, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 virtual bool OnCanThrottleRequest( | 180 virtual bool OnCanThrottleRequest( |
181 const net::URLRequest& request) const OVERRIDE { | 181 const net::URLRequest& request) const OVERRIDE { |
182 return false; | 182 return false; |
183 } | 183 } |
184 | 184 |
185 virtual int OnBeforeSocketStreamConnect( | 185 virtual int OnBeforeSocketStreamConnect( |
186 net::SocketStream* stream, | 186 net::SocketStream* stream, |
187 const net::CompletionCallback& callback) OVERRIDE { | 187 const net::CompletionCallback& callback) OVERRIDE { |
188 return net::OK; | 188 return net::OK; |
189 } | 189 } |
| 190 |
| 191 virtual void OnCacheWaitStateChange(const net::URLRequest& request, |
| 192 CacheWaitState state) OVERRIDE { |
| 193 } |
190 }; | 194 }; |
191 | 195 |
192 TestShellRequestContextParams* g_request_context_params = NULL; | 196 TestShellRequestContextParams* g_request_context_params = NULL; |
193 TestShellRequestContext* g_request_context = NULL; | 197 TestShellRequestContext* g_request_context = NULL; |
194 TestShellNetworkDelegate* g_network_delegate = NULL; | 198 TestShellNetworkDelegate* g_network_delegate = NULL; |
195 base::Thread* g_cache_thread = NULL; | 199 base::Thread* g_cache_thread = NULL; |
196 | 200 |
197 struct FileOverHTTPParams { | 201 struct FileOverHTTPParams { |
198 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) | 202 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) |
199 : file_path_template(in_file_path_template), | 203 : file_path_template(in_file_path_template), |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1134 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
1131 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1135 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
1132 http_prefix); | 1136 http_prefix); |
1133 } | 1137 } |
1134 | 1138 |
1135 // static | 1139 // static |
1136 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1140 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
1137 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1141 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
1138 return new ResourceLoaderBridgeImpl(request_info); | 1142 return new ResourceLoaderBridgeImpl(request_info); |
1139 } | 1143 } |
OLD | NEW |