Changeset 35162 in webkit for trunk/JavaScriptCore/kjs/Shell.cpp


Ignore:
Timestamp:
Jul 14, 2008, 11:23:48 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Kevin McCullough.

Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
global data.

  • JavaScriptCore.exp:
  • kjs/JSGlobalData.cpp: (KJS::JSGlobalData::create):
  • kjs/JSGlobalData.h: Made contructor private, and added a static create() method. Made the class inherit from RefCounted.
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::globalData): JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common WebCore one, which are never deleted).
  • kjs/Shell.cpp: (main): Create JSGlobalData with create() method.

WebCore:

  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::commonJSGlobalData): Create JSGlobalData with create() method.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/Shell.cpp

    r35159 r35162  
    301301    int res = 0;
    302302    TRY
    303         JSGlobalData* globalData = new JSGlobalData;
     303        JSGlobalData* globalData = JSGlobalData::create().releaseRef();
    304304        res = jscmain(argc, argv, globalData);
    305305        delete globalData;
Note: See TracChangeset for help on using the changeset viewer.