Remove unnecessary strlen from DocumentWriter
Created attachment 96869 [details] Patch
Comment on attachment 96869 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=96869&action=review > Source/WebCore/loader/DocumentWriter.cpp:204 > -void DocumentWriter::addData(const char* bytes, int length) > +void DocumentWriter::addData(const char* bytes, size_t length) > { > - if (length == -1) > - length = strlen(bytes); > - > m_parser->appendBytes(this, bytes, length); > } This function now truncates a passed-in size_t to an int by passing it to appendBytes. It would be possible to instead write a loop that does up to INT_MAX characters at once. Or to make a more extensive change so we use size_t in the signature of the appendBytes function too.
Comment on attachment 96869 [details] Patch Clearing flags on attachment: 96869 Committed r88610: <http://trac.webkit.org/changeset/88610>
All reviewed patches have been landed. Closing bug.
> It would be possible to instead write a loop that does up to INT_MAX characters at once. Or to make a more extensive change so we use size_t in the signature of the appendBytes function too. It seems like we should just use size_t everywhere for the length of the buffer. There's a bunch of code sites that need to change. I'll study it.