| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #include "platform/graphics/GraphicsLayerDebugInfo.h" | 100 #include "platform/graphics/GraphicsLayerDebugInfo.h" |
| 101 #include "platform/graphics/paint/CullRect.h" | 101 #include "platform/graphics/paint/CullRect.h" |
| 102 #include "platform/graphics/paint/PaintController.h" | 102 #include "platform/graphics/paint/PaintController.h" |
| 103 #include "platform/scheduler/CancellableTaskFactory.h" | 103 #include "platform/scheduler/CancellableTaskFactory.h" |
| 104 #include "platform/scroll/ScrollAnimatorBase.h" | 104 #include "platform/scroll/ScrollAnimatorBase.h" |
| 105 #include "platform/scroll/ScrollbarTheme.h" | 105 #include "platform/scroll/ScrollbarTheme.h" |
| 106 #include "platform/text/TextStream.h" | 106 #include "platform/text/TextStream.h" |
| 107 #include "public/platform/WebDisplayItemList.h" | 107 #include "public/platform/WebDisplayItemList.h" |
| 108 #include "public/platform/WebFrameScheduler.h" | 108 #include "public/platform/WebFrameScheduler.h" |
| 109 #include "wtf/CurrentTime.h" | 109 #include "wtf/CurrentTime.h" |
| 110 #include "wtf/PtrUtil.h" |
| 110 #include "wtf/StdLibExtras.h" | 111 #include "wtf/StdLibExtras.h" |
| 111 #include "wtf/TemporaryChange.h" | 112 #include "wtf/TemporaryChange.h" |
| 113 #include <memory> |
| 112 | 114 |
| 113 namespace blink { | 115 namespace blink { |
| 114 | 116 |
| 115 using namespace HTMLNames; | 117 using namespace HTMLNames; |
| 116 | 118 |
| 117 // The maximum number of updateWidgets iterations that should be done before ret
urning. | 119 // The maximum number of updateWidgets iterations that should be done before ret
urning. |
| 118 static const unsigned maxUpdateWidgetsIterations = 2; | 120 static const unsigned maxUpdateWidgetsIterations = 2; |
| 119 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; | 121 static const double resourcePriorityUpdateDelayAfterScroll = 0.250; |
| 120 | 122 |
| 121 static bool s_initialTrackAllPaintInvalidations = false; | 123 static bool s_initialTrackAllPaintInvalidations = false; |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 | 829 |
| 828 void FrameView::prepareLayoutAnalyzer() | 830 void FrameView::prepareLayoutAnalyzer() |
| 829 { | 831 { |
| 830 bool isTracing = false; | 832 bool isTracing = false; |
| 831 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.la
yout"), &isTracing); | 833 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.la
yout"), &isTracing); |
| 832 if (!isTracing) { | 834 if (!isTracing) { |
| 833 m_analyzer.reset(); | 835 m_analyzer.reset(); |
| 834 return; | 836 return; |
| 835 } | 837 } |
| 836 if (!m_analyzer) | 838 if (!m_analyzer) |
| 837 m_analyzer = adoptPtr(new LayoutAnalyzer()); | 839 m_analyzer = wrapUnique(new LayoutAnalyzer()); |
| 838 m_analyzer->reset(); | 840 m_analyzer->reset(); |
| 839 } | 841 } |
| 840 | 842 |
| 841 PassOwnPtr<TracedValue> FrameView::analyzerCounters() | 843 std::unique_ptr<TracedValue> FrameView::analyzerCounters() |
| 842 { | 844 { |
| 843 if (!m_analyzer) | 845 if (!m_analyzer) |
| 844 return TracedValue::create(); | 846 return TracedValue::create(); |
| 845 OwnPtr<TracedValue> value = m_analyzer->toTracedValue(); | 847 std::unique_ptr<TracedValue> value = m_analyzer->toTracedValue(); |
| 846 value->setString("host", layoutViewItem().document().location()->host()); | 848 value->setString("host", layoutViewItem().document().location()->host()); |
| 847 value->setString("frame", String::format("0x%" PRIxPTR, reinterpret_cast<uin
tptr_t>(m_frame.get()))); | 849 value->setString("frame", String::format("0x%" PRIxPTR, reinterpret_cast<uin
tptr_t>(m_frame.get()))); |
| 848 value->setInteger("contentsHeightAfterLayout", layoutViewItem().documentRect
().height()); | 850 value->setInteger("contentsHeightAfterLayout", layoutViewItem().documentRect
().height()); |
| 849 value->setInteger("visibleHeight", visibleHeight()); | 851 value->setInteger("visibleHeight", visibleHeight()); |
| 850 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate
BlankCharacterCount(*m_frame->document())); | 852 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate
BlankCharacterCount(*m_frame->document())); |
| 851 return value; | 853 return value; |
| 852 } | 854 } |
| 853 | 855 |
| 854 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF
AULT("blink.debug.layout") | 856 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF
AULT("blink.debug.layout") |
| 855 | 857 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); | 1301 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); |
| 1300 | 1302 |
| 1301 m_backgroundAttachmentFixedObjects.remove(object); | 1303 m_backgroundAttachmentFixedObjects.remove(object); |
| 1302 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) | 1304 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) |
| 1303 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidCha
nge(this); | 1305 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidCha
nge(this); |
| 1304 } | 1306 } |
| 1305 | 1307 |
| 1306 void FrameView::addViewportConstrainedObject(LayoutObject* object) | 1308 void FrameView::addViewportConstrainedObject(LayoutObject* object) |
| 1307 { | 1309 { |
| 1308 if (!m_viewportConstrainedObjects) | 1310 if (!m_viewportConstrainedObjects) |
| 1309 m_viewportConstrainedObjects = adoptPtr(new ViewportConstrainedObjectSet
); | 1311 m_viewportConstrainedObjects = wrapUnique(new ViewportConstrainedObjectS
et); |
| 1310 | 1312 |
| 1311 if (!m_viewportConstrainedObjects->contains(object)) { | 1313 if (!m_viewportConstrainedObjects->contains(object)) { |
| 1312 m_viewportConstrainedObjects->add(object); | 1314 m_viewportConstrainedObjects->add(object); |
| 1313 | 1315 |
| 1314 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina
tor()) | 1316 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina
tor()) |
| 1315 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | 1317 scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
| 1316 } | 1318 } |
| 1317 } | 1319 } |
| 1318 | 1320 |
| 1319 void FrameView::removeViewportConstrainedObject(LayoutObject* object) | 1321 void FrameView::removeViewportConstrainedObject(LayoutObject* object) |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2941 | 2943 |
| 2942 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), | 2944 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), |
| 2943 "FrameView::setTracksPaintInvalidations", TRACE_EVENT_SCOPE_GLOBAL, "ena
bled", trackPaintInvalidations); | 2945 "FrameView::setTracksPaintInvalidations", TRACE_EVENT_SCOPE_GLOBAL, "ena
bled", trackPaintInvalidations); |
| 2944 | 2946 |
| 2945 m_isTrackingPaintInvalidations = trackPaintInvalidations; | 2947 m_isTrackingPaintInvalidations = trackPaintInvalidations; |
| 2946 } | 2948 } |
| 2947 | 2949 |
| 2948 void FrameView::addResizerArea(LayoutBox& resizerBox) | 2950 void FrameView::addResizerArea(LayoutBox& resizerBox) |
| 2949 { | 2951 { |
| 2950 if (!m_resizerAreas) | 2952 if (!m_resizerAreas) |
| 2951 m_resizerAreas = adoptPtr(new ResizerAreaSet); | 2953 m_resizerAreas = wrapUnique(new ResizerAreaSet); |
| 2952 m_resizerAreas->add(&resizerBox); | 2954 m_resizerAreas->add(&resizerBox); |
| 2953 } | 2955 } |
| 2954 | 2956 |
| 2955 void FrameView::removeResizerArea(LayoutBox& resizerBox) | 2957 void FrameView::removeResizerArea(LayoutBox& resizerBox) |
| 2956 { | 2958 { |
| 2957 if (!m_resizerAreas) | 2959 if (!m_resizerAreas) |
| 2958 return; | 2960 return; |
| 2959 | 2961 |
| 2960 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); | 2962 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); |
| 2961 if (it != m_resizerAreas->end()) | 2963 if (it != m_resizerAreas->end()) |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4144 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4146 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4145 } | 4147 } |
| 4146 | 4148 |
| 4147 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4149 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4148 { | 4150 { |
| 4149 ASSERT(!layoutViewItem().isNull()); | 4151 ASSERT(!layoutViewItem().isNull()); |
| 4150 return *layoutView(); | 4152 return *layoutView(); |
| 4151 } | 4153 } |
| 4152 | 4154 |
| 4153 } // namespace blink | 4155 } // namespace blink |
| OLD | NEW |