mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
src: avoid copy when creating Blob
PR-URL: https://github.com/nodejs/node/pull/44616 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This commit is contained in:
1 parent
9a469bef2c
commit
24172ca6fe
2 files changed
+7
-12
No files matched your search
+3
-5
@@ -69,11 +69,9 @@ bool Blob::HasInstance(Environment* env, v8::Local<v8::Value> object) {
|
||||
return GetConstructorTemplate(env)->HasInstance(object);
|
||||
}
|
||||
|
||||
BaseObjectPtr<Blob> Blob::Create(
|
||||
Environment* env,
|
||||
const std::vector<BlobEntry> store,
|
||||
size_t length) {
|
||||
|
||||
BaseObjectPtr<Blob> Blob::Create(Environment* env,
|
||||
const std::vector<BlobEntry>& store,
|
||||
size_t length) {
|
||||
HandleScope scope(env->isolate());
|
||||
|
||||
Local<Function> ctor;
|
||||
|
||||
+4
-7
@@ -45,16 +45,13 @@ class Blob : public BaseObject {
|
||||
static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
|
||||
Environment* env);
|
||||
|
||||
static BaseObjectPtr<Blob> Create(
|
||||
Environment* env,
|
||||
const std::vector<BlobEntry> store,
|
||||
size_t length);
|
||||
static BaseObjectPtr<Blob> Create(Environment* env,
|
||||
const std::vector<BlobEntry>& store,
|
||||
size_t length);
|
||||
|
||||
static bool HasInstance(Environment* env, v8::Local<v8::Value> object);
|
||||
|
||||
const std::vector<BlobEntry> entries() const {
|
||||
return store_;
|
||||
}
|
||||
const std::vector<BlobEntry>& entries() const { return store_; }
|
||||
|
||||
void MemoryInfo(MemoryTracker* tracker) const override;
|
||||
SET_MEMORY_INFO_NAME(Blob)
|
||||
|
||||
Reference in new issue
Block a user