Commit d983bd12 authored by mkwst@chromium.org's avatar mkwst@chromium.org

Remove 'WebURLRequest::TargetType' from 'content::RenderFrameImpl'.

'WebURLRequest::TargetType' has been dropped in Blink in favor of
'RequestContext' and 'FrameType', matching the Fetch specification's
changes, and allowing both more granularity in various Blink-side checks
and more clarity around the thing that caused a request, and the frame
that the request affects.

This CL should have zero practical effect, as it's simply hoisting the
translation work that 'WebURLRequest::setTargetType' is already doing
up into the content layer to bring us one step closer to removing the
concept entirely.

There's still one call to 'ResourceType::FromTargetType' in
RenderFrameImpl that this CL doesn't remove: that method will be
converted to RequestContext in a future CL.

BUG=390497

Review URL: https://codereview.chromium.org/403323003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284520 0039d316-1c4b-4281-b951-d872f2087c98
parent d3f74e4e
...@@ -2361,7 +2361,7 @@ void RenderFrameImpl::willSendRequest( ...@@ -2361,7 +2361,7 @@ void RenderFrameImpl::willSendRequest(
// Set the first party for cookies url if it has not been set yet (new // Set the first party for cookies url if it has not been set yet (new
// requests). For redirects, it is updated by WebURLLoaderImpl. // requests). For redirects, it is updated by WebURLLoaderImpl.
if (request.firstPartyForCookies().isEmpty()) { if (request.firstPartyForCookies().isEmpty()) {
if (request.targetType() == blink::WebURLRequest::TargetIsMainFrame) { if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel) {
request.setFirstPartyForCookies(request.url()); request.setFirstPartyForCookies(request.url());
} else { } else {
request.setFirstPartyForCookies( request.setFirstPartyForCookies(
...@@ -2422,8 +2422,8 @@ void RenderFrameImpl::willSendRequest( ...@@ -2422,8 +2422,8 @@ void RenderFrameImpl::willSendRequest(
// Add the default accept header for frame request if it has not been set // Add the default accept header for frame request if it has not been set
// already. // already.
if ((request.targetType() == blink::WebURLRequest::TargetIsMainFrame || if ((request.frameType() == blink::WebURLRequest::FrameTypeTopLevel ||
request.targetType() == blink::WebURLRequest::TargetIsSubframe) && request.frameType() == blink::WebURLRequest::FrameTypeNested) &&
request.httpHeaderField(WebString::fromUTF8(kAcceptHeader)).isEmpty()) { request.httpHeaderField(WebString::fromUTF8(kAcceptHeader)).isEmpty()) {
request.setHTTPHeaderField(WebString::fromUTF8(kAcceptHeader), request.setHTTPHeaderField(WebString::fromUTF8(kAcceptHeader),
WebString::fromUTF8(kDefaultAcceptHeader)); WebString::fromUTF8(kDefaultAcceptHeader));
...@@ -2450,8 +2450,8 @@ void RenderFrameImpl::willSendRequest( ...@@ -2450,8 +2450,8 @@ void RenderFrameImpl::willSendRequest(
} }
int provider_id = kInvalidServiceWorkerProviderId; int provider_id = kInvalidServiceWorkerProviderId;
if (request.targetType() == blink::WebURLRequest::TargetIsMainFrame || if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel ||
request.targetType() == blink::WebURLRequest::TargetIsSubframe) { request.frameType() == blink::WebURLRequest::FrameTypeNested) {
// |provisionalDataSource| may be null in some content::ResourceFetcher // |provisionalDataSource| may be null in some content::ResourceFetcher
// use cases, we don't hook those requests. // use cases, we don't hook those requests.
if (frame->provisionalDataSource()) { if (frame->provisionalDataSource()) {
...@@ -2494,7 +2494,7 @@ void RenderFrameImpl::willSendRequest( ...@@ -2494,7 +2494,7 @@ void RenderFrameImpl::willSendRequest(
if (top_document_state) { if (top_document_state) {
// TODO(gavinp): separate out prefetching and prerender field trials // TODO(gavinp): separate out prefetching and prerender field trials
// if the rel=prerender rel type is sticking around. // if the rel=prerender rel type is sticking around.
if (request.targetType() == WebURLRequest::TargetIsPrefetch) if (request.requestContext() == WebURLRequest::RequestContextPrefetch)
top_document_state->set_was_prefetcher(true); top_document_state->set_was_prefetcher(true);
if (was_after_preconnect_request) if (was_after_preconnect_request)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment