Ignore:
Timestamp:
Dec 3, 2011, 9:20:08 PM (14 years ago)
Author:
Darin Adler
Message:

Use HashMap<OwnPtr> for the opaqueJSClassData map
https://bugs.webkit.org/show_bug.cgi?id=73759

Reviewed by Andreas Kling.

  • API/JSClassRef.cpp:

(OpaqueJSClass::contextData): Update types.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::~JSGlobalData): Add an explicit clear of opaqueJSClassData to keep the
timing the same. If we didn't care about the order of operations, we could remove this, too.

  • runtime/JSGlobalData.h: Use OwnPtr instead of raw pointer for the mapped type in the

opaqueJSClassData map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSClassRef.cpp

    r96627 r101945  
    203203OpaqueJSClassContextData& OpaqueJSClass::contextData(ExecState* exec)
    204204{
    205     OpaqueJSClassContextData*& contextData = exec->globalData().opaqueJSClassData.add(this, 0).first->second;
     205    OwnPtr<OpaqueJSClassContextData>& contextData = exec->globalData().opaqueJSClassData.add(this, nullptr).first->second;
    206206    if (!contextData)
    207         contextData = new OpaqueJSClassContextData(exec->globalData(), this);
     207        contextData = adoptPtr(new OpaqueJSClassContextData(exec->globalData(), this));
    208208    return *contextData;
    209209}
Note: See TracChangeset for help on using the changeset viewer.