| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 virtual bool OnCanAccessFile(const net::URLRequest& request, | 176 virtual bool OnCanAccessFile(const net::URLRequest& request, |
| 177 const FilePath& path) const OVERRIDE { | 177 const FilePath& path) const OVERRIDE { |
| 178 return true; | 178 return true; |
| 179 } | 179 } |
| 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( |
| 186 net::SocketStream* stream, |
| 187 const net::CompletionCallback& callback) OVERRIDE { |
| 188 return net::OK; |
| 189 } |
| 185 }; | 190 }; |
| 186 | 191 |
| 187 TestShellRequestContextParams* g_request_context_params = NULL; | 192 TestShellRequestContextParams* g_request_context_params = NULL; |
| 188 TestShellRequestContext* g_request_context = NULL; | 193 TestShellRequestContext* g_request_context = NULL; |
| 189 TestShellNetworkDelegate* g_network_delegate = NULL; | 194 TestShellNetworkDelegate* g_network_delegate = NULL; |
| 190 base::Thread* g_cache_thread = NULL; | 195 base::Thread* g_cache_thread = NULL; |
| 191 | 196 |
| 192 struct FileOverHTTPParams { | 197 struct FileOverHTTPParams { |
| 193 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) | 198 FileOverHTTPParams(std::string in_file_path_template, GURL in_http_prefix) |
| 194 : file_path_template(in_file_path_template), | 199 : file_path_template(in_file_path_template), |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1133 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
| 1129 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1134 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
| 1130 http_prefix); | 1135 http_prefix); |
| 1131 } | 1136 } |
| 1132 | 1137 |
| 1133 // static | 1138 // static |
| 1134 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1139 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1135 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1140 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1136 return new ResourceLoaderBridgeImpl(request_info); | 1141 return new ResourceLoaderBridgeImpl(request_info); |
| 1137 } | 1142 } |
| OLD | NEW |