Changeset 194281 in webkit
- Timestamp:
- Dec 18, 2015, 11:48:20 AM (11 years ago)
- Location:
- branches/safari-601.1.46.60-branch/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
page/DOMWindow.cpp (modified) (2 diffs)
-
page/Performance.cpp (modified) (5 diffs)
-
page/Performance.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog
r193839 r194281 1 2015-12-18 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r192582. 4 5 2015-11-18 Chris Dumez <cdumez@apple.com> 6 7 Null dereference in Performance::Performance(WebCore::Frame*) 8 https://bugs.webkit.org/show_bug.cgi?id=151390 9 10 Reviewed by Brady Eidson. 11 12 Based on the stack trace, it appears the DocumentLoader can be null 13 when constructing the Performance object. This patch thus adds a null 14 check before trying to dereference it. 15 16 No new tests, was not able to reproduce. 17 18 * page/DOMWindow.cpp: 19 (WebCore::DOMWindow::navigator): 20 (WebCore::DOMWindow::performance): 21 * page/Performance.cpp: 22 (WebCore::Performance::Performance): 23 (WebCore::Performance::scriptExecutionContext): 24 * page/Performance.h: 25 1 26 2015-12-09 Babak Shafiei <bshafiei@apple.com> 2 27 -
branches/safari-601.1.46.60-branch/Source/WebCore/page/DOMWindow.cpp
r191458 r194281 725 725 { 726 726 if (!isCurrentlyDisplayedInFrame()) 727 return 0;727 return nullptr; 728 728 if (!m_navigator) 729 729 m_navigator = Navigator::create(m_frame); … … 735 735 { 736 736 if (!isCurrentlyDisplayedInFrame()) 737 return 0;737 return nullptr; 738 738 if (!m_performance) 739 m_performance = Performance::create( m_frame);739 m_performance = Performance::create(*m_frame); 740 740 return m_performance.get(); 741 741 } -
branches/safari-601.1.46.60-branch/Source/WebCore/page/Performance.cpp
r186208 r194281 31 31 32 32 #include "config.h" 33 34 #if ENABLE(WEB_TIMING) 33 35 #include "Performance.h" 34 36 35 37 #include "Document.h" 36 38 #include "DocumentLoader.h" 39 #include "Frame.h" 37 40 #include "PerformanceEntry.h" 38 41 #include "PerformanceNavigation.h" … … 43 46 #include <wtf/CurrentTime.h> 44 47 45 #if ENABLE(WEB_TIMING)46 47 #include "Frame.h"48 49 48 namespace WebCore { 50 49 … … 53 52 #endif 54 53 55 Performance::Performance(Frame *frame)56 : DOMWindowProperty( frame)54 Performance::Performance(Frame& frame) 55 : DOMWindowProperty(&frame) 57 56 #if ENABLE(RESOURCE_TIMING) 58 57 , m_resourceTimingBufferSize(defaultResourceTimingBufferSize) 59 58 #endif // ENABLE(RESOURCE_TIMING) 60 , m_referenceTime(frame ->document()->loader()->timing().referenceMonotonicTime())59 , m_referenceTime(frame.document()->loader() ? frame.document()->loader()->timing().referenceMonotonicTime() : monotonicallyIncreasingTime()) 61 60 #if ENABLE(USER_TIMING) 62 61 , m_userTiming(nullptr) … … 73 72 { 74 73 if (!frame()) 75 return 0;74 return nullptr; 76 75 return frame()->document(); 77 76 } … … 232 231 double Performance::now() const 233 232 { 234 double nowSeconds = WTF::monotonicallyIncreasingTime() - m_referenceTime;233 double nowSeconds = monotonicallyIncreasingTime() - m_referenceTime; 235 234 const double resolutionSeconds = 0.000005; 236 235 return 1000.0 * floor(nowSeconds / resolutionSeconds) * resolutionSeconds; -
branches/safari-601.1.46.60-branch/Source/WebCore/page/Performance.h
r184066 r194281 55 55 class Performance final : public ScriptWrappable, public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData { 56 56 public: 57 static Ref<Performance> create(Frame *frame) { return adoptRef(*new Performance(frame)); }57 static Ref<Performance> create(Frame& frame) { return adoptRef(*new Performance(frame)); } 58 58 ~Performance(); 59 59 … … 90 90 91 91 private: 92 explicit Performance(Frame *);92 explicit Performance(Frame&); 93 93 94 94 virtual void refEventTarget() override { ref(); }
Note:
See TracChangeset
for help on using the changeset viewer.