diff --git a/shell/browser/api/message_port.cc b/shell/browser/api/message_port.cc index a4ffcf5fe577..7d48119484cb 100644 --- a/shell/browser/api/message_port.cc +++ b/shell/browser/api/message_port.cc @@ -5,7 +5,6 @@ #include "shell/browser/api/message_port.h" #include -#include #include #include "base/containers/to_vector.h" @@ -20,6 +19,7 @@ #include "shell/common/gin_helper/event_emitter_caller.h" #include "shell/common/node_includes.h" #include "shell/common/v8_util.h" +#include "third_party/abseil-cpp/absl/container/flat_hash_set.h" #include "third_party/blink/public/common/messaging/transferable_message.h" #include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h" #include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h" @@ -226,7 +226,8 @@ std::vector MessagePort::DisentanglePorts( if (ports.empty()) return {}; - std::unordered_set visited; + absl::flat_hash_set visited; + visited.reserve(ports.size()); // Walk the incoming array - if there are any duplicate ports, or null ports // or cloned ports, throw an error (per section 8.3.3 of the HTML5 spec). diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index e3be831ee276..46b8a03163a6 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -20,6 +19,7 @@ #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/function_template.h" #include "shell/common/gin_helper/microtasks_scope.h" +#include "third_party/abseil-cpp/absl/container/flat_hash_set.h" #include "third_party/blink/public/web/web_text_checking_completion.h" #include "third_party/blink/public/web/web_text_checking_result.h" #include "third_party/icu/source/common/unicode/uscript.h" @@ -182,9 +182,9 @@ void SpellCheckClient::SpellCheckText() { void SpellCheckClient::OnSpellCheckDone( const std::vector& misspelled_words) { + const absl::flat_hash_set misspelled{misspelled_words.begin(), + misspelled_words.end()}; std::vector results; - std::unordered_set misspelled(misspelled_words.begin(), - misspelled_words.end()); auto& word_list = pending_request_param_->wordlist();