summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-02-16 20:49:23 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-02-16 20:49:23 -0800
commit549017cdf590ea4ce4d8ad55c013c33a506133a3 (patch)
tree4783fa4d796c6deb1f7f39d0937778d88858daf3 /src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
parentfcee7171b683db63aafac3c7351b22a849d06db4 (diff)
downloadDotNetOpenAuth-549017cdf590ea4ce4d8ad55c013c33a506133a3.zip
DotNetOpenAuth-549017cdf590ea4ce4d8ad55c013c33a506133a3.tar.gz
DotNetOpenAuth-549017cdf590ea4ce4d8ad55c013c33a506133a3.tar.bz2
More warning fixes.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
index 60df47f..29ef8d5 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
@@ -17,17 +17,6 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
/// Sets the HTTP Method property on a signed message before the signing module gets to it.
/// </summary>
internal class OAuthHttpMethodBindingElement : IChannelBindingElement {
- /// <summary>
- /// A reusable pre-completed task that may be returned multiple times to reduce GC pressure.
- /// </summary>
- private static readonly Task<MessageProtections?> NullTask = Task.FromResult<MessageProtections?>(null);
-
- /// <summary>
- /// A reusable pre-completed task that may be returned multiple times to reduce GC pressure.
- /// </summary>
- private static readonly Task<MessageProtections?> NoneTask =
- Task.FromResult<MessageProtections?>(MessageProtections.None);
-
#region IChannelBindingElement Members
/// <summary>
@@ -58,13 +47,13 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
HttpDeliveryMethods transmissionMethod = oauthMessage.HttpMethods;
try {
oauthMessage.HttpMethod = MessagingUtilities.GetHttpVerb(transmissionMethod);
- return NoneTask;
+ return MessageProtectionTasks.None;
} catch (ArgumentException ex) {
Logger.OAuth.Error("Unrecognized HttpDeliveryMethods value.", ex);
- return NullTask;
+ return MessageProtectionTasks.Null;
}
} else {
- return NullTask;
+ return MessageProtectionTasks.Null;
}
}
@@ -82,8 +71,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
/// Thrown when the binding element rules indicate that this message is invalid and should
/// NOT be processed.
/// </exception>
- public async Task<MessageProtections?> ProcessIncomingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
- return null;
+ public Task<MessageProtections?> ProcessIncomingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
+ return MessageProtectionTasks.Null;
}
#endregion