Commit 7fab097c authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

2010-08-13 Pavel Feldman <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: rename InspectorValue::push and set to
        push{Value|Object|Array} and set{...}.
        https://bugs.webkit.org/show_bug.cgi?id=43966

        * bindings/js/ScriptProfile.cpp:
        (WebCore::buildInspectorObjectFor):
        * bindings/js/ScriptValue.cpp:
        (WebCore::jsToInspectorValue):
        * bindings/v8/ScriptCallStack.cpp:
        (WebCore::ScriptCallStack::stackTrace):
        * bindings/v8/ScriptProfile.cpp:
        (WebCore::buildInspectorObjectFor):
        * bindings/v8/ScriptValue.cpp:
        (WebCore::v8ToInspectorValue):
        * inspector/CodeGeneratorInspector.pm:
        * inspector/ConsoleMessage.cpp:
        (WebCore::ConsoleMessage::addToFrontend):
        * inspector/Inspector.idl:
        * inspector/InspectorApplicationCacheAgent.cpp:
        (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
        (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::buildArrayForCookies):
        (WebCore::InspectorController::getDOMStorageEntries):
        (WebCore::InspectorController::getProfileHeaders):
        (WebCore::InspectorController::getProfile):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::getEventListenersForNode):
        (WebCore::InspectorDOMAgent::buildObjectForNode):
        (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
        (WebCore::InspectorDOMAgent::getStyles):
        (WebCore::InspectorDOMAgent::getAllStyles):
        (WebCore::InspectorDOMAgent::getRuleRanges):
        (WebCore::InspectorDOMAgent::buildObjectForAttributeStyles):
        (WebCore::InspectorDOMAgent::buildArrayForCSSRules):
        (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
        (WebCore::InspectorDOMAgent::buildObjectForStyle):
        (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
        (WebCore::InspectorDOMAgent::buildArrayForDisabledStyleProperties):
        (WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
        (WebCore::InspectorDOMAgent::buildObjectForRule):
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::saveBreakpoints):
        * inspector/InspectorResource.cpp:
        (WebCore::InspectorResource::updateScriptObject):
        * inspector/InspectorStorageAgent.cpp:
        (WebCore::):
        (WebCore::InspectorStorageAgent::executeSQL):
        * inspector/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::pushGCEventRecords):
        (WebCore::InspectorTimelineAgent::didInstallTimer):
        (WebCore::InspectorTimelineAgent::didRemoveTimer):
        (WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
        (WebCore::InspectorTimelineAgent::willSendResourceRequest):
        (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
        (WebCore::InspectorTimelineAgent::didMarkTimeline):
        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
        (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
        * inspector/InspectorValues.cpp:
        (WebCore::):
        (WebCore::InspectorValue::asValue):
        (WebCore::InspectorValue::asObject):
        (WebCore::InspectorValue::asArray):
        (WebCore::InspectorObject::asObject):
        (WebCore::InspectorArray::asArray):
        * inspector/InspectorValues.h:
        (WebCore::InspectorObject::setBool):
        (WebCore::InspectorObject::setNumber):
        (WebCore::InspectorObject::setString):
        (WebCore::InspectorObject::setValue):
        (WebCore::InspectorObject::setObject):
        (WebCore::InspectorObject::setArray):
        (WebCore::InspectorArray::pushValue):
        (WebCore::InspectorArray::pushObject):
        (WebCore::InspectorArray::pushArray):
        * inspector/ScriptBreakpoint.cpp:
        (WebCore::ScriptBreakpoint::inspectorObjectFromSourceBreakpoints):
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::createGenericRecord):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 28b03451
2010-08-13 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: rename InspectorValue::push and set to
push{Value|Object|Array} and set{...}.
https://bugs.webkit.org/show_bug.cgi?id=43966
* bindings/js/ScriptProfile.cpp:
(WebCore::buildInspectorObjectFor):
* bindings/js/ScriptValue.cpp:
(WebCore::jsToInspectorValue):
* bindings/v8/ScriptCallStack.cpp:
(WebCore::ScriptCallStack::stackTrace):
* bindings/v8/ScriptProfile.cpp:
(WebCore::buildInspectorObjectFor):
* bindings/v8/ScriptValue.cpp:
(WebCore::v8ToInspectorValue):
* inspector/CodeGeneratorInspector.pm:
* inspector/ConsoleMessage.cpp:
(WebCore::ConsoleMessage::addToFrontend):
* inspector/Inspector.idl:
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
(WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::buildArrayForCookies):
(WebCore::InspectorController::getDOMStorageEntries):
(WebCore::InspectorController::getProfileHeaders):
(WebCore::InspectorController::getProfile):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
(WebCore::InspectorDOMAgent::getStyles):
(WebCore::InspectorDOMAgent::getAllStyles):
(WebCore::InspectorDOMAgent::getRuleRanges):
(WebCore::InspectorDOMAgent::buildObjectForAttributeStyles):
(WebCore::InspectorDOMAgent::buildArrayForCSSRules):
(WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
(WebCore::InspectorDOMAgent::buildObjectForStyle):
(WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
(WebCore::InspectorDOMAgent::buildArrayForDisabledStyleProperties):
(WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
(WebCore::InspectorDOMAgent::buildObjectForRule):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::saveBreakpoints):
* inspector/InspectorResource.cpp:
(WebCore::InspectorResource::updateScriptObject):
* inspector/InspectorStorageAgent.cpp:
(WebCore::):
(WebCore::InspectorStorageAgent::executeSQL):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::pushGCEventRecords):
(WebCore::InspectorTimelineAgent::didInstallTimer):
(WebCore::InspectorTimelineAgent::didRemoveTimer):
(WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
(WebCore::InspectorTimelineAgent::willSendResourceRequest):
(WebCore::InspectorTimelineAgent::didFinishLoadingResource):
(WebCore::InspectorTimelineAgent::didMarkTimeline):
(WebCore::InspectorTimelineAgent::addRecordToTimeline):
(WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
* inspector/InspectorValues.cpp:
(WebCore::):
(WebCore::InspectorValue::asValue):
(WebCore::InspectorValue::asObject):
(WebCore::InspectorValue::asArray):
(WebCore::InspectorObject::asObject):
(WebCore::InspectorArray::asArray):
* inspector/InspectorValues.h:
(WebCore::InspectorObject::setBool):
(WebCore::InspectorObject::setNumber):
(WebCore::InspectorObject::setString):
(WebCore::InspectorObject::setValue):
(WebCore::InspectorObject::setObject):
(WebCore::InspectorObject::setArray):
(WebCore::InspectorArray::pushValue):
(WebCore::InspectorArray::pushObject):
(WebCore::InspectorArray::pushArray):
* inspector/ScriptBreakpoint.cpp:
(WebCore::ScriptBreakpoint::inspectorObjectFromSourceBreakpoints):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
2010-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r65204.
......@@ -84,8 +84,8 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const JSC::ProfileNod
const ProfileNodesList& children = node->children();
ProfileNodesList::const_iterator end = children.end();
for (ProfileNodesList::const_iterator iter = children.begin(); iter != end; ++iter)
childrenArray->push(buildInspectorObjectFor(iter->get()));
result->set("children", childrenArray);
childrenArray->pushObject(buildInspectorObjectFor(iter->get()));
result->setArray("children", childrenArray);
return result;
}
......
......@@ -123,7 +123,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
ASSERT_NOT_REACHED();
elementValue = InspectorValue::null();
}
inspectorArray->push(elementValue);
inspectorArray->pushValue(elementValue);
}
return inspectorArray;
}
......@@ -139,7 +139,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
ASSERT_NOT_REACHED();
inspectorValue = InspectorValue::null();
}
inspectorObject->set(String(name.characters(), name.length()), inspectorValue);
inspectorObject->setValue(String(name.characters(), name.length()), inspectorValue);
}
return inspectorObject;
}
......
......@@ -171,7 +171,7 @@ bool ScriptCallStack::stackTrace(int frameLimit, const RefPtr<InspectorArray>& s
frameObject->setString("functionName", functionName.IsEmpty() ? "" : toWebCoreString(functionName));
frameObject->setNumber("lineNumber", frame->GetLineNumber());
frameObject->setNumber("column", frame->GetColumn());
stackTrace->push(frameObject);
stackTrace->pushObject(frameObject);
}
return true;
#else
......
......@@ -72,9 +72,9 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::CpuProfileN
const int childrenCount = node->GetChildrenCount();
for (int i = 0; i < childrenCount; i++) {
const v8::CpuProfileNode* child = node->GetChild(i);
children->push(buildInspectorObjectFor(child));
children->pushObject(buildInspectorObjectFor(child));
}
result->set("children", children);
result->setArray("children", children);
return result;
}
......
......@@ -93,7 +93,7 @@ static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
ASSERT_NOT_REACHED();
element = InspectorValue::null();
}
inspectorArray->push(element);
inspectorArray->pushValue(element);
}
return inspectorArray;
}
......@@ -112,7 +112,7 @@ static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
ASSERT_NOT_REACHED();
continue;
}
inspectorObject->set(toWebCoreStringWithNullCheck(name), propertyValue);
inspectorObject->setValue(toWebCoreStringWithNullCheck(name), propertyValue);
}
return inspectorObject;
}
......
......@@ -47,30 +47,27 @@ $typeTransform{"PassRefPtr"} = {
};
$typeTransform{"Object"} = {
"param" => "PassRefPtr<InspectorObject>",
"retVal" => "PassRefPtr<InspectorObject>",
"variable" => "RefPtr<InspectorObject>",
"defaultValue" => "InspectorObject::create()",
"forward" => "InspectorObject",
"header" => "InspectorValues.h",
"accessorSuffix" => ""
"accessorSuffix" => "Object"
};
$typeTransform{"Array"} = {
"param" => "PassRefPtr<InspectorArray>",
"retVal" => "PassRefPtr<InspectorArray>",
"variable" => "RefPtr<InspectorArray>",
"defaultValue" => "InspectorArray::create()",
"forward" => "InspectorArray",
"header" => "InspectorValues.h",
"accessorSuffix" => ""
"accessorSuffix" => "Array"
};
$typeTransform{"Value"} = {
"param" => "PassRefPtr<InspectorValue>",
"retVal" => "PassRefPtr<InspectorValue>",
"variable" => "RefPtr<InspectorValue>",
"defaultValue" => "InspectorValue::null()",
"forward" => "InspectorValue",
"header" => "InspectorValues.h",
"accessorSuffix" => ""
"accessorSuffix" => "Value"
};
$typeTransform{"String"} = {
"param" => "const String&",
......@@ -120,7 +117,6 @@ $typeTransform{"boolean"} = {
"accessorSuffix" => "Bool"
};
$typeTransform{"void"} = {
"retVal" => "void",
"forward" => "",
"header" => ""
};
......@@ -324,7 +320,7 @@ sub generateBackendFunction
my $i = 1; # zero element is the method name.
foreach my $parameter (@inArgs) {
my $type = $parameter->type;
my $argumentType = $typeTransform{$type}->{$typeTransform{$type}->{"retVal"} ? "retVal" : "variable"};
my $argumentType = $typeTransform{$type}->{"variable"};
push(@function, " $argumentType " . $parameter->name . ";") if !($parameter->name eq "callId");
push(@function, " if (!args->get($i)->as" . $typeTransform{$type}->{"accessorSuffix"} . "(&" . $parameter->name . ")) {");
push(@function, " ASSERT_NOT_REACHED();");
......
......@@ -134,15 +134,15 @@ void ConsoleMessage::addToFrontend(RemoteInspectorFrontend* frontend, InjectedSc
ASSERT_NOT_REACHED();
return;
}
jsonArgs->push(inspectorValue);
jsonArgs->pushValue(inspectorValue);
}
jsonObj->set("parameters", jsonArgs);
jsonObj->setArray("parameters", jsonArgs);
}
if (!m_frames.isEmpty()) {
RefPtr<InspectorArray> frames = InspectorArray::create();
for (unsigned i = 0; i < m_frames.size(); i++)
frames->push(m_frames.at(i).buildInspectorObject());
jsonObj->set("stackTrace", frames);
frames->pushObject(m_frames.at(i).buildInspectorObject());
jsonObj->setArray("stackTrace", frames);
}
frontend->addConsoleMessage(jsonObj);
}
......
......@@ -217,6 +217,5 @@ module core {
[handler=Controller] void setDOMStorageItem(in long callId, in long storageId, in String key, in String value, out boolean success);
[handler=Controller] void removeDOMStorageItem(in long callId, in long storageId, in String key, out boolean success);
#endif
};
}
......@@ -82,7 +82,7 @@ PassRefPtr<InspectorObject> InspectorApplicationCacheAgent::buildObjectForApplic
value->setString("lastPathComponent", applicationCacheInfo.m_manifest.lastPathComponent());
value->setNumber("creationTime", applicationCacheInfo.m_creationTime);
value->setNumber("updateTime", applicationCacheInfo.m_updateTime);
value->set("resources", buildArrayForApplicationCacheResources(applicationCacheResources));
value->setArray("resources", buildArrayForApplicationCacheResources(applicationCacheResources));
return value;
}
......@@ -93,7 +93,7 @@ PassRefPtr<InspectorArray> InspectorApplicationCacheAgent::buildArrayForApplicat
ApplicationCacheHost::ResourceInfoList::const_iterator end = applicationCacheResources.end();
ApplicationCacheHost::ResourceInfoList::const_iterator it = applicationCacheResources.begin();
for (int i = 0; it != end; ++it, i++)
resources->push(buildObjectForApplicationCacheResource(*it));
resources->pushObject(buildObjectForApplicationCacheResource(*it));
return resources;
}
......
......@@ -1334,7 +1334,7 @@ PassRefPtr<InspectorArray> InspectorController::buildArrayForCookies(ListHashSet
ListHashSet<Cookie>::iterator end = cookiesList.end();
ListHashSet<Cookie>::iterator it = cookiesList.begin();
for (int i = 0; it != end; ++it, i++)
cookies->push(buildObjectForCookie(*it));
cookies->pushObject(buildObjectForCookie(*it));
return cookies;
}
......@@ -1418,7 +1418,7 @@ void InspectorController::getDOMStorageEntries(long storageId, RefPtr<InspectorA
RefPtr<InspectorArray> entry = InspectorArray::create();
entry->pushString(name);
entry->pushString(value);
(*entries)->push(entry);
(*entries)->pushArray(entry);
}
}
}
......@@ -1505,7 +1505,7 @@ void InspectorController::getProfileHeaders(RefPtr<InspectorArray>* headers)
{
ProfilesMap::iterator profilesEnd = m_profiles.end();
for (ProfilesMap::iterator it = m_profiles.begin(); it != profilesEnd; ++it)
(*headers)->push(createProfileHeader(*it->second));
(*headers)->pushObject(createProfileHeader(*it->second));
}
void InspectorController::getProfile(unsigned uid, RefPtr<InspectorObject>* profileObject)
......@@ -1513,7 +1513,7 @@ void InspectorController::getProfile(unsigned uid, RefPtr<InspectorObject>* prof
ProfilesMap::iterator it = m_profiles.find(uid);
if (it != m_profiles.end()) {
*profileObject = createProfileHeader(*it->second);
(*profileObject)->set("head", it->second->buildInspectorObjectForHead());
(*profileObject)->setObject("head", it->second->buildInspectorObjectForHead());
}
}
......
......@@ -600,7 +600,7 @@ void InspectorDOMAgent::getEventListenersForNode(long nodeId, long* outNodeId, R
for (size_t j = 0; j < vector.size(); ++j) {
const RegisteredEventListener& listener = vector[j];
if (listener.useCapture)
(*listenersArray)->push(buildObjectForEventListener(listener, info.eventType, info.node));
(*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
}
}
......@@ -611,7 +611,7 @@ void InspectorDOMAgent::getEventListenersForNode(long nodeId, long* outNodeId, R
for (size_t j = 0; j < vector.size(); ++j) {
const RegisteredEventListener& listener = vector[j];
if (!listener.useCapture)
(*listenersArray)->push(buildObjectForEventListener(listener, info.eventType, info.node));
(*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
}
}
}
......@@ -766,11 +766,11 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForNode(Node* node, in
value->setNumber("childNodeCount", nodeCount);
RefPtr<InspectorArray> children = buildArrayForContainerChildren(node, depth, nodesMap);
if (children->length() > 0)
value->set("children", children.release());
value->setArray("children", children.release());
if (node->nodeType() == Node::ELEMENT_NODE) {
Element* element = static_cast<Element*>(node);
value->set("attributes", buildArrayForElementAttributes(element));
value->setArray("attributes", buildArrayForElementAttributes(element));
if (node->isFrameOwnerElement()) {
HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
value->setString("documentURL", documentURLString(frameOwner->contentDocument()));
......@@ -813,7 +813,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForContainerChildren(Nod
if (innerChildNodeCount(container) == 1) {
Node *child = innerFirstChild(container);
if (child->nodeType() == Node::TEXT_NODE)
children->push(buildObjectForNode(child, 0, nodesMap));
children->pushObject(buildObjectForNode(child, 0, nodesMap));
}
return children.release();
} else if (depth > 0) {
......@@ -821,7 +821,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForContainerChildren(Nod
}
for (Node *child = innerFirstChild(container); child; child = innerNextSibling(child))
children->push(buildObjectForNode(child, depth, nodesMap));
children->pushObject(buildObjectForNode(child, depth, nodesMap));
return children.release();
}
......@@ -986,27 +986,27 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
RefPtr<InspectorObject> result = InspectorObject::create();
if (element->style())
result->set("inlineStyle", buildObjectForStyle(element->style(), true));
result->set("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
result->setObject("inlineStyle", buildObjectForStyle(element->style(), true));
result->setObject("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, authorOnly);
result->set("matchedCSSRules", buildArrayForCSSRules(node->ownerDocument(), matchedRules.get()));
result->setArray("matchedCSSRules", buildArrayForCSSRules(node->ownerDocument(), matchedRules.get()));
result->set("styleAttributes", buildObjectForAttributeStyles(element));
result->set("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
result->setObject("styleAttributes", buildObjectForAttributeStyles(element));
result->setArray("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
RefPtr<InspectorObject> currentStyle = result;
Element* parentElement = element->parentElement();
while (parentElement) {
RefPtr<InspectorObject> parentStyle = InspectorObject::create();
currentStyle->set("parent", parentStyle);
currentStyle->setObject("parent", parentStyle);
if (parentElement->style() && parentElement->style()->length())
parentStyle->set("inlineStyle", buildObjectForStyle(parentElement->style(), true));
parentStyle->setObject("inlineStyle", buildObjectForStyle(parentElement->style(), true));
CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
RefPtr<CSSRuleList> parentMatchedRules = parentSelector->styleRulesForElement(parentElement, authorOnly);
parentStyle->set("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentStyle->setArray("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentElement = parentElement->parentElement();
currentStyle = parentStyle;
......@@ -1021,7 +1021,7 @@ void InspectorDOMAgent::getAllStyles(RefPtr<InspectorArray>* styles)
for (unsigned i = 0; i < list->length(); ++i) {
StyleSheet* styleSheet = list->item(i);
if (styleSheet->isCSSStyleSheet())
(*styles)->push(buildObjectForStyleSheet((*it).get(), static_cast<CSSStyleSheet*>(styleSheet)));
(*styles)->pushObject(buildObjectForStyleSheet((*it).get(), static_cast<CSSStyleSheet*>(styleSheet)));
}
}
}
......@@ -1044,9 +1044,9 @@ void InspectorDOMAgent::getRuleRanges(long styleSheetId, RefPtr<InspectorValue>*
for (HashMap<long, SourceRange>::iterator it = ruleRanges.begin(); it != ruleRanges.end(); ++it) {
if (it->second.second) {
RefPtr<InspectorObject> ruleRange = InspectorObject::create();
result->set(String::number(it->first).utf8().data(), ruleRange);
result->setObject(String::number(it->first).utf8().data(), ruleRange);
RefPtr<InspectorObject> bodyRange = InspectorObject::create();
ruleRange->set("bodyRange", bodyRange);
ruleRange->setObject("bodyRange", bodyRange);
bodyRange->setNumber("start", it->second.first);
bodyRange->setNumber("end", it->second.second);
}
......@@ -1085,7 +1085,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForAttributeStyles(Ele
Attribute* attribute = attributes->attributeItem(i);
if (attribute->style()) {
String attributeName = attribute->localName();
styleAttributes->set(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), true));
styleAttributes->setObject(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), true));
}
}
return styleAttributes;
......@@ -1097,7 +1097,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForCSSRules(Document* ow
for (unsigned i = 0; matchedRules && i < matchedRules->length(); ++i) {
CSSRule* rule = matchedRules->item(i);
if (rule->type() == CSSRule::STYLE_RULE)
matchedCSSRules->push(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
matchedCSSRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
return matchedCSSRules.release();
}
......@@ -1113,8 +1113,8 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForPseudoElements(Elemen
if (matchedRules && matchedRules->length()) {
RefPtr<InspectorObject> pseudoStyles = InspectorObject::create();
pseudoStyles->setNumber("pseudoId", static_cast<int>(pseudoId));
pseudoStyles->set("rules", buildArrayForCSSRules(element->ownerDocument(), matchedRules.get()));
result->push(pseudoStyles.release());
pseudoStyles->setArray("rules", buildArrayForCSSRules(element->ownerDocument(), matchedRules.get()));
result->pushObject(pseudoStyles.release());
}
}
return result.release();
......@@ -1309,7 +1309,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyle(CSSStyleDecla
DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(styleId, false);
if (disabledStyle)
result->set("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
result->setArray("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
}
result->setString("width", style->getPropertyValue("width"));
result->setString("height", style->getPropertyValue("height"));
......@@ -1336,10 +1336,10 @@ void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* s
shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
}
property->setString("value", style->getPropertyValue(name));
properties->push(property.release());
properties->pushObject(property.release());
}
result->set("properties", properties);
result->set("shorthandValues", shorthandValues);
result->setArray("properties", properties);
result->setObject("shorthandValues", shorthandValues);
}
PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperties(DisabledStyleDeclaration* declaration)
......@@ -1350,7 +1350,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperti
property->setString("name", it->first);
property->setString("value", it->second.first);
property->setString("priority", it->second.second);
properties->push(property.release());
properties->pushObject(property.release());
}
return properties.release();
}
......@@ -1370,10 +1370,10 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document
for (unsigned i = 0; i < cssRuleList->length(); ++i) {
CSSRule* rule = cssRuleList->item(i);
if (rule->isStyleRule())
cssRules->push(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
cssRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
}
result->set("cssRules", cssRules.release());
result->setArray("cssRules", cssRules.release());
return result.release();
}
......@@ -1390,7 +1390,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
parentStyleSheetValue->setString("href", parentStyleSheet->href());
parentStyleSheetValue->setNumber("id", cssStore()->bindStyleSheet(parentStyleSheet));
result->set("parentStyleSheet", parentStyleSheetValue.release());
result->setObject("parentStyleSheet", parentStyleSheetValue.release());
}
bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty();
bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document";
......@@ -1400,7 +1400,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
// Bind editable scripts only.
bool bind = !isUserAgent && !isUser;
result->set("style", buildObjectForStyle(rule->style(), bind));
result->setObject("style", buildObjectForStyle(rule->style(), bind));
if (bind)
result->setNumber("id", cssStore()->bindRule(rule));
......
......@@ -236,7 +236,7 @@ void InspectorDebuggerAgent::saveBreakpoints()
if (it->second.isEmpty())
continue;
RefPtr<InspectorObject> breakpointsForURL = ScriptBreakpoint::inspectorObjectFromSourceBreakpoints(it->second);
breakpoints->set(it->first, breakpointsForURL);
breakpoints->setObject(it->first, breakpointsForURL);
}
m_inspectorController->saveBreakpoints(breakpoints);
}
......
......@@ -189,7 +189,7 @@ void InspectorResource::updateScriptObject(RemoteInspectorFrontend* frontend)
jsonObject->setString("path", m_requestURL.path());
jsonObject->setString("lastPathComponent", m_requestURL.lastPathComponent());
RefPtr<InspectorObject> requestHeaders = buildHeadersObject(m_requestHeaderFields);
jsonObject->set("requestHeaders", requestHeaders);
jsonObject->setObject("requestHeaders", requestHeaders);
jsonObject->setBool("mainResource", m_isMainResource);
jsonObject->setString("requestMethod", m_requestMethod);
jsonObject->setString("requestFormData", m_requestFormData);
......@@ -203,12 +203,12 @@ void InspectorResource::updateScriptObject(RemoteInspectorFrontend* frontend)
jsonObject->setNumber("statusCode", m_responseStatusCode);
jsonObject->setString("statusText", m_responseStatusText);
RefPtr<InspectorObject> responseHeaders = buildHeadersObject(m_responseHeaderFields);
jsonObject->set("responseHeaders", responseHeaders);
jsonObject->setObject("responseHeaders", responseHeaders);
jsonObject->setNumber("connectionID", m_connectionID);
jsonObject->setBool("connectionReused", m_connectionReused);
jsonObject->setBool("cached", m_cached);
if (m_loadTiming && !m_cached)
jsonObject->set("timing", buildObjectForTiming(m_loadTiming.get()));
jsonObject->setObject("timing", buildObjectForTiming(m_loadTiming.get()));
jsonObject->setBool("didResponseChange", true);
}
......
......@@ -66,10 +66,10 @@ void reportTransactionFailed(InspectorStorageAgent* agent, long transactionId, S
class StatementCallback : public SQLStatementCallback {
public:
static PassRefPtr<StatementCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new StatementCallback(transactionId, agent));
}
static PassRefPtr<StatementCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new StatementCallback(transactionId, agent));
}
virtual ~StatementCallback() { }
......@@ -92,7 +92,7 @@ public:
switch (value.type()) {
case SQLValue::StringValue: values->pushString(value.string()); break;
case SQLValue::NumberValue: values->pushNumber(value.number()); break;
case SQLValue::NullValue: values->push(InspectorValue::null()); break;
case SQLValue::NullValue: values->pushValue(InspectorValue::null()); break;
}
}
m_agent->frontend()->sqlTransactionSucceeded(m_transactionId, columnNames, values);
......@@ -109,10 +109,10 @@ private:
class StatementErrorCallback : public SQLStatementErrorCallback {
public:
static PassRefPtr<StatementErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new StatementErrorCallback(transactionId, agent));
}
static PassRefPtr<StatementErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new StatementErrorCallback(transactionId, agent));
}
virtual ~StatementErrorCallback() { }
......@@ -132,10 +132,10 @@ private:
class TransactionCallback : public SQLTransactionCallback {
public:
static PassRefPtr<TransactionCallback> create(const String& sqlStatement, long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new TransactionCallback(sqlStatement, transactionId, agent));
}
static PassRefPtr<TransactionCallback> create(const String& sqlStatement, long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new TransactionCallback(sqlStatement, transactionId, agent));
}
virtual ~TransactionCallback() { }
......@@ -163,10 +163,10 @@ private:
class TransactionErrorCallback : public SQLTransactionErrorCallback {
public:
static PassRefPtr<TransactionErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new TransactionErrorCallback(transactionId, agent));
}
static PassRefPtr<TransactionErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
{
return adoptRef(new TransactionErrorCallback(transactionId, agent));
}
virtual ~TransactionErrorCallback() { }
......@@ -183,20 +183,20 @@ private:
RefPtr<InspectorStorageAgent> m_agent;
};
class TransactionSuccessCallback : public VoidCallback {
public:
static PassRefPtr<TransactionSuccessCallback> create()
{
return adoptRef(new TransactionSuccessCallback());
}
virtual ~TransactionSuccessCallback() { }
virtual void handleEvent() { }
private:
TransactionSuccessCallback() { }
};
class TransactionSuccessCallback : public VoidCallback {
public:
static PassRefPtr<TransactionSuccessCallback> create()
{
return adoptRef(new TransactionSuccessCallback());
}