Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files
Differential Revision: https://phabricator.services.mozilla.com/D58217
EncodeString and EncodeBinary already use a common backend EncodeAsString,
the same should be done in decoding, as the encoding of a binary is
a special case of the encoding of a string.
Differential Revision: https://phabricator.services.mozilla.com/D38076
The comment referenced the former 3 prefix used for strings, but this is
no longer correct for strings (which now use a 0x30) prefix, and the
function has been generalized to also work for binaries, and got
a parameter aType specifying the prefix. Updated the comment accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D37850
EncodeString and EncodeBinary already use a common backend EncodeAsString,
the same should be done in decoding, as the encoding of a binary is
a special case of the encoding of a string.
Differential Revision: https://phabricator.services.mozilla.com/D38076
The comment referenced the former 3 prefix used for strings, but this is
no longer correct for strings (which now use a 0x30) prefix, and the
function has been generalized to also work for binaries, and got
a parameter aType specifying the prefix. Updated the comment accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D37850
This commit adds the text of the spec as inline comments and refactors
the code such that it directly corresponds to the spec's steps. This
makes it easier to understand how the spec's algorithm is implemented.
Differential Revision: https://phabricator.services.mozilla.com/D28976
EncodeString and EncodeBinary already use a common backend EncodeAsString,
the same should be done in decoding, as the encoding of a binary is
a special case of the encoding of a string.
Differential Revision: https://phabricator.services.mozilla.com/D38076
The comment referenced the former 3 prefix used for strings, but this is
no longer correct for strings (which now use a 0x30) prefix, and the
function has been generalized to also work for binaries, and got
a parameter aType specifying the prefix. Updated the comment accordingly.
Differential Revision: https://phabricator.services.mozilla.com/D37850
This commit adds the text of the spec as inline comments and refactors
the code such that it directly corresponds to the spec's steps. This
makes it easier to understand how the spec's algorithm is implemented.
Differential Revision: https://phabricator.services.mozilla.com/D28976
Key::ToLocaleBasedKey() overlooked the existence of |eBinary| type,
probably because |eBinary| was added later and the code wasn't updated
properly.
Differential Revision: https://phabricator.services.mozilla.com/D24882
When using JS_IsArrayBufferViewObject() to check ArrayBufferView object,
we should use JS_GetObjectAsArrayBufferView() to get its length and data.
Because in rare case there might be a wrapper on the object, JS_GetObjectAsArrayBufferView()
will handle it, js::GetArrayBufferViewLengthAndData() won't.
Differential Revision: https://phabricator.services.mozilla.com/D24009
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.
Differential Revision: https://phabricator.services.mozilla.com/D13073
Remove various calls to SetCapacity() that fall into various misuse categories:
1) Mistakenly believing that the caller should advice the string about zero
terminator.
2) Cases where a single append does the right computation on its own.
3) Calling SetCapacity() with a constant when the string is self-allocated
and could be an nsAuto[C]StringN and the string doesn't get passed on
in a way that could benefit from a heap-allocated buffer.
4) Calling SetCapacity() before assigning a shared buffer to the string.
5) Calling SetCapacity() before calling a function that will either calls
SetLength() anyway or calls Adopt().
MozReview-Commit-ID: IKjfl5gLmcD
Differential Revision: https://phabricator.services.mozilla.com/D4672
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.
MozReview-Commit-ID: 5UQVHElSpCr