-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Conversation
d06d207
to
5e0cfd8
Compare
@@ -137,3 +143,199 @@ public sealed class SerializationInfoEnumerator : IEnumerator | |||
public void Reset() { throw null; } | |||
} | |||
} | |||
namespace System.Runtime.Serialization | |||
{ | |||
[System.CLSCompliantAttribute(false)] |
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.
Are we not scrubbing these out?
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.
CLSCompliant? No. If something isn't compliant and isn't attributed to say so, it'll produce a build error.
how much should we be reviewing the binaryformatter itself - how much is essentially the desktoip code verbatim? |
|
||
//If the id that we need to place is greater than our current length, and less | ||
//than the maximum allowable size of the array. We need to double the size | ||
//of the array. If the array has already reached it's maximum allowable size, |
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.
If the array has already reached it's maximum allowable size, [](start = 28, length = 62)
is there a test for this?
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.
is there a test for this?
You mean if we try to serialize two billion objects? No.
From a logic perspective, it's the desktop code. I had to supply replacements where there were dependencies that aren't exposed, remove code that wasn't relevant, plus a lot of style stuff, but for the most part it's the same code and doesn't need to be reviewed in depth... honestly there are parts I'm not entirely sure what they're doing ;) |
[Serializable] | ||
internal sealed class IntSizedArray : ICloneable | ||
{ | ||
internal int[] objects = new int[16]; |
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.
objects [](start = 23, length = 7)
leading underscores?
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.
Yup, somehow missed these two.
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.
Fixed.
Thank you for doing this, great stuff. |
internal FormatterTypeStyle _FEtypeFormat; | ||
internal FormatterAssemblyStyle _FEassemblyFormat; | ||
internal TypeFilterLevel _FEsecurityLevel; | ||
internal InternalSerializerTypeE _FEserializerTypeEnum; |
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.
The casing on the names here (and in NameInfo) seems off. In Desktop they had no underscore, presenting as property names. Now they are underscore-pascal; which I don't think is any part of our style rules. Bad CodeFormatter edit?
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.
Will fix.
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.
Fixed.
This ports BinaryFormatter from desktop, along with all of the supporting types and general Formatter-related types. I've added a bunch of tests, bringing code coverage up to ~80%, though there's still more that can/should be done. I did not port remoting-specific functionality, though there are still some remnants I've left as they were enabled in the runtime even when remoting wasn't compiled in, and it wasn't clear if they were serving additional purposes.
5e0cfd8
to
7896300
Compare
Thanks for all the feedback. I believe I've addressed everything. |
👍 |
{ | ||
try | ||
{ | ||
Assembly.Load(new AssemblyName(assemblyName)); |
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.
Are you missing an assignment to assm
here?
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.
Yup.
Replaced by #10144 |
This ports BinaryFormatter from desktop, along with all of the supporting types and general Formatter-related types. I've added a bunch of tests, bringing code coverage up to ~80%, though there's still more that can/should be done. I did not port remoting-specific functionality, though there are still some remnants I've left as they were enabled in the runtime even when remoting wasn't compiled in, as it wasn't clear if they were serving additional purposes. I did a bunch of cleanup, but there's still more that can be done in the fullness of time.
I already made several changes to CoreCLR to enable this:
(This PR is currently going against master. If that turns out to be the wrong branch for it, I'll resubmit against the correct branch prior to merging.)
cc: @danmosemsft, @jkotas, @KrzysztofCwalina, @ianhays, @bartonjs
Fixes https://github.com/dotnet/corefx/issues/7938
Fixes https://github.com/dotnet/corefx/issues/9582