Skip to content

Commit

Permalink
Convert headless to use the URLResponseHead mojom types.
Browse files Browse the repository at this point in the history
Bug: 984550
Change-Id: I07244066da4394b74830765f6219b630f66b2cf1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1876977
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709043}
  • Loading branch information
lucasgadani authored and Commit Bot committed Oct 24, 2019
1 parent 474b8ca commit efe8380
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions headless/test/test_network_interceptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "net/url_request/redirect_util.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"

namespace headless {

Expand Down Expand Up @@ -57,15 +57,15 @@ class RedirectLoader : public network::mojom::URLLoader {
response_->headers->response_code(), url_.Resolve(location),
net::RedirectUtil::GetReferrerPolicyHeader(response_->headers.get()),
false /* insecure_scheme_was_upgraded */, true);
network::ResourceResponseHead head;
head.request_time = base::Time::Now();
head.response_time = base::Time::Now();
head.content_length = 0;
head.encoded_data_length = 0;
head.headers = response_->headers;
auto head = network::mojom::URLResponseHead::New();
head->request_time = base::Time::Now();
head->response_time = base::Time::Now();
head->content_length = 0;
head->encoded_data_length = 0;
head->headers = response_->headers;
url_ = redirect_info.new_url;
method_ = redirect_info.new_method;
client_->OnReceiveRedirect(redirect_info, head);
client_->OnReceiveRedirect(redirect_info, std::move(head));
}

TestNetworkInterceptor::Impl* const interceptor_impl_;
Expand Down

0 comments on commit efe8380

Please sign in to comment.