Commit message: None
CVE: CVE-2012-2867
Vulnerability description: The SPDY implementation in Google Chrome before 21.0.1180.89 allows remote attackers to cause a denial of service (application crash) via unspecified vectors.

Project: Chrome

 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
     : m_element(element)
 {
}

Project: Chrome

AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
    : JSWrappable()
    , m_element(other.m_element)
{
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
{
    return 0;
}

Project: Chrome

bool AccessibilityUIElement::addNotificationListener(JSValueRef functionCallback)
{
    return true;
}

Project: Chrome

void AccessibilityUIElement::addSelection()
{
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    GOwnPtr<gchar> attributeData(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element))));
    return JSStringCreateWithUTF8CString(attributeData.get());
}

Project: Chrome

static void alterCurrentValue(PlatformUIElement element, int factor)
{
    if (!element || !ATK_IS_VALUE(element))
        return;

    GValue currentValue = G_VALUE_INIT;
    atk_value_get_current_value(ATK_VALUE(element), &currentValue);

    GValue increment = G_VALUE_INIT;
    atk_value_get_minimum_increment(ATK_VALUE(element), &increment);

    GValue newValue = G_VALUE_INIT;
    g_value_init(&newValue, G_TYPE_DOUBLE);

    g_value_set_float(&newValue, g_value_get_float(&currentValue) + factor * g_value_get_float(&increment));
    atk_value_set_current_value(ATK_VALUE(element), &newValue);

    g_value_unset(&newValue);
    g_value_unset(&increment);
     g_value_unset(&currentValue);
 }

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

bool AccessibilityUIElement::ariaIsGrabbed() const
{
    return false;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

static gchar* attributeSetToString(AtkAttributeSet* attributeSet)
{
    GString* str = g_string_new(0);
    for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) {
        AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
        GOwnPtr<gchar> attributeData(g_strconcat(attribute->name, ":", attribute->value, NULL));
        g_string_append(str, attributeData.get());
        if (attributes->next)
            g_string_append(str, ", ");
    }

    return g_string_free(str, FALSE);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef attribute, AccessibilityTextMarkerRange* range)
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
{
    return false;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
{
    return false;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row)
{
    if (!m_element || !ATK_IS_TABLE(m_element))
        return 0;

    AtkObject* foundCell = atk_table_ref_at(ATK_TABLE(m_element), row, col);
    return foundCell ? AccessibilityUIElement::create(foundCell) : 0;
}

Project: Chrome

static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
{
    if (!ATK_IS_OBJECT(element))
        return false;

    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
    return atk_state_set_contains_state(stateSet.get(), stateType);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned index)
{
    Vector<RefPtr<AccessibilityUIElement> > children;
    getChildrenWithRange(children, index, 1);

    if (children.size() == 1)
        return children[0];

    return 0;
}

Project: Chrome

double AccessibilityUIElement::clickPointX()
{
    return 0.0f;
}

Project: Chrome

double AccessibilityUIElement::clickPointY()
{
    return 0.0f;
}

Project: Chrome

int AccessibilityUIElement::columnCount()
{
    if (!m_element || !ATK_IS_TABLE(m_element))
        return 0;

    return atk_table_get_n_columns(ATK_TABLE(m_element));
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange()
{
    return indexRangeInTable(m_element, false);
}

Project: Chrome

void AccessibilityUIElement::decrement()
{
    alterCurrentValue(m_element, -1);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    const gchar* description = atk_object_get_description(ATK_OBJECT(m_element));
    if (!description)
        return JSStringCreateWithCharacters(0, 0);

    GOwnPtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description));

    return JSStringCreateWithUTF8CString(axDesc.get());
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
    if (role != ATK_ROLE_DOCUMENT_FRAME)
        return JSStringCreateWithCharacters(0, 0);

    return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "Encoding"));
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
    if (role != ATK_ROLE_DOCUMENT_FRAME)
        return JSStringCreateWithCharacters(0, 0);

    return JSStringCreateWithUTF8CString(atk_document_get_attribute_value(ATK_DOCUMENT(m_element), "URI"));
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int x, int y)
{
    return 0;
}

