⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194283 in webkit


Ignore:
Timestamp:
Dec 18, 2015, 11:49:58 AM (11 years ago)
Author:
bshafiei@apple.com
Message:

Merged r192582. rdar://problem/23957053

Location:
branches/safari-601.1.46-branch/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601.1.46-branch/Source/WebCore/ChangeLog

    r194260 r194283  
     12015-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
    1262015-12-17  Matthew Hanson  <matthew_hanson@apple.com>
    227
  • branches/safari-601.1.46-branch/Source/WebCore/page/DOMWindow.cpp

    r191458 r194283  
    725725{
    726726    if (!isCurrentlyDisplayedInFrame())
    727         return 0;
     727        return nullptr;
    728728    if (!m_navigator)
    729729        m_navigator = Navigator::create(m_frame);
    … …  
    735735{
    736736    if (!isCurrentlyDisplayedInFrame())
    737         return 0;
     737        return nullptr;
    738738    if (!m_performance)
    739         m_performance = Performance::create(m_frame);
     739        m_performance = Performance::create(*m_frame);
    740740    return m_performance.get();
    741741}
  • branches/safari-601.1.46-branch/Source/WebCore/page/Performance.cpp

    r186208 r194283  
    3131
    3232#include "config.h"
     33
     34#if ENABLE(WEB_TIMING)
    3335#include "Performance.h"
    3436
    3537#include "Document.h"
    3638#include "DocumentLoader.h"
     39#include "Frame.h"
    3740#include "PerformanceEntry.h"
    3841#include "PerformanceNavigation.h"
    … …  
    4346#include <wtf/CurrentTime.h>
    4447
    45 #if ENABLE(WEB_TIMING)
    46 
    47 #include "Frame.h"
    48 
    4948namespace WebCore {
    5049
    … …  
    5352#endif
    5453
    55 Performance::Performance(Frame* frame)
    56     : DOMWindowProperty(frame)
     54Performance::Performance(Frame& frame)
     55    : DOMWindowProperty(&frame)
    5756#if ENABLE(RESOURCE_TIMING)
    5857    , m_resourceTimingBufferSize(defaultResourceTimingBufferSize)
    5958#endif // ENABLE(RESOURCE_TIMING)
    60     , m_referenceTime(frame->document()->loader()->timing().referenceMonotonicTime())
     59    , m_referenceTime(frame.document()->loader() ? frame.document()->loader()->timing().referenceMonotonicTime() : monotonicallyIncreasingTime())
    6160#if ENABLE(USER_TIMING)
    6261    , m_userTiming(nullptr)
    … …  
    7372{
    7473    if (!frame())
    75         return 0;
     74        return nullptr;
    7675    return frame()->document();
    7776}
    … …  
    232231double Performance::now() const
    233232{
    234     double nowSeconds = WTF::monotonicallyIncreasingTime() - m_referenceTime;
     233    double nowSeconds = monotonicallyIncreasingTime() - m_referenceTime;
    235234    const double resolutionSeconds = 0.000005;
    236235    return 1000.0 * floor(nowSeconds / resolutionSeconds) * resolutionSeconds;
  • branches/safari-601.1.46-branch/Source/WebCore/page/Performance.h

    r184066 r194283  
    5555class Performance final : public ScriptWrappable, public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData {
    5656public:
    57     static Ref<Performance> create(Frame* frame) { return adoptRef(*new Performance(frame)); }
     57    static Ref<Performance> create(Frame& frame) { return adoptRef(*new Performance(frame)); }
    5858    ~Performance();
    5959
    … …  
    9090
    9191private:
    92     explicit Performance(Frame*);
     92    explicit Performance(Frame&);
    9393
    9494    virtual void refEventTarget() override { ref(); }
Note: See TracChangeset for help on using the changeset viewer.