Exemple #1
0
static v8::Handle<v8::Value> byteLengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.ArrayBuffer.byteLength._get");
    ArrayBuffer* imp = V8ArrayBuffer::toNative(info.Holder());
    return v8::Integer::New(imp->byteLength());
}
Exemple #2
0
static v8::Handle<v8::Value> typeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Blob.type._get");
    Blob* imp = V8Blob::toNative(info.Holder());
    return v8String(imp->type());
}
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.TestException.name._get");
    TestException* imp = V8TestException::toNative(info.Holder());
    return v8String(imp->name(), info.GetIsolate());
}
Exemple #4
0
v8::Handle<v8::Value> V8Float64Array::setCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Float64Array.set()");
    return setWebGLArrayHelper<Float64Array, V8Float64Array>(args);
}
static v8::Handle<v8::Value> attr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.TestEventConstructor.attr2._get");
    TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder());
    return v8String(imp->attr2(), info.GetIsolate());
}
Exemple #6
0
 static v8::Handle<v8::Value> getCallback(const v8::Arguments& args) {
   INC_STATS("DOM.WebGLUnsignedIntArray.get");
   WebGLUnsignedIntArray* imp = V8WebGLUnsignedIntArray::toNative(args.Holder());
   unsigned index = toInt32(args[0]);
   return v8::Integer::NewFromUnsigned(imp->get(index));
 }
v8::Handle<v8::Value> V8WebGLUnsignedShortArray::setCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.WebGLUnsignedShortArray.set()");
    return setWebGLArray<WebGLUnsignedShortArray, V8WebGLUnsignedShortArray>(args, V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY);
}
Exemple #8
0
v8::Handle<v8::Value> V8WorkerContext::setIntervalCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.WorkerContext.setInterval()");
    return SetTimeoutOrInterval(args, false);
}
Exemple #9
0
 static v8::Handle<v8::Value> filenameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.ErrorEvent.filename._get");
   ErrorEvent* imp = V8ErrorEvent::toNative(info.Holder());
   return v8String(imp->filename());
 }
static v8::Handle<v8::Value> dataAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.TextEvent.data._get");
    TextEvent* imp = V8TextEvent::toNative(info.Holder());
    return v8String(imp->data());
}
v8::Handle<v8::Value> V8ScriptProfileNode::callUIDAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.ScriptProfileNode.callUIDAccessorGetter");
    ScriptProfileNode* imp = V8ScriptProfileNode::toNative(info.Holder());
    return v8::Number::New(imp->callUID());
}
Exemple #12
0
 static v8::Handle<v8::Value> valueAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.HTMLLIElement.value._get");
   HTMLLIElement* imp = V8HTMLLIElement::toNative(info.Holder());
   return v8::Integer::New(imp->value());
 }
static v8::Handle<v8::Value> farthestViewportElementAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGLocatable.farthestViewportElement._get");
    SVGLocatable* imp = V8SVGLocatable::toNative(info.Holder());
    return toV8(imp->farthestViewportElement());
}
static v8::Handle<v8::Value> yAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGPathSegLinetoVerticalAbs.y._get");
    SVGPathSegLinetoVerticalAbs* imp = V8SVGPathSegLinetoVerticalAbs::toNative(info.Holder());
    return v8::Number::New(imp->y());
}
v8::Handle<v8::Value> V8DOMSettableTokenList::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.DOMSettableTokenList.IndexedPropertyGetter");
    DOMSettableTokenList* list = V8DOMSettableTokenList::toNative(info.Holder());
    return v8StringOrNull(list->item(index));
}
Exemple #16
0
 static v8::Handle<v8::Value> linenoAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.ErrorEvent.lineno._get");
   ErrorEvent* imp = V8ErrorEvent::toNative(info.Holder());
   return v8::Integer::NewFromUnsigned(imp->lineno());
 }
