Skip to content

Commit 6cb055b

Browse files
committed
fix test
1 parent 67bc93b commit 6cb055b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/inspector/dom_storage_agent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class DOMStorageAgent : public protocol::DOMStorage::Backend,
5151

5252
private:
5353
std::unique_ptr<protocol::DOMStorage::Frontend> frontend_;
54-
std::unordered_map<std::string, std::string> local_storage_map_;
55-
std::unordered_map<std::string, std::string> session_storage_map_;
56-
bool enabled_;
54+
std::unordered_map<std::string, std::string> local_storage_map_ = {};
55+
std::unordered_map<std::string, std::string> session_storage_map_ = {};
56+
bool enabled_ = false;
5757
Environment* env_;
5858
};
5959

src/inspector/notification_emitter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ namespace inspector {
88
NotificationEmitter::NotificationEmitter() {}
99

1010
void NotificationEmitter::emitNotification(v8::Local<v8::Context> context,
11-
const std::string& event,
11+
const EventKey& event,
1212
v8::Local<v8::Object> params) {
1313
auto it = event_notifier_map_.find(event);
1414
if (it != event_notifier_map_.end()) {
1515
(this->*(it->second))(context, params);
1616
}
1717
}
1818

19-
void NotificationEmitter::addEventNotifier(const protocol::String& event,
19+
void NotificationEmitter::addEventNotifier(const EventKey& event,
2020
EventNotifier notifier) {
2121
event_notifier_map_[event] = notifier;
2222
}

src/inspector/notification_emitter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33

44
#include <string>
55
#include <unordered_map>
6-
#include "node/inspector/protocol/Protocol.h"
76
#include "v8.h"
87

98
namespace node {
109
namespace inspector {
1110

1211
class NotificationEmitter {
1312
public:
13+
using EventKey = std::string;
1414
using EventNotifier = void (NotificationEmitter::*)(
1515
v8::Local<v8::Context> context, v8::Local<v8::Object>);
1616
NotificationEmitter();
1717
virtual ~NotificationEmitter() = default;
1818

1919
void emitNotification(v8::Local<v8::Context> context,
20-
const protocol::String& event,
20+
const EventKey& event,
2121
v8::Local<v8::Object> params);
2222
virtual bool canEmit(const std::string& domain) = 0;
2323

2424
NotificationEmitter(const NotificationEmitter&) = delete;
2525
NotificationEmitter& operator=(const NotificationEmitter&) = delete;
2626

2727
protected:
28-
void addEventNotifier(const protocol::String& event, EventNotifier notifier);
28+
void addEventNotifier(const EventKey& event, EventNotifier notifier);
2929

3030
private:
31-
std::unordered_map<protocol::String, EventNotifier> event_notifier_map_;
31+
std::unordered_map<EventKey, EventNotifier> event_notifier_map_ = {};
3232
};
3333

3434
} // namespace inspector

0 commit comments

Comments
 (0)