Esempio n. 1
0
static v8::Handle<v8::Value> containsCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.DOMStringList.contains");
    DOMStringList* imp = V8DOMStringList::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, string, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
    return v8Boolean(imp->contains(string));
}
Esempio n. 2
0
DOMStringList* IDBDatabase::objectStoreNames() const {
  DOMStringList* objectStoreNames =
      DOMStringList::create(DOMStringList::IndexedDB);
  for (const auto& it : m_metadata.objectStores)
    objectStoreNames->append(it.value->name);
  objectStoreNames->sort();
  return objectStoreNames;
}
Esempio n. 3
0
DOMStringList* IDBObjectStore::indexNames() const
{
    IDB_TRACE("IDBObjectStore::indexNames");
    DOMStringList* indexNames = DOMStringList::create(DOMStringList::IndexedDB);
    for (const auto& it : m_metadata.indexes)
        indexNames->append(it.value.name);
    indexNames->sort();
    return indexNames;
}
Esempio n. 4
0
DOMStringList* IDBTransaction::objectStoreNames() const {
  if (isVersionChange())
    return m_database->objectStoreNames();

  DOMStringList* objectStoreNames =
      DOMStringList::create(DOMStringList::IndexedDB);
  for (const String& objectStoreName : m_scope)
    objectStoreNames->append(objectStoreName);
  objectStoreNames->sort();
  return objectStoreNames;
}
Esempio n. 5
0
static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.DOMStringList.item");
    DOMStringList* imp = V8DOMStringList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    EXCEPTION_BLOCK(int, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
    if (UNLIKELY(index < 0)) {
        ec = INDEX_SIZE_ERR;
        goto fail;
    }
    return v8StringOrNull(imp->item(index));
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
Esempio n. 6
0
void ContentSecurityPolicy::gatherReportURIs(DOMStringList& list) const
{
    ASSERT(m_scriptExecutionContext);
    for (auto& policy : m_policies) {
        for (auto& url : policy->reportURIs())
            list.append(m_scriptExecutionContext->completeURL(url).string());
    }
}
Esempio n. 7
0
static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.DOMStringList.length._get");
    DOMStringList* imp = V8DOMStringList::toNative(info.Holder());
    return v8::Integer::NewFromUnsigned(imp->length());
}
static v8::Handle<v8::Value> containsCallback(const v8::Arguments& args)
{
    DOMStringList* imp = V8DOMStringList::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, string, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return v8Boolean(imp->contains(string), args.GetIsolate());
}
static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
{
    DOMStringList* imp = V8DOMStringList::toNative(args.Holder());
    V8TRYCATCH(unsigned, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
    return v8StringOrNull(imp->item(index), args.GetIsolate());
}
static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    DOMStringList* imp = V8DOMStringList::toNative(info.Holder());
    return v8UnsignedInteger(imp->length(), info.GetIsolate());
}