/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/inspector/network_resource_manager.cc
29 строк
731 B
Shima Ryuhei
inspector: initial support for Network.loadNetworkResource
10 июл 2025, 15:34
Не верифицирован
10 июл 2025, 15:34
b7db89f
Код
Авторство
О чём код?
#include "inspector/network_resource_manager.h" #include <atomic> #include <iostream> #include <string> #include <unordered_map> namespace node { namespace inspector { void NetworkResourceManager::Put(const std::string& url, const std::string& data) { Mutex::ScopedLock lock(mutex_); resources_[url] = data; } std::string NetworkResourceManager::Get(const std::string& url) { Mutex::ScopedLock lock(mutex_); auto it = resources_.find(url); if (it != resources_.end()) return it->second; return {}; } void NetworkResourceManager::Erase(const std::string& stream_id) { Mutex::ScopedLock lock(mutex_); resources_.erase(stream_id); } } // namespace inspector } // namespace node