[linker] Stop passing data to the CoreHttpMessageHandler step using a constructor.
This commit is contained in:
Родитель
03c6f8d1cc
Коммит
0dde91584c
|
@ -23,13 +23,10 @@ namespace Xamarin.Linker.Steps {
|
|||
|
||||
public class CoreHttpMessageHandler : ExceptionalSubStep {
|
||||
|
||||
public CoreHttpMessageHandler (LinkerOptions options)
|
||||
public CoreHttpMessageHandler ()
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
|
||||
public LinkerOptions Options { get; private set; }
|
||||
|
||||
public override SubStepTargets Targets {
|
||||
get { return SubStepTargets.Type; }
|
||||
}
|
||||
|
@ -39,11 +36,7 @@ namespace Xamarin.Linker.Steps {
|
|||
|
||||
Application App {
|
||||
get {
|
||||
#if MONOMAC
|
||||
return Driver.App;
|
||||
#else
|
||||
return Options.Application;
|
||||
#endif
|
||||
return LinkContext.App;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +65,7 @@ namespace Xamarin.Linker.Steps {
|
|||
MethodDefinition method = type.Methods.First (x => x.Name == "GetHttpMessageHandler" && !x.HasParameters);
|
||||
|
||||
AssemblyDefinition systemNetHTTPAssembly = context.GetAssemblies ().First (x => x.Name.Name == "System.Net.Http");
|
||||
TypeDefinition handler = RuntimeOptions.GetHttpMessageHandler (App, Options.RuntimeOptions, systemNetHTTPAssembly.MainModule, type.Module);
|
||||
TypeDefinition handler = RuntimeOptions.GetHttpMessageHandler (App, LinkContext.Target.LinkerOptions.RuntimeOptions, systemNetHTTPAssembly.MainModule, type.Module);
|
||||
MethodReference handler_ctor = handler.Methods.First (x => x.IsConstructor && !x.HasParameters && !x.IsStatic);
|
||||
|
||||
// HttpClientHandler is defined in System.Net.Http.dll so we need to import
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace MonoMac.Tuner {
|
|||
if (options.Application.Optimizations.CustomAttributesRemoval == true)
|
||||
sub.Add (new CoreRemoveAttributes ());
|
||||
|
||||
sub.Add (new CoreHttpMessageHandler (options));
|
||||
sub.Add (new CoreHttpMessageHandler ());
|
||||
sub.Add (new MarkNSObjects ());
|
||||
|
||||
// CoreRemoveSecurity can modify non-linked assemblies
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace MonoTouch.Tuner {
|
|||
sub.Add (new RemoveCode (options));
|
||||
sub.Add (new MarkNSObjects ());
|
||||
sub.Add (new PreserveSoapHttpClients ());
|
||||
sub.Add (new CoreHttpMessageHandler (options));
|
||||
sub.Add (new CoreHttpMessageHandler ());
|
||||
sub.Add (new InlinerSubStep ());
|
||||
sub.Add (new PreserveSmartEnumConversionsSubStep ());
|
||||
return sub;
|
||||
|
|
Загрузка…
Ссылка в новой задаче