IndexedDB: Move IDBKeyRangeBuilder::Build to IDBKeyRange::Create

Bug: 717812
Change-Id: I851085136c1a40389719a29cc453ca6811b493a3
Reviewed-on: https://chromium-review.googlesource.com/c/1368310
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620995}
diff --git a/third_party/blink/renderer/modules/indexeddb/BUILD.gn b/third_party/blink/renderer/modules/indexeddb/BUILD.gn
index 2955433f..595ec078 100644
--- a/third_party/blink/renderer/modules/indexeddb/BUILD.gn
+++ b/third_party/blink/renderer/modules/indexeddb/BUILD.gn
@@ -70,8 +70,6 @@
     "indexed_db_database_callbacks_impl.h",
     "indexed_db_dispatcher.cc",
     "indexed_db_dispatcher.h",
-    "indexed_db_key_builder.cc",
-    "indexed_db_key_builder.h",
     "inspector_indexed_db_agent.cc",
     "inspector_indexed_db_agent.h",
     "web_idb_callbacks.h",
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_key_range.h b/third_party/blink/renderer/modules/indexeddb/idb_key_range.h
index 9df0a6d..80fb953 100644
--- a/third_party/blink/renderer/modules/indexeddb/idb_key_range.h
+++ b/third_party/blink/renderer/modules/indexeddb/idb_key_range.h
@@ -44,6 +44,13 @@
   enum LowerBoundType { kLowerBoundOpen, kLowerBoundClosed };
   enum UpperBoundType { kUpperBoundOpen, kUpperBoundClosed };
 
+  static IDBKeyRange* Create(const IDBKey* key) {
+    std::unique_ptr<IDBKey> lower_key = IDBKey::Clone(key);
+    std::unique_ptr<IDBKey> upper_key = IDBKey::Clone(key);
+    return IDBKeyRange::Create(std::move(lower_key), std::move(upper_key),
+                               kLowerBoundClosed, kUpperBoundClosed);
+  }
+
   static IDBKeyRange* Create(std::unique_ptr<IDBKey> lower,
                              std::unique_ptr<IDBKey> upper,
                              LowerBoundType lower_type,
diff --git a/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.cc b/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.cc
deleted file mode 100644
index 2347651..0000000
--- a/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.h"
-
-#include "third_party/blink/renderer/modules/indexeddb/idb_key_range.h"
-
-namespace blink {
-
-// static
-IDBKeyRange* IDBKeyRangeBuilder::Build(const IDBKey* key) {
-  std::unique_ptr<IDBKey> lower_key = IDBKey::Clone(key);
-  std::unique_ptr<IDBKey> upper_key = IDBKey::Clone(key);
-  return IDBKeyRange::Create(std::move(lower_key), std::move(upper_key),
-                             IDBKeyRange::kLowerBoundClosed,
-                             IDBKeyRange::kUpperBoundClosed);
-}
-
-}  // namespace blink
diff --git a/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.h b/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.h
deleted file mode 100644
index e1987723..0000000
--- a/third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_
-#define THIRD_PARTY_BLINK_RENDERER_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_
-
-#include "base/macros.h"
-#include "third_party/blink/renderer/modules/modules_export.h"
-
-namespace blink {
-
-class IDBKey;
-class IDBKeyRange;
-
-class MODULES_EXPORT IDBKeyRangeBuilder {
- public:
-  // Builds a point range (containing a single key).
-  static IDBKeyRange* Build(const IDBKey* key);
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(IDBKeyRangeBuilder);
-};
-
-}  // namespace blink
-
-#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_INDEXEDDB_INDEXED_DB_KEY_BUILDER_H_
diff --git a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
index 6f50832..242bf09 100644
--- a/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
+++ b/third_party/blink/renderer/modules/indexeddb/web_idb_database_impl.cc
@@ -18,7 +18,6 @@
 #include "third_party/blink/renderer/modules/indexeddb/indexed_db_blink_mojom_traits.h"
 #include "third_party/blink/renderer/modules/indexeddb/indexed_db_callbacks_impl.h"
 #include "third_party/blink/renderer/modules/indexeddb/indexed_db_dispatcher.h"
-#include "third_party/blink/renderer/modules/indexeddb/indexed_db_key_builder.h"
 #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
 
 namespace blink {
@@ -210,7 +209,7 @@
   IndexedDBDispatcher::ResetCursorPrefetchCaches(transaction_id, nullptr);
 
   mojom::blink::IDBKeyRangePtr key_range_ptr =
-      mojom::blink::IDBKeyRange::From(IDBKeyRangeBuilder::Build(primary_key));
+      mojom::blink::IDBKeyRange::From(IDBKeyRange::Create(primary_key));
   auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>(
       base::WrapUnique(callbacks), transaction_id, nullptr);
   database_->DeleteRange(transaction_id, object_store_id,