Imported Upstream version 5.4.0.167

Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-08-21 15:34:15 +00:00
parent e49d6f06c0
commit 536cd135cc
12856 changed files with 563812 additions and 223249 deletions

View File

@ -111,7 +111,7 @@ namespace System.ServiceModel.Dispatcher
this.filters.Add(filter, data);
List<MessageFilter> filters;
#pragma warning suppress 56506 // [....], Actions will never be null
#pragma warning suppress 56506 // Microsoft, Actions will never be null
if (filter.Actions.Count == 0)
{
this.always.Add(filter);
@ -426,7 +426,7 @@ namespace System.ServiceModel.Dispatcher
if (this.filters.Remove(filter))
{
#pragma warning suppress 56506 // [....], ActionMessageFilter.Actions can never be null
#pragma warning suppress 56506 // Microsoft, ActionMessageFilter.Actions can never be null
if (filter.Actions.Count == 0)
{
this.always.Remove(filter);
@ -436,9 +436,9 @@ namespace System.ServiceModel.Dispatcher
List<MessageFilter> filters;
for (int i = 0; i < filter.Actions.Count; ++i)
{
#pragma warning suppress 56506 // [....], PreSharp generates a false error here
#pragma warning suppress 56506 // Microsoft, PreSharp generates a false error here
filters = this.actions[filter.Actions[i]];
#pragma warning suppress 56506 // [....], filters can never be null
#pragma warning suppress 56506 // Microsoft, filters can never be null
if (filters.Count == 1)
{
this.actions.Remove(filter.Actions[i]);

View File

@ -30,7 +30,7 @@ namespace System.ServiceModel.Dispatcher
List<IDuplexRequest> requests;
List<ICorrelatorKey> timedOutRequests;
ChannelHandler channelHandler;
volatile bool requestAborted;
bool requestAborted;
internal DuplexChannelBinder(IDuplexChannel channel, IRequestReplyCorrelator correlator)
{
@ -207,25 +207,32 @@ namespace System.ServiceModel.Dispatcher
void AbortRequests()
{
IDuplexRequest[] array = null;
lock (this.ThisLock)
{
if (this.requests != null)
{
array = this.requests.ToArray();
foreach (IDuplexRequest request in array)
{
request.Abort();
}
this.requests = null;
}
this.requests = null;
this.requestAborted = true;
}
bool hadRequests = array != null && array.Length > 0;
if (hadRequests)
{
foreach (IDuplexRequest request in array)
{
request.Abort();
}
}
// Remove requests from the correlator since the channel might be either faulting or aborting,
// We are not going to get a reply for these requests. If they are not removed from the correlator, this will cause a leak.
// This operation does not have to be under the lock
if (array != null && array.Length > 0)
if (hadRequests)
{
RequestReplyCorrelator requestReplyCorrelator = this.correlator as RequestReplyCorrelator;
if (requestReplyCorrelator != null)
@ -537,7 +544,7 @@ namespace System.ServiceModel.Dispatcher
}
}
// ASSUMPTION: ([....]) caller holds lock (this.mutex)
// ASSUMPTION: (Microsoft) caller holds lock (this.mutex)
void RequestStarting(Message message, IDuplexRequest request)
{
if (request != null)
@ -552,7 +559,7 @@ namespace System.ServiceModel.Dispatcher
}
// ASSUMPTION: ([....]) caller holds lock (this.mutex)
// ASSUMPTION: (Microsoft) caller holds lock (this.mutex)
void RequestCompleting(IDuplexRequest request)
{
this.pending--;
@ -1473,7 +1480,7 @@ namespace System.ServiceModel.Dispatcher
public void EndClose(IAsyncResult result)
{
// don't need to lock here since BeginClose is the [....]-point
// don't need to lock here since BeginClose is the sync-point
if (this.closeState.TryUserClose())
{
this.innerChannel.EndClose(result);

View File

@ -92,7 +92,7 @@ namespace System.ServiceModel.Dispatcher
}
// To
#pragma warning suppress 56506 // [....], Message.Headers can never be null
#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null
Uri to = message.Headers.To;
Uri actingAs = this.address.Uri;

View File

@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher
this.candidates.Add(filter, can);
CandidateSet cset;
#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
if (filter.IncludeHostNameInComparison)
{
@ -181,7 +181,7 @@ namespace System.ServiceModel.Dispatcher
// Update the QName ref count
QName qname;
int cnt;
#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
for (int i = 0; i < address.Headers.Count; ++i)
{
AddressHeader parameter = address.Headers[i];
@ -719,7 +719,7 @@ namespace System.ServiceModel.Dispatcher
}
Candidate can = this.candidates[filter];
#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null
#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset = null;
@ -761,7 +761,7 @@ namespace System.ServiceModel.Dispatcher
{
// Adjust QName counts
QName qname;
#pragma warning suppress 56506 // [....], EndpointAddress.Headers can never be null
#pragma warning suppress 56506 // Microsoft, EndpointAddress.Headers can never be null
for (int i = 0; i < address.Headers.Count; ++i)
{
AddressHeader parameter = address.Headers[i];

View File

@ -1144,7 +1144,7 @@ namespace System.ServiceModel.Dispatcher
{
if (!rpc.Operation.IsSynchronous)
{
// If async call completes in [....], it tells us through the gate below
// If async call completes in sync, it tells us through the gate below
rpc.PrepareInvokeContinueGate();
}

View File

@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}

View File

@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("filter", SR.GetString(SR.FilterExists));
}
#pragma warning suppress 56506 // [....], PreSharp generates a false warning here
#pragma warning suppress 56506 // Microsoft, PreSharp generates a false warning here
Type filterType = filter.GetType();
Type tableType = null;
IMessageFilterTable<TFilterData> table = null;

View File

@ -41,7 +41,7 @@ namespace System.ServiceModel.Dispatcher
{
if (description.BeginMethod != null)
{
// both [....] and async methods are present on the contract, check the preference
// both sync and async methods are present on the contract, check the preference
OperationBehaviorAttribute operationBehaviorAttribue = description.Behaviors.Find<OperationBehaviorAttribute>();
if ((operationBehaviorAttribue != null) && operationBehaviorAttribue.PreferAsyncInvocation)
{
@ -54,7 +54,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
// only [....] method is present on the contract
// only sync method is present on the contract
dispatch.Invoker = new SyncMethodInvoker(description.SyncMethod);
}
}

View File

@ -43,7 +43,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}

View File

@ -85,7 +85,7 @@ namespace System.ServiceModel.Dispatcher
}
// To
#pragma warning suppress 56506 // [....], Message.Headers can never be null
#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null
Uri to = message.Headers.To;
object o;

View File

@ -59,7 +59,7 @@ namespace System.ServiceModel.Dispatcher
Candidate can = new Candidate(filter, data, mask, filter.HeaderLookup);
this.candidates.Add(filter, can);
#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null
#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset;
@ -134,7 +134,7 @@ namespace System.ServiceModel.Dispatcher
}
Candidate can = this.candidates[filter];
#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null
#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null
Uri soapToAddress = filter.Address.Uri;
CandidateSet cset = null;

View File

@ -46,7 +46,7 @@ namespace System.ServiceModel.Dispatcher
OperationFormatter.Validate(description, isRpc, false/*isEncoded*/);
this.operation = description;
#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null
#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null
this.requestMessage = description.Messages[0];
if (description.Messages.Count == 2)
this.responseMessage = description.Messages[1];
@ -290,7 +290,7 @@ namespace System.ServiceModel.Dispatcher
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description");
OperationDescription operation = description;
#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null
#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null
MessageDescription requestMessage = description.Messages[0];
MessageDescription responseMessage = null;
if (description.Messages.Count == 2)

View File

@ -55,7 +55,7 @@ namespace System.ServiceModel.Dispatcher
List<NodeSequenceIterator> iterList;
// REFACTOR, [....], make this a function on QueryValueModel
// REFACTOR, Microsoft, make this a function on QueryValueModel
internal XsltFunctionCallOpcode(XsltContext context, IXsltContextFunction function, int argCount)
: base(OpcodeID.XsltFunction)
{
@ -138,7 +138,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
// PERF, [....], see if we can cache these arrays to avoid allocations
// PERF, Microsoft, see if we can cache these arrays to avoid allocations
object[] xsltArgs = new object[this.argCount];
int iterationCount = context.TopArg.Count;
for (int iteration = 0; iteration < iterationCount; ++iteration)
@ -1210,7 +1210,7 @@ namespace System.ServiceModel.Dispatcher
StackFrame argKeys = context.SecondArg;
StackFrame argValues = context[2];
// PERF, [....], this is really slow.
// PERF, Microsoft, this is really slow.
StringBuilder builder = new StringBuilder();
while (argSource.basePtr <= argSource.endPtr)
{

View File

@ -140,7 +140,7 @@ namespace System.ServiceModel.Dispatcher
NodesetLast = 0x01,
}
// PERF, [....], Remove when generic sort works
// PERF, Microsoft, Remove when generic sort works
// Used to sort in document order
#if NO
internal class NodeSequenceItemObjectComparer : IComparer
@ -908,7 +908,7 @@ namespace System.ServiceModel.Dispatcher
{
this.Merge(false);
// PERF, [....], make this work
// PERF, Microsoft, make this work
//Array.Sort<NodeSequenceItem>(this.items, 0, this.count, NodeSequence.Comparer);
Array.Sort(this.items, 0, this.count, NodeSequence.ObjectComparer);
@ -974,7 +974,7 @@ namespace System.ServiceModel.Dispatcher
return seq;
/*
// PERF, [....], I think we can do the merge ourselves and avoid the sort.
// PERF, Microsoft, I think we can do the merge ourselves and avoid the sort.
// Need to verify that the sequences are always in document order.
for(int i = 0; i < this.count; ++i)
{
@ -1055,13 +1055,13 @@ namespace System.ServiceModel.Dispatcher
{
if (this.index == 0)
{
#pragma warning suppress 56503 // [....], postponing the public change
#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryProcessingException(QueryProcessingError.Unexpected, SR.GetString(SR.QueryContextNotSupportedInSequences)));
}
if (this.index > this.data.seq.Count)
{
#pragma warning suppress 56503 // [....], postponing the public change
#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes)));
}
//
@ -1156,13 +1156,13 @@ namespace System.ServiceModel.Dispatcher
{
if (this.iter.CurrentPosition == 0)
{
#pragma warning suppress 56503 // [....], postponing the public change
#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryBeforeNodes)));
}
if (this.iter.CurrentPosition > this.iter.Count)
{
#pragma warning suppress 56503 // [....], postponing the public change
#pragma warning suppress 56503 // Microsoft, postponing the public change
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes)));
}

View File

@ -457,7 +457,7 @@ namespace System.ServiceModel.Dispatcher
this.matcher = matcher;
this.flags = QueryProcessingFlags.Match;
// PERF, [....], see if we can just let these to their default init
// PERF, Microsoft, see if we can just let these to their default init
this.messageAction = null;
//this.messageAddress = null;
//this.messageVia = null;
@ -510,7 +510,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
#pragma warning suppress 56503 // [....], property is more readable for this
#pragma warning suppress 56503 // Microsoft, property is more readable for this
throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new QueryProcessingException(QueryProcessingError.Unexpected));
}
this.counter = this.contextNode as INodeCounter;

View File

@ -44,7 +44,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
// PERF, [....], weaken guard?
// PERF, Microsoft, weaken guard?
return QueryAxisType.Self == this.axis.Type || QueryAxisType.Child == this.axis.Type;
//return ((QueryAxisType.Self == this.axis.Type) || ((this.axis.Type != QueryAxisType.DescendantOrSelf || this.axis.Type != QueryAxisType.Descendant)&& 0 != ((QueryNodeType.Element | QueryNodeType.Root) & this.type)));
}

View File

@ -278,8 +278,8 @@ namespace System.ServiceModel.Dispatcher
internal class SubExprHeader : SubExpr
{
// WS, [....], Can probably combine these
// WS, [....], Make this data structure less ugly (if possible)
// WS, Microsoft, Can probably combine these
// WS, Microsoft, Make this data structure less ugly (if possible)
Dictionary<string, Dictionary<string, List<SubExpr>>> nameLookup;
Dictionary<SubExpr, MyInt> indexLookup;
@ -329,7 +329,7 @@ namespace System.ServiceModel.Dispatcher
context.SaveVariable(this.var, context.Processor.ElapsedCount(marker));
}
// WS, [....], see if we can put this array in the processor to save
// WS, Microsoft, see if we can put this array in the processor to save
// an allocation. Perhaps we can use the variables slot we're going to fill
NodeSequence[] childSequences = new NodeSequence[this.children.Count];
NodeSequence seq = context.Sequences[context.TopSequenceArg.basePtr].Sequence;

View File

@ -657,7 +657,7 @@ namespace System.ServiceModel.Dispatcher
}
else
{
// PERF, [....], can this be made more efficient? Does it need to be?
// PERF, Microsoft, can this be made more efficient? Does it need to be?
Remove(old);
Insert(replace);
}
@ -704,7 +704,7 @@ namespace System.ServiceModel.Dispatcher
}
else if (this.buffer.Length == this.size)
{
// PERF, [....], how should we choose a new size?
// PERF, Microsoft, how should we choose a new size?
T[] tmp = new T[this.size + 1];
if (index == 0)

View File

@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher
{
get
{
#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
}
}

View File

@ -235,7 +235,7 @@ namespace System.ServiceModel.Dispatcher
if (sbe is SymmetricSecurityBindingElement || sbe is AsymmetricSecurityBindingElement)
{
// check to see if we are streaming
// ([....] 53690): need to have a general way get the transfer Mode from the binding
// (Microsoft 53690): need to have a general way get the transfer Mode from the binding
// TransferMode transferMode = binding.GetProperty<TransferMode>(new BindingParameterCollection());
if (GetTransferMode(binding) != TransferMode.Buffered)
{

Some files were not shown because too many files have changed in this diff Show More