Revert "inspector: teach v8Inspector to return default context"
This reverts commit 22cb8d45c3
.
Reason for revert: it is fundamentally wrong to fetch default
frame context using contextGroupId: contextGroupId is per page rather
then per frame.
Original change's description:
> inspector: teach v8Inspector to return default context
>
> This is a follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/1173718
>
> R=kozy, pfeldman
> TBR=pfeldman
>
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I48b4ca5589505d03773477623654fa54703f0714
> Reviewed-on: https://chromium-review.googlesource.com/1175061
> Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55133}
TBR=lushnikov@chromium.org,pfeldman@chromium.org,kozyatinskiy@chromium.org
NOTRY=true
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ide4246bfe75ccc8a4fb1f0c5dbc44ae4236cac5c
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/c/1419082
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58906}
This commit is contained in:
parent
1b41a5fdf0
commit
8665bac17a
@ -245,8 +245,7 @@ class V8_EXPORT V8Inspector {
|
|||||||
virtual void contextCreated(const V8ContextInfo&) = 0;
|
virtual void contextCreated(const V8ContextInfo&) = 0;
|
||||||
virtual void contextDestroyed(v8::Local<v8::Context>) = 0;
|
virtual void contextDestroyed(v8::Local<v8::Context>) = 0;
|
||||||
virtual void resetContextGroup(int contextGroupId) = 0;
|
virtual void resetContextGroup(int contextGroupId) = 0;
|
||||||
virtual v8::MaybeLocal<v8::Context> contextById(int groupId,
|
virtual v8::MaybeLocal<v8::Context> contextById(int contextId) = 0;
|
||||||
v8::Maybe<int> contextId) = 0;
|
|
||||||
|
|
||||||
// Various instrumentation.
|
// Various instrumentation.
|
||||||
virtual void idleStarted() = 0;
|
virtual void idleStarted() = 0;
|
||||||
|
@ -188,14 +188,8 @@ InspectedContext* V8InspectorImpl::getContext(int contextId) const {
|
|||||||
return getContext(contextGroupId(contextId), contextId);
|
return getContext(contextGroupId(contextId), contextId);
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::MaybeLocal<v8::Context> V8InspectorImpl::contextById(
|
v8::MaybeLocal<v8::Context> V8InspectorImpl::contextById(int contextId) {
|
||||||
int groupId, v8::Maybe<int> contextId) {
|
InspectedContext* context = getContext(contextId);
|
||||||
if (contextId.IsNothing()) {
|
|
||||||
v8::Local<v8::Context> context =
|
|
||||||
client()->ensureDefaultContextInGroup(groupId);
|
|
||||||
return context.IsEmpty() ? v8::MaybeLocal<v8::Context>() : context;
|
|
||||||
}
|
|
||||||
InspectedContext* context = getContext(contextId.FromJust());
|
|
||||||
return context ? context->context() : v8::MaybeLocal<v8::Context>();
|
return context ? context->context() : v8::MaybeLocal<v8::Context>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,8 +79,7 @@ class V8InspectorImpl : public V8Inspector {
|
|||||||
const StringView& state) override;
|
const StringView& state) override;
|
||||||
void contextCreated(const V8ContextInfo&) override;
|
void contextCreated(const V8ContextInfo&) override;
|
||||||
void contextDestroyed(v8::Local<v8::Context>) override;
|
void contextDestroyed(v8::Local<v8::Context>) override;
|
||||||
v8::MaybeLocal<v8::Context> contextById(int groupId,
|
v8::MaybeLocal<v8::Context> contextById(int contextId) override;
|
||||||
v8::Maybe<int> contextId) override;
|
|
||||||
void contextCollected(int contextGroupId, int contextId);
|
void contextCollected(int contextGroupId, int contextId);
|
||||||
void resetContextGroup(int contextGroupId) override;
|
void resetContextGroup(int contextGroupId) override;
|
||||||
void idleStarted() override;
|
void idleStarted() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user