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"; ...@@ -35,10 +35,6 @@ const char* const kAutoplayCrossOriginMetric = "WebAudio.Autoplay.CrossOrigin";
class MockCrossOriginLocalFrameClient final : public EmptyLocalFrameClient { class MockCrossOriginLocalFrameClient final : public EmptyLocalFrameClient {
public: public:
static MockCrossOriginLocalFrameClient* Create(Frame* parent) {
return MakeGarbageCollected<MockCrossOriginLocalFrameClient>(parent);
}
explicit MockCrossOriginLocalFrameClient(Frame* parent) : parent_(parent) {} explicit MockCrossOriginLocalFrameClient(Frame* parent) : parent_(parent) {}
void Trace(blink::Visitor* visitor) override { void Trace(blink::Visitor* visitor) override {
......
...@@ -46,11 +46,7 @@ class AudioListener : public ScriptWrappable { ...@@ -46,11 +46,7 @@ class AudioListener : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
static AudioListener* Create(BaseAudioContext& context) { explicit AudioListener(BaseAudioContext&);
return MakeGarbageCollected<AudioListener>(context);
}
AudioListener(BaseAudioContext&);
~AudioListener() override; ~AudioListener() override;
// Location of the listener // Location of the listener
......
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
namespace blink { namespace blink {
AudioWorklet* AudioWorklet::Create(BaseAudioContext* context) {
return MakeGarbageCollected<AudioWorklet>(context);
}
AudioWorklet::AudioWorklet(BaseAudioContext* context) AudioWorklet::AudioWorklet(BaseAudioContext* context)
: Worklet(To<Document>(context->GetExecutionContext())), : Worklet(To<Document>(context->GetExecutionContext())),
context_(context) {} context_(context) {}
......
...@@ -24,8 +24,6 @@ class MODULES_EXPORT AudioWorklet final : public Worklet { ...@@ -24,8 +24,6 @@ class MODULES_EXPORT AudioWorklet final : public Worklet {
USING_GARBAGE_COLLECTED_MIXIN(AudioWorklet); USING_GARBAGE_COLLECTED_MIXIN(AudioWorklet);
public: public:
static AudioWorklet* Create(BaseAudioContext*);
explicit AudioWorklet(BaseAudioContext*); explicit AudioWorklet(BaseAudioContext*);
~AudioWorklet() override = default; ~AudioWorklet() override = default;
......
...@@ -35,13 +35,6 @@ ...@@ -35,13 +35,6 @@
namespace blink { namespace blink {
AudioWorkletGlobalScope* AudioWorkletGlobalScope::Create(
std::unique_ptr<GlobalScopeCreationParams> creation_params,
WorkerThread* thread) {
return MakeGarbageCollected<AudioWorkletGlobalScope>(
std::move(creation_params), thread);
}
AudioWorkletGlobalScope::AudioWorkletGlobalScope( AudioWorkletGlobalScope::AudioWorkletGlobalScope(
std::unique_ptr<GlobalScopeCreationParams> creation_params, std::unique_ptr<GlobalScopeCreationParams> creation_params,
WorkerThread* thread) WorkerThread* thread)
......
...@@ -53,10 +53,6 @@ class MODULES_EXPORT AudioWorkletGlobalScope final : public WorkletGlobalScope { ...@@ -53,10 +53,6 @@ class MODULES_EXPORT AudioWorkletGlobalScope final : public WorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
static AudioWorkletGlobalScope* Create(
std::unique_ptr<GlobalScopeCreationParams>,
WorkerThread*);
AudioWorkletGlobalScope(std::unique_ptr<GlobalScopeCreationParams>, AudioWorkletGlobalScope(std::unique_ptr<GlobalScopeCreationParams>,
WorkerThread*); WorkerThread*);
~AudioWorkletGlobalScope() override; ~AudioWorkletGlobalScope() override;
......
...@@ -67,7 +67,8 @@ WorkerOrWorkletGlobalScope* AudioWorkletThread::CreateWorkerGlobalScope( ...@@ -67,7 +67,8 @@ WorkerOrWorkletGlobalScope* AudioWorkletThread::CreateWorkerGlobalScope(
std::unique_ptr<GlobalScopeCreationParams> creation_params) { std::unique_ptr<GlobalScopeCreationParams> creation_params) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("audio-worklet"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("audio-worklet"),
"AudioWorkletThread::createWorkerGlobalScope"); "AudioWorkletThread::createWorkerGlobalScope");
return AudioWorkletGlobalScope::Create(std::move(creation_params), this); return MakeGarbageCollected<AudioWorkletGlobalScope>(
std::move(creation_params), this);
} }
} // namespace blink } // namespace blink
...@@ -120,7 +120,7 @@ void BaseAudioContext::Initialize() { ...@@ -120,7 +120,7 @@ void BaseAudioContext::Initialize() {
FFTFrame::Initialize(); FFTFrame::Initialize();
audio_worklet_ = AudioWorklet::Create(this); audio_worklet_ = MakeGarbageCollected<AudioWorklet>(this);
if (destination_node_) { if (destination_node_) {
destination_node_->Handler().Initialize(); destination_node_->Handler().Initialize();
...@@ -134,7 +134,7 @@ void BaseAudioContext::Initialize() { ...@@ -134,7 +134,7 @@ void BaseAudioContext::Initialize() {
// The AudioParams in the listener need access to the destination node, so // The AudioParams in the listener need access to the destination node, so
// only create the listener if the destination node exists. // 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