~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/JavaScriptCore/API/JSContextRef.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
JSContextGroupRef JSContextGroupCreate()
46
46
{
 
47
    initializeThreading();
47
48
    return toRef(JSGlobalData::create().releaseRef());
48
49
}
49
50
 
60
61
 
61
62
JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
62
63
{
 
64
    initializeThreading();
63
65
#if PLATFORM(DARWIN)
64
66
    // When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed
65
67
    // to use a unique JSGlobalData, we use a shared one for compatibility.
68
70
#else
69
71
    {
70
72
#endif
71
 
        JSLock lock(true);
 
73
        JSLock lock(LockForReal);
72
74
        return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
73
75
    }
74
76
#endif // PLATFORM(DARWIN)
80
82
{
81
83
    initializeThreading();
82
84
 
83
 
    JSLock lock(true);
 
85
    JSLock lock(LockForReal);
84
86
 
85
87
    RefPtr<JSGlobalData> globalData = group ? PassRefPtr<JSGlobalData>(toJS(group)) : JSGlobalData::create();
86
88
 
95
97
 
96
98
    JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalObjectClass);
97
99
    ExecState* exec = globalObject->globalExec();
98
 
    JSValuePtr prototype = globalObjectClass->prototype(exec);
 
100
    JSValue prototype = globalObjectClass->prototype(exec);
99
101
    if (!prototype)
100
102
        prototype = jsNull();
101
103
    globalObject->resetPrototype(prototype);