| Index: webkit/glue/weburlloader_impl.cc
|
| diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
|
| index c5838f952acf5744e864bd96d2020b7c6c52b92f..e4f4a634d53d7081a05ccaf6cd05b1f37e406031 100644
|
| --- a/webkit/glue/weburlloader_impl.cc
|
| +++ b/webkit/glue/weburlloader_impl.cc
|
| @@ -268,6 +268,31 @@ void PopulateURLResponse(
|
| }
|
| }
|
|
|
| +net::RequestPriority ConvertWebKitPriorityToNetPriority(
|
| + const WebURLRequest::Priority& priority) {
|
| + switch (priority) {
|
| + case WebURLRequest::PriorityVeryHigh:
|
| + return net::HIGHEST;
|
| +
|
| + case WebURLRequest::PriorityHigh:
|
| + return net::MEDIUM;
|
| +
|
| + case WebURLRequest::PriorityMedium:
|
| + return net::LOW;
|
| +
|
| + case WebURLRequest::PriorityLow:
|
| + return net::LOWEST;
|
| +
|
| + case WebURLRequest::PriorityVeryLow:
|
| + return net::IDLE;
|
| +
|
| + case WebURLRequest::PriorityUnresolved:
|
| + default:
|
| + NOTREACHED();
|
| + return net::LOW;
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|
| // WebURLLoaderImpl::Context --------------------------------------------------
|
| @@ -285,6 +310,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
|
|
|
| void Cancel();
|
| void SetDefersLoading(bool value);
|
| + void DidChangePriority(WebURLRequest::Priority new_priority);
|
| void Start(
|
| const WebURLRequest& request,
|
| ResourceLoaderBridge::SyncLoadResponse* sync_load_response,
|
| @@ -354,6 +380,13 @@ void WebURLLoaderImpl::Context::SetDefersLoading(bool value) {
|
| bridge_->SetDefersLoading(value);
|
| }
|
|
|
| +void WebURLLoaderImpl::Context::DidChangePriority(
|
| + WebURLRequest::Priority new_priority) {
|
| + if (bridge_.get())
|
| + bridge_->DidChangePriority(
|
| + ConvertWebKitPriorityToNetPriority(new_priority));
|
| +}
|
| +
|
| void WebURLLoaderImpl::Context::Start(
|
| const WebURLRequest& request,
|
| ResourceLoaderBridge::SyncLoadResponse* sync_load_response,
|
| @@ -433,7 +466,8 @@ void WebURLLoaderImpl::Context::Start(
|
| request_info.requestor_pid = request.requestorProcessID();
|
| request_info.request_type =
|
| ResourceType::FromTargetType(request.targetType());
|
| - request_info.priority = request.priority();
|
| + request_info.priority =
|
| + ConvertWebKitPriorityToNetPriority(request.priority());
|
| request_info.appcache_host_id = request.appCacheHostID();
|
| request_info.routing_id = request.requestorID();
|
| request_info.download_to_file = request.downloadToFile();
|
| @@ -784,4 +818,8 @@ void WebURLLoaderImpl::setDefersLoading(bool value) {
|
| context_->SetDefersLoading(value);
|
| }
|
|
|
| +void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) {
|
| + context_->DidChangePriority(new_priority);
|
| +}
|
| +
|
| } // namespace webkit_glue
|
|
|