diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
commit | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch) | |
tree | e5435159cd1bf0519276363a6fe1663d1721bed3 /src/mscorlib/src/System/DelegateSerializationHolder.cs | |
parent | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff) | |
download | coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2 coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip |
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/mscorlib/src/System/DelegateSerializationHolder.cs')
-rw-r--r-- | src/mscorlib/src/System/DelegateSerializationHolder.cs | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/mscorlib/src/System/DelegateSerializationHolder.cs b/src/mscorlib/src/System/DelegateSerializationHolder.cs index a6280333db..83fe35ad1e 100644 --- a/src/mscorlib/src/System/DelegateSerializationHolder.cs +++ b/src/mscorlib/src/System/DelegateSerializationHolder.cs @@ -17,14 +17,13 @@ namespace System internal sealed class DelegateSerializationHolder : IObjectReference, ISerializable { #region Static Members - [System.Security.SecurityCritical] // auto-generated internal static DelegateEntry GetDelegateSerializationInfo( SerializationInfo info, Type delegateType, Object target, MethodInfo method, int targetIndex) { // Used for MulticastDelegate if (method == null) - throw new ArgumentNullException("method"); + throw new ArgumentNullException(nameof(method)); Contract.EndContractBlock(); if (!method.IsPublic || (method.DeclaringType != null && !method.DeclaringType.IsVisible)) @@ -116,11 +115,10 @@ namespace System #endregion #region Constructor - [System.Security.SecurityCritical] // auto-generated private DelegateSerializationHolder(SerializationInfo info, StreamingContext context) { if (info == null) - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); Contract.EndContractBlock(); bool bNewWire = true; @@ -182,7 +180,7 @@ namespace System private DelegateEntry OldDelegateWireFormat(SerializationInfo info, StreamingContext context) { if (info == null) - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); Contract.EndContractBlock(); String delegateType = info.GetString("DelegateType"); @@ -195,7 +193,6 @@ namespace System return new DelegateEntry(delegateType, delegateAssembly, target, targetTypeAssembly, targetTypeName, methodName); } - [System.Security.SecurityCritical] private Delegate GetDelegate(DelegateEntry de, int index) { Delegate d; @@ -218,27 +215,19 @@ namespace System // If we received the new style delegate encoding we already have the target MethodInfo in hand. if (m_methods != null) { -#if FEATURE_REMOTING - Object target = de.target != null ? RemotingServices.CheckCast(de.target, targetType) : null; -#else if(de.target != null && !targetType.IsInstanceOfType(de.target)) throw new InvalidCastException(); Object target=de.target; -#endif d = Delegate.CreateDelegateNoSecurityCheck(type, target, m_methods[index]); } else { if (de.target != null) -#if FEATURE_REMOTING - d = Delegate.CreateDelegate(type, RemotingServices.CheckCast(de.target, targetType), de.methodName); -#else - { - if(!targetType.IsInstanceOfType(de.target)) - throw new InvalidCastException(); - d = Delegate.CreateDelegate(type, de.target, de.methodName); - } -#endif + { + if(!targetType.IsInstanceOfType(de.target)) + throw new InvalidCastException(); + d = Delegate.CreateDelegate(type, de.target, de.methodName); + } else d = Delegate.CreateDelegate(type, targetType, de.methodName); } @@ -259,7 +248,6 @@ namespace System #endregion #region IObjectReference - [System.Security.SecurityCritical] // auto-generated public Object GetRealObject(StreamingContext context) { int count = 0; @@ -289,7 +277,6 @@ namespace System #endregion #region ISerializable - [System.Security.SecurityCritical] // auto-generated public void GetObjectData(SerializationInfo info, StreamingContext context) { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DelegateSerHolderSerial")); |