@@ -116,7 +116,7 @@ using jsurl::SpecSlice, jsurl::SpecString, jsurl::JSUrl, jsurl::JSUrlSearchParam
116
116
static JS::PersistentRootedObjectVector *pending_requests;
117
117
static JS::PersistentRootedObjectVector *pending_body_reads;
118
118
119
- // TODO: introduce a version that writes into an existing buffer, and use that
119
+ // TODO(performance) : introduce a version that writes into an existing buffer, and use that
120
120
// with the hostcall buffer where possible.
121
121
UniqueChars encode (JSContext *cx, HandleString str, size_t *encoded_len) {
122
122
UniqueChars text = JS_EncodeStringToUTF8 (cx, str);
@@ -190,10 +190,10 @@ JSObject *PromiseRejectedWithPendingError(JSContext *cx) {
190
190
template <auto op, class HandleType >
191
191
static char *read_from_handle_all (JSContext *cx, HandleType handle, size_t *nwritten,
192
192
bool read_until_zero) {
193
- // TODO: investigate passing a size hint in situations where we might know
193
+ // TODO(performance) : investigate passing a size hint in situations where we might know
194
194
// the final size, e.g. via the `content-length` header.
195
195
size_t buf_size = HANDLE_READ_CHUNK_SIZE;
196
- // TODO: make use of malloc slack.
196
+ // TODO(performance) : make use of malloc slack.
197
197
char *buf = static_cast <char *>(JS_malloc (cx, buf_size));
198
198
if (!buf) {
199
199
JS_ReportOutOfMemory (cx);
@@ -217,7 +217,7 @@ static char *read_from_handle_all(JSContext *cx, HandleType handle, size_t *nwri
217
217
break ;
218
218
}
219
219
220
- // TODO: make use of malloc slack, and use a smarter buffer growth strategy.
220
+ // TODO(performance) : make use of malloc slack, and use a smarter buffer growth strategy.
221
221
size_t new_size = buf_size + HANDLE_READ_CHUNK_SIZE;
222
222
new_buf = static_cast <char *>(JS_realloc (cx, buf, buf_size, new_size));
223
223
if (!new_buf) {
@@ -965,7 +965,7 @@ bool bodyAll(JSContext *cx, CallArgs args, HandleObject self) {
965
965
966
966
// If the body is a ReadableStream that's not backed by a BodyHandle,
967
967
// we need to manually read all chunks from the stream.
968
- // TODO: ensure that we're properly shortcutting reads from TransformStream
968
+ // TODO(performance) : ensure that we're properly shortcutting reads from TransformStream
969
969
// readables.
970
970
RootedObject stream (cx, body_stream (self));
971
971
if (stream && !NativeStreamSource::stream_is_body (cx, stream)) {
@@ -2365,12 +2365,12 @@ bool constructor(JSContext *cx, unsigned argc, Value *vp) {
2365
2365
// be consumed by the content creating it, so we're lenient about its format.
2366
2366
2367
2367
// 3. Set `this`’s `response` to a new `response`.
2368
- // TODO: consider not creating a host-side representation for responses
2368
+ // TODO(performance) : consider not creating a host-side representation for responses
2369
2369
// eagerly. Some applications create Response objects purely for internal use,
2370
2370
// e.g. to represent cache entries. While that's perhaps not ideal to begin
2371
2371
// with, it exists, so we should handle it in a good way, and not be
2372
2372
// superfluously slow.
2373
- // TODO: enable creating Response objects during the init phase, and only
2373
+ // TODO(performance) : enable creating Response objects during the init phase, and only
2374
2374
// creating the host-side representation when processing requests.
2375
2375
ResponseHandle response_handle = {.handle = INVALID_HANDLE};
2376
2376
if (!HANDLE_RESULT (cx, xqd_resp_new (&response_handle))) {
@@ -3319,7 +3319,7 @@ bool append(JSContext *cx, unsigned argc, Value *vp) {
3319
3319
* doesn't already contain a header with that name.
3320
3320
*
3321
3321
* Assumes that both the name and value are valid and normalized.
3322
- * TODO: fully skip normalization.
3322
+ * TODO(performance) : fully skip normalization.
3323
3323
*/
3324
3324
bool maybe_add (JSContext *cx, HandleObject self, const char *name, const char *value) {
3325
3325
MOZ_ASSERT (is_instance (self));
0 commit comments