| 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 response->url = params_->url; | 932 response->url = params_->url; |
| 933 | 933 |
| 934 proxy_ = new SyncRequestProxy(response); | 934 proxy_ = new SyncRequestProxy(response); |
| 935 proxy_->AddRef(); | 935 proxy_->AddRef(); |
| 936 | 936 |
| 937 proxy_->Start(NULL, params_.release()); | 937 proxy_->Start(NULL, params_.release()); |
| 938 | 938 |
| 939 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); | 939 static_cast<SyncRequestProxy*>(proxy_)->WaitForCompletion(); |
| 940 } | 940 } |
| 941 | 941 |
| 942 virtual void UpdateRoutingId(int new_routing_id) { } | |
| 943 | |
| 944 private: | 942 private: |
| 945 // Ownership of params_ is transfered to the proxy when the proxy is created. | 943 // Ownership of params_ is transfered to the proxy when the proxy is created. |
| 946 scoped_ptr<RequestParams> params_; | 944 scoped_ptr<RequestParams> params_; |
| 947 | 945 |
| 948 // The request proxy is allocated when we start the request, and then it | 946 // The request proxy is allocated when we start the request, and then it |
| 949 // sticks around until this ResourceLoaderBridge is destroyed. | 947 // sticks around until this ResourceLoaderBridge is destroyed. |
| 950 RequestProxy* proxy_; | 948 RequestProxy* proxy_; |
| 951 }; | 949 }; |
| 952 | 950 |
| 953 //----------------------------------------------------------------------------- | 951 //----------------------------------------------------------------------------- |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); | 1126 (http_prefix.SchemeIs("http") || http_prefix.SchemeIs("https"))); |
| 1129 g_file_over_http_params = new FileOverHTTPParams(file_path_template, | 1127 g_file_over_http_params = new FileOverHTTPParams(file_path_template, |
| 1130 http_prefix); | 1128 http_prefix); |
| 1131 } | 1129 } |
| 1132 | 1130 |
| 1133 // static | 1131 // static |
| 1134 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1132 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1135 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1133 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1136 return new ResourceLoaderBridgeImpl(request_info); | 1134 return new ResourceLoaderBridgeImpl(request_info); |
| 1137 } | 1135 } |
| OLD | NEW |