Commit 33ccb807 authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Remove dead code after r527760.

Bug: 769401
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I5d6f976b69e0c5191ec275a0f8eb7c4d0f6bc34a
Reviewed-on: https://chromium-review.googlesource.com/896554Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537164}
parent 31256664
......@@ -1324,17 +1324,13 @@ ResourceDispatcherHostImpl::CreateResourceHandler(
new RedirectToFileResourceHandler(std::move(handler), request));
}
bool start_detached = request_data.download_to_network_cache_only;
// Prefetches and <a ping> requests outlive their child process.
if (start_detached || request_data.resource_type == RESOURCE_TYPE_PREFETCH ||
if (request_data.resource_type == RESOURCE_TYPE_PREFETCH ||
request_data.keepalive) {
auto detachable_handler = std::make_unique<DetachableResourceHandler>(
request,
base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs),
std::move(handler));
if (start_detached)
detachable_handler->Detach();
handler = std::move(detachable_handler);
}
......
......@@ -1022,51 +1022,6 @@ TEST_F(ResourceDispatcherHostTest, Cancel) {
EXPECT_EQ(0, network_delegate()->error_count());
}
TEST_F(ResourceDispatcherHostTest, DownloadToNetworkCache) {
network::mojom::URLLoaderPtr loader1, loader2;
network::TestURLLoaderClient client1, client2;
// Normal request.
MakeTestRequest(0, 1, net::URLRequestTestJob::test_url_2(),
mojo::MakeRequest(&loader1), client1.CreateInterfacePtr());
// Cache-only request.
network::ResourceRequest request_to_cache = CreateResourceRequest(
"GET", RESOURCE_TYPE_IMAGE, net::URLRequestTestJob::test_url_3());
request_to_cache.download_to_network_cache_only = true;
filter_->CreateLoaderAndStart(
mojo::MakeRequest(&loader2), 0, 2, network::mojom::kURLLoadOptionNone,
request_to_cache, client2.CreateInterfacePtr(),
net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS));
content::RunAllTasksUntilIdle();
// The handler for the cache-only request should have been detached now.
GlobalRequestID global_request_id(filter_->child_id(), 2);
ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(
host_.GetURLRequest(global_request_id));
ASSERT_TRUE(info->detachable_handler()->is_detached());
// Flush all the pending requests.
while (net::URLRequestTestJob::ProcessOnePendingMessage()) {
}
content::RunAllTasksUntilIdle();
// Everything should be out now.
EXPECT_EQ(0, host_.pending_requests());
// The normal request succeeded.
CheckSuccessfulRequest(&client1, net::URLRequestTestJob::test_data_2());
// The cache-only request got canceled, as far as the renderer is concerned.
client2.RunUntilComplete();
EXPECT_EQ(net::ERR_ABORTED, client2.completion_status().error_code);
// However, all requests should have actually gone to completion.
EXPECT_EQ(2, network_delegate()->completed_requests());
EXPECT_EQ(0, network_delegate()->canceled_requests());
EXPECT_EQ(0, network_delegate()->error_count());
}
// Shows that detachable requests will timeout if the request takes too long to
// complete.
TEST_F(ResourceDispatcherHostTest, DetachedResourceTimesOut) {
......
......@@ -44,13 +44,6 @@ void RequestExtraData::CopyToResourceRequest(
request->originated_from_service_worker = originated_from_service_worker_;
request->initiated_in_secure_context = initiated_in_secure_context_;
/*
TODO(jam): if have agreement that alternate solution of having a dummy sink
in the renderer so that notifications are still received, then undo
the cl https://codereview.chromium.org/2262183002.
request->download_to_network_cache_only = download_to_network_cache_only_;
*/
}
} // namespace content
......@@ -110,7 +110,7 @@ class CONTENT_EXPORT RequestExtraData : public blink::WebURLRequest::ExtraData {
}
// The request is downloaded to the network cache, but not rendered or
// executed. The renderer will see this as an aborted request.
// executed.
bool download_to_network_cache_only() const {
return download_to_network_cache_only_;
}
......
......@@ -327,7 +327,6 @@ IPC_STRUCT_TRAITS_BEGIN(network::ResourceRequest)
IPC_STRUCT_TRAITS_MEMBER(previews_state)
IPC_STRUCT_TRAITS_MEMBER(resource_body_stream_url)
IPC_STRUCT_TRAITS_MEMBER(initiated_in_secure_context)
IPC_STRUCT_TRAITS_MEMBER(download_to_network_cache_only)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(network::ResourceResponseInfo)
......
......@@ -215,10 +215,6 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
// Wether or not the initiator of this request is a secure context.
bool initiated_in_secure_context = false;
// The response should be downloaded and stored in the network cache, but not
// sent back to the renderer.
bool download_to_network_cache_only = false;
};
} // namespace network
......
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