static v8::Handle<v8::Value> excitingAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.TestActiveDOMObject.excitingAttr._get");
    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
    return v8Integer(imp->excitingAttr(), info.GetIsolate());
}
v8::Handle<v8::Value> V8Console::memoryAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Console.memoryAccessorGetter");
    Console* imp = V8Console::toNative(info.Holder());
    return toV8(imp->memory(), info.Holder(), info.GetIsolate());
}
v8::Handle<v8::Value> V8WebGLUnsignedShortArray::constructorCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.WebGLUnsignedShortArray.Contructor");

    return constructWebGLArray<WebGLUnsignedShortArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY));
}
Exemple #20
0
static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.AudioParam.name._get");
    AudioParam* imp = V8AudioParam::toNative(info.Holder());
    return v8String(imp->name());
}
Exemple #21
0
v8::Handle<v8::Value> V8Float64Array::constructorCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Float64Array.Contructor");

    return constructWebGLArray<Float64Array, double>(args, &info, v8::kExternalDoubleArray);
}
Exemple #22
0
static v8::Handle<v8::Value> unitsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.AudioParam.units._get");
    AudioParam* imp = V8AudioParam::toNative(info.Holder());
    return v8::Integer::New(imp->units());
}
Exemple #23
0
static v8::Handle<v8::Value> numberOfItemsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGPathSegList.numberOfItems._get");
    SVGPathSegListPropertyTearOff* imp = V8SVGPathSegList::toNative(info.Holder());
    return v8::Integer::NewFromUnsigned(imp->numberOfItems());
}
v8::Handle<v8::Value> V8WebGLByteArray::constructorCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.WebGLByteArray.Contructor");

    return constructWebGLArray<WebGLByteArray, signed char>(args, &info, v8::kExternalByteArray);
}
Exemple #25
0
static v8::Handle<v8::Value> sizeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Blob.size._get");
    Blob* imp = V8Blob::toNative(info.Holder());
    return v8::Number::New(static_cast<double>(imp->size()));
}
v8::Handle<v8::Value> V8WebGLByteArray::setCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.WebGLByteArray.set()");
    return setWebGLArray<WebGLByteArray, V8WebGLByteArray>(args);
}
v8::Handle<v8::Value> V8DatabaseSync::readTransactionCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.DatabaseSync.readTransaction()");
    return createTransaction(args, true);
}
Exemple #28
0
VOID
SpySetName (
    __inout PRECORD_LIST RecordList,
    __in PDEVICE_OBJECT DeviceObject,
    __in_opt PFILE_OBJECT FileObject,
    __in ULONG LookupFlags,
    __in_opt PVOID Context
)
/*++

Routine Description:

    This routine looks up the FileObject in the hash table.  If the FileObject
    is found in the hash table, copy the associated file name to RecordList.
    Otherwise, calls NLGetFullPathName to try to get the name of the FileObject.
    If successful, copy the file name to the RecordList and insert into hash
    table.

Arguments:

    RecordList - RecordList to copy name to.
    FileObject - the FileObject to look up.
    LookInFileObject - see routine description
    DeviceExtension - contains the volume name (e.g., "c:") and
        the next device object which may be needed.

Return Value:

    None.

--*/
{
    PFILESPY_DEVICE_EXTENSION devExt = DeviceObject->DeviceExtension;
    UINT_PTR hashIndex;
    KIRQL oldIrql;
    PHASH_ENTRY pHash;
    PHASH_ENTRY newHash;
    PLIST_ENTRY listHead;
    PNAME_CONTROL newName = NULL;
    PCHAR buffer = NULL;
    NTSTATUS status;
    BOOLEAN cacheName;

    UNREFERENCED_PARAMETER( Context );

    try {

        if (FileObject == NULL) {

            SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &gEmptyUnicode );
            leave;
        }

        hashIndex = HASH_FUNC(FileObject);

        INC_STATS(TotalContextSearches);

        listHead = &gHashTable[hashIndex];

        //
        //  Don't bother checking the hash if we are in create, we must always
        //  generate a name.
        //

        if (!FlagOn(LookupFlags, NLFL_IN_CREATE)) {

            //
            //  Acquire the hash lock
            //

            KeAcquireSpinLock( &gHashLockTable[hashIndex], &oldIrql );

            pHash = SpyHashBucketLookup( &gHashTable[hashIndex], FileObject );

            if (pHash != NULL) {

                //
                //  Copy the found file name to the LogRecord
                //

                SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &pHash->Name );

                KeReleaseSpinLock( &gHashLockTable[hashIndex], oldIrql );

                INC_STATS( TotalContextFound );

                leave;
            }

            KeReleaseSpinLock( &gHashLockTable[hashIndex], oldIrql );
        }