Project: Chrome

void AccessibilityUIElement::getChildren(Vector<RefPtr<AccessibilityUIElement> >& children)
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return;

    int count = childrenCount();
    for (int i = 0; i < count; i++) {
        AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i);
        children.append(AccessibilityUIElement::create(child));
    }
}

Project: Chrome

void AccessibilityUIElement::getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >& children, unsigned location, unsigned length)
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return;
    unsigned end = location + length;
    for (unsigned i = location; i < end; i++) {
        AtkObject* child = atk_object_ref_accessible_child(ATK_OBJECT(m_element), i);
        children.append(AccessibilityUIElement::create(child));
    }
}

Project: Chrome

bool AccessibilityUIElement::hasPopup() const
{
    return false;
}

Project: Chrome

double AccessibilityUIElement::height()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    int width, height;
    atk_component_get_size(ATK_COMPONENT(m_element), &width, &height);
    return height;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

int AccessibilityUIElement::hierarchicalLevel() const
{
    return 0;
}

Project: Chrome

int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker* marker)
{
    return -1;
}

Project: Chrome

int AccessibilityUIElement::indexInTable()
{
    return -1;
}

Project: Chrome

unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0;

    Vector<RefPtr<AccessibilityUIElement> > children;
    getChildren(children);

    unsigned count = children.size();
    for (unsigned i = 0; i < count; i++)
        if (children[i]->isEqual(element))
            return i;

    return 0;
}

Project: Chrome

static JSStringRef indexRangeInTable(PlatformUIElement element, bool isRowRange)
{
    GOwnPtr<gchar> rangeString(g_strdup("{0, 0}"));

    if (!element || !ATK_IS_OBJECT(element))
        return JSStringCreateWithUTF8CString(rangeString.get());

    AtkObject* axTable = atk_object_get_parent(ATK_OBJECT(element));
    if (!axTable || !ATK_IS_TABLE(axTable))
        return JSStringCreateWithUTF8CString(rangeString.get());

    gint indexInParent = atk_object_get_index_in_parent(ATK_OBJECT(element));
    if (indexInParent == -1)
        return JSStringCreateWithUTF8CString(rangeString.get());

    int row = -1;
    int column = -1;
    row = atk_table_get_row_at_index(ATK_TABLE(axTable), indexInParent);
    column = atk_table_get_column_at_index(ATK_TABLE(axTable), indexInParent);

    if (row != -1 && column != -1) {
        int base = 0;
        int length = 0;
        if (isRowRange) {
            base = row;
            length = atk_table_get_row_extent_at(ATK_TABLE(axTable), row, column);
        } else {
            base = column;
            length = atk_table_get_column_extent_at(ATK_TABLE(axTable), row, column);
        }
        rangeString.set(g_strdup_printf("{%d, %d}", base, length));
    }

    return JSStringCreateWithUTF8CString(rangeString.get());
}

Project: Chrome

int AccessibilityUIElement::insertionPointLineNumber()
{
    return -1;
}

Project: Chrome

double AccessibilityUIElement::intValue() const
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    GValue value = G_VALUE_INIT;
    atk_value_get_current_value(ATK_VALUE(m_element), &value);
    if (!G_VALUE_HOLDS_FLOAT(&value))
        return 0.0f;

    return g_value_get_float(&value);
}

Project: Chrome

bool AccessibilityUIElement::isActionSupported(JSStringRef action)
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isCollapsed() const
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isEnabled()
{
    return checkElementState(m_element, ATK_STATE_ENABLED);
}

Project: Chrome

bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
{
    return m_element == otherElement->platformUIElement();
}

Project: Chrome

bool AccessibilityUIElement::isExpanded() const
{
    return checkElementState(m_element, ATK_STATE_EXPANDED);
}

Project: Chrome

bool AccessibilityUIElement::isFocusable() const
{
    return checkElementState(m_element, ATK_STATE_FOCUSABLE);
}

Project: Chrome

