| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 88d9676 commit 33ebf5d
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -426,7 +426,7 @@ that state is through the use of `Environment::AddBindingData`, which gives | |||
| 426 | 426 | binding functions access to an object for storing such state. | |
| 427 | 427 | That object is always a [`BaseObject`][]. | |
| 428 | 428 | ||
| 429 | - Its class needs to have a static `binding_data_name` field based on a | ||
| 429 | + Its class needs to have a static `type_name` field based on a | ||
| 430 | 430 | constant string, in order to disambiguate it from other classes of this type, | |
| 431 | 431 | and which could e.g. match the binding’s name (in the example above, that would | |
| 432 | 432 | be `cares_wrap`). | |
@@ -437,7 +437,7 @@ class BindingData : public BaseObject { | |||
| 437 | 437 | public: | |
| 438 | 438 | BindingData(Environment* env, Local<Object> obj) : BaseObject(env, obj) {} | |
| 439 | 439 | ||
| 440 | - static constexpr FastStringKey binding_data_name { "http_parser" }; | ||
| 440 | + static constexpr FastStringKey type_name { "http_parser" }; | ||
| 441 | 441 | ||
| 442 | 442 | std::vector<char> parser_buffer; | |
| 443 | 443 | bool parser_buffer_in_use = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -387,7 +387,7 @@ inline T* Environment::GetBindingData(v8::Local<v8::Context> context) { | |||
| 387 | 387 | context->GetAlignedPointerFromEmbedderData( | |
| 388 | 388 | ContextEmbedderIndex::kBindingListIndex)); | |
| 389 | 389 | DCHECK_NOT_NULL(map); | |
| 390 | - auto it = map->find(T::binding_data_name); | ||
| 390 | + auto it = map->find(T::type_name); | ||
| 391 | 391 | if (UNLIKELY(it == map->end())) return nullptr; | |
| 392 | 392 | T* result = static_cast<T*>(it->second.get()); | |
| 393 | 393 | DCHECK_NOT_NULL(result); | |
@@ -406,7 +406,7 @@ inline T* Environment::AddBindingData( | |||
| 406 | 406 | context->GetAlignedPointerFromEmbedderData( | |
| 407 | 407 | ContextEmbedderIndex::kBindingListIndex)); | |
| 408 | 408 | DCHECK_NOT_NULL(map); | |
| 409 | - auto result = map->emplace(T::binding_data_name, item); | ||
| 409 | + auto result = map->emplace(T::type_name, item); | ||
| 410 | 410 | CHECK(result.second); | |
| 411 | 411 | DCHECK_EQ(GetBindingData<T>(context), item.get()); | |
| 412 | 412 | return item.get(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2394,7 +2394,7 @@ void BindingData::MemoryInfo(MemoryTracker* tracker) const { | |||
| 2394 | 2394 | } | |
| 2395 | 2395 | ||
| 2396 | 2396 | // TODO(addaleax): Remove once we're on C++17. | |
| 2397 | - constexpr FastStringKey BindingData::binding_data_name; | ||
| 2397 | + constexpr FastStringKey BindingData::type_name; | ||
| 2398 | 2398 | ||
| 2399 | 2399 | void Initialize(Local<Object> target, | |
| 2400 | 2400 | 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 | |
|---|---|---|---|
@@ -2975,7 +2975,7 @@ void Http2State::MemoryInfo(MemoryTracker* tracker) const { | |||
| 2975 | 2975 | } | |
| 2976 | 2976 | ||
| 2977 | 2977 | // TODO(addaleax): Remove once we're on C++17. | |
| 2978 | - constexpr FastStringKey Http2State::binding_data_name; | ||
| 2978 | + constexpr FastStringKey Http2State::type_name; | ||
| 2979 | 2979 | ||
| 2980 | 2980 | // Set up the process.binding('http2') binding. | |
| 2981 | 2981 | 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