Commit 0b8c45ff authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

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

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/serial, 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: I8fd18e5e047eadc90fd26652bfa180fad97314c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1557661Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#648595}
parent b370b729
...@@ -35,7 +35,8 @@ NavigatorSerial::NavigatorSerial(Navigator& navigator) ...@@ -35,7 +35,8 @@ NavigatorSerial::NavigatorSerial(Navigator& navigator)
: Supplement<Navigator>(navigator) { : Supplement<Navigator>(navigator) {
if (navigator.GetFrame()) { if (navigator.GetFrame()) {
DCHECK(navigator.GetFrame()->GetDocument()); DCHECK(navigator.GetFrame()->GetDocument());
serial_ = Serial::Create(*navigator.GetFrame()->GetDocument()); serial_ =
MakeGarbageCollected<Serial>(*navigator.GetFrame()->GetDocument());
} }
} }
......
...@@ -34,11 +34,6 @@ String TokenToString(const base::UnguessableToken& token) { ...@@ -34,11 +34,6 @@ String TokenToString(const base::UnguessableToken& token) {
} // namespace } // namespace
// static
Serial* Serial::Create(ExecutionContext& execution_context) {
return MakeGarbageCollected<Serial>(execution_context);
}
Serial::Serial(ExecutionContext& execution_context) Serial::Serial(ExecutionContext& execution_context)
: ContextLifecycleObserver(&execution_context) {} : ContextLifecycleObserver(&execution_context) {}
......
...@@ -28,8 +28,6 @@ class Serial final : public EventTargetWithInlineData, ...@@ -28,8 +28,6 @@ class Serial final : public EventTargetWithInlineData,
USING_GARBAGE_COLLECTED_MIXIN(Serial); USING_GARBAGE_COLLECTED_MIXIN(Serial);
public: public:
static Serial* Create(ExecutionContext& executionContext);
explicit Serial(ExecutionContext&); explicit Serial(ExecutionContext&);
// EventTarget // EventTarget
......
...@@ -33,7 +33,7 @@ Serial* WorkerNavigatorSerial::serial(ScriptState* script_state) { ...@@ -33,7 +33,7 @@ Serial* WorkerNavigatorSerial::serial(ScriptState* script_state) {
// TODO(https://crbug.com/839117): Remove this check once the Exposed // TODO(https://crbug.com/839117): Remove this check once the Exposed
// attribute is fixed to only expose this property in dedicated workers. // attribute is fixed to only expose this property in dedicated workers.
if (execution_context->IsDedicatedWorkerGlobalScope()) if (execution_context->IsDedicatedWorkerGlobalScope())
serial_ = Serial::Create(*execution_context); serial_ = MakeGarbageCollected<Serial>(*execution_context);
} }
return serial_; return serial_;
} }
......
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