bool AccessibilityUIElement::isFocused() const
{
    return checkElementState(m_element, ATK_STATE_FOCUSED);
}

Project: Chrome

bool AccessibilityUIElement::isIgnored() const
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isMultiSelectable() const
{
    return checkElementState(m_element, ATK_STATE_MULTISELECTABLE);
}

Project: Chrome

bool AccessibilityUIElement::isOffScreen() const
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isRequired() const
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isSelectable() const
{
    return checkElementState(m_element, ATK_STATE_SELECTABLE);
}

Project: Chrome

bool AccessibilityUIElement::isSelected() const
{
    return checkElementState(m_element, ATK_STATE_SELECTED);
}

Project: Chrome

bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker* textMarker)
{
    return false;
}

Project: Chrome

bool AccessibilityUIElement::isVisible() const
{
    return checkElementState(m_element, ATK_STATE_VISIBLE);
}

Project: Chrome

int AccessibilityUIElement::lineForIndex(int index)
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

double AccessibilityUIElement::maxValue()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    GValue value = G_VALUE_INIT;
    atk_value_get_maximum_value(ATK_VALUE(m_element), &value);
    if (!G_VALUE_HOLDS_FLOAT(&value))
        return 0.0f;

    return g_value_get_float(&value);
}

Project: Chrome

double AccessibilityUIElement::minValue()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    GValue value = G_VALUE_INIT;
    atk_value_get_minimum_value(ATK_VALUE(m_element), &value);
    if (!G_VALUE_HOLDS_FLOAT(&value))
        return 0.0f;

    return g_value_get_float(&value);
}

Project: Chrome

PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
{
    return 0;
}

Project: Chrome

double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
{
    return 0.0f;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0;

    AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element));
    return parent ? AccessibilityUIElement::create(parent) : 0;
}

Project: Chrome

void AccessibilityUIElement::press()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return;

    if (!ATK_IS_ACTION(m_element))
        return;

    atk_action_do_action(ATK_ACTION(m_element), 0);
}

Project: Chrome

PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

bool AccessibilityUIElement::removeNotificationListener()
{
    return true;
}

Project: Chrome

void AccessibilityUIElement::removeSelection()
{
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element));
    if (!role)
        return JSStringCreateWithCharacters(0, 0);

    const gchar* roleName = atk_role_get_name(role);
    GOwnPtr<gchar> axRole(g_strdup_printf("AXRole: %s", roleName));

    return JSStringCreateWithUTF8CString(axRole.get());
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
{
    return 0;
}

Project: Chrome

unsigned AccessibilityUIElement::selectedChildrenCount() const
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
{
}

Project: Chrome

void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
{
}

Project: Chrome

void AccessibilityUIElement::showMenu()
{
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::speak()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

void AccessibilityUIElement::takeFocus()
{
}

Project: Chrome

void AccessibilityUIElement::takeSelection()
{
}

Project: Chrome

PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForIndex(int textIndex)
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y)
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
{
    return 0;
}

Project: Chrome

int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return JSStringCreateWithCharacters(0, 0);

    const gchar* name = atk_object_get_name(ATK_OBJECT(m_element));
    if (!name)
        return JSStringCreateWithCharacters(0, 0);

    GOwnPtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name));

    return JSStringCreateWithUTF8CString(axTitle.get());
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement()
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef attribute) const
{
    return 0;
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText)
{
    return 0;
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
{
    return JSStringCreateWithCharacters(0, 0);
}

Project: Chrome

PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const
{
    return 0;
}

Project: Chrome

double AccessibilityUIElement::width()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    int width, height;
    atk_component_get_size(ATK_COMPONENT(m_element), &width, &height);
    return width;
}

Project: Chrome

double AccessibilityUIElement::x()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    int x, y;
    atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN);
    return x;
}

Project: Chrome

double AccessibilityUIElement::y()
{
    if (!m_element || !ATK_IS_OBJECT(m_element))
        return 0.0f;

    int x, y;
    atk_component_get_position(ATK_COMPONENT(m_element), &x, &y, ATK_XY_SCREEN);
    return y;
}