| 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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 response->url = params_->url; | 960 response->url = params_->url; |
| 961 | 961 |
| 962 proxy_ = new SyncRequestProxy(response); | 962 proxy_ = new SyncRequestProxy(response); |
| 963 proxy_->AddRef(); | 963 proxy_->AddRef(); |
| 964 | 964 |
| 965 proxy_->Start(NULL, params_.release()); | 965 proxy_->Start(NULL, params_.release()); |
| 966 | 966 |
| 967 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); | 967 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); |
| 968 } | 968 } |
| 969 | 969 |
| 970 virtual void DidChangePriority(net::RequestPriority new_priority) { |
| 971 // Not really needed for DRT. |
| 972 } |
| 973 |
| 970 private: | 974 private: |
| 971 // Ownership of params_ is transfered to the proxy when the proxy is created. | 975 // Ownership of params_ is transfered to the proxy when the proxy is created. |
| 972 scoped_ptr<RequestParams> params_; | 976 scoped_ptr<RequestParams> params_; |
| 973 | 977 |
| 974 // The request proxy is allocated when we start the request, and then it | 978 // The request proxy is allocated when we start the request, and then it |
| 975 // sticks around until this ResourceLoaderBridge is destroyed. | 979 // sticks around until this ResourceLoaderBridge is destroyed. |
| 976 RequestProxy* proxy_; | 980 RequestProxy* proxy_; |
| 977 }; | 981 }; |
| 978 | 982 |
| 979 //----------------------------------------------------------------------------- | 983 //----------------------------------------------------------------------------- |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 if (!g_file_over_http_mappings) | 1157 if (!g_file_over_http_mappings) |
| 1154 g_file_over_http_mappings = new FileOverHTTPPathMappings(); | 1158 g_file_over_http_mappings = new FileOverHTTPPathMappings(); |
| 1155 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); | 1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); |
| 1156 } | 1160 } |
| 1157 | 1161 |
| 1158 // static | 1162 // static |
| 1159 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1160 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1161 return new ResourceLoaderBridgeImpl(request_info); | 1165 return new ResourceLoaderBridgeImpl(request_info); |
| 1162 } | 1166 } |
| OLD | NEW |