File tree Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Open diff view settings
Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Open diff view settings
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
422422binding functions access to an object for storing such state.
423423That object is always a [`BaseObject`][].
424424
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
426426constant string, in order to disambiguate it from other classes of this type,
427427and which could e.g. match the binding’s name (in the example above, that would
428428be `cares_wrap`).
@@ -433,7 +433,7 @@ class BindingData : public BaseObject {
433433 public:
434434 BindingData(Environment* env, Local<Object> obj) : BaseObject(env, obj) {}
435435
436- static constexpr FastStringKey binding_data_name { "http_parser" };
436+ static constexpr FastStringKey type_name { "http_parser" };
437437
438438 std::vector<char> parser_buffer;
439439 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) {
358358 context->GetAlignedPointerFromEmbedderData (
359359 ContextEmbedderIndex::kBindingListIndex ));
360360 DCHECK_NOT_NULL (map);
361- auto it = map->find (T::binding_data_name );
361+ auto it = map->find (T::type_name );
362362 if (UNLIKELY (it == map->end ())) return nullptr ;
363363 T* result = static_cast <T*>(it->second .get ());
364364 DCHECK_NOT_NULL (result);
@@ -377,7 +377,7 @@ inline T* Environment::AddBindingData(
377377 context->GetAlignedPointerFromEmbedderData (
378378 ContextEmbedderIndex::kBindingListIndex ));
379379 DCHECK_NOT_NULL (map);
380- auto result = map->emplace (T::binding_data_name , item);
380+ auto result = map->emplace (T::type_name , item);
381381 CHECK (result.second );
382382 DCHECK_EQ (GetBindingData<T>(context), item.get ());
383383 return item.get ();
Original file line number Diff line number Diff line change @@ -2399,7 +2399,7 @@ void BindingData::MemoryInfo(MemoryTracker* tracker) const {
23992399}
24002400
24012401// TODO(addaleax): Remove once we're on C++17.
2402- constexpr FastStringKey BindingData::binding_data_name ;
2402+ constexpr FastStringKey BindingData::type_name ;
24032403
24042404void Initialize (Local<Object> target,
24052405 Local<Value> unused,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class BindingData : public BaseObject {
2727 std::vector<BaseObjectPtr<FileHandleReadWrap>>
2828 file_handle_read_wrap_freelist;
2929
30- static constexpr FastStringKey binding_data_name { " fs" };
30+ static constexpr FastStringKey type_name { " fs" };
3131
3232 void MemoryInfo (MemoryTracker* tracker) const override ;
3333 SET_SELF_SIZE (BindingData)
Original file line number Diff line number Diff line change @@ -3001,7 +3001,7 @@ void Http2State::MemoryInfo(MemoryTracker* tracker) const {
30013001}
30023002
30033003// TODO(addaleax): Remove once we're on C++17.
3004- constexpr FastStringKey Http2State::binding_data_name ;
3004+ constexpr FastStringKey Http2State::type_name ;
30053005
30063006// Set up the process.binding('http2') binding.
30073007void Initialize (Local<Object> target,
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ class Http2State : public BaseObject {
127127 SET_SELF_SIZE (Http2State)
128128 SET_MEMORY_INFO_NAME(Http2State)
129129
130- static constexpr FastStringKey binding_data_name { " http2" };
130+ static constexpr FastStringKey type_name { " http2" };
131131
132132 private:
133133 struct http2_state_internal {
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class BindingData : public BaseObject {
8888 BindingData (Environment* env, Local<Object> obj)
8989 : BaseObject(env, obj) {}
9090
91- static constexpr FastStringKey binding_data_name { " http_parser" };
91+ static constexpr FastStringKey type_name { " http_parser" };
9292
9393 std::vector<char > parser_buffer;
9494 bool parser_buffer_in_use = false ;
@@ -101,7 +101,7 @@ class BindingData : public BaseObject {
101101};
102102
103103// TODO(addaleax): Remove once we're on C++17.
104- constexpr FastStringKey BindingData::binding_data_name ;
104+ constexpr FastStringKey BindingData::type_name ;
105105
106106// helper class for the Parser
107107struct StringPtr {
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ class BindingData : public BaseObject {
9595 heap_code_statistics_buffer(env->isolate (),
9696 kHeapCodeStatisticsPropertiesCount) {}
9797
98- static constexpr FastStringKey binding_data_name { " v8" };
98+ static constexpr FastStringKey type_name { " v8" };
9999
100100 AliasedFloat64Array heap_statistics_buffer;
101101 AliasedFloat64Array heap_space_statistics_buffer;
@@ -113,7 +113,7 @@ class BindingData : public BaseObject {
113113};
114114
115115// TODO(addaleax): Remove once we're on C++17.
116- constexpr FastStringKey BindingData::binding_data_name ;
116+ constexpr FastStringKey BindingData::type_name ;
117117
118118void CachedDataVersionTag (const FunctionCallbackInfo<Value>& args) {
119119 Environment* env = Environment::GetCurrent (args);
You can’t perform that action at this time.
0 commit comments