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

@ -402,7 +402,7 @@ namespace System.Runtime
return asyncResult;
}
// can be utilized by subclasses to write core completion code for both the [....] and async paths
// can be utilized by subclasses to write core completion code for both the sync and async paths
// in one location, signalling chainable synchronous completion with the boolean result,
// and leveraging PrepareAsyncCompletion for conversion to an AsyncCallback.
// NOTE: requires that "this" is passed in as the state object to the asynchronous sub-call being used with a completion routine.

View File

@ -484,7 +484,7 @@ namespace System.Runtime.Diagnostics
{
OnShutdownTracing();
}
#pragma warning suppress 56500 //[....]; Taken care of by FxCop
#pragma warning suppress 56500 //Microsoft; Taken care of by FxCop
catch (Exception exception)
{
if (Fx.IsFatal(exception))

View File

@ -15,6 +15,7 @@ namespace System.Runtime.Diagnostics
using System.Xml.XPath;
using System.Diagnostics.CodeAnalysis;
using System.Security.Permissions;
using System.ServiceModel.Internals;
using System.Collections.Generic;
using System.Collections.Concurrent;
@ -29,6 +30,7 @@ namespace System.Runtime.Diagnostics
const string DiagnosticTraceSource = "System.ServiceModel.Diagnostics";
const int XmlBracketsLength = 5; // "<></>".Length;
const int XmlBracketsLengthForNullValue = 4; // "< />".Length; (Empty XML Element)
static readonly public Guid ImmutableDefaultEtwProviderId = new Guid("{c651f5f6-1c0d-492e-8ae1-b4efd7c9d503}");
[Fx.Tag.SecurityNote(Critical = "provider Id to create EtwProvider, which is SecurityCritical")]
@ -891,7 +893,19 @@ namespace System.Runtime.Diagnostics
static bool WriteXmlElementString(XmlTextWriter xml, string localName, string value, ref int remainingLength)
{
int xmlElementLength = (localName.Length * 2) + EtwDiagnosticTrace.XmlBracketsLength + value.Length;
int xmlElementLength;
// Quirk to fix DevDiv 155469: All previous versions of that platform (up-to 4.6.2) will get the old behavior (throw null ref when Exception Message property is null)
if (string.IsNullOrEmpty(value) && !LocalAppContextSwitches.IncludeNullExceptionMessageInETWTrace)
{
xmlElementLength = localName.Length + EtwDiagnosticTrace.XmlBracketsLengthForNullValue;
}
else
{
xmlElementLength = (localName.Length * 2) + EtwDiagnosticTrace.XmlBracketsLength + value.Length;
}
if (xmlElementLength <= remainingLength)
{
xml.WriteElementString(localName, value);

View File

@ -60,7 +60,7 @@ namespace System.Runtime
Fx.Assert(null != key, "");
// if anything goes wrong (duplicate entry, etc) we should
// clear our caches so that we don't get out of [....]
// clear our caches so that we don't get out of sync
bool success = false;
try
{

View File

@ -105,7 +105,7 @@ namespace System.Runtime
{
if (!thisPtr.RemoveWaiter(data.Waiter))
{
// The timeout ----d with Exit and exit won.
// The timeout raced with Exit and exit won.
// We've successfully entered.
exceptionToPropagate = null;
}
@ -160,7 +160,7 @@ namespace System.Runtime
if (timedOut && !RemoveWaiter(waiter))
{
// The timeout ----d with Exit and exit won.
// The timeout raced with Exit and exit won.
// We've successfully entered.
timedOut = false;

View File

@ -10,7 +10,7 @@ namespace System.Runtime
using System.Diagnostics;
/// <remarks>
/// [....] (11/15/10, CSDMain 194940) - Previously, this code first checked that the opcode was set to informational. If not, it would check
/// Microsoft (11/15/10, CSDMain 194940) - Previously, this code first checked that the opcode was set to informational. If not, it would check
/// the opcode name for start, stop, suspend, or resume and use that or return Information otherwise. This does not work well with the latest
/// ETW changes where almost every event has a task and opcode. With the old logic, if an opcode is set on the event with a level such as
/// warning or error, the level would be incorrectly reported in diagnostic tracing as informational. Also, start/stop/suspend/resume events