Commit 39f10322 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Remove Create() methods which use MakeGarbageCollected<> in modules/webaudio

As advised in [1], this CL removes unnecessary Foo::Create() factory functions
which return an instance created by MakeGarbageCollected<Foo> in
//third_party/blink/renderer/modules/webaudio, then this CL makes
the callers use MakeGarbageCollected<Foo> instead of Foo::Create() factory
functions.

[1] https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/iJ1bawbxbWs/vEdfT5QtBgAJ

Bug: 939691
Change-Id: I0556290c2f89e7210aecc9644490344145b3a4d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1556661Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#648657}
parent 8d7d3c73
......@@ -35,10 +35,6 @@ const char* const kAutoplayCrossOriginMetric = "WebAudio.Autoplay.CrossOrigin";
class MockCrossOriginLocalFrameClient final : public EmptyLocalFrameClient {
public:
static MockCrossOriginLocalFrameClient* Create(Frame* parent) {
return MakeGarbageCollected<MockCrossOriginLocalFrameClient>(parent);
}
explicit MockCrossOriginLocalFrameClient(Frame* parent) : parent_(parent) {}
void Trace(blink::Visitor* visitor) override {
......
......@@ -46,11 +46,7 @@ class AudioListener : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static AudioListener* Create(BaseAudioContext& context) {
return MakeGarbageCollected<AudioListener>(context);
}
AudioListener(BaseAudioContext&);
explicit AudioListener(BaseAudioContext&);
~AudioListener() override;
// Location of the listener
......
......@@ -16,10 +16,6 @@
namespace blink {
AudioWorklet* AudioWorklet::Create(BaseAudioContext* context) {
return MakeGarbageCollected<AudioWorklet>(context);
}
AudioWorklet::AudioWorklet(BaseAudioContext* context)
: Worklet(To<Document>(context->GetExecutionContext())),
context_(context) {}
......
......@@ -24,8 +24,6 @@ class MODULES_EXPORT AudioWorklet final : public Worklet {
USING_GARBAGE_COLLECTED_MIXIN(AudioWorklet);
public:
static AudioWorklet* Create(BaseAudioContext*);
explicit AudioWorklet(BaseAudioContext*);
~AudioWorklet() override = default;
......
......@@ -35,13 +35,6 @@
namespace blink {
AudioWorkletGlobalScope* AudioWorkletGlobalScope::Create(
std::unique_ptr<GlobalScopeCreationParams> creation_params,
WorkerThread* thread) {
return MakeGarbageCollected<AudioWorkletGlobalScope>(
std::move(creation_params), thread);
}
AudioWorkletGlobalScope::AudioWorkletGlobalScope(
std::unique_ptr<GlobalScopeCreationParams> creation_params,
WorkerThread* thread)
......
......@@ -53,10 +53,6 @@ class MODULES_EXPORT AudioWorkletGlobalScope final : public WorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
public:
static AudioWorkletGlobalScope* Create(
std::unique_ptr<GlobalScopeCreationParams>,
WorkerThread*);
AudioWorkletGlobalScope(std::unique_ptr<GlobalScopeCreationParams>,
WorkerThread*);
~AudioWorkletGlobalScope() override;
......
......@@ -67,7 +67,8 @@ WorkerOrWorkletGlobalScope* AudioWorkletThread::CreateWorkerGlobalScope(
std::unique_ptr<GlobalScopeCreationParams> creation_params) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("audio-worklet"),
"AudioWorkletThread::createWorkerGlobalScope");
return AudioWorkletGlobalScope::Create(std::move(creation_params), this);
return MakeGarbageCollected<AudioWorkletGlobalScope>(
std::move(creation_params), this);
}
} // namespace blink
......@@ -120,7 +120,7 @@ void BaseAudioContext::Initialize() {
FFTFrame::Initialize();
audio_worklet_ = AudioWorklet::Create(this);
audio_worklet_ = MakeGarbageCollected<AudioWorklet>(this);
if (destination_node_) {
destination_node_->Handler().Initialize();
......@@ -134,7 +134,7 @@ void BaseAudioContext::Initialize() {
// The AudioParams in the listener need access to the destination node, so
// only create the listener if the destination node exists.
listener_ = AudioListener::Create(*this);
listener_ = MakeGarbageCollected<AudioListener>(*this);
}
}
......
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