Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/Foundation/NSUrlSessionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ protected override async Task<HttpResponseMessage> SendAsync (HttpRequestMessage
return await tcs.Task.ConfigureAwait (false);
}

// Needed since we strip during linking since we're inside a product assembly.
[Preserve (AllMembers = true)]
partial class NSUrlSessionHandlerDelegate : NSUrlSessionDataDelegate
{
readonly NSUrlSessionHandler sessionHandler;
Expand All @@ -487,6 +485,7 @@ InflightData GetInflightData (NSUrlSessionTask task)
return null;
}

[Preserve (Conditional = true)]
public override void DidReceiveResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlResponse response, Action<NSUrlSessionResponseDisposition> completionHandler)
{
var inflight = GetInflightData (dataTask);
Expand Down Expand Up @@ -549,6 +548,7 @@ public override void DidReceiveResponse (NSUrlSession session, NSUrlSessionDataT
completionHandler (NSUrlSessionResponseDisposition.Allow);
}

[Preserve (Conditional = true)]
public override void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask dataTask, NSData data)
{
var inflight = GetInflightData (dataTask);
Expand All @@ -560,6 +560,7 @@ public override void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask
SetResponse (inflight);
}

[Preserve (Conditional = true)]
public override void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, NSError error)
{
var inflight = GetInflightData (task);
Expand Down Expand Up @@ -608,16 +609,19 @@ void SetResponse (InflightData inflight)
}
}

[Preserve (Conditional = true)]
public override void WillCacheResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSCachedUrlResponse proposedResponse, Action<NSCachedUrlResponse> completionHandler)
{
completionHandler (sessionHandler.DisableCaching ? null : proposedResponse);
}

[Preserve (Conditional = true)]
public override void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response, NSUrlRequest newRequest, Action<NSUrlRequest> completionHandler)
{
completionHandler (sessionHandler.AllowAutoRedirect ? newRequest : null);
}

[Preserve (Conditional = true)]
public override void DidReceiveChallenge (NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action<NSUrlSessionAuthChallengeDisposition, NSUrlCredential> completionHandler)
{
var inflight = GetInflightData (task);
Expand Down Expand Up @@ -705,8 +709,6 @@ static bool TryGetAuthenticationType (NSUrlProtectionSpace protectionSpace, out
}
}

// Needed since we strip during linking since we're inside a product assembly.
[Preserve (AllMembers = true)]
class InflightData : IDisposable
{
public readonly object Lock = new object ();
Expand Down Expand Up @@ -745,8 +747,6 @@ protected virtual void Dispose (bool disposing)

}

// Needed since we strip during linking since we're inside a product assembly.
[Preserve (AllMembers = true)]
class NSUrlSessionDataTaskStreamContent : MonoStreamContent
{
Action disposed;
Expand Down Expand Up @@ -857,8 +857,6 @@ protected internal override bool TryComputeLength (out long length)
}
}

// Needed since we strip during linking since we're inside a product assembly.
[Preserve (AllMembers = true)]
class NSUrlSessionDataTaskStream : Stream
{
readonly Queue<NSData> data;
Expand Down Expand Up @@ -1004,8 +1002,6 @@ public override void Write (byte [] buffer, int offset, int count)
}
}

// Needed since we strip during linking since we're inside a product assembly.
[Preserve (AllMembers = true)]
class WrappedNSInputStream : NSInputStream
{
NSStreamStatus status;
Expand Down
1 change: 0 additions & 1 deletion src/ObjCRuntime/RuntimeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ internal static RuntimeOptions Read ()
}
}

[Preserve] // always present but re-written by the linker
internal static HttpMessageHandler GetHttpMessageHandler ()
{
var options = RuntimeOptions.Read ();
Expand Down
4 changes: 1 addition & 3 deletions tools/linker/MarkNSObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
//

using System;
using System.Collections.Generic;

using Mono.Cecil;
using Mono.Linker;
Expand Down Expand Up @@ -154,8 +153,7 @@ static bool IsProductMethod (MethodDefinition method)

static bool IsProductType (TypeDefinition type)
{
var name = type.Module.Assembly.Name.Name;
return name == ProductAssembly || name == "System.Net.Http";
return type.Module.Assembly.Name.Name == ProductAssembly;
}
}
}