davidben: overall
sunnyps: gpu (cuz I changed code more pervasively there)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
for (AttributeMap::const_iterator iter = shader->attrib_map().begin();
use range-based for loop instead (https://clang.llvm.org/extra/clang-tidy/checks/modernize/loop-convert.html)
(Note: running clang-tidy on this file failed; this diagnostic might be incorrect as a result.)
(Lint observed on `android-clang-tidy-rel` and `linux-clang-tidy-rel`)
Ok I rewrote a bunch of for loops in memory_program_cache.cc..
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
.copy_from(base::SHA1Hash(base::as_byte_span(module_basename)));
SHA-1 hashes (20 bytes) are probably juuuust getting to the point that it's worth having an out param to avoid the extra copy, but I doubt it matters for this code. :-)
(cf the discussions we had way back about how U64ToBigEndian and friends should work. Or how Rust's `digest` crate has both `finalize` and `finalize_into`.)
ProgramLRUCache::iterator found = store_.Get(sha_string);
Suspect we'd need to teach base::LRUCache to support heterogenous lookup if we want to string_view this.
RunShaderCallback(client, proto.get(), sha_string);
Hah. Not only is the `std::string` wasteful, but `RunShaderCallback` takes the string by value.
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 24)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 16)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 8)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value)));
I believe this is simply:
```suggestion
CHECK(buffer.WriteI32BigEndian(value));
```
OpenGL seems to promise that `GLint` is a 32-bit, signed integer. Also, man, I gotta say `WriteU8LittleEndian` continues to throw me off every time. Still think we should call it `WriteU8`, because it's very confusing.
base::span(CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer)));
There's already a `CryptoBufferAsSpan` in net/cert/x509_util.h. No sense in carrying around two of these, since each will need its own UNSAFE_BUFFERS in the long run.
// `base::as_string_view(cert->cert_span())`.
I mean, these wrappers atop the CRYPTO_BUFFER accessor is just as safe, but I don't mind having the extra wrapper. *shrug*
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This change meets the code coverage requirements.
Code-Coverage | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
EXPECT_EQ(byte_span.size(), kVec.size() * sizeof(int));
Maybe an EXPECT_DEATH() if we try to make a mismatches span.
base::SHA1Hash(base::as_bytes(base::make_span(input))));
nit: should be as_byte_span() ?
base::SHA1Hash(base::as_bytes(base::make_span(unique_tag)));
nit: should be as_byte_span() ?
base::SHA1Hash(base::as_bytes(base::make_span(unique_tag)));
nit: should be as_byte_span() ? Numerous usages throughout.
base::SHA1Hash(base::as_bytes(base::make_span(identifier)))));
nit: I'm going to stop flagging these now ...
PTAL
EXPECT_EQ(byte_span.size(), kVec.size() * sizeof(int));
Maybe an EXPECT_DEATH() if we try to make a mismatches span.
Done
base::SHA1Hash(base::as_bytes(base::make_span(input))));
nit: should be as_byte_span() ?
Done
base::SHA1Hash(base::as_bytes(base::make_span(unique_tag)));
nit: should be as_byte_span() ?
Done
base::SHA1Hash(base::as_bytes(base::make_span(unique_tag)));
nit: should be as_byte_span() ? Numerous usages throughout.
Done
base::SHA1Hash(base::as_bytes(base::make_span(identifier)))));
nit: I'm going to stop flagging these now ...
Done
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 24)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 16)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value >> 8)));
CHECK(buffer.WriteU8LittleEndian(static_cast<uint8_t>(value)));
I believe this is simply:
```suggestion
CHECK(buffer.WriteI32BigEndian(value));
```OpenGL seems to promise that `GLint` is a 32-bit, signed integer. Also, man, I gotta say `WriteU8LittleEndian` continues to throw me off every time. Still think we should call it `WriteU8`, because it's very confusing.
Done
base::span(CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer)));
There's already a `CryptoBufferAsSpan` in net/cert/x509_util.h. No sense in carrying around two of these, since each will need its own UNSAFE_BUFFERS in the long run.
ok i removed cert_span() and references to it. i added a comment instead that points to CryptoBufferAsSpan() so that folks can find that.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
base::span(CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer)));
danakjThere's already a `CryptoBufferAsSpan` in net/cert/x509_util.h. No sense in carrying around two of these, since each will need its own UNSAFE_BUFFERS in the long run.
ok i removed cert_span() and references to it. i added a comment instead that points to CryptoBufferAsSpan() so that folks can find that.
I have put cert_span() back and it's implemented by CryptoBufferAsSpan().
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This change meets the code coverage requirements.
Code-Coverage | +1 |
Remove base::SHA1HashBytes(), consolidate into base::SHA1Hash()
Now that there's no ambiguity we don't need the span suffix, just
as we don't have one in base::HexEncode().
Convert GPU Command Buffer code from using `char*` with a known constant
length to be `span<uint8_t, kHashLength>` for compile-time
bounds-safety.
Convert other uses of SHA1HashBytes() to SHA1Hash() and the use of
spans.
Add an overload of base::as_byte_span and base::as_writable_byte_span
that takes a compile-time size for the output span, and verifies at
runtime that it is correct. This allows the caller to skip calling the
span ctor or make_span<N> overload in order to move from a variable
sized container to a fixed-size byte span.
R=davi...@chromium.org, sun...@chromium.org
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |