| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3079a78 commit 54d36b0
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -422,7 +422,7 @@ that state is through the use of `Environment::AddBindingData`, which gives | |||
| 422 | 422 | binding functions access to an object for storing such state. | |
| 423 | 423 | That object is always a [`BaseObject`][]. | |
| 424 | 424 | ||
| 425 | - Its class needs to have a static `binding_data_name` field based on a | ||
| 425 | + Its class needs to have a static `type_name` field based on a | ||
| 426 | 426 | constant string, in order to disambiguate it from other classes of this type, | |
| 427 | 427 | and which could e.g. match the binding’s name (in the example above, that would | |
| 428 | 428 | be `cares_wrap`). | |
@@ -433,7 +433,7 @@ class BindingData : public BaseObject { | |||
| 433 | 433 | public: | |
| 434 | 434 | BindingData(Environment* env, Local<Object> obj) : BaseObject(env, obj) {} | |
| 435 | 435 | ||
| 436 | - static constexpr FastStringKey binding_data_name { "http_parser" }; | ||
| 436 | + static constexpr FastStringKey type_name { "http_parser" }; | ||
| 437 | 437 | ||
| 438 | 438 | std::vector<char> parser_buffer; | |
| 439 | 439 | bool parser_buffer_in_use = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -358,7 +358,7 @@ inline T* Environment::GetBindingData(v8::Local<v8::Context> context) { | |||
| 358 | 358 | context->GetAlignedPointerFromEmbedderData( | |
| 359 | 359 | ContextEmbedderIndex::kBindingListIndex)); | |
| 360 | 360 | DCHECK_NOT_NULL(map); | |
| 361 | - auto it = map->find(T::binding_data_name); | ||
| 361 | + auto it = map->find(T::type_name); | ||
| 362 | 362 | if (UNLIKELY(it == map->end())) return nullptr; | |
| 363 | 363 | T* result = static_cast<T*>(it->second.get()); | |
| 364 | 364 | DCHECK_NOT_NULL(result); | |
@@ -377,7 +377,7 @@ inline T* Environment::AddBindingData( | |||
| 377 | 377 | context->GetAlignedPointerFromEmbedderData( | |
| 378 | 378 | ContextEmbedderIndex::kBindingListIndex)); | |
| 379 | 379 | DCHECK_NOT_NULL(map); | |
| 380 | - auto result = map->emplace(T::binding_data_name, item); | ||
| 380 | + auto result = map->emplace(T::type_name, item); | ||
| 381 | 381 | CHECK(result.second); | |
| 382 | 382 | DCHECK_EQ(GetBindingData<T>(context), item.get()); | |
| 383 | 383 | return item.get(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2399,7 +2399,7 @@ void BindingData::MemoryInfo(MemoryTracker* tracker) const { | |||
| 2399 | 2399 | } | |
| 2400 | 2400 | ||
| 2401 | 2401 | // TODO(addaleax): Remove once we're on C++17. | |
| 2402 | - constexpr FastStringKey BindingData::binding_data_name; | ||
| 2402 | + constexpr FastStringKey BindingData::type_name; | ||
| 2403 | 2403 | ||
| 2404 | 2404 | void Initialize(Local<Object> target, | |
| 2405 | 2405 | Local<Value> unused, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ class BindingData : public BaseObject { | |||
| 27 | 27 | std::vector<BaseObjectPtr<FileHandleReadWrap>> | |
| 28 | 28 | file_handle_read_wrap_freelist; | |
| 29 | 29 | ||
| 30 | - static constexpr FastStringKey binding_data_name { "fs" }; | ||
| 30 | + static constexpr FastStringKey type_name { "fs" }; | ||
| 31 | 31 | ||
| 32 | 32 | void MemoryInfo(MemoryTracker* tracker) const override; | |
| 33 | 33 | SET_SELF_SIZE(BindingData) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3001,7 +3001,7 @@ void Http2State::MemoryInfo(MemoryTracker* tracker) const { | |||
| 3001 | 3001 | } | |
| 3002 | 3002 | ||
| 3003 | 3003 | // TODO(addaleax): Remove once we're on C++17. | |
| 3004 | - constexpr FastStringKey Http2State::binding_data_name; | ||
| 3004 | + constexpr FastStringKey Http2State::type_name; | ||
| 3005 | 3005 | ||
| 3006 | 3006 | // Set up the process.binding('http2') binding. | |
| 3007 | 3007 | void Initialize(Local<Object> target, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,7 +127,7 @@ class Http2State : public BaseObject { | |||
| 127 | 127 | SET_SELF_SIZE(Http2State) | |
| 128 | 128 | SET_MEMORY_INFO_NAME(Http2State) | |
| 129 | 129 | ||
| 130 | - static constexpr FastStringKey binding_data_name { "http2" }; | ||
| 130 | + static constexpr FastStringKey type_name { "http2" }; | ||
| 131 | 131 | ||
| 132 | 132 | private: | |
| 133 | 133 | struct http2_state_internal { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,7 @@ class BindingData : public BaseObject { | |||
| 88 | 88 | BindingData(Environment* env, Local<Object> obj) | |
| 89 | 89 | : BaseObject(env, obj) {} | |
| 90 | 90 | ||
| 91 | - static constexpr FastStringKey binding_data_name { "http_parser" }; | ||
| 91 | + static constexpr FastStringKey type_name { "http_parser" }; | ||
| 92 | 92 | ||
| 93 | 93 | std::vector<char> parser_buffer; | |
| 94 | 94 | bool parser_buffer_in_use = false; | |
@@ -101,7 +101,7 @@ class BindingData : public BaseObject { | |||
| 101 | 101 | }; | |
| 102 | 102 | ||
| 103 | 103 | // TODO(addaleax): Remove once we're on C++17. | |
| 104 | - constexpr FastStringKey BindingData::binding_data_name; | ||
| 104 | + constexpr FastStringKey BindingData::type_name; | ||
| 105 | 105 | ||
| 106 | 106 | // helper class for the Parser | |
| 107 | 107 | struct StringPtr { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,7 +95,7 @@ class BindingData : public BaseObject { | |||
| 95 | 95 | heap_code_statistics_buffer(env->isolate(), | |
| 96 | 96 | kHeapCodeStatisticsPropertiesCount) {} | |
| 97 | 97 | ||
| 98 | - static constexpr FastStringKey binding_data_name { "v8" }; | ||
| 98 | + static constexpr FastStringKey type_name { "v8" }; | ||
| 99 | 99 | ||
| 100 | 100 | AliasedFloat64Array heap_statistics_buffer; | |
| 101 | 101 | AliasedFloat64Array heap_space_statistics_buffer; | |
@@ -113,7 +113,7 @@ class BindingData : public BaseObject { | |||
| 113 | 113 | }; | |
| 114 | 114 | ||
| 115 | 115 | // TODO(addaleax): Remove once we're on C++17. | |
| 116 | - constexpr FastStringKey BindingData::binding_data_name; | ||
| 116 | + constexpr FastStringKey BindingData::type_name; | ||
| 117 | 117 | ||
| 118 | 118 | void CachedDataVersionTag(const FunctionCallbackInfo<Value>& args) { | |
| 119 | 119 | Environment* env = Environment::GetCurrent(args); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments