| 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 | |
| 974 private: | 970 private: |
| 975 // Ownership of params_ is transfered to the proxy when the proxy is created. | 971 // Ownership of params_ is transfered to the proxy when the proxy is created. |
| 976 scoped_ptr<RequestParams> params_; | 972 scoped_ptr<RequestParams> params_; |
| 977 | 973 |
| 978 // The request proxy is allocated when we start the request, and then it | 974 // The request proxy is allocated when we start the request, and then it |
| 979 // sticks around until this ResourceLoaderBridge is destroyed. | 975 // sticks around until this ResourceLoaderBridge is destroyed. |
| 980 RequestProxy* proxy_; | 976 RequestProxy* proxy_; |
| 981 }; | 977 }; |
| 982 | 978 |
| 983 //----------------------------------------------------------------------------- | 979 //----------------------------------------------------------------------------- |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 if (!g_file_over_http_mappings) | 1153 if (!g_file_over_http_mappings) |
| 1158 g_file_over_http_mappings = new FileOverHTTPPathMappings(); | 1154 g_file_over_http_mappings = new FileOverHTTPPathMappings(); |
| 1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); | 1155 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); |
| 1160 } | 1156 } |
| 1161 | 1157 |
| 1162 // static | 1158 // static |
| 1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1159 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1160 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1165 return new ResourceLoaderBridgeImpl(request_info); | 1161 return new ResourceLoaderBridgeImpl(request_info); |
| 1166 } | 1162 } |
| OLD | NEW |