Clean up unnecessary Create() factory functions in platform/bindings

As advised in [1], this CL removes unnecessary Foo::Create() in
//third_party/blink/renderer/platform/bindings and make their constructors
public, then make the callers use std::make_unique<Foo> instead
of their Create() factory functions.

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

Bug: 939691
Change-Id: I0a28a2b8ce259313b6e2c55ed69d6d52eb36437d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525767
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#641154}
diff --git a/third_party/blink/renderer/bindings/core/v8/v0_custom_element_constructor_builder.cc b/third_party/blink/renderer/bindings/core/v8/v0_custom_element_constructor_builder.cc
index 2c848e5..7c59689 100644
--- a/third_party/blink/renderer/bindings/core/v8/v0_custom_element_constructor_builder.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v0_custom_element_constructor_builder.cc
@@ -312,8 +312,8 @@
 bool V0CustomElementConstructorBuilder::DidRegisterDefinition() const {
   DCHECK(!constructor_.IsEmpty());
 
-  return callbacks_->SetBinding(
-      V0CustomElementBinding::Create(script_state_->GetIsolate(), prototype_));
+  return callbacks_->SetBinding(std::make_unique<V0CustomElementBinding>(
+      script_state_->GetIsolate(), prototype_));
 }
 
 ScriptValue V0CustomElementConstructorBuilder::BindingsReturnValue() const {
diff --git a/third_party/blink/renderer/platform/bindings/script_state.cc b/third_party/blink/renderer/platform/bindings/script_state.cc
index cd270eb..67c312eb 100644
--- a/third_party/blink/renderer/platform/bindings/script_state.cc
+++ b/third_party/blink/renderer/platform/bindings/script_state.cc
@@ -20,7 +20,7 @@
     : isolate_(context->GetIsolate()),
       context_(isolate_, context),
       world_(std::move(world)),
-      per_context_data_(V8PerContextData::Create(context)),
+      per_context_data_(std::make_unique<V8PerContextData>(context)),
       reference_from_v8_context_(this) {
   DCHECK(world_);
   context_.SetWeak(this, &OnV8ContextCollectedCallback);
diff --git a/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.cc b/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.cc
index 68e534a..5413028 100644
--- a/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.cc
+++ b/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.cc
@@ -36,12 +36,6 @@
 
 namespace blink {
 
-std::unique_ptr<V0CustomElementBinding> V0CustomElementBinding::Create(
-    v8::Isolate* isolate,
-    v8::Local<v8::Object> prototype) {
-  return base::WrapUnique(new V0CustomElementBinding(isolate, prototype));
-}
-
 V0CustomElementBinding::V0CustomElementBinding(v8::Isolate* isolate,
                                                v8::Local<v8::Object> prototype)
     : prototype_(isolate, prototype) {
diff --git a/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.h b/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.h
index c5a005f..46eae21 100644
--- a/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.h
+++ b/third_party/blink/renderer/platform/bindings/v0_custom_element_binding.h
@@ -44,13 +44,10 @@
   USING_FAST_MALLOC(V0CustomElementBinding);
 
  public:
-  static std::unique_ptr<V0CustomElementBinding> Create(
-      v8::Isolate*,
-      v8::Local<v8::Object> prototype);
+  V0CustomElementBinding(v8::Isolate*, v8::Local<v8::Object> prototype);
   ~V0CustomElementBinding();
 
  private:
-  V0CustomElementBinding(v8::Isolate*, v8::Local<v8::Object> prototype);
   ScopedPersistent<v8::Object> prototype_;
 };
 
diff --git a/third_party/blink/renderer/platform/bindings/v8_per_context_data.cc b/third_party/blink/renderer/platform/bindings/v8_per_context_data.cc
index ee25586..386783f 100644
--- a/third_party/blink/renderer/platform/bindings/v8_per_context_data.cc
+++ b/third_party/blink/renderer/platform/bindings/v8_per_context_data.cc
@@ -78,11 +78,6 @@
   }
 }
 
-std::unique_ptr<V8PerContextData> V8PerContextData::Create(
-    v8::Local<v8::Context> context) {
-  return base::WrapUnique(new V8PerContextData(context));
-}
-
 V8PerContextData* V8PerContextData::From(v8::Local<v8::Context> context) {
   return ScriptState::From(context)->PerContextData();
 }
diff --git a/third_party/blink/renderer/platform/bindings/v8_per_context_data.h b/third_party/blink/renderer/platform/bindings/v8_per_context_data.h
index a65880d..89b5777 100644
--- a/third_party/blink/renderer/platform/bindings/v8_per_context_data.h
+++ b/third_party/blink/renderer/platform/bindings/v8_per_context_data.h
@@ -60,7 +60,7 @@
   USING_FAST_MALLOC(V8PerContextData);
 
  public:
-  static std::unique_ptr<V8PerContextData> Create(v8::Local<v8::Context>);
+  explicit V8PerContextData(v8::Local<v8::Context>);
 
   static V8PerContextData* From(v8::Local<v8::Context>);
 
@@ -125,8 +125,6 @@
   Data* GetData(const char* key);
 
  private:
-  V8PerContextData(v8::Local<v8::Context>);
-
   v8::Local<v8::Object> CreateWrapperFromCacheSlowCase(const WrapperTypeInfo*);
   v8::Local<v8::Function> ConstructorForTypeSlowCase(const WrapperTypeInfo*);
 
diff --git a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc
index ea8cbfa..2f41550 100644
--- a/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc
+++ b/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc
@@ -85,7 +85,7 @@
       interface_template_map_for_v8_context_snapshot_(GetIsolate(),
                                                       kInterfaceMapLabel),
       string_cache_(std::make_unique<StringCache>(GetIsolate())),
-      private_property_(V8PrivateProperty::Create()),
+      private_property_(std::make_unique<V8PrivateProperty>()),
       constructor_mode_(ConstructorMode::kCreateNewObject),
       use_counter_disabled_(false),
       is_handling_recursion_level_error_(false),
@@ -114,7 +114,7 @@
                       gin::IsolateHolder::IsolateCreationMode::kCreateSnapshot),
       interface_template_map_for_v8_context_snapshot_(GetIsolate()),
       string_cache_(std::make_unique<StringCache>(GetIsolate())),
