| 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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 &document.GetPage()->GetEventHandlerRegistry(); | 1574 &document.GetPage()->GetEventHandlerRegistry(); |
| 1575 unsigned count = 0; | 1575 unsigned count = 0; |
| 1576 const EventTargetSet* targets = registry->EventHandlerTargets(handler_class); | 1576 const EventTargetSet* targets = registry->EventHandlerTargets(handler_class); |
| 1577 if (targets) { | 1577 if (targets) { |
| 1578 for (const auto& target : *targets) | 1578 for (const auto& target : *targets) |
| 1579 count += target.value; | 1579 count += target.value; |
| 1580 } | 1580 } |
| 1581 return count; | 1581 return count; |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 unsigned Internals::wheelEventHandlerCount(Document* document) { | 1584 unsigned Internals::wheelEventHandlerCount(Document* document) const { |
| 1585 DCHECK(document); | 1585 DCHECK(document); |
| 1586 return EventHandlerCount(*document, | 1586 return EventHandlerCount(*document, |
| 1587 EventHandlerRegistry::kWheelEventBlocking); | 1587 EventHandlerRegistry::kWheelEventBlocking); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 unsigned Internals::scrollEventHandlerCount(Document* document) { | 1590 unsigned Internals::scrollEventHandlerCount(Document* document) const { |
| 1591 DCHECK(document); | 1591 DCHECK(document); |
| 1592 return EventHandlerCount(*document, EventHandlerRegistry::kScrollEvent); | 1592 return EventHandlerCount(*document, EventHandlerRegistry::kScrollEvent); |
| 1593 } | 1593 } |
| 1594 | 1594 |
| 1595 unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) { | 1595 unsigned Internals::touchStartOrMoveEventHandlerCount( |
| 1596 Document* document) const { |
| 1596 DCHECK(document); | 1597 DCHECK(document); |
| 1597 return EventHandlerCount( | 1598 return EventHandlerCount( |
| 1598 *document, EventHandlerRegistry::kTouchStartOrMoveEventBlocking) + | 1599 *document, EventHandlerRegistry::kTouchStartOrMoveEventBlocking) + |
| 1599 EventHandlerCount(*document, | 1600 EventHandlerCount(*document, |
| 1600 EventHandlerRegistry::kTouchStartOrMoveEventPassive); | 1601 EventHandlerRegistry::kTouchStartOrMoveEventPassive); |
| 1601 } | 1602 } |
| 1602 | 1603 |
| 1603 unsigned Internals::touchEndOrCancelEventHandlerCount(Document* document) { | 1604 unsigned Internals::touchEndOrCancelEventHandlerCount( |
| 1605 Document* document) const { |
| 1604 DCHECK(document); | 1606 DCHECK(document); |
| 1605 return EventHandlerCount( | 1607 return EventHandlerCount( |
| 1606 *document, EventHandlerRegistry::kTouchEndOrCancelEventBlocking) + | 1608 *document, EventHandlerRegistry::kTouchEndOrCancelEventBlocking) + |
| 1607 EventHandlerCount(*document, | 1609 EventHandlerCount(*document, |
| 1608 EventHandlerRegistry::kTouchEndOrCancelEventPassive); | 1610 EventHandlerRegistry::kTouchEndOrCancelEventPassive); |
| 1609 } | 1611 } |
| 1610 | 1612 |
| 1613 unsigned Internals::pointerEventHandlerCount(Document* document) const { |
| 1614 DCHECK(document); |
| 1615 return EventHandlerCount(*document, EventHandlerRegistry::kPointerEvent); |
| 1616 } |
| 1617 |
| 1611 static PaintLayer* FindLayerForGraphicsLayer(PaintLayer* search_root, | 1618 static PaintLayer* FindLayerForGraphicsLayer(PaintLayer* search_root, |
| 1612 GraphicsLayer* graphics_layer, | 1619 GraphicsLayer* graphics_layer, |
| 1613 IntSize* layer_offset, | 1620 IntSize* layer_offset, |
| 1614 String* layer_type) { | 1621 String* layer_type) { |
| 1615 *layer_offset = IntSize(); | 1622 *layer_offset = IntSize(); |
| 1616 if (search_root->HasCompositedLayerMapping() && | 1623 if (search_root->HasCompositedLayerMapping() && |
| 1617 graphics_layer == | 1624 graphics_layer == |
| 1618 search_root->GetCompositedLayerMapping()->MainGraphicsLayer()) { | 1625 search_root->GetCompositedLayerMapping()->MainGraphicsLayer()) { |
| 1619 // If the |graphicsLayer| sets the scrollingContent layer as its | 1626 // If the |graphicsLayer| sets the scrollingContent layer as its |
| 1620 // scroll parent, consider it belongs to the scrolling layer and | 1627 // scroll parent, consider it belongs to the scrolling layer and |
| (...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3293 | 3300 |
| 3294 void Internals::crash() { | 3301 void Internals::crash() { |
| 3295 CHECK(false) << "Intentional crash"; | 3302 CHECK(false) << "Intentional crash"; |
| 3296 } | 3303 } |
| 3297 | 3304 |
| 3298 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3305 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
| 3299 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3306 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
| 3300 } | 3307 } |
| 3301 | 3308 |
| 3302 } // namespace blink | 3309 } // namespace blink |
| OLD | NEW |