| Index: third_party/WebKit/Source/core/events/PointerIdManager.h
|
| diff --git a/third_party/WebKit/Source/core/events/PointerIdManager.h b/third_party/WebKit/Source/core/events/PointerIdManager.h
|
| index b3e01343bf4fefc6cbcc68ac76172fe634b890a1..959d19fc0d2aef178f0026c1ad7ec51c24fec979 100644
|
| --- a/third_party/WebKit/Source/core/events/PointerIdManager.h
|
| +++ b/third_party/WebKit/Source/core/events/PointerIdManager.h
|
| @@ -7,7 +7,7 @@
|
|
|
| #include "public/platform/WebPointerProperties.h"
|
| #include "wtf/Allocator.h"
|
| -#include "wtf/ListHashSet.h"
|
| +#include "wtf/HashMap.h"
|
|
|
| namespace blink {
|
|
|
| @@ -17,17 +17,23 @@ namespace blink {
|
| class PointerIdManager {
|
| DISALLOW_NEW();
|
| public:
|
| + typedef unsigned MappedId;
|
| + typedef std::pair<WebPointerProperties::PointerType, unsigned> GeneratedPointer;
|
| + static const MappedId s_invalidId;
|
| PointerIdManager();
|
| ~PointerIdManager();
|
| void clear();
|
| - void add(WebPointerProperties::PointerType, unsigned);
|
| - void remove(WebPointerProperties::PointerType, unsigned);
|
| - bool isPrimary(WebPointerProperties::PointerType, unsigned);
|
| + MappedId add(const GeneratedPointer);
|
| + void remove(const GeneratedPointer);
|
| + void remove(const MappedId);
|
| + bool isPrimary(const MappedId) const;
|
| + MappedId getPrimaryId(const WebPointerProperties::PointerType) const;
|
| + WebPointerProperties::PointerType getType(const MappedId) const;
|
|
|
| private:
|
| - // TODO(crbug.com/537319): Switch to /one/ set of ids to guarantee uniqueness.
|
| - ListHashSet<unsigned> m_ids[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1];
|
| - bool m_hasPrimaryId[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1];
|
| + HashMap<unsigned, MappedId> m_ids[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1];
|
| + HashMap<MappedId, GeneratedPointer> m_reverseMapping;
|
| + MappedId m_primaryId[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + 1];
|
| };
|
|
|
| } // namespace blink
|
|
|