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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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)-> |
468 blob_storage_controller()))); | 468 blob_storage_controller(), |
| 469 base::MessageLoopProxy::current()))); |
469 } | 470 } |
470 SimpleAppCacheSystem::SetExtraRequestInfo( | 471 SimpleAppCacheSystem::SetExtraRequestInfo( |
471 request_.get(), params->appcache_host_id, params->request_type); | 472 request_.get(), params->appcache_host_id, params->request_type); |
472 | 473 |
473 download_to_file_ = params->download_to_file; | 474 download_to_file_ = params->download_to_file; |
474 if (download_to_file_) { | 475 if (download_to_file_) { |
475 FilePath path; | 476 FilePath path; |
476 if (file_util::CreateTemporaryFile(&path)) { | 477 if (file_util::CreateTemporaryFile(&path)) { |
477 downloaded_file_ = ShareableFileReference::GetOrCreate( | 478 downloaded_file_ = ShareableFileReference::GetOrCreate( |
478 path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, | 479 path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 if (!g_file_over_http_mappings) | 1151 if (!g_file_over_http_mappings) |
1151 g_file_over_http_mappings = new FileOverHTTPPathMappings(); | 1152 g_file_over_http_mappings = new FileOverHTTPPathMappings(); |
1152 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); | 1153 g_file_over_http_mappings->AddMapping(file_path_template, http_prefix); |
1153 } | 1154 } |
1154 | 1155 |
1155 // static | 1156 // static |
1156 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( | 1157 webkit_glue::ResourceLoaderBridge* SimpleResourceLoaderBridge::Create( |
1157 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 1158 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
1158 return new ResourceLoaderBridgeImpl(request_info); | 1159 return new ResourceLoaderBridgeImpl(request_info); |
1159 } | 1160 } |
OLD | NEW |