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; }
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()); }
static v8::Handle<v8::Value> positionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.XMLHttpRequestProgressEvent.position._get"); XMLHttpRequestProgressEvent* imp = V8XMLHttpRequestProgressEvent::toNative(info.Holder()); return v8::Number::New(static_cast<double>(imp->position())); }