Commit 1b3bcb74 authored by Randy Smith's avatar Randy Smith Committed by Commit Bot

Move serialization code for net::RedirectInfo to //services/network.

Bug: 753658
Change-Id: I68a98c15c64428d3faed7730d1837f9bbe3ac274
Reviewed-on: https://chromium-review.googlesource.com/844025Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Randy Smith <rdsmith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527002}
parent c1989a59
......@@ -25,7 +25,6 @@
#include "net/base/request_priority.h"
#include "net/http/http_response_info.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/network_param_ipc_traits.h"
#include "services/network/public/interfaces/fetch_api.mojom.h"
#include "third_party/WebKit/public/platform/WebMixedContentContextType.h"
......@@ -150,19 +149,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseInfo)
IPC_STRUCT_TRAITS_MEMBER(cors_exposed_header_names)
IPC_STRUCT_TRAITS_END()
IPC_ENUM_TRAITS_MAX_VALUE(net::URLRequest::ReferrerPolicy,
net::URLRequest::MAX_REFERRER_POLICY - 1)
IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo)
IPC_STRUCT_TRAITS_MEMBER(status_code)
IPC_STRUCT_TRAITS_MEMBER(new_method)
IPC_STRUCT_TRAITS_MEMBER(new_url)
IPC_STRUCT_TRAITS_MEMBER(new_site_for_cookies)
IPC_STRUCT_TRAITS_MEMBER(new_referrer)
IPC_STRUCT_TRAITS_MEMBER(new_referrer_policy)
IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(net::MutableNetworkTrafficAnnotationTag)
IPC_STRUCT_TRAITS_MEMBER(unique_id_hash_code)
IPC_STRUCT_TRAITS_END()
......
......@@ -4,9 +4,8 @@
mojom = "//content/public/common/url_loader.mojom"
public_headers = [ "//net/url_request/redirect_info.h" ]
traits_headers = [ "//content/common/resource_messages.h" ]
traits_headers = [ "//services/network/public/cpp/network_param_ipc_traits.h" ]
deps = [
"//content:export",
"//net:net",
]
type_mappings = [ "content.mojom.URLRequestRedirectInfo=net::RedirectInfo" ]
......@@ -24,6 +24,7 @@ static_library("cpp") {
public_deps = [
"//services/network/public/interfaces",
"//url/ipc:url_ipc",
]
deps = [
......
......@@ -16,8 +16,10 @@
#include "net/cert/signed_certificate_timestamp_and_status.h"
#include "net/http/http_request_headers.h"
#include "net/ssl/ssl_info.h"
#include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/cors_error_status.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "url/ipc/url_param_traits.h"
#ifndef INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_
#define INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_
......@@ -25,7 +27,8 @@
// services/network/public/cpp is currently packaged as a static library,
// so there's no need for export defines; it's linked directly into whatever
// other components need it.
// This redefinition is present for the IPC macros below.
// This redefinition is present for the IPC macros below, including in the
// included header files.
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT
......@@ -154,4 +157,17 @@ IPC_STRUCT_TRAITS_BEGIN(network::URLLoaderCompletionStatus)
IPC_STRUCT_TRAITS_MEMBER(blocked_cross_site_document)
IPC_STRUCT_TRAITS_END()
IPC_ENUM_TRAITS_MAX_VALUE(net::URLRequest::ReferrerPolicy,
net::URLRequest::MAX_REFERRER_POLICY - 1)
IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo)
IPC_STRUCT_TRAITS_MEMBER(status_code)
IPC_STRUCT_TRAITS_MEMBER(new_method)
IPC_STRUCT_TRAITS_MEMBER(new_url)
IPC_STRUCT_TRAITS_MEMBER(new_site_for_cookies)
IPC_STRUCT_TRAITS_MEMBER(new_referrer)
IPC_STRUCT_TRAITS_MEMBER(new_referrer_policy)
IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host)
IPC_STRUCT_TRAITS_END()
#endif // SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_
......@@ -22,17 +22,20 @@ component("url_ipc") {
]
}
test("url_ipc_unittests") {
sources = [
"url_param_traits_unittest.cc",
]
# IPC unit tests aren't build on iOS.
if (!is_ios) {
test("url_ipc_unittests") {
sources = [
"url_param_traits_unittest.cc",
]
deps = [
":url_ipc",
"//base",
"//base/test:run_all_unittests",
"//ipc:test_support",
"//testing/gtest",
"//url:url",
]
deps = [
":url_ipc",
"//base",
"//base/test:run_all_unittests",
"//ipc:test_support",
"//testing/gtest",
"//url:url",
]
}
}
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