This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add Brotli Compression to CoreFX #26229
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Common/src/Microsoft/Win32/SafeHandles/SafeBrotliHandle.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Microsoft.Win32.SafeHandles | ||
| { | ||
| internal sealed class SafeBrotliEncoderHandle : SafeHandle | ||
| { | ||
| public SafeBrotliEncoderHandle() : base(IntPtr.Zero, true) { } | ||
|
|
||
| protected override bool ReleaseHandle() | ||
| { | ||
| Interop.Brotli.BrotliEncoderDestroyInstance(handle); | ||
| return true; | ||
| } | ||
|
|
||
| public override bool IsInvalid => handle == IntPtr.Zero; | ||
| } | ||
|
|
||
| internal sealed class SafeBrotliDecoderHandle : SafeHandle | ||
| { | ||
| public SafeBrotliDecoderHandle() : base(IntPtr.Zero, true) { } | ||
|
|
||
| protected override bool ReleaseHandle() | ||
| { | ||
| Interop.Brotli.BrotliDecoderDestroyInstance(handle); | ||
| return true; | ||
| } | ||
|
|
||
| public override bool IsInvalid => handle == IntPtr.Zero; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-26 Bytes
...dLoads/_tools_BinscopeFilter_packages_Newtonsoft.Json.9.0.1_lib_net45_Newtonsoft.Json.txt
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling/disabling different warnings by changing the order here does not scale. Can we disable the specific warnings in System.IO.Compression.Native/CMakeLists.txt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of a way to remove a compile option once it's already been added. We could add them to each of the other library CmakeLists, but that scales worse than the ordering change.
CMake is pretty flexible and there's probably a way of getting all compile flags, parsing them for what you want to remove, then creating a new list without that item that is library specific. That would be more convoluted than just sticking the compression library add above the compile options though, and require more far effort to make sure it's exactly correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok