summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-26 11:19:06 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-26 11:19:06 -0700
commit3d37ff45cab6838d80b22e6b782a0b9b4c2f4aeb (patch)
treec15816c3d7f6e74334553f2ff98605ce1c22c538 /src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs
parent5e9014f36b2d53b8e419918675df636540ea24e2 (diff)
parente6f7409f4caceb7bc2a5b4ddbcb1a4097af340f2 (diff)
downloadDotNetOpenAuth-3d37ff45cab6838d80b22e6b782a0b9b4c2f4aeb.zip
DotNetOpenAuth-3d37ff45cab6838d80b22e6b782a0b9b4c2f4aeb.tar.gz
DotNetOpenAuth-3d37ff45cab6838d80b22e6b782a0b9b4c2f4aeb.tar.bz2
Move to HttpClient throughout library.
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs b/src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs
new file mode 100644
index 0000000..37c86ca
--- /dev/null
+++ b/src/DotNetOpenAuth.Core/Messaging/MessageProtectionTasks.cs
@@ -0,0 +1,41 @@
+//-----------------------------------------------------------------------
+// <copyright file="MessageProtectionTasks.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Messaging {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using System.Threading.Tasks;
+
+ /// <summary>
+ /// Reusable pre-completed tasks that may be returned multiple times to reduce GC pressure.
+ /// </summary>
+ internal static class MessageProtectionTasks {
+ /// <summary>
+ /// A task whose result is <c>null</c>
+ /// </summary>
+ internal static readonly Task<MessageProtections?> Null = Task.FromResult<MessageProtections?>(null);
+
+ /// <summary>
+ /// A task whose result is <see cref="MessageProtections.None"/>
+ /// </summary>
+ internal static readonly Task<MessageProtections?> None =
+ Task.FromResult<MessageProtections?>(MessageProtections.None);
+
+ /// <summary>
+ /// A task whose result is <see cref="MessageProtections.TamperProtection"/>
+ /// </summary>
+ internal static readonly Task<MessageProtections?> TamperProtection =
+ Task.FromResult<MessageProtections?>(MessageProtections.TamperProtection);
+
+ /// <summary>
+ /// A task whose result is <see cref="MessageProtections.ReplayProtection"/>
+ /// </summary>
+ internal static readonly Task<MessageProtections?> ReplayProtection =
+ Task.FromResult<MessageProtections?>(MessageProtections.ReplayProtection);
+ }
+}