Commit 95e14d64 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

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

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/netinfo, 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: Ica09e05246b9a8e830498c4fb2c5be5d836d59b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1556958Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#648583}
parent 8b4142d2
...@@ -42,7 +42,7 @@ NetworkInformation* NavigatorNetworkInformation::connection( ...@@ -42,7 +42,7 @@ NetworkInformation* NavigatorNetworkInformation::connection(
NetworkInformation* NavigatorNetworkInformation::connection() { NetworkInformation* NavigatorNetworkInformation::connection() {
if (!connection_ && GetFrame()) { if (!connection_ && GetFrame()) {
DCHECK(GetFrame()->DomWindow()); DCHECK(GetFrame()->DomWindow());
connection_ = NetworkInformation::Create( connection_ = MakeGarbageCollected<NetworkInformation>(
GetFrame()->DomWindow()->GetExecutionContext()); GetFrame()->DomWindow()->GetExecutionContext());
} }
return connection_.Get(); return connection_.Get();
......
...@@ -73,10 +73,6 @@ String GetConsoleLogStringForWebHoldback() { ...@@ -73,10 +73,6 @@ String GetConsoleLogStringForWebHoldback() {
} // namespace } // namespace
NetworkInformation* NetworkInformation::Create(ExecutionContext* context) {
return MakeGarbageCollected<NetworkInformation>(context);
}
NetworkInformation::~NetworkInformation() { NetworkInformation::~NetworkInformation() {
DCHECK(!IsObserving()); DCHECK(!IsObserving());
} }
......
...@@ -27,8 +27,6 @@ class NetworkInformation final ...@@ -27,8 +27,6 @@ class NetworkInformation final
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
public: public:
static NetworkInformation* Create(ExecutionContext*);
explicit NetworkInformation(ExecutionContext*); explicit NetworkInformation(ExecutionContext*);
~NetworkInformation() override; ~NetworkInformation() override;
......
...@@ -57,7 +57,7 @@ NetworkInformation* WorkerNavigatorNetworkInformation::connection( ...@@ -57,7 +57,7 @@ NetworkInformation* WorkerNavigatorNetworkInformation::connection(
ExecutionContext* context) { ExecutionContext* context) {
DCHECK(context); DCHECK(context);
if (!connection_) if (!connection_)
connection_ = NetworkInformation::Create(context); connection_ = MakeGarbageCollected<NetworkInformation>(context);
return connection_.Get(); return connection_.Get();
} }
......
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