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

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/bindings/js/JSCustomPositionCallback.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:
26
26
#include "config.h"
27
27
#include "JSCustomPositionCallback.h"
28
28
 
29
 
#include "CString.h"
30
29
#include "Frame.h"
31
30
#include "JSGeoposition.h"
32
 
#include "Page.h"
33
31
#include "ScriptController.h"
34
32
#include <runtime/JSLock.h>
35
33
 
37
35
 
38
36
using namespace JSC;
39
37
 
40
 
JSCustomPositionCallback::JSCustomPositionCallback(JSObject* callback, Frame* frame)
 
38
JSCustomPositionCallback::JSCustomPositionCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
41
39
    : m_callback(callback)
42
 
    , m_frame(frame)
 
40
    , m_globalObject(globalObject)
43
41
{
44
42
}
45
43
 
46
 
void JSCustomPositionCallback::handleEvent(Geoposition* geoposition, bool& raisedException)
 
44
void JSCustomPositionCallback::handleEvent(Geoposition* geoposition)
47
45
{
48
46
    ASSERT(m_callback);
49
 
    ASSERT(m_frame);
50
 
    
51
 
    if (!m_frame->script()->isEnabled())
52
 
        return;
53
 
    
54
 
    JSGlobalObject* globalObject = m_frame->script()->globalObject();
55
 
    ExecState* exec = globalObject->globalExec();
56
 
    
57
 
    JSC::JSLock lock(false);
58
 
    
59
 
    JSValuePtr function = m_callback->get(exec, Identifier(exec, "handleEvent"));
 
47
    ASSERT(m_globalObject);
 
48
 
 
49
    ExecState* exec = m_globalObject->globalExec();
 
50
    
 
51
    JSC::JSLock lock(SilenceAssertionsOnly);
 
52
    
 
53
    JSValue function = m_callback->get(exec, Identifier(exec, "handleEvent"));
60
54
    CallData callData;
61
 
    CallType callType = function->getCallData(callData);
 
55
    CallType callType = function.getCallData(callData);
62
56
    if (callType == CallTypeNone) {
63
57
        callType = m_callback->getCallData(callData);
64
58
        if (callType == CallTypeNone) {
69
63
    }
70
64
    
71
65
    RefPtr<JSCustomPositionCallback> protect(this);
72
 
    
73
 
    ArgList args;
74
 
    args.append(toJS(exec, geoposition));
75
 
    
76
 
    globalObject->startTimeoutCheck();
 
66
 
 
67
    MarkedArgumentBuffer args;
 
68
    args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), geoposition));
 
69
 
 
70
    m_globalObject->globalData()->timeoutChecker.start();
77
71
    call(exec, function, callType, callData, m_callback, args);
78
 
    globalObject->stopTimeoutCheck();
79
 
    
80
 
    if (exec->hadException()) {
 
72
    m_globalObject->globalData()->timeoutChecker.stop();
 
73
 
 
74
    if (exec->hadException())
81
75
        reportCurrentException(exec);
82
 
        raisedException = true;
83
 
    }
 
76
    
 
77
    Document::updateStyleForAllDocuments();
84
78
}
85
79
 
86
80
} // namespace WebCore