OLD | NEW |
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/input/TouchEventManager.h" | 5 #include "core/input/TouchEventManager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/events/TouchEvent.h" | 9 #include "core/events/TouchEvent.h" |
10 #include "core/frame/Deprecation.h" | 10 #include "core/frame/Deprecation.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 if (newTouchSequence) { | 461 if (newTouchSequence) { |
462 // Ideally we'd ASSERT(!m_touchSequenceDocument) here since we should | 462 // Ideally we'd ASSERT(!m_touchSequenceDocument) here since we should |
463 // have cleared the active document when we saw the last release. But we | 463 // have cleared the active document when we saw the last release. But we |
464 // have some tests that violate this, ClusterFuzz could trigger it, and | 464 // have some tests that violate this, ClusterFuzz could trigger it, and |
465 // there may be cases where the browser doesn't reliably release all | 465 // there may be cases where the browser doesn't reliably release all |
466 // touches. http://crbug.com/345372 tracks this. | 466 // touches. http://crbug.com/345372 tracks this. |
467 m_touchSequenceDocument.clear(); | 467 m_touchSequenceDocument.clear(); |
468 } | 468 } |
469 | 469 |
470 ASSERT(m_frame->view()); | 470 ASSERT(m_frame->view()); |
471 if (m_touchSequenceDocument && (!m_touchSequenceDocument->frame() || | 471 if (m_touchSequenceDocument && |
472 !m_touchSequenceDocument->frame()->view())) { | 472 (!m_touchSequenceDocument->frame() || |
| 473 !m_touchSequenceDocument->frame()->view())) { |
473 // If the active touch document has no frame or view, it's probably being | 474 // If the active touch document has no frame or view, it's probably being |
474 // destroyed so we can't dispatch events. | 475 // destroyed so we can't dispatch events. |
475 return false; | 476 return false; |
476 } | 477 } |
477 | 478 |
478 updateTargetAndRegionMapsForTouchStarts(touchInfos); | 479 updateTargetAndRegionMapsForTouchStarts(touchInfos); |
479 | 480 |
480 m_touchPressed = !allTouchesReleased; | 481 m_touchPressed = !allTouchesReleased; |
481 | 482 |
482 // If there's no document receiving touch events, or no handlers on the | 483 // If there's no document receiving touch events, or no handlers on the |
(...skipping 29 matching lines...) Expand all Loading... |
512 } | 513 } |
513 | 514 |
514 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); | 515 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); |
515 } | 516 } |
516 | 517 |
517 bool TouchEventManager::isAnyTouchActive() const { | 518 bool TouchEventManager::isAnyTouchActive() const { |
518 return m_touchPressed; | 519 return m_touchPressed; |
519 } | 520 } |
520 | 521 |
521 } // namespace blink | 522 } // namespace blink |
OLD | NEW |