Commit 089aac9d authored by Hongchan Choi's avatar Hongchan Choi Committed by Commit Bot

Rename DidDestroy* to WillDestroy* for BaseAudioContext devtool event

"DidDestroy" was never true because we can't notify anything from
the GC-managed object destruction. "WillDestroy" means that it is
marked for GC and will go away sometime in the future.

This is a preview of the new event pattern for the WebAudio DevTool.
A series of CLs to implement the graph event will use this pattern
to notify the lifecycle event.

There's no functional change in this CL.

Bug: 970898
Change-Id: Ic359d4ca5a3c69fd5e85ce135fa2a3de881b83bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1724815
Commit-Queue: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681926}
parent e2d6cb06
......@@ -44,13 +44,13 @@ void AudioGraphTracer::DidCreateBaseAudioContext(
inspector_agent_->DidCreateBaseAudioContext(context);
}
void AudioGraphTracer::DidDestroyBaseAudioContext(
void AudioGraphTracer::WillDestroyBaseAudioContext(
BaseAudioContext* context) {
DCHECK(contexts_.Contains(context));
contexts_.erase(context);
if (inspector_agent_)
inspector_agent_->DidDestroyBaseAudioContext(context);
inspector_agent_->WillDestroyBaseAudioContext(context);
}
void AudioGraphTracer::DidChangeBaseAudioContext(
......
......@@ -34,11 +34,10 @@ class MODULES_EXPORT AudioGraphTracer final
void SetInspectorAgent(InspectorWebAudioAgent*);
// Notify an associated inspector agent when a BaseAudioContext is created.
// Graph events: notifies an associated inspector agent about object
// lifecycle of BaseAudioContext.
void DidCreateBaseAudioContext(BaseAudioContext*);
// Notify an associated inspector agent when a BaseAudioContext is destroyed.
void DidDestroyBaseAudioContext(BaseAudioContext*);
void WillDestroyBaseAudioContext(BaseAudioContext*);
// Notify an associated inspector agent when a BaseAudioContext is changed.
void DidChangeBaseAudioContext(BaseAudioContext*);
......
......@@ -156,7 +156,7 @@ void BaseAudioContext::Uninitialize() {
// may use destination-related data (e.g. sample rate and channel count)
// to populate the devtool protocol object.
if (GraphTracer())
GraphTracer()->DidDestroyBaseAudioContext(this);
GraphTracer()->WillDestroyBaseAudioContext(this);
// This stops the audio thread and all audio rendering.
if (destination_node_)
......
......@@ -105,7 +105,7 @@ void InspectorWebAudioAgent::DidCreateBaseAudioContext(
GetFrontend()->contextCreated(BuildProtocolContext(context));
}
void InspectorWebAudioAgent::DidDestroyBaseAudioContext(
void InspectorWebAudioAgent::WillDestroyBaseAudioContext(
BaseAudioContext* context) {
GetFrontend()->contextDestroyed(context->Uuid());
}
......
......@@ -35,7 +35,7 @@ class MODULES_EXPORT InspectorWebAudioAgent final
// API for InspectorInstrumentation (modules/webaudio -> agent)
void DidCreateBaseAudioContext(BaseAudioContext*);
void DidDestroyBaseAudioContext(BaseAudioContext*);
void WillDestroyBaseAudioContext(BaseAudioContext*);
void DidChangeBaseAudioContext(BaseAudioContext*);
void Trace(blink::Visitor*) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment