refactor: rewrite the net module to simplify state tracking (#21244)

This commit is contained in:
Jeremy Apthorp 2019-11-26 17:01:13 -08:00 committed by GitHub
parent 4149d76890
commit d25256dcf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1092 additions and 1033 deletions

View file

@ -5,7 +5,10 @@
#ifndef SHELL_COMMON_GIN_CONVERTERS_NET_CONVERTER_H_
#define SHELL_COMMON_GIN_CONVERTERS_NET_CONVERTER_H_
#include <string>
#include "gin/converter.h"
#include "services/network/public/mojom/fetch_api.mojom.h"
#include "shell/browser/net/cert_verifier_client.h"
namespace base {
@ -19,6 +22,7 @@ class URLRequest;
class X509Certificate;
class HttpResponseHeaders;
struct CertPrincipal;
class HttpVersion;
} // namespace net
namespace network {
@ -96,6 +100,18 @@ struct Converter<electron::VerifyRequestParams> {
electron::VerifyRequestParams val);
};
template <>
struct Converter<net::HttpVersion> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const net::HttpVersion& val);
};
template <>
struct Converter<net::RedirectInfo> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const net::RedirectInfo& val);
};
} // namespace gin
#endif // SHELL_COMMON_GIN_CONVERTERS_NET_CONVERTER_H_