-      private_property_(V8PrivateProperty::Create()),
+      private_property_(std::make_unique<V8PrivateProperty>()),
       constructor_mode_(ConstructorMode::kCreateNewObject),
       use_counter_disabled_(false),
       is_handling_recursion_level_error_(false),
diff --git a/third_party/blink/renderer/platform/bindings/v8_private_property.h b/third_party/blink/renderer/platform/bindings/v8_private_property.h
index 48956be..3d75d56 100644
--- a/third_party/blink/renderer/platform/bindings/v8_private_property.h
+++ b/third_party/blink/renderer/platform/bindings/v8_private_property.h
@@ -87,6 +87,8 @@
     kWindowDocumentCachedAccessor,
   };
 
+  V8PrivateProperty() = default;
+
   // Provides fast access to V8's private properties.
   //
   // Retrieving/creating a global private symbol from a string is very
@@ -140,10 +142,6 @@
     v8::Isolate* isolate_;
   };
 
-  static std::unique_ptr<V8PrivateProperty> Create() {
-    return base::WrapUnique(new V8PrivateProperty());
-  }
-
 #define V8_PRIVATE_PROPERTY_DEFINE_GETTER(InterfaceName, KeyName)              \
   static Symbol V8_PRIVATE_PROPERTY_GETTER_NAME(/* // NOLINT */                \
                                                 InterfaceName, KeyName)(       \
@@ -197,8 +195,6 @@
   }
 
  private:
-  V8PrivateProperty() = default;
-
   static v8::Local<v8::Private> CreateV8Private(v8::Isolate*,
                                                 const char* symbol);
   // TODO(peria): Remove this method. We should not use v8::Private::ForApi().