Index: content/browser/loader/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
index ecd4237016bc0db3c48ee77a2f1c9a0490a35a2d..d0cbe2c587e3ef5cc4dfb31f2f38922d025c8f22 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -473,7 +473,7 @@ net::Error ResourceDispatcherHostImpl::BeginDownload( |
} else { |
extra_load_flags |= net::LOAD_DISABLE_CACHE; |
} |
- request->set_load_flags(request->load_flags() | extra_load_flags); |
+ request->SetLoadFlags(request->load_flags() | extra_load_flags); |
// No need to get offline load flags for downloads, but make sure |
// we have an OfflinePolicy to receive request completions. |
@@ -1027,6 +1027,15 @@ void ResourceDispatcherHostImpl::BeginRequest( |
load_flags |= offline_policy_map_[id]->GetAdditionalLoadFlags( |
load_flags, request_data.resource_type == ResourceType::MAIN_FRAME); |
+ // Sync loads should have maximum priority and should be the only |
+ // requets that have the ignore limits flag set. |
+ if (is_sync_load) { |
+ DCHECK_EQ(request_data.priority, net::MAXIMUM_PRIORITY); |
+ DCHECK_NE(load_flags & net::LOAD_IGNORE_LIMITS, 0); |
+ } else { |
+ DCHECK_EQ(load_flags & net::LOAD_IGNORE_LIMITS, 0); |
+ } |
+ |
// Construct the request. |
scoped_ptr<net::URLRequest> new_request; |
net::URLRequest* request; |
@@ -1042,7 +1051,7 @@ void ResourceDispatcherHostImpl::BeginRequest( |
headers.AddHeadersFromString(request_data.headers); |
request->SetExtraRequestHeaders(headers); |
- request->set_load_flags(load_flags); |
+ request->SetLoadFlags(load_flags); |
// Resolve elements from request_body and prepare upload data. |
if (request_data.request_body.get()) { |
@@ -1285,7 +1294,7 @@ void ResourceDispatcherHostImpl::BeginSaveFile( |
// So far, for saving page, we need fetch content from cache, in the |
// future, maybe we can use a configuration to configure this behavior. |
- request->set_load_flags(net::LOAD_PREFERRING_CACHE); |
+ request->SetLoadFlags(net::LOAD_PREFERRING_CACHE); |
// No need to get offline load flags for save files, but make sure |
// we have an OfflinePolicy to receive request completions. |
@@ -1572,7 +1581,7 @@ void ResourceDispatcherHostImpl::BeginRequestInternal( |
if ((TimeTicks::Now() - last_user_gesture_time_) < |
TimeDelta::FromMilliseconds(kUserGestureWindowMs)) { |
- request->set_load_flags( |
+ request->SetLoadFlags( |
request->load_flags() | net::LOAD_MAYBE_USER_GESTURE); |
} |