Skip to content

Commit cfc7adf

Browse files
committed
feat: Re-add V8 inspector sources
These were removed in the upgrade to V8 10.3.22. Re-add them.
1 parent d7d3d27 commit cfc7adf

File tree

146 files changed

+26770
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+26770
-1
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// This file is generated by Exported_h.template.
2+
3+
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
#ifndef v8_inspector_protocol_Debugger_api_h
8+
#define v8_inspector_protocol_Debugger_api_h
9+
10+
#include "v8-inspector.h"
11+
12+
namespace v8_inspector {
13+
namespace protocol {
14+
15+
#ifndef v8_inspector_protocol_exported_api_h
16+
#define v8_inspector_protocol_exported_api_h
17+
class V8_EXPORT Exported {
18+
public:
19+
virtual void AppendSerialized(std::vector<uint8_t>* out) const = 0;
20+
21+
virtual ~Exported() { }
22+
};
23+
#endif // !defined(v8_inspector_protocol_exported_api_h)
24+
25+
namespace Debugger {
26+
namespace API {
27+
28+
// ------------- Enums.
29+
30+
namespace Paused {
31+
namespace ReasonEnum {
32+
V8_EXPORT extern const char* Ambiguous;
33+
V8_EXPORT extern const char* Assert;
34+
V8_EXPORT extern const char* CSPViolation;
35+
V8_EXPORT extern const char* DebugCommand;
36+
V8_EXPORT extern const char* DOM;
37+
V8_EXPORT extern const char* EventListener;
38+
V8_EXPORT extern const char* Exception;
39+
V8_EXPORT extern const char* Instrumentation;
40+
V8_EXPORT extern const char* OOM;
41+
V8_EXPORT extern const char* Other;
42+
V8_EXPORT extern const char* PromiseRejection;
43+
V8_EXPORT extern const char* XHR;
44+
} // ReasonEnum
45+
} // Paused
46+
47+
// ------------- Types.
48+
49+
class V8_EXPORT SearchMatch : public Exported {
50+
public:
51+
static std::unique_ptr<protocol::Debugger::API::SearchMatch> fromBinary(const uint8_t* data, size_t length);
52+
};
53+
54+
} // namespace API
55+
} // namespace Debugger
56+
} // namespace v8_inspector
57+
} // namespace protocol
58+
59+
#endif // !defined(v8_inspector_protocol_Debugger_api_h)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// This file is generated by Exported_h.template.
2+
3+
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
#ifndef v8_inspector_protocol_Runtime_api_h
8+
#define v8_inspector_protocol_Runtime_api_h
9+
10+
#include "v8-inspector.h"
11+
12+
namespace v8_inspector {
13+
namespace protocol {
14+
15+
#ifndef v8_inspector_protocol_exported_api_h
16+
#define v8_inspector_protocol_exported_api_h
17+
class V8_EXPORT Exported {
18+
public:
19+
virtual void AppendSerialized(std::vector<uint8_t>* out) const = 0;
20+
21+
virtual ~Exported() { }
22+
};
23+
#endif // !defined(v8_inspector_protocol_exported_api_h)
24+
25+
namespace Runtime {
26+
namespace API {
27+
28+
// ------------- Enums.
29+
30+
// ------------- Types.
31+
32+
class V8_EXPORT RemoteObject : public Exported {
33+
public:
34+
static std::unique_ptr<protocol::Runtime::API::RemoteObject> fromBinary(const uint8_t* data, size_t length);
35+
};
36+
37+
class V8_EXPORT StackTrace : public Exported {
38+
public:
39+
static std::unique_ptr<protocol::Runtime::API::StackTrace> fromBinary(const uint8_t* data, size_t length);
40+
};
41+
42+
class V8_EXPORT StackTraceId : public Exported {
43+
public:
44+
static std::unique_ptr<protocol::Runtime::API::StackTraceId> fromBinary(const uint8_t* data, size_t length);
45+
};
46+
47+
} // namespace API
48+
} // namespace Runtime
49+
} // namespace v8_inspector
50+
} // namespace protocol
51+
52+
#endif // !defined(v8_inspector_protocol_Runtime_api_h)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// This file is generated by Exported_h.template.
2+
3+
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style license that can be
5+
// found in the LICENSE file.
6+
7+
#ifndef v8_inspector_protocol_Schema_api_h
8+
#define v8_inspector_protocol_Schema_api_h
9+
10+
#include "v8-inspector.h"
11+
12+
namespace v8_inspector {
13+
namespace protocol {
14+
15+
#ifndef v8_inspector_protocol_exported_api_h
16+
#define v8_inspector_protocol_exported_api_h
17+
class V8_EXPORT Exported {
18+
public:
19+
virtual void AppendSerialized(std::vector<uint8_t>* out) const = 0;
20+
21+
virtual ~Exported() { }
22+
};
23+
#endif // !defined(v8_inspector_protocol_exported_api_h)
24+
25+
namespace Schema {
26+
namespace API {
27+
28+
// ------------- Enums.
29+
30+
// ------------- Types.
31+
32+
class V8_EXPORT Domain : public Exported {
33+
public:
34+
static std::unique_ptr<protocol::Schema::API::Domain> fromBinary(const uint8_t* data, size_t length);
35+
};
36+
37+
} // namespace API
38+
} // namespace Schema
39+
} // namespace v8_inspector
40+
} // namespace protocol
41+
42+
#endif // !defined(v8_inspector_protocol_Schema_api_h)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright 2018 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#ifndef V8_BASE_ADDRESS_REGION_H_
6+
#define V8_BASE_ADDRESS_REGION_H_
7+
8+
#include <iostream>
9+
10+
#include "src/base/macros.h"
11+
12+
namespace v8 {
13+
namespace base {
14+
15+
// Helper class representing an address region of certain size.
16+
class AddressRegion {
17+
public:
18+
// Function object that compares the start address of two regions. Usable as
19+
// compare function on std data structures and algorithms.
20+
struct StartAddressLess {
21+
bool operator()(base::AddressRegion a, base::AddressRegion b) const {
22+
return a.begin() < b.begin();
23+
}
24+
};
25+
26+
using Address = uintptr_t;
27+
28+
constexpr AddressRegion() = default;
29+
30+
constexpr AddressRegion(Address address, size_t size)
31+
: address_(address), size_(size) {}
32+
33+
Address begin() const { return address_; }
34+
Address end() const { return address_ + size_; }
35+
36+
size_t size() const { return size_; }
37+
void set_size(size_t size) { size_ = size; }
38+
39+
bool is_empty() const { return size_ == 0; }
40+
41+
bool contains(Address address) const {
42+
STATIC_ASSERT(std::is_unsigned<Address>::value);
43+
return (address - begin()) < size();
44+
}
45+
46+
bool contains(Address address, size_t size) const {
47+
STATIC_ASSERT(std::is_unsigned<Address>::value);
48+
Address offset = address - begin();
49+
return (offset < size_) && (offset + size <= size_);
50+
}
51+
52+
bool contains(AddressRegion region) const {
53+
return contains(region.address_, region.size_);
54+
}
55+
56+
base::AddressRegion GetOverlap(AddressRegion region) const {
57+
Address overlap_start = std::max(begin(), region.begin());
58+
Address overlap_end =
59+
std::max(overlap_start, std::min(end(), region.end()));
60+
return {overlap_start, overlap_end - overlap_start};
61+
}
62+
63+
bool operator==(AddressRegion other) const {
64+
return address_ == other.address_ && size_ == other.size_;
65+
}
66+
67+
bool operator!=(AddressRegion other) const {
68+
return address_ != other.address_ || size_ != other.size_;
69+
}
70+
71+
private:
72+
Address address_ = 0;
73+
size_t size_ = 0;
74+
};
75+
ASSERT_TRIVIALLY_COPYABLE(AddressRegion);
76+
77+
// Construct an AddressRegion from anything providing a {data()} and {size()}
78+
// accessor.
79+
template <typename Container,
80+
typename = decltype(std::declval<Container>().data()),
81+
typename = decltype(std::declval<Container>().size())>
82+
inline constexpr AddressRegion AddressRegionOf(Container&& c) {
83+
return AddressRegion{reinterpret_cast<AddressRegion::Address>(c.data()),
84+
sizeof(*c.data()) * c.size()};
85+
}
86+
87+
inline std::ostream& operator<<(std::ostream& out, AddressRegion region) {
88+
return out << "[" << reinterpret_cast<void*>(region.begin()) << "+"
89+
<< region.size() << "]";
90+
}
91+
92+
} // namespace base
93+
} // namespace v8
94+
95+
#endif // V8_BASE_ADDRESS_REGION_H_

0 commit comments

Comments
 (0)