| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 447 } |
| 448 | 448 |
| 449 // -------------------------------------------------------------------------- | 449 // -------------------------------------------------------------------------- |
| 450 // The following methods are called on the io thread. They correspond to | 450 // The following methods are called on the io thread. They correspond to |
| 451 // actions performed on the owner's thread. | 451 // actions performed on the owner's thread. |
| 452 | 452 |
| 453 void AsyncStart(RequestParams* params) { | 453 void AsyncStart(RequestParams* params) { |
| 454 request_.reset(g_request_context->CreateRequest(params->url, this)); | 454 request_.reset(g_request_context->CreateRequest(params->url, this)); |
| 455 request_->set_method(params->method); | 455 request_->set_method(params->method); |
| 456 request_->set_first_party_for_cookies(params->first_party_for_cookies); | 456 request_->set_first_party_for_cookies(params->first_party_for_cookies); |
| 457 request_->set_referrer(params->referrer.spec()); | 457 request_->SetReferrer(params->referrer.spec()); |
| 458 webkit_glue::ConfigureURLRequestForReferrerPolicy( | 458 webkit_glue::ConfigureURLRequestForReferrerPolicy( |
| 459 request_.get(), params->referrer_policy); | 459 request_.get(), params->referrer_policy); |
| 460 net::HttpRequestHeaders headers; | 460 net::HttpRequestHeaders headers; |
| 461 headers.AddHeadersFromString(params->headers); | 461 headers.AddHeadersFromString(params->headers); |
| 462 request_->SetExtraRequestHeaders(headers); | 462 request_->SetExtraRequestHeaders(headers); |
| 463 request_->set_load_flags(params->load_flags); | 463 request_->set_load_flags(params->load_flags); |
| 464 if (params->request_body) { | 464 if (params->request_body) { |
| 465 request_->set_upload(make_scoped_ptr( | 465 request_->set_upload(make_scoped_ptr( |
| 466 params->request_body->ResolveElementsAndCreateUploadDataStream( | 466 params->request_body->ResolveElementsAndCreateUploadDataStream( |
| 467 static_cast<TestShellRequestContext*>(g_request_context)-> | 467 static_cast<TestShellRequestContext*>(g_request_context)-> |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 if (!g_file_over_http_mappings) | 1157 if (!g_file_over_http_mappings) |
| 1158 g_file_over_http_mappings = new FileOverHTTPPathMappings(); | 1158 g_file_over_http_mappings = new FileOverHTTPPathMappings(); |
| 1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); | 1159 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 // static | 1162 // static |
| 1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1163 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
| 1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1164 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 1165 return new ResourceLoaderBridgeImpl(request_info); | 1165 return new ResourceLoaderBridgeImpl(request_info); |
| 1166 } | 1166 } |
| OLD | NEW |