diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 7960a56f54..d4102f5c6c 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -1741,7 +1741,9 @@ domain Runtime event executionContextDestroyed parameters # Id of the destroyed context - ExecutionContextId executionContextId + deprecated ExecutionContextId executionContextId + # Unique Id of the destroyed context + experimental string executionContextUniqueId # Issued when all executionContexts were cleared in browser event executionContextsCleared diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc index 5cb582c0bf..9a1a845487 100644 --- a/src/inspector/v8-runtime-agent-impl.cc +++ b/src/inspector/v8-runtime-agent-impl.cc @@ -997,7 +997,8 @@ void V8RuntimeAgentImpl::reportExecutionContextDestroyed( InspectedContext* context) { if (m_enabled && context->isReported(m_session->sessionId())) { context->setReported(m_session->sessionId(), false); - m_frontend.executionContextDestroyed(context->contextId()); + m_frontend.executionContextDestroyed(context->contextId(), + context->uniqueId().toString()); } } diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js index d45ea22baf..a5e9505b82 100644 --- a/test/inspector/protocol-test.js +++ b/test/inspector/protocol-test.js @@ -36,7 +36,8 @@ InspectorTest.logMessage = function(originalMessage) { const nonStableFields = new Set([ 'objectId', 'scriptId', 'exceptionId', 'timestamp', 'executionContextId', 'callFrameId', 'breakpointId', 'bindRemoteObjectFunctionId', - 'formatterObjectId', 'debuggerId', 'bodyGetterId', 'uniqueId' + 'formatterObjectId', 'debuggerId', 'bodyGetterId', 'uniqueId', + 'executionContextUniqueId' ]); const message = JSON.parse(JSON.stringify(originalMessage, replacer.bind(null, Symbol(), nonStableFields))); if (message.id) diff --git a/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt b/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt index 9a5e1708c1..381cf88c2e 100644 --- a/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt +++ b/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt @@ -3,5 +3,6 @@ Tests that contextDesrtoyed nofitication is fired when context is collected. method : Runtime.executionContextDestroyed params : { executionContextId : + executionContextUniqueId : } } diff --git a/test/inspector/sessions/create-session-expected.txt b/test/inspector/sessions/create-session-expected.txt index 4459f4d19c..b8f9c5f828 100644 --- a/test/inspector/sessions/create-session-expected.txt +++ b/test/inspector/sessions/create-session-expected.txt @@ -70,6 +70,7 @@ From session 2 method : Runtime.executionContextDestroyed params : { executionContextId : + executionContextUniqueId : } } id matching: true @@ -78,6 +79,7 @@ From session 1 method : Runtime.executionContextDestroyed params : { executionContextId : + executionContextUniqueId : } } id matching: true @@ -86,6 +88,7 @@ From session 3 method : Runtime.executionContextDestroyed params : { executionContextId : + executionContextUniqueId : } } id matching: true