#if WINVER >= 0x0501
        //
        //  We can not allocate paged pool if this is a paging file.  If it is
        //  a paging file set a default name and return
        //

#if __NDAS_FS__

        NDASFS_ASSERT( FALSE );

#else

        if (FsRtlIsPagingFile( FileObject )) {

            SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &PagingFile );
            leave;
        }

#endif

#endif

        //
        //  We did not find the name in the hash.  Allocate name control buffer
        //  (for getting name) and a buffer for inserting this name into the
        //  hash.
        //

        buffer = SpyAllocateBuffer( &gNamesAllocated, gMaxNamesToAllocate, NULL );

        status = NLAllocateNameControl( &newName, &gFileSpyNameBufferLookasideList );

        if ((buffer != NULL) && NT_SUCCESS(status)) {

            //
            //  Init the new hash entry in case we need to use it
            //

            newHash = (PHASH_ENTRY)buffer;
            RtlInitEmptyUnicodeString( &newHash->Name,
                                       (PWCHAR)(buffer + sizeof(HASH_ENTRY)),
                                       RECORD_SIZE - sizeof(HASH_ENTRY) );

            //
            //  Retrieve the name
            //

            status = NLGetFullPathName( FileObject,
                                        newName,
                                        &devExt->NLExtHeader,
                                        LookupFlags | NLFL_USE_DOS_DEVICE_NAME,
                                        &gFileSpyNameBufferLookasideList,
                                        &cacheName );

            if (NT_SUCCESS( status ) && cacheName) {

                //
                //  We got a name and the name should be cached, save it in the
                //  log record and the hash buffer.
                //

                SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &newName->Name );

                RtlCopyUnicodeString( &newHash->Name, &newName->Name );
                newHash->FileObject = FileObject;

                //
                //  Acquire the hash lock
                //

                KeAcquireSpinLock( &gHashLockTable[hashIndex], &oldIrql );

                //
                //  Search again because it may have been stored in the hash table
                //  since we did our last search and dropped the lock.
                //

                pHash = SpyHashBucketLookup( &gHashTable[hashIndex], FileObject );

                if (pHash != NULL) {

                    //
                    //  We found it in the hash table this time, don't need to
                    //  cache it again.
                    //

                    KeReleaseSpinLock( &gHashLockTable[hashIndex], oldIrql );

                    leave;
                }

                //
                //  It not found in the hash, add the new entry.
                //

                InsertHeadList( listHead, &newHash->List );

                gHashCurrentCounters[hashIndex]++;

                if (gHashCurrentCounters[hashIndex] > gHashMaxCounters[hashIndex]) {

                    gHashMaxCounters[hashIndex] = gHashCurrentCounters[hashIndex];
                }

                //
                //  Since we inserted the new hash entry, mark the buffer as empty
                //  so we won't try and free it
                //

                buffer = NULL;

                KeReleaseSpinLock( &gHashLockTable[hashIndex], oldIrql );

            } else {

                //
                //  Either the name should not be cached or we couldn't get a
                //  name, return whatever name they gave us
                //

                SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &newName->Name );

                INC_STATS( TotalContextTemporary );
            }

        } else {

            //
            //  Set a default string even if there is no buffer.
            //

            SpyCopyFileNameToLogRecord( &RecordList->LogRecord, &OutOfBuffers );
        }

    }
    finally {

        //
        //  Free memory
        //

        if (buffer != NULL) {

            SpyFreeBuffer( buffer, &gNamesAllocated );
        }

        if (newName != NULL) {

            NLFreeNameControl( newName, &gFileSpyNameBufferLookasideList );
        }
    }
}
Exemple #29
0
static v8::Handle<v8::Value> selectedAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
    INC_STATS("DOM.HTMLOptionElement.selected._get");
    HTMLOptionElement* imp = V8HTMLOptionElement::toNative(info.Holder());
    return v8Boolean(imp->selected());
}
Exemple #30
0
 static v8::Handle<v8::Value> styleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.CSSPageRule.style._get");
   CSSPageRule* imp = V8CSSPageRule::toNative(info.Holder());
   return toV8(imp->style());
 }