Apply CA2016: Forward CancellationToken to methods that can take it (#37607)
authorCarlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com>
Wed, 15 Jul 2020 20:10:46 +0000 (13:10 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Jul 2020 20:10:46 +0000 (13:10 -0700)
commit7f34be5319af78de3cb5fe12438f2756a864bddd
tree7431eb894e1a395d2acd044f2e33bfed9674aaf7
parent5fbcb38af1b4e856c09d3b0423a8d1dd3946060b
Apply CA2016: Forward CancellationToken to methods that can take it (#37607)

* Forward CancellationToken to methods that can take it

* Address suggestions

* address suggestions

* Revert using

* Make rule 2016 a warning in runtime

* Extra cases found

* Revert changes that should not pass a token, change rule to info to verify build and test CI results

* Pass CancellationToken.None to base.CreateContentReadStreamAsync, as in its default overload

* Address stack overflow in MultipartContent

* HostingAbstractionsHostExtensions address using

* Update nuget package version to latest, Info->Warning again, fix one more case.

* System.Diagnostics.ProcessWaitState.Unix token

* Remove two unnecessary tokens
22 files changed:
eng/Analyzers.props
eng/CodeAnalysis.ruleset
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs
src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs
src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs
src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs
src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netcoreapp.cs [new file with mode: 0644]
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netstandard.cs [new file with mode: 0644]
src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/BrowserHttpHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs
src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs
src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs