#ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_CACHED_STRING_H_
#define ELECTRON_SHELL_COMMON_GIN_HELPER_CACHED_STRING_H_
#include <string>
#include <string_view>
#include "v8/include/v8-forward.h"
#include "v8/include/v8-traced-handle.h"
namespace cppgc {
class Visitor;
}
namespace gin_helper {
class CachedString {
public:
CachedString();
~CachedString();
CachedString(const CachedString&) = delete;
CachedString& operator=(const CachedString&) = delete;
v8::Local<v8::String> Get(v8::Isolate* isolate, std::string_view value);
void Trace(cppgc::Visitor* visitor) const;
private:
std::string value_;
v8::TracedReference<v8::String> handle_;
};
}
#endif