JSValue* JSXMLHttpRequestProgressEvent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case PositionAttrNum: {
        XMLHttpRequestProgressEvent* imp = static_cast<XMLHttpRequestProgressEvent*>(impl());
        return jsNumber(exec, imp->position());
    }
    case TotalSizeAttrNum: {
        XMLHttpRequestProgressEvent* imp = static_cast<XMLHttpRequestProgressEvent*>(impl());
        return jsNumber(exec, imp->totalSize());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
Exemplo n.º 2
0
 static v8::Handle<v8::Value> totalSizeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.XMLHttpRequestProgressEvent.totalSize._get");
   XMLHttpRequestProgressEvent* imp = V8XMLHttpRequestProgressEvent::toNative(info.Holder());
   return v8::Integer::NewFromUnsigned(imp->totalSize());
 }