Skip to content

Commit b1750f7

Browse files
authored
Merge pull request #897 from cloudflare/jsnell/jsg-completion-avoid-isolate-in-blob
2 parents 404d6bb + 5f06b26 commit b1750f7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/workerd/api/blob.c++

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ jsg::Ref<Blob> Blob::slice(jsg::Optional<int> maybeStart, jsg::Optional<int> may
129129
normalizeType(kj::mv(type).orDefault(nullptr)));
130130
}
131131

132-
jsg::Promise<kj::Array<kj::byte>> Blob::arrayBuffer(v8::Isolate* isolate) {
132+
jsg::Promise<kj::Array<kj::byte>> Blob::arrayBuffer(jsg::Lock& js) {
133133
// TODO(perf): Find a way to avoid the copy.
134-
return jsg::resolvedPromise(isolate, kj::heapArray<byte>(data));
134+
return js.resolvedPromise(kj::heapArray<byte>(data));
135135
}
136-
jsg::Promise<kj::String> Blob::text(v8::Isolate* isolate) {
137-
return jsg::resolvedPromise(isolate, kj::str(data.asChars()));
136+
jsg::Promise<kj::String> Blob::text(jsg::Lock& js) {
137+
return js.resolvedPromise(kj::str(data.asChars()));
138138
}
139139

140140
class Blob::BlobInputStream final: public ReadableStreamSource {
@@ -192,7 +192,7 @@ private:
192192
jsg::Ref<Blob> blob;
193193
};
194194

195-
jsg::Ref<ReadableStream> Blob::stream(v8::Isolate* isolate) {
195+
jsg::Ref<ReadableStream> Blob::stream() {
196196
return jsg::alloc<ReadableStream>(
197197
IoContext::current(),
198198
kj::heap<BlobInputStream>(JSG_THIS));

src/workerd/api/blob.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class Blob: public jsg::Object {
4040
jsg::Ref<Blob> slice(jsg::Optional<int> start, jsg::Optional<int> end,
4141
jsg::Optional<kj::String> type);
4242

43-
jsg::Promise<kj::Array<kj::byte>> arrayBuffer(v8::Isolate* isolate);
44-
jsg::Promise<kj::String> text(v8::Isolate* isolate);
45-
jsg::Ref<ReadableStream> stream(v8::Isolate* isolate);
43+
jsg::Promise<kj::Array<kj::byte>> arrayBuffer(jsg::Lock& js);
44+
jsg::Promise<kj::String> text(jsg::Lock& js);
45+
jsg::Ref<ReadableStream> stream();
4646

4747
JSG_RESOURCE_TYPE(Blob, CompatibilityFlags::Reader flags) {
4848
if (flags.getJsgPropertyOnPrototypeTemplate()) {

0 commit comments

Comments
 (0)