Lines Matching refs:env

4 #include "env-inl.h"
50 FixedSizeBlobCopyJob::Initialize(realm->env(), target);
53 Local<FunctionTemplate> Blob::GetConstructorTemplate(Environment* env) {
54 Local<FunctionTemplate> tmpl = env->blob_constructor_template();
56 Isolate* isolate = env->isolate();
60 tmpl->Inherit(BaseObject::GetConstructorTemplate(env));
62 FIXED_ONE_BYTE_STRING(env->isolate(), "Blob"));
65 env->set_blob_constructor_template(tmpl);
70 bool Blob::HasInstance(Environment* env, v8::Local<v8::Value> object) {
71 return GetConstructorTemplate(env)->HasInstance(object);
74 BaseObjectPtr<Blob> Blob::Create(Environment* env,
77 HandleScope scope(env->isolate());
80 if (!GetConstructorTemplate(env)->GetFunction(env->context()).ToLocal(&ctor))
84 if (!ctor->NewInstance(env->context()).ToLocal(&obj))
87 return MakeBaseObject<Blob>(env, obj, store, length);
91 Environment* env = Environment::GetCurrent(args);
102 if (!ary->Get(env->context(), n).ToLocal(&entry))
104 CHECK(entry->IsArrayBufferView() || Blob::HasInstance(env, entry));
123 BaseObjectPtr<Blob> blob = Create(env, entries, length);
129 Environment* env = Environment::GetCurrent(args);
133 if (blob->GetArrayBuffer(env).ToLocal(&ret))
138 Environment* env = Environment::GetCurrent(args);
145 BaseObjectPtr<Blob> slice = blob->Slice(env, start, end);
154 MaybeLocal<Value> Blob::GetArrayBuffer(Environment* env) {
155 EscapableHandleScope scope(env->isolate());
158 ArrayBuffer::NewBackingStore(env->isolate(), len);
172 return scope.Escape(ArrayBuffer::New(env->isolate(), store));
175 BaseObjectPtr<Blob> Blob::Slice(Environment* env, size_t start, size_t end) {
184 if (total == 0) return Create(env, slices, 0);
203 return Create(env, slices, total);
207 Environment* env,
211 : BaseObject(env, obj),
219 Environment* env,
222 if (context != env->context()) {
223 THROW_ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE(env);
226 return Blob::Create(env, store_, length_);
238 Environment* env = Environment::GetCurrent(args);
242 CHECK(Blob::HasInstance(env, args[1])); // Blob
246 Utf8Value key(env->isolate(), args[0]);
251 Utf8Value type(env->isolate(), args[3]);
264 Environment* env = Environment::GetCurrent(args);
267 Utf8Value key(env->isolate(), args[0]);
275 Environment* env = Environment::GetCurrent(args);
278 Utf8Value key(env->isolate(), args[0]);
285 env->isolate(),
294 Uint32::NewFromUnsigned(env->isolate(), stored.length),
300 env->isolate(),
306 FixedSizeBlobCopyJob::FixedSizeBlobCopyJob(Environment* env,
310 : AsyncWrap(env, object, AsyncWrap::PROVIDER_FIXEDSIZEBLOBCOPY),
311 ThreadPoolWork(env, "blob"),
319 Environment* env = AsyncWrap::env();
323 HandleScope handle_scope(env->isolate());
324 Context::Scope context_scope(env->context());
328 args[0] = Number::New(env->isolate(), status),
329 args[1] = Undefined(env->isolate());
331 args[0] = Undefined(env->isolate());
332 args[1] = ArrayBuffer::New(env->isolate(), destination_);
335 ptr->MakeCallback(env->ondone_string(), arraysize(args), args);
360 void FixedSizeBlobCopyJob::Initialize(Environment* env, Local<Object> target) {
361 Isolate* isolate = env->isolate();
363 job->Inherit(AsyncWrap::GetConstructorTemplate(env));
367 SetConstructorFunction(env->context(), target, "FixedSizeBlobCopyJob", job);
374 Environment* env = Environment::GetCurrent(args);
377 CHECK(Blob::HasInstance(env, args[0]));
391 new FixedSizeBlobCopyJob(env, args.This(), blob, mode);
395 Environment* env = Environment::GetCurrent(args);
399 ArrayBuffer::NewBackingStore(env->isolate(), job->length_);
405 ArrayBuffer::New(env->isolate(), job->destination_));