mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
perf: use absl::flat_hash_map instead of std::unordered_map (#46202)
* perf: make ElectronUsbDelegate::controller_map_ an absl::flat_hash_map * perf: make ElectronSerialDelegate::controller_map_ an absl::flat_hash_map * perf: make ElectronHidDelegate::controller_map_ an absl::flat_hash_map * perf: make FrameTreeNodeIdMap an absl::flat_hash_map * perf: make AutofillDriverFactory::driver_map_ an absl::flat_hash_map * perf: make asar::Archive::external_files_ an absl::flat_hash_map * perf: make VersionIdMap an absl::flat_hash_map * perf: make ObjectCache::proxy_map_ an absl::flat_hash_map * docs: add TODO to investigate absl map in KeyWeakMap
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#define ELECTRON_SHELL_BROWSER_SERIAL_ELECTRON_SERIAL_DELEGATE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
@@ -15,6 +14,7 @@
|
||||
#include "content/public/browser/serial_delegate.h"
|
||||
#include "shell/browser/serial/serial_chooser_context.h"
|
||||
#include "shell/browser/serial/serial_chooser_controller.h"
|
||||
#include "third_party/abseil-cpp/absl/container/flat_hash_map.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -77,8 +77,8 @@ class ElectronSerialDelegate : public content::SerialDelegate,
|
||||
port_observation_{this};
|
||||
base::ObserverList<content::SerialDelegate::Observer> observer_list_;
|
||||
|
||||
std::unordered_map<content::RenderFrameHost*,
|
||||
std::unique_ptr<SerialChooserController>>
|
||||
absl::flat_hash_map<content::RenderFrameHost*,
|
||||
std::unique_ptr<SerialChooserController>>
|
||||
controller_map_;
|
||||
|
||||
base::WeakPtrFactory<ElectronSerialDelegate> weak_factory_{this};
|
||||
|
||||
Reference in New Issue
Block a user