| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 &document.GetPage()->GetEventHandlerRegistry(); | 1634 &document.GetPage()->GetEventHandlerRegistry(); |
| 1635 unsigned count = 0; | 1635 unsigned count = 0; |
| 1636 const EventTargetSet* targets = registry->EventHandlerTargets(handler_class); | 1636 const EventTargetSet* targets = registry->EventHandlerTargets(handler_class); |
| 1637 if (targets) { | 1637 if (targets) { |
| 1638 for (const auto& target : *targets) | 1638 for (const auto& target : *targets) |
| 1639 count += target.value; | 1639 count += target.value; |
| 1640 } | 1640 } |
| 1641 return count; | 1641 return count; |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 unsigned Internals::wheelEventHandlerCount(Document* document) { | 1644 unsigned Internals::wheelEventHandlerCount(Document* document) const { |
| 1645 DCHECK(document); | 1645 DCHECK(document); |
| 1646 return EventHandlerCount(*document, | 1646 return EventHandlerCount(*document, |
| 1647 EventHandlerRegistry::kWheelEventBlocking); | 1647 EventHandlerRegistry::kWheelEventBlocking); |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 unsigned Internals::scrollEventHandlerCount(Document* document) { | 1650 unsigned Internals::scrollEventHandlerCount(Document* document) const { |
| 1651 DCHECK(document); | 1651 DCHECK(document); |
| 1652 return EventHandlerCount(*document, EventHandlerRegistry::kScrollEvent); | 1652 return EventHandlerCount(*document, EventHandlerRegistry::kScrollEvent); |
| 1653 } | 1653 } |
| 1654 | 1654 |
| 1655 unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) { | 1655 unsigned Internals::touchStartOrMoveEventHandlerCount( |
| 1656 Document* document) const { |
| 1656 DCHECK(document); | 1657 DCHECK(document); |
| 1657 return EventHandlerCount( | 1658 return EventHandlerCount( |
| 1658 *document, EventHandlerRegistry::kTouchStartOrMoveEventBlocking) + | 1659 *document, EventHandlerRegistry::kTouchStartOrMoveEventBlocking) + |
| 1659 EventHandlerCount(*document, | 1660 EventHandlerCount(*document, |
| 1660 EventHandlerRegistry::kTouchStartOrMoveEventPassive); | 1661 EventHandlerRegistry::kTouchStartOrMoveEventPassive); |
| 1661 } | 1662 } |
| 1662 | 1663 |
| 1663 unsigned Internals::touchEndOrCancelEventHandlerCount(Document* document) { | 1664 unsigned Internals::touchEndOrCancelEventHandlerCount( |
| 1665 Document* document) const { |
| 1664 DCHECK(document); | 1666 DCHECK(document); |
| 1665 return EventHandlerCount( | 1667 return EventHandlerCount( |
| 1666 *document, EventHandlerRegistry::kTouchEndOrCancelEventBlocking) + | 1668 *document, EventHandlerRegistry::kTouchEndOrCancelEventBlocking) + |
| 1667 EventHandlerCount(*document, | 1669 EventHandlerCount(*document, |
| 1668 EventHandlerRegistry::kTouchEndOrCancelEventPassive); | 1670 EventHandlerRegistry::kTouchEndOrCancelEventPassive); |
| 1669 } | 1671 } |
| 1670 | 1672 |
| 1673 unsigned Internals::pointerEventHandlerCount(Document* document) const { |
| 1674 DCHECK(document); |
| 1675 return EventHandlerCount(*document, EventHandlerRegistry::kPointerEvent); |
| 1676 } |
| 1677 |
| 1671 static PaintLayer* FindLayerForGraphicsLayer(PaintLayer* search_root, | 1678 static PaintLayer* FindLayerForGraphicsLayer(PaintLayer* search_root, |
| 1672 GraphicsLayer* graphics_layer, | 1679 GraphicsLayer* graphics_layer, |
| 1673 IntSize* layer_offset, | 1680 IntSize* layer_offset, |
| 1674 String* layer_type) { | 1681 String* layer_type) { |
| 1675 *layer_offset = IntSize(); | 1682 *layer_offset = IntSize(); |
| 1676 if (search_root->HasCompositedLayerMapping() && | 1683 if (search_root->HasCompositedLayerMapping() && |
| 1677 graphics_layer == | 1684 graphics_layer == |
| 1678 search_root->GetCompositedLayerMapping()->MainGraphicsLayer()) { | 1685 search_root->GetCompositedLayerMapping()->MainGraphicsLayer()) { |
| 1679 // If the |graphicsLayer| sets the scrollingContent layer as its | 1686 // If the |graphicsLayer| sets the scrollingContent layer as its |
| 1680 // scroll parent, consider it belongs to the scrolling layer and | 1687 // scroll parent, consider it belongs to the scrolling layer and |
| (...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3381 | 3388 |
| 3382 void Internals::crash() { | 3389 void Internals::crash() { |
| 3383 CHECK(false) << "Intentional crash"; | 3390 CHECK(false) << "Intentional crash"; |
| 3384 } | 3391 } |
| 3385 | 3392 |
| 3386 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3393 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
| 3387 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3394 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
| 3388 } | 3395 } |
| 3389 | 3396 |
| 3390 } // namespace blink | 3397 } // namespace blink |
| OLD | NEW |