Skip to content

Commit

Permalink
src: align PerformanceState class name with conventions
Browse files Browse the repository at this point in the history
Class names are written in UpperCamelCase. Otherwise, this looks like
it’s a variable, not a class name.

PR-URL: #32539
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and targos committed Apr 11, 2020
1 parent 78b90d9 commit e066584
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ inline const Mutex& Environment::extra_linked_bindings_mutex() const {
return extra_linked_bindings_mutex_;
}

inline performance::performance_state* Environment::performance_state() {
inline performance::PerformanceState* Environment::performance_state() {
return performance_state_.get();
}

Expand Down
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Environment::Environment(IsolateData* isolate_data,
this);

performance_state_ =
std::make_unique<performance::performance_state>(isolate());
std::make_unique<performance::PerformanceState>(isolate());
performance_state_->Mark(
performance::NODE_PERFORMANCE_MILESTONE_ENVIRONMENT);
performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_NODE_START,
Expand Down
6 changes: 3 additions & 3 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FileHandleReadWrap;
}

namespace performance {
class performance_state;
class PerformanceState;
}

namespace tracing {
Expand Down Expand Up @@ -1016,7 +1016,7 @@ class Environment : public MemoryRetainer {
inline std::vector<std::unique_ptr<fs::FileHandleReadWrap>>&
file_handle_read_wrap_freelist();

inline performance::performance_state* performance_state();
inline performance::PerformanceState* performance_state();
inline std::unordered_map<std::string, uint64_t>* performance_marks();

void CollectUVExceptionInfo(v8::Local<v8::Value> context,
Expand Down Expand Up @@ -1323,7 +1323,7 @@ class Environment : public MemoryRetainer {

AliasedInt32Array stream_base_state_;

std::unique_ptr<performance::performance_state> performance_state_;
std::unique_ptr<performance::PerformanceState> performance_state_;
std::unordered_map<std::string, uint64_t> performance_marks_;

bool has_run_bootstrapping_code_ = false;
Expand Down
6 changes: 3 additions & 3 deletions src/node_perf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const uint64_t timeOrigin = PERFORMANCE_NOW();
const double timeOriginTimestamp = GetCurrentTimeInMicroseconds();
uint64_t performance_v8_start;

void performance_state::Mark(enum PerformanceMilestone milestone,
void PerformanceState::Mark(enum PerformanceMilestone milestone,
uint64_t ts) {
this->milestones[milestone] = ts;
TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(
Expand Down Expand Up @@ -267,7 +267,7 @@ void MarkGarbageCollectionEnd(Isolate* isolate,
GCCallbackFlags flags,
void* data) {
Environment* env = static_cast<Environment*>(data);
performance_state* state = env->performance_state();
PerformanceState* state = env->performance_state();
// If no one is listening to gc performance entries, do not create them.
if (!state->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC])
return;
Expand Down Expand Up @@ -553,7 +553,7 @@ void Initialize(Local<Object> target,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
performance_state* state = env->performance_state();
PerformanceState* state = env->performance_state();

target->Set(context,
FIXED_ONE_BYTE_STRING(isolate, "observerCounts"),
Expand Down
4 changes: 2 additions & 2 deletions src/node_perf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ enum PerformanceEntryType {
NODE_PERFORMANCE_ENTRY_TYPE_INVALID
};

class performance_state {
class PerformanceState {
public:
explicit performance_state(v8::Isolate* isolate) :
explicit PerformanceState(v8::Isolate* isolate) :
root(
isolate,
sizeof(performance_state_internal)),
Expand Down

0 comments on commit e066584

Please sign in to comment.