Commit 7c921a71 authored by Lucas Furukawa Gadani's avatar Lucas Furukawa Gadani Committed by Commit Bot

Convert fuchsia to use the URLResponseHead mojom types.

Bug: 984550
Change-Id: I5771e2c7294c29241ccda5a55f9ebb5f95117871
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1876976
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709057}
parent fa0ddb4c
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include "net/base/filename_util.h" #include "net/base/filename_util.h"
#include "net/base/mime_sniffer.h" #include "net/base/mime_sniffer.h"
#include "net/base/parse_number.h" #include "net/base/parse_number.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace { namespace {
...@@ -179,7 +179,7 @@ class ContentDirectoryURLLoader : public network::mojom::URLLoader { ...@@ -179,7 +179,7 @@ class ContentDirectoryURLLoader : public network::mojom::URLLoader {
} }
// Construct and deliver the HTTP response header. // Construct and deliver the HTTP response header.
network::ResourceResponseHead response; auto response = network::mojom::URLResponseHead::New();
// Read the charset and MIME type from the optional _metadata file. // Read the charset and MIME type from the optional _metadata file.
base::Optional<std::string> charset; base::Optional<std::string> charset;
...@@ -207,10 +207,10 @@ class ContentDirectoryURLLoader : public network::mojom::URLLoader { ...@@ -207,10 +207,10 @@ class ContentDirectoryURLLoader : public network::mojom::URLLoader {
reinterpret_cast<char*>(mmap_.data()), mmap_.length(), request.url, reinterpret_cast<char*>(mmap_.data()), mmap_.length(), request.url,
"", net::ForceSniffFileUrlsForHtml::kDisabled, &*mime_type); "", net::ForceSniffFileUrlsForHtml::kDisabled, &*mime_type);
} }
response.mime_type = *mime_type; response->mime_type = *mime_type;
response.headers = CreateHeaders(response.mime_type, charset); response->headers = CreateHeaders(*mime_type, charset);
response.content_length = mmap_.length(); response->content_length = mmap_.length();
client_->OnReceiveResponse(response); client_->OnReceiveResponse(std::move(response));
// Set up the Mojo DataPipe used for streaming the response payload to the // Set up the Mojo DataPipe used for streaming the response payload to the
// client. // client.
......
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