7#include "../../third_party/inspector_protocol/crdtp/json.h"
8#include "src/inspector/protocol/Protocol.h"
15String16 serializeId(uint64_t isolateId,
int injectedScriptId,
int id) {
24 : m_isolateId(0), m_injectedScriptId(0), m_id(0) {}
27 const UChar dot =
'.';
28 size_t firstDotPos = objectId.
find(dot);
32 if (!ok)
return false;
34 size_t secondDotPos = objectId.
find(dot, firstDotPos);
36 int injectedScriptId =
37 objectId.
substring(firstDotPos, secondDotPos - firstDotPos)
39 if (!ok)
return false;
42 if (!ok)
return false;
50 std::unique_ptr<RemoteObjectId>*
result) {
51 std::unique_ptr<RemoteObjectId> remoteObjectId(
new RemoteObjectId());
52 if (!remoteObjectId->parseId(objectId))
53 return Response::ServerError(
"Invalid remote object id");
54 *
result = std::move(remoteObjectId);
55 return Response::Success();
60 return serializeId(
isolateId, injectedScriptId,
id);
64 std::unique_ptr<RemoteCallFrameId>*
result) {
66 if (!remoteCallFrameId->parseId(objectId))
67 return Response::ServerError(
"Invalid call frame id");
68 *
result = std::move(remoteCallFrameId);
69 return Response::Success();
static Response parse(const String16 &, std::unique_ptr< RemoteCallFrameId > *)
static String16 serialize(uint64_t isolateId, int injectedScriptId, int frameOrdinal)
uint64_t isolateId() const
bool parseId(const String16 &)
static Response parse(const String16 &, std::unique_ptr< RemoteObjectId > *)
static String16 serialize(uint64_t isolateId, int injectedScriptId, int id)
String16 substring(size_t pos, size_t len=UINT_MAX) const
static String16 fromInteger(int)
int toInteger(bool *ok=nullptr) const
static String16 fromInteger64(int64_t)
static String16 concat(T... args)
int64_t toInteger64(bool *ok=nullptr) const
size_t find(const String16 &str, size_t start=0) const
static const size_t kNotFound
ZoneVector< RpoNumber > & result