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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Kent; merge. Created 4 years, 6 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 /* 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
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
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
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 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 2947
2946 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), 2948 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"),
2947 "FrameView::setTracksPaintInvalidations", TRACE_EVENT_SCOPE_GLOBAL, "ena bled", trackPaintInvalidations); 2949 "FrameView::setTracksPaintInvalidations", TRACE_EVENT_SCOPE_GLOBAL, "ena bled", trackPaintInvalidations);
2948 2950
2949 m_isTrackingPaintInvalidations = trackPaintInvalidations; 2951 m_isTrackingPaintInvalidations = trackPaintInvalidations;
2950 } 2952 }
2951 2953
2952 void FrameView::addResizerArea(LayoutBox& resizerBox) 2954 void FrameView::addResizerArea(LayoutBox& resizerBox)
2953 { 2955 {
2954 if (!m_resizerAreas) 2956 if (!m_resizerAreas)
2955 m_resizerAreas = adoptPtr(new ResizerAreaSet); 2957 m_resizerAreas = wrapUnique(new ResizerAreaSet);
2956 m_resizerAreas->add(&resizerBox); 2958 m_resizerAreas->add(&resizerBox);
2957 } 2959 }
2958 2960
2959 void FrameView::removeResizerArea(LayoutBox& resizerBox) 2961 void FrameView::removeResizerArea(LayoutBox& resizerBox)
2960 { 2962 {
2961 if (!m_resizerAreas) 2963 if (!m_resizerAreas)
2962 return; 2964 return;
2963 2965
2964 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); 2966 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox);
2965 if (it != m_resizerAreas->end()) 2967 if (it != m_resizerAreas->end())
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4150 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4149 } 4151 }
4150 4152
4151 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4153 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4152 { 4154 {
4153 ASSERT(!layoutViewItem().isNull()); 4155 ASSERT(!layoutViewItem().isNull());
4154 return *layoutView(); 4156 return *layoutView();
4155 } 4157 }
4156 4158
4157 } // namespace blink 4159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698