Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 1906213004: Simplify PointerEventFactory::getPointerIdsOfType() return type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/events/PointerEventFactory.h" 5 #include "core/events/PointerEventFactory.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 namespace { 9 namespace {
10 10
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 IncomingId p = m_pointerIdMapping.get(mappedId).incomingId; 302 IncomingId p = m_pointerIdMapping.get(mappedId).incomingId;
303 int type = p.pointerType(); 303 int type = p.pointerType();
304 m_pointerIdMapping.remove(mappedId); 304 m_pointerIdMapping.remove(mappedId);
305 m_pointerIncomingIdMapping.remove(p); 305 m_pointerIncomingIdMapping.remove(p);
306 if (m_primaryId[type] == mappedId) 306 if (m_primaryId[type] == mappedId)
307 m_primaryId[type] = PointerEventFactory::s_invalidId; 307 m_primaryId[type] = PointerEventFactory::s_invalidId;
308 m_idCount[type]--; 308 m_idCount[type]--;
309 return true; 309 return true;
310 } 310 }
311 311
312 HeapVector<int> PointerEventFactory::getPointerIdsOfType(WebPointerProperties::P ointerType pointerType) 312 Vector<int> PointerEventFactory::getPointerIdsOfType(WebPointerProperties::Point erType pointerType)
313 { 313 {
314 HeapVector<int> mappedIds; 314 Vector<int> mappedIds;
315 315
316 for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end( ); ++iter) { 316 for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end( ); ++iter) {
317 int mappedId = iter->key; 317 int mappedId = iter->key;
318 if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType )) 318 if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType ))
319 mappedIds.append(mappedId); 319 mappedIds.append(mappedId);
320 } 320 }
321 321
322 // Sorting for a predictable ordering. 322 // Sorting for a predictable ordering.
323 std::sort(mappedIds.begin(), mappedIds.end()); 323 std::sort(mappedIds.begin(), mappedIds.end());
324 return mappedIds; 324 return mappedIds;
(...skipping 23 matching lines...) Expand all
348 return m_pointerIdMapping.contains(pointerId); 348 return m_pointerIdMapping.contains(pointerId);
349 } 349 }
350 350
351 bool PointerEventFactory::isActiveButtonsState(const int pointerId) 351 bool PointerEventFactory::isActiveButtonsState(const int pointerId)
352 { 352 {
353 return m_pointerIdMapping.contains(pointerId) 353 return m_pointerIdMapping.contains(pointerId)
354 && m_pointerIdMapping.get(pointerId).isActiveButtons; 354 && m_pointerIdMapping.get(pointerId).isActiveButtons;
355 } 355 }
356 356
357 } // namespace blink 357 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698