Changeset 173554 in webkit
- Timestamp:
- Sep 11, 2014, 9:53:35 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 29 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/bindings/ScriptValue.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/InjectedScriptManager.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/InspectorBackendDispatcher.cpp (modified) (6 diffs)
-
JavaScriptCore/inspector/InspectorBackendDispatcher.h (modified) (1 diff)
-
JavaScriptCore/inspector/InspectorProtocolTypes.h (modified) (3 diffs)
-
JavaScriptCore/inspector/InspectorValues.cpp (modified) (11 diffs)
-
JavaScriptCore/inspector/InspectorValues.h (modified) (12 diffs)
-
JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (modified) (5 diffs)
-
JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/scripts/codegen/generator.py (modified) (2 diffs)
-
JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result (modified) (11 diffs)
-
JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result (modified) (7 diffs)
-
JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result (modified) (3 diffs)
-
JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result (modified) (1 diff)
-
JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result (modified) (4 diffs)
-
JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result (modified) (2 diffs)
-
JavaScriptCore/replay/EncodedValue.cpp (modified) (6 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/InspectorDOMAgent.cpp (modified) (3 diffs)
-
WebCore/inspector/InspectorDOMDebuggerAgent.cpp (modified) (1 diff)
-
WebCore/inspector/InspectorIndexedDBAgent.cpp (modified) (2 diffs)
-
WebCore/inspector/InspectorOverlay.cpp (modified) (5 diffs)
-
WebCore/inspector/InspectorReplayAgent.cpp (modified) (1 diff)
-
WebCore/inspector/InspectorStyleSheet.h (modified) (1 diff)
-
WebCore/inspector/InspectorTimelineAgent.cpp (modified) (2 diffs)
-
WebCore/inspector/TimelineRecordFactory.cpp (modified) (16 diffs)
-
WebCore/inspector/TimelineRecordFactory.h (modified) (2 diffs)
-
WebCore/page/ContentSecurityPolicy.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r173551 r173554 1 2014-09-11 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Inspector: disambiguate double and integer primitive types in the protocol 4 https://bugs.webkit.org/show_bug.cgi?id=136606 5 6 Reviewed by Timothy Hatcher. 7 8 Right now it's really easy to mix up doubles and integers when serializing or deserializing 9 values for the inspector protocol. This patch disambiguates setting/getting doubles and integers 10 so that it is clearer as to which type is intended. 11 12 A new InspectorValue::Type is added for Integer types, and the Number type is renamed to Double. 13 The existing callsites for asNumber/getNumber/setNumber have been fixed. 14 15 Address various integration points to make sure the right type tag is assigned to InspectorValues. 16 17 * bindings/ScriptValue.cpp: 18 (Deprecated::jsToInspectorValue): Make an Integer if the JSValue is Int52 or smaller. 19 * inspector/InjectedScriptManager.cpp: 20 (Inspector::InjectedScriptManager::injectedScriptForObjectId): 21 * inspector/InspectorBackendDispatcher.cpp: 22 (Inspector::InspectorBackendDispatcher::dispatch): 23 (Inspector::InspectorBackendDispatcher::sendResponse): 24 (Inspector::InspectorBackendDispatcher::reportProtocolError): 25 (Inspector::AsMethodBridges::asInteger): 26 (Inspector::AsMethodBridges::asDouble): 27 (Inspector::InspectorBackendDispatcher::getInteger): 28 (Inspector::InspectorBackendDispatcher::getDouble): 29 (Inspector::AsMethodBridges::asInt): Deleted. 30 (Inspector::InspectorBackendDispatcher::getInt): Deleted. 31 * inspector/InspectorBackendDispatcher.h: 32 * inspector/InspectorProtocolTypes.h: Remove the special case for checking int type tags. 33 (Inspector::Protocol::ArrayItemHelper<int>::Traits::pushRaw): 34 (Inspector::Protocol::ArrayItemHelper<double>::Traits::pushRaw): 35 (Inspector::Protocol::BindingTraits<int>::assertValueHasExpectedType): Deleted. 36 * inspector/InspectorValues.cpp: Allow integers and doubles to be convertible using asInteger/asDouble. 37 (Inspector::InspectorValue::asDouble): 38 (Inspector::InspectorValue::asInteger): 39 (Inspector::InspectorBasicValue::asDouble): 40 (Inspector::InspectorBasicValue::asInteger): 41 (Inspector::InspectorBasicValue::writeJSON): 42 (Inspector::InspectorValue::asNumber): Deleted. 43 (Inspector::InspectorBasicValue::asNumber): Deleted. 44 * inspector/InspectorValues.h: 45 (Inspector::InspectorObjectBase::setInteger): 46 (Inspector::InspectorObjectBase::setDouble): 47 (Inspector::InspectorArrayBase::pushInteger): 48 (Inspector::InspectorArrayBase::pushDouble): 49 (Inspector::InspectorObjectBase::setNumber): Deleted. 50 (Inspector::InspectorArrayBase::pushInt): Deleted. 51 (Inspector::InspectorArrayBase::pushNumber): Deleted. 52 * inspector/agents/InspectorDebuggerAgent.cpp: 53 (Inspector::buildObjectForBreakpointCookie): 54 (Inspector::InspectorDebuggerAgent::breakpointActionsFromProtocol): 55 (Inspector::parseLocation): 56 (Inspector::InspectorDebuggerAgent::didParseSource): 57 * inspector/agents/InspectorRuntimeAgent.cpp: 58 (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets): 59 * inspector/scripts/codegen/generator.py: Update emitted code and rebaseline test results. 60 (Generator.keyed_get_method_for_type): 61 (Generator.keyed_set_method_for_type): 62 * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: 63 * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: 64 * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: 65 * inspector/scripts/tests/expected/events-with-optional-parameters.json-result: 66 * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result: 67 * inspector/scripts/tests/expected/type-declaration-object-type.json-result: 68 * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: 69 * replay/EncodedValue.cpp: 70 (JSC::EncodedValue::convertTo<double>): 71 (JSC::EncodedValue::convertTo<float>): 72 (JSC::EncodedValue::convertTo<int32_t>): 73 (JSC::EncodedValue::convertTo<int64_t>): 74 (JSC::EncodedValue::convertTo<uint32_t>): 75 (JSC::EncodedValue::convertTo<uint64_t>): 76 1 77 2014-09-11 Joseph Pecoraro <pecoraro@apple.com> 2 78 -
trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp
r173410 r173554 115 115 if (value.isBoolean()) 116 116 return InspectorBasicValue::create(value.asBoolean()); 117 if (value.isNumber() )117 if (value.isNumber() && value.isDouble()) 118 118 return InspectorBasicValue::create(value.asNumber()); 119 if (value.isNumber() && value.isMachineInt()) 120 return InspectorBasicValue::create(static_cast<int>(value.asMachineInt())); 119 121 if (value.isString()) 120 122 return InspectorString::create(value.getString(scriptState)); -
trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp
r173410 r173554 98 98 if (parsedObjectId && parsedObjectId->type() == InspectorValue::Type::Object) { 99 99 long injectedScriptId = 0; 100 bool success = parsedObjectId->asObject()->get Number(ASCIILiteral("injectedScriptId"), &injectedScriptId);100 bool success = parsedObjectId->asObject()->getInteger(ASCIILiteral("injectedScriptId"), &injectedScriptId); 101 101 if (success) 102 102 return m_idToInjectedScript.get(injectedScriptId); -
trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
r173120 r173554 98 98 99 99 long callId = 0; 100 if (!callIdValue->as Number(&callId)) {101 reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("The type of 'id' property must be number"));100 if (!callIdValue->asInteger(&callId)) { 101 reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("The type of 'id' property must be integer")); 102 102 return; 103 103 } … … 144 144 RefPtr<InspectorObject> responseMessage = InspectorObject::create(); 145 145 responseMessage->setObject(ASCIILiteral("result"), result); 146 responseMessage->set Number(ASCIILiteral("id"), callId);146 responseMessage->setInteger(ASCIILiteral("id"), callId); 147 147 m_inspectorFrontendChannel->sendMessageToFrontend(responseMessage->toJSONString()); 148 148 } … … 172 172 173 173 RefPtr<InspectorObject> error = InspectorObject::create(); 174 error->set Number(ASCIILiteral("code"), errorCodes[errorCode]);174 error->setInteger(ASCIILiteral("code"), errorCodes[errorCode]); 175 175 error->setString(ASCIILiteral("message"), errorMessage); 176 176 if (data) … … 180 180 message->setObject(ASCIILiteral("error"), error.release()); 181 181 if (callId) 182 message->set Number(ASCIILiteral("id"), *callId);182 message->setInteger(ASCIILiteral("id"), *callId); 183 183 else 184 184 message->setValue(ASCIILiteral("id"), InspectorValue::null()); … … 222 222 223 223 struct AsMethodBridges { 224 static bool asInt (InspectorValue* value, int* output) { return value->asNumber(output); }225 static bool asDouble(InspectorValue* value, double* output) { return value->as Number(output); }224 static bool asInteger(InspectorValue* value, int* output) { return value->asInteger(output); } 225 static bool asDouble(InspectorValue* value, double* output) { return value->asDouble(output); } 226 226 static bool asString(InspectorValue* value, String* output) { return value->asString(output); } 227 227 static bool asBoolean(InspectorValue* value, bool* output) { return value->asBoolean(output); } … … 230 230 }; 231 231 232 int InspectorBackendDispatcher::getInt (InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)233 { 234 return getPropertyValue<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInt , "Number");232 int InspectorBackendDispatcher::getInteger(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) 233 { 234 return getPropertyValue<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInteger, "Integer"); 235 235 } 236 236 -
trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
r160457 r173554 87 87 void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<InspectorArray> data) const; 88 88 89 static int getInt (InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors);89 static int getInteger(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); 90 90 static double getDouble(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); 91 91 static String getString(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); -
trunk/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
r172930 r173554 121 121 static void pushRaw(InspectorArray* array, int value) 122 122 { 123 array->pushInt (value);123 array->pushInteger(value); 124 124 } 125 125 }; … … 131 131 static void pushRaw(InspectorArray* array, double value) 132 132 { 133 array->push Number(value);133 array->pushDouble(value); 134 134 } 135 135 }; … … 249 249 template<> struct BindingTraits<String> : public PrimitiveBindingTraits<InspectorValue::Type::String> { }; 250 250 template<> struct BindingTraits<bool> : public PrimitiveBindingTraits<InspectorValue::Type::Boolean> { }; 251 template<> struct BindingTraits<double> : public PrimitiveBindingTraits<InspectorValue::Type::Number> { }; 252 253 // FIXME: Add an Inspector::Type tag for int so we can remove this special case. 254 template<> 255 struct BindingTraits<int> { 256 #if !ASSERT_DISABLED 257 static void assertValueHasExpectedType(InspectorValue* value) 258 { 259 double v; 260 bool castRes = value->asNumber(&v); 261 ASSERT_UNUSED(castRes, castRes); 262 ASSERT(static_cast<double>(static_cast<int>(v)) == v); 263 } 264 #endif // !ASSERT_DISABLED 265 }; 251 template<> struct BindingTraits<double> : public PrimitiveBindingTraits<InspectorValue::Type::Double> { }; 252 template<> struct BindingTraits<int> : public PrimitiveBindingTraits<InspectorValue::Type::Integer> { }; 266 253 267 254 } // namespace Protocol -
trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp
r172655 r173554 486 486 } 487 487 488 bool InspectorValue::as Number(double*) const489 { 490 return false; 491 } 492 493 bool InspectorValue::as Number(float*) const494 { 495 return false; 496 } 497 498 bool InspectorValue::as Number(int*) const499 { 500 return false; 501 } 502 503 bool InspectorValue::as Number(unsigned*) const504 { 505 return false; 506 } 507 508 bool InspectorValue::as Number(long*) const509 { 510 return false; 511 } 512 513 bool InspectorValue::as Number(long long*) const514 { 515 return false; 516 } 517 518 bool InspectorValue::as Number(unsigned long*) const519 { 520 return false; 521 } 522 523 bool InspectorValue::as Number(unsigned long long*) const488 bool InspectorValue::asDouble(double*) const 489 { 490 return false; 491 } 492 493 bool InspectorValue::asDouble(float*) const 494 { 495 return false; 496 } 497 498 bool InspectorValue::asInteger(int*) const 499 { 500 return false; 501 } 502 503 bool InspectorValue::asInteger(unsigned*) const 504 { 505 return false; 506 } 507 508 bool InspectorValue::asInteger(long*) const 509 { 510 return false; 511 } 512 513 bool InspectorValue::asInteger(long long*) const 514 { 515 return false; 516 } 517 518 bool InspectorValue::asInteger(unsigned long*) const 519 { 520 return false; 521 } 522 523 bool InspectorValue::asInteger(unsigned long long*) const 524 524 { 525 525 return false; … … 592 592 } 593 593 594 bool InspectorBasicValue::as Number(double* output) const595 { 596 if (type() != Type:: Number)594 bool InspectorBasicValue::asDouble(double* output) const 595 { 596 if (type() != Type::Double) 597 597 return false; 598 598 *output = m_doubleValue; … … 600 600 } 601 601 602 bool InspectorBasicValue::as Number(float* output) const603 { 604 if (type() != Type:: Number)602 bool InspectorBasicValue::asDouble(float* output) const 603 { 604 if (type() != Type::Double) 605 605 return false; 606 606 *output = static_cast<float>(m_doubleValue); … … 608 608 } 609 609 610 bool InspectorBasicValue::as Number(int* output) const611 { 612 if (type() != Type:: Number)610 bool InspectorBasicValue::asInteger(int* output) const 611 { 612 if (type() != Type::Integer && type() != Type::Double) 613 613 return false; 614 614 *output = static_cast<int>(m_doubleValue); … … 616 616 } 617 617 618 bool InspectorBasicValue::as Number(unsigned* output) const619 { 620 if (type() != Type:: Number)618 bool InspectorBasicValue::asInteger(unsigned* output) const 619 { 620 if (type() != Type::Integer && type() != Type::Double) 621 621 return false; 622 622 *output = static_cast<unsigned>(m_doubleValue); … … 624 624 } 625 625 626 bool InspectorBasicValue::as Number(long* output) const627 { 628 if (type() != Type:: Number)626 bool InspectorBasicValue::asInteger(long* output) const 627 { 628 if (type() != Type::Integer && type() != Type::Double) 629 629 return false; 630 630 *output = static_cast<long>(m_doubleValue); … … 632 632 } 633 633 634 bool InspectorBasicValue::as Number(long long* output) const635 { 636 if (type() != Type:: Number)634 bool InspectorBasicValue::asInteger(long long* output) const 635 { 636 if (type() != Type::Integer && type() != Type::Double) 637 637 return false; 638 638 *output = static_cast<long long>(m_doubleValue); … … 640 640 } 641 641 642 bool InspectorBasicValue::as Number(unsigned long* output) const643 { 644 if (type() != Type:: Number)642 bool InspectorBasicValue::asInteger(unsigned long* output) const 643 { 644 if (type() != Type::Integer && type() != Type::Double) 645 645 return false; 646 646 *output = static_cast<unsigned long>(m_doubleValue); … … 648 648 } 649 649 650 bool InspectorBasicValue::as Number(unsigned long long* output) const651 { 652 if (type() != Type:: Number)650 bool InspectorBasicValue::asInteger(unsigned long long* output) const 651 { 652 if (type() != Type::Integer && type() != Type::Double) 653 653 return false; 654 654 *output = static_cast<unsigned long long>(m_doubleValue); … … 658 658 void InspectorBasicValue::writeJSON(StringBuilder* output) const 659 659 { 660 ASSERT(type() == Type::Boolean || type() == Type:: Number);660 ASSERT(type() == Type::Boolean || type() == Type::Double || type() == Type::Integer); 661 661 if (type() == Type::Boolean) { 662 662 if (m_boolValue) … … 664 664 else 665 665 output->append(falseString, 5); 666 } else if (type() == Type:: Number) {666 } else if (type() == Type::Double || type() == Type::Integer) { 667 667 NumberToLStringBuffer buffer; 668 668 if (!std::isfinite(m_doubleValue)) { -
trunk/Source/JavaScriptCore/inspector/InspectorValues.h
r172655 r173554 59 59 Null = 0, 60 60 Boolean, 61 Number, 61 Double, 62 Integer, 62 63 String, 63 64 Object, … … 70 71 71 72 virtual bool asBoolean(bool* output) const; 72 virtual bool as Number(double* output) const;73 virtual bool as Number(float* output) const;74 virtual bool as Number(int* output) const;75 virtual bool as Number(unsigned* output) const;76 virtual bool as Number(long* output) const;77 virtual bool as Number(long long* output) const;78 virtual bool as Number(unsigned long* output) const;79 virtual bool as Number(unsigned long long* output) const;73 virtual bool asInteger(int* output) const; 74 virtual bool asInteger(unsigned* output) const; 75 virtual bool asInteger(long* output) const; 76 virtual bool asInteger(long long* output) const; 77 virtual bool asInteger(unsigned long* output) const; 78 virtual bool asInteger(unsigned long long* output) const; 79 virtual bool asDouble(double* output) const; 80 virtual bool asDouble(float* output) const; 80 81 virtual bool asString(String* output) const; 81 82 virtual bool asValue(RefPtr<InspectorValue>* output); … … 105 106 106 107 virtual bool asBoolean(bool* output) const override; 107 virtual bool asNumber(double* output) const override; 108 virtual bool asNumber(float* output) const override; 109 virtual bool asNumber(int* output) const override; 110 virtual bool asNumber(unsigned* output) const override; 111 virtual bool asNumber(long* output) const override; 112 virtual bool asNumber(long long* output) const override; 113 virtual bool asNumber(unsigned long* output) const override; 114 virtual bool asNumber(unsigned long long* output) const override; 108 // Numbers from the frontend are always parsed as doubles, so we allow 109 // clients to convert to integral values with this function. 110 virtual bool asInteger(int* output) const override; 111 virtual bool asInteger(unsigned* output) const override; 112 virtual bool asInteger(long* output) const override; 113 virtual bool asInteger(long long* output) const override; 114 virtual bool asInteger(unsigned long* output) const override; 115 virtual bool asInteger(unsigned long long* output) const override; 116 virtual bool asDouble(double* output) const override; 117 virtual bool asDouble(float* output) const override; 115 118 116 119 virtual void writeJSON(StringBuilder* output) const override; … … 122 125 123 126 explicit InspectorBasicValue(int value) 124 : InspectorValue(Type:: Number)127 : InspectorValue(Type::Integer) 125 128 , m_doubleValue(static_cast<double>(value)) { } 126 129 127 130 explicit InspectorBasicValue(double value) 128 : InspectorValue(Type:: Number)131 : InspectorValue(Type::Double) 129 132 , m_doubleValue(value) { } 130 133 … … 172 175 virtual bool asObject(RefPtr<InspectorObject>* output) override; 173 176 177 // FIXME: use templates to reduce the amount of duplicated set*() methods. 174 178 void setBoolean(const String& name, bool); 175 void setNumber(const String& name, double); 179 void setInteger(const String& name, int); 180 void setDouble(const String& name, double); 176 181 void setString(const String& name, const String&); 177 182 void setValue(const String& name, PassRefPtr<InspectorValue>); … … 181 186 iterator find(const String& name); 182 187 const_iterator find(const String& name) const; 188 189 // FIXME: use templates to reduce the amount of duplicated get*() methods. 183 190 bool getBoolean(const String& name, bool* output) const; 184 template<class T> bool get Number(const String& name, T* output) const191 template<class T> bool getDouble(const String& name, T* output) const 185 192 { 186 193 RefPtr<InspectorValue> value = get(name); 187 194 if (!value) 188 195 return false; 189 return value->as Number(output);196 return value->asDouble(output); 190 197 } 198 template<class T> bool getInteger(const String& name, T* output) const 199 { 200 RefPtr<InspectorValue> value = get(name); 201 if (!value) 202 return false; 203 return value->asInteger(output); 204 } 205 191 206 bool getString(const String& name, String* output) const; 192 207 PassRefPtr<InspectorObject> getObject(const String& name) const; … … 220 235 221 236 using InspectorObjectBase::setBoolean; 222 using InspectorObjectBase::setNumber; 237 using InspectorObjectBase::setInteger; 238 using InspectorObjectBase::setDouble; 223 239 using InspectorObjectBase::setString; 224 240 using InspectorObjectBase::setValue; … … 228 244 using InspectorObjectBase::find; 229 245 using InspectorObjectBase::getBoolean; 230 using InspectorObjectBase::getNumber; 246 using InspectorObjectBase::getInteger; 247 using InspectorObjectBase::getDouble; 231 248 using InspectorObjectBase::getString; 232 249 using InspectorObjectBase::getObject; … … 258 275 259 276 void pushBoolean(bool); 260 void pushInt (int);261 void push Number(double);277 void pushInteger(int); 278 void pushDouble(double); 262 279 void pushString(const String&); 263 280 void pushValue(PassRefPtr<InspectorValue>); … … 288 305 289 306 using InspectorArrayBase::pushBoolean; 290 using InspectorArrayBase::pushInt ;291 using InspectorArrayBase::push Number;307 using InspectorArrayBase::pushInteger; 308 using InspectorArrayBase::pushDouble; 292 309 using InspectorArrayBase::pushString; 293 310 using InspectorArrayBase::pushValue; … … 317 334 } 318 335 319 inline void InspectorObjectBase::setNumber(const String& name, double value) 336 inline void InspectorObjectBase::setInteger(const String& name, int value) 337 { 338 setValue(name, InspectorBasicValue::create(value)); 339 } 340 341 inline void InspectorObjectBase::setDouble(const String& name, double value) 320 342 { 321 343 setValue(name, InspectorBasicValue::create(value)); … … 353 375 } 354 376 355 inline void InspectorArrayBase::pushInt (int value)377 inline void InspectorArrayBase::pushInteger(int value) 356 378 { 357 379 m_data.append(InspectorBasicValue::create(value)); 358 380 } 359 381 360 inline void InspectorArrayBase::push Number(double value)382 inline void InspectorArrayBase::pushDouble(double value) 361 383 { 362 384 m_data.append(InspectorBasicValue::create(value)); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r172930 r173554 153 153 RefPtr<InspectorObject> breakpointObject = InspectorObject::create(); 154 154 breakpointObject->setString(ASCIILiteral("url"), url); 155 breakpointObject->set Number(ASCIILiteral("lineNumber"), lineNumber);156 breakpointObject->set Number(ASCIILiteral("columnNumber"), columnNumber);155 breakpointObject->setInteger(ASCIILiteral("lineNumber"), lineNumber); 156 breakpointObject->setInteger(ASCIILiteral("columnNumber"), columnNumber); 157 157 breakpointObject->setString(ASCIILiteral("condition"), condition); 158 158 breakpointObject->setBoolean(ASCIILiteral("isRegex"), isRegex); … … 229 229 // in the frontend across multiple backend probe actions and segregate object groups. 230 230 int identifier = 0; 231 object->get Number(ASCIILiteral("id"), &identifier);231 object->getInteger(ASCIILiteral("id"), &identifier); 232 232 233 233 String data; … … 289 289 { 290 290 String scriptIDStr; 291 if (!location->getString(ASCIILiteral("scriptId"), &scriptIDStr) || !location->get Number(ASCIILiteral("lineNumber"), lineNumber)) {291 if (!location->getString(ASCIILiteral("scriptId"), &scriptIDStr) || !location->getInteger(ASCIILiteral("lineNumber"), lineNumber)) { 292 292 *sourceID = JSC::noSourceID; 293 293 *errorString = ASCIILiteral("scriptId and lineNumber are required."); … … 297 297 *sourceID = scriptIDStr.toIntPtr(); 298 298 *columnNumber = 0; 299 location->get Number(ASCIILiteral("columnNumber"), columnNumber);299 location->getInteger(ASCIILiteral("columnNumber"), columnNumber); 300 300 return true; 301 301 } … … 602 602 continue; 603 603 ScriptBreakpoint breakpoint; 604 breakpointObject->get Number(ASCIILiteral("lineNumber"), &breakpoint.lineNumber);605 breakpointObject->get Number(ASCIILiteral("columnNumber"), &breakpoint.columnNumber);604 breakpointObject->getInteger(ASCIILiteral("lineNumber"), &breakpoint.lineNumber); 605 breakpointObject->getInteger(ASCIILiteral("columnNumber"), &breakpoint.columnNumber); 606 606 breakpointObject->getString(ASCIILiteral("condition"), &breakpoint.condition); 607 607 breakpointObject->getBoolean(ASCIILiteral("autoContinue"), &breakpoint.autoContinue); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
r173505 r173554 222 222 String sourceIDAsString; 223 223 int divot; 224 location->get Number(ASCIILiteral("typeInformationDescriptor"), &descriptor);224 location->getInteger(ASCIILiteral("typeInformationDescriptor"), &descriptor); 225 225 location->getString(ASCIILiteral("sourceID"), &sourceIDAsString); 226 location->get Number(ASCIILiteral("divot"), &divot);226 location->getInteger(ASCIILiteral("divot"), &divot); 227 227 228 228 bool okay; -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py
r172980 r173554 233 233 if isinstance(_type, PrimitiveType): 234 234 if _type.raw_name() is 'integer': 235 return 'getInt' 235 return 'getInteger' 236 elif _type.raw_name() is 'number': 237 return 'getDouble' 236 238 else: 237 239 return 'get' + ucfirst(_type.raw_name()) … … 248 250 return 'setArray' 249 251 if isinstance(_type, PrimitiveType): 250 if _type.raw_name() in ['integer', 'number']: 251 return 'setNumber' 252 elif _type.raw_name() in ['any']: 252 if _type.raw_name() is 'integer': 253 return 'setInteger' 254 elif _type.raw_name() is 'number': 255 return 'setDouble' 256 elif _type.raw_name() is 'any': 253 257 return 'setValue' 254 258 else: -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
r173526 r173554 216 216 InspectorObject* paramsContainerPtr = paramsContainer.get(); 217 217 InspectorArray* protocolErrorsPtr = protocolErrors.get(); 218 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);218 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr); 219 219 String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr); 220 220 if (protocolErrors->length()) { … … 243 243 result->setString(ASCIILiteral("notes"), out_notes.getValue()); 244 244 if (out_timestamp.isAssigned()) 245 result->set Number(ASCIILiteral("timestamp"), out_timestamp.getValue());245 result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue()); 246 246 if (out_values.isAssigned()) 247 247 result->setObject(ASCIILiteral("values"), out_values.getValue()); … … 249 249 result->setValue(ASCIILiteral("payload"), out_payload.getValue()); 250 250 if (out_databaseId.isAssigned()) 251 result->set Number(ASCIILiteral("databaseId"), out_databaseId.getValue());251 result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue()); 252 252 if (out_sqlError) 253 253 result->setObject(ASCIILiteral("sqlError"), out_sqlError); … … 270 270 jsonMessage->setString(ASCIILiteral("notes"), notes.getValue()); 271 271 if (timestamp.isAssigned()) 272 jsonMessage->set Number(ASCIILiteral("timestamp"), timestamp.getValue());272 jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp.getValue()); 273 273 if (values.isAssigned()) 274 274 jsonMessage->setObject(ASCIILiteral("values"), values.getValue()); … … 276 276 jsonMessage->setValue(ASCIILiteral("payload"), payload.getValue()); 277 277 if (databaseId.isAssigned()) 278 jsonMessage->set Number(ASCIILiteral("databaseId"), databaseId.getValue());278 jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId.getValue()); 279 279 if (sqlError) 280 280 jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError); … … 292 292 InspectorObject* paramsContainerPtr = paramsContainer.get(); 293 293 InspectorArray* protocolErrorsPtr = protocolErrors.get(); 294 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);294 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr); 295 295 String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr); 296 296 if (protocolErrors->length()) { … … 318 318 InspectorObject* paramsContainerPtr = paramsContainer.get(); 319 319 InspectorArray* protocolErrorsPtr = protocolErrors.get(); 320 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);320 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr); 321 321 String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr); 322 322 if (protocolErrors->length()) { … … 342 342 result->setArray(ASCIILiteral("columnNames"), out_columnNames); 343 343 result->setString(ASCIILiteral("notes"), out_notes); 344 result->set Number(ASCIILiteral("timestamp"), out_timestamp);344 result->setDouble(ASCIILiteral("timestamp"), out_timestamp); 345 345 result->setObject(ASCIILiteral("values"), out_values); 346 346 result->setValue(ASCIILiteral("payload"), out_payload); 347 result->set Number(ASCIILiteral("databaseId"), out_databaseId);347 result->setInteger(ASCIILiteral("databaseId"), out_databaseId); 348 348 result->setObject(ASCIILiteral("sqlError"), out_sqlError); 349 349 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getTestEnumConstantValue(out_screenColor)); … … 360 360 jsonMessage->setArray(ASCIILiteral("columnNames"), columnNames); 361 361 jsonMessage->setString(ASCIILiteral("notes"), notes); 362 jsonMessage->set Number(ASCIILiteral("timestamp"), timestamp);362 jsonMessage->setDouble(ASCIILiteral("timestamp"), timestamp); 363 363 jsonMessage->setObject(ASCIILiteral("values"), values); 364 364 jsonMessage->setValue(ASCIILiteral("payload"), payload); 365 jsonMessage->set Number(ASCIILiteral("databaseId"), databaseId);365 jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId); 366 366 jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError); 367 367 jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getTestEnumConstantValue(screenColor)); … … 376 376 InspectorObject* paramsContainerPtr = paramsContainer.get(); 377 377 InspectorArray* protocolErrorsPtr = protocolErrors.get(); 378 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);378 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr); 379 379 String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("query"), nullptr, protocolErrorsPtr); 380 380 if (protocolErrors->length()) { … … 615 615 { 616 616 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); 617 m_result->set Number(ASCIILiteral("code"), value);617 m_result->setInteger(ASCIILiteral("code"), value); 618 618 return castState<CodeSet>(); 619 619 } -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
r173526 r173554 200 200 String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("notes"), ¬es_valueFound, protocolErrorsPtr); 201 201 bool timestamp_valueFound = false; 202 Inspector::Protocol::OptOutput<double> in_timestamp = InspectorBackendDispatcher::get Number(paramsContainerPtr, ASCIILiteral("timestamp"), ×tamp_valueFound, protocolErrorsPtr);202 Inspector::Protocol::OptOutput<double> in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainerPtr, ASCIILiteral("timestamp"), ×tamp_valueFound, protocolErrorsPtr); 203 203 bool values_valueFound = false; 204 204 RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("values"), &values_valueFound, protocolErrorsPtr); … … 206 206 RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getAny(paramsContainerPtr, ASCIILiteral("payload"), &payload_valueFound, protocolErrorsPtr); 207 207 bool databaseId_valueFound = false; 208 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), &databaseId_valueFound, protocolErrorsPtr);208 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), &databaseId_valueFound, protocolErrorsPtr); 209 209 bool sqlError_valueFound = false; 210 210 RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("sqlError"), &sqlError_valueFound, protocolErrorsPtr); … … 238 238 result->setString(ASCIILiteral("notes"), out_notes.getValue()); 239 239 if (out_timestamp.isAssigned()) 240 result->set Number(ASCIILiteral("timestamp"), out_timestamp.getValue());240 result->setDouble(ASCIILiteral("timestamp"), out_timestamp.getValue()); 241 241 if (out_values.isAssigned()) 242 242 result->setObject(ASCIILiteral("values"), out_values.getValue()); … … 244 244 result->setValue(ASCIILiteral("payload"), out_payload.getValue()); 245 245 if (out_databaseId.isAssigned()) 246 result->set Number(ASCIILiteral("databaseId"), out_databaseId.getValue());246 result->setInteger(ASCIILiteral("databaseId"), out_databaseId.getValue()); 247 247 if (out_sqlError) 248 248 result->setObject(ASCIILiteral("sqlError"), out_sqlError); … … 263 263 RefPtr<Inspector::InspectorArray> in_columnNames = InspectorBackendDispatcher::getArray(paramsContainerPtr, ASCIILiteral("columnNames"), nullptr, protocolErrorsPtr); 264 264 String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("notes"), nullptr, protocolErrorsPtr); 265 double in_timestamp = InspectorBackendDispatcher::get Number(paramsContainerPtr, ASCIILiteral("timestamp"), nullptr, protocolErrorsPtr);265 double in_timestamp = InspectorBackendDispatcher::getDouble(paramsContainerPtr, ASCIILiteral("timestamp"), nullptr, protocolErrorsPtr); 266 266 RefPtr<Inspector::InspectorObject> in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("values"), nullptr, protocolErrorsPtr); 267 267 RefPtr<Inspector::InspectorValue> in_payload = InspectorBackendDispatcher::getAny(paramsContainerPtr, ASCIILiteral("payload"), nullptr, protocolErrorsPtr); 268 int in_databaseId = InspectorBackendDispatcher::getInt (paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr);268 int in_databaseId = InspectorBackendDispatcher::getInteger(paramsContainerPtr, ASCIILiteral("databaseId"), nullptr, protocolErrorsPtr); 269 269 RefPtr<Inspector::InspectorObject> in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral("sqlError"), nullptr, protocolErrorsPtr); 270 270 String in_screenColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral("screenColor"), nullptr, protocolErrorsPtr); … … 292 292 result->setArray(ASCIILiteral("columnNames"), out_columnNames); 293 293 result->setString(ASCIILiteral("notes"), out_notes); 294 result->set Number(ASCIILiteral("timestamp"), out_timestamp);294 result->setDouble(ASCIILiteral("timestamp"), out_timestamp); 295 295 result->setObject(ASCIILiteral("values"), out_values); 296 296 result->setValue(ASCIILiteral("payload"), out_payload); 297 result->set Number(ASCIILiteral("databaseId"), out_databaseId);297 result->setInteger(ASCIILiteral("databaseId"), out_databaseId); 298 298 result->setObject(ASCIILiteral("sqlError"), out_sqlError); 299 299 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::getTestEnumConstantValue(out_screenColor)); … … 522 522 { 523 523 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); 524 m_result->set Number(ASCIILiteral("code"), value);524 m_result->setInteger(ASCIILiteral("code"), value); 525 525 return castState<CodeSet>(); 526 526 } -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
r172980 r173554 250 250 paramsObject->setString(ASCIILiteral("notes"), *notes); 251 251 if (timestamp) 252 paramsObject->set Number(ASCIILiteral("timestamp"), *timestamp);252 paramsObject->setDouble(ASCIILiteral("timestamp"), *timestamp); 253 253 if (values) 254 254 paramsObject->setObject(ASCIILiteral("values"), values); … … 273 273 paramsObject->setArray(ASCIILiteral("columnNames"), columnNames); 274 274 paramsObject->setString(ASCIILiteral("notes"), notes); 275 paramsObject->set Number(ASCIILiteral("timestamp"), timestamp);275 paramsObject->setDouble(ASCIILiteral("timestamp"), timestamp); 276 276 paramsObject->setObject(ASCIILiteral("values"), values); 277 277 paramsObject->setValue(ASCIILiteral("payload"), payload); … … 399 399 { 400 400 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); 401 m_result->set Number(ASCIILiteral("code"), value);401 m_result->setInteger(ASCIILiteral("code"), value); 402 402 return castState<CodeSet>(); 403 403 } -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
r173526 r173554 420 420 { 421 421 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); 422 m_result->set Number(ASCIILiteral("code"), value);422 m_result->setInteger(ASCIILiteral("code"), value); 423 423 return castState<CodeSet>(); 424 424 } -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
r172980 r173554 342 342 { 343 343 COMPILE_ASSERT(!(STATE & CodeSet), property_code_already_set); 344 m_result->set Number(ASCIILiteral("code"), value);344 m_result->setInteger(ASCIILiteral("code"), value); 345 345 return castState<CodeSet>(); 346 346 } … … 432 432 void setTimestamp(double value) 433 433 { 434 InspectorObjectBase::set Number(ASCIILiteral("timestamp"), value);434 InspectorObjectBase::setDouble(ASCIILiteral("timestamp"), value); 435 435 } 436 436 … … 499 499 { 500 500 COMPILE_ASSERT(!(STATE & TimestampSet), property_timestamp_already_set); 501 m_result->set Number(ASCIILiteral("timestamp"), value);501 m_result->setDouble(ASCIILiteral("timestamp"), value); 502 502 return castState<TimestampSet>(); 503 503 } … … 700 700 { 701 701 COMPILE_ASSERT(!(STATE & TimestampSet), property_timestamp_already_set); 702 m_result->set Number(ASCIILiteral("timestamp"), value);702 m_result->setDouble(ASCIILiteral("timestamp"), value); 703 703 return castState<TimestampSet>(); 704 704 } -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
r172930 r173554 351 351 { 352 352 COMPILE_ASSERT(!(STATE & NumberSet), property_number_already_set); 353 m_result->set Number(ASCIILiteral("number"), value);353 m_result->setInteger(ASCIILiteral("number"), value); 354 354 return castState<NumberSet>(); 355 355 } … … 365 365 { 366 366 COMPILE_ASSERT(!(STATE & IdSet), property_id_already_set); 367 m_result->set Number(ASCIILiteral("id"), value);367 m_result->setInteger(ASCIILiteral("id"), value); 368 368 return castState<IdSet>(); 369 369 } -
trunk/Source/JavaScriptCore/replay/EncodedValue.cpp
r171682 r173554 113 113 { 114 114 double result; 115 bool castSucceeded = m_value->as Number(&result);115 bool castSucceeded = m_value->asDouble(&result); 116 116 ASSERT_UNUSED(castSucceeded, castSucceeded); 117 117 … … 122 122 { 123 123 float result; 124 bool castSucceeded = m_value->as Number(&result);124 bool castSucceeded = m_value->asDouble(&result); 125 125 ASSERT_UNUSED(castSucceeded, castSucceeded); 126 126 … … 131 131 { 132 132 int32_t result; 133 bool castSucceeded = m_value->as Number(&result);133 bool castSucceeded = m_value->asInteger(&result); 134 134 ASSERT_UNUSED(castSucceeded, castSucceeded); 135 135 … … 140 140 { 141 141 int64_t result; 142 bool castSucceeded = m_value->as Number(&result);142 bool castSucceeded = m_value->asInteger(&result); 143 143 ASSERT_UNUSED(castSucceeded, castSucceeded); 144 144 … … 149 149 { 150 150 uint32_t result; 151 bool castSucceeded = m_value->as Number(&result);151 bool castSucceeded = m_value->asInteger(&result); 152 152 ASSERT_UNUSED(castSucceeded, castSucceeded); 153 153 … … 158 158 { 159 159 uint64_t result; 160 bool castSucceeded = m_value->as Number(&result);160 bool castSucceeded = m_value->asInteger(&result); 161 161 ASSERT_UNUSED(castSucceeded, castSucceeded); 162 162 -
trunk/Source/WebCore/ChangeLog
r173553 r173554 1 2014-09-11 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Inspector: disambiguate integral and real number primitive types in the protocol 4 https://bugs.webkit.org/show_bug.cgi?id=136606 5 6 Reviewed by Timothy Hatcher. 7 8 Update clients of InspectorValue to disambiguate integer and double primitive types. 9 10 No new tests, no behavior changed. 11 12 * inspector/InspectorDOMAgent.cpp: 13 (WebCore::parseColor): 14 (WebCore::parseQuad): 15 (WebCore::InspectorDOMAgent::performSearch): 16 * inspector/InspectorDOMDebuggerAgent.cpp: 17 (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): 18 * inspector/InspectorIndexedDBAgent.cpp: 19 * inspector/InspectorOverlay.cpp: 20 (WebCore::buildObjectForPoint): 21 (WebCore::buildObjectForRect): 22 (WebCore::buildObjectForSize): 23 (WebCore::appendPathCommandAndPoints): 24 (WebCore::InspectorOverlay::reset): 25 * inspector/InspectorReplayAgent.cpp: 26 (WebCore::InspectorReplayAgent::replayToPosition): 27 * inspector/InspectorStyleSheet.h: 28 (WebCore::InspectorCSSId::InspectorCSSId): 29 * inspector/InspectorTimelineAgent.cpp: 30 (WebCore::InspectorTimelineAgent::didWriteHTML): 31 (WebCore::InspectorTimelineAgent::didCompleteRecordEntry): 32 * inspector/TimelineRecordFactory.cpp: 33 (WebCore::TimelineRecordFactory::createGenericRecord): 34 (WebCore::TimelineRecordFactory::createBackgroundRecord): 35 (WebCore::TimelineRecordFactory::createGCEventData): 36 (WebCore::TimelineRecordFactory::createFunctionCallData): 37 (WebCore::TimelineRecordFactory::createProbeSampleData): 38 (WebCore::TimelineRecordFactory::createGenericTimerData): 39 (WebCore::TimelineRecordFactory::createTimerInstallData): 40 (WebCore::TimelineRecordFactory::createXHRReadyStateChangeData): 41 (WebCore::TimelineRecordFactory::createEvaluateScriptData): 42 (WebCore::TimelineRecordFactory::createResourceReceiveResponseData): 43 (WebCore::TimelineRecordFactory::createResourceFinishData): 44 (WebCore::TimelineRecordFactory::createReceiveResourceData): 45 (WebCore::TimelineRecordFactory::createLayoutData): 46 (WebCore::TimelineRecordFactory::createParseHTMLData): 47 (WebCore::TimelineRecordFactory::createAnimationFrameData): 48 (WebCore::createQuad): 49 * inspector/TimelineRecordFactory.h: 50 (WebCore::TimelineRecordFactory::createWebSocketCreateData): 51 (WebCore::TimelineRecordFactory::createGenericWebSocketData): 52 * page/ContentSecurityPolicy.cpp: 53 (WebCore::ContentSecurityPolicy::reportViolation): 54 1 55 2014-09-11 Ryuan Choi <ryuan.choi@gmail.com> 2 56 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r173350 r173554 120 120 int g; 121 121 int b; 122 bool success = (*colorObject)->get Number("r", &r);123 success |= (*colorObject)->get Number("g", &g);124 success |= (*colorObject)->get Number("b", &b);122 bool success = (*colorObject)->getInteger("r", &r); 123 success |= (*colorObject)->getInteger("g", &g); 124 success |= (*colorObject)->getInteger("b", &b); 125 125 if (!success) 126 126 return Color::transparent; 127 127 128 128 double a; 129 success = (*colorObject)->get Number("a", &a);129 success = (*colorObject)->getDouble("a", &a); 130 130 if (!success) 131 131 return Color(r, g, b); … … 155 155 return false; 156 156 for (size_t i = 0; i < coordinatesInQuad; ++i) { 157 if (!quadArray->get(i)->as Number(coordinates + i))157 if (!quadArray->get(i)->asDouble(coordinates + i)) 158 158 return false; 159 159 } … … 900 900 } 901 901 int nodeId = 0; 902 if (!nodeValue->as Number(&nodeId)) {902 if (!nodeValue->asInteger(&nodeId)) { 903 903 *errorString = "Invalid nodeIds item type. Expecting integer types."; 904 904 return; -
trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
r172930 r173554 329 329 int breakpointOwnerNodeId = m_domAgent->boundNodeId(breakpointOwner); 330 330 ASSERT(breakpointOwnerNodeId); 331 description->set Number("nodeId", breakpointOwnerNodeId);331 description->setInteger("nodeId", breakpointOwnerNodeId); 332 332 description->setString("type", domTypeName(breakpointType)); 333 333 } -
trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
r173016 r173554 337 337 if (type == number) { 338 338 double number; 339 if (!key->get Number("number", &number))339 if (!key->getDouble("number", &number)) 340 340 return nullptr; 341 341 idbKey = IDBKey::createNumber(number); … … 347 347 } else if (type == date) { 348 348 double date; 349 if (!key->get Number("date", &date))349 if (!key->getDouble("date", &date)) 350 350 return nullptr; 351 351 idbKey = IDBKey::createDate(date); -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r173142 r173554 334 334 { 335 335 RefPtr<InspectorObject> object = InspectorObject::create(); 336 object->set Number(ASCIILiteral("x"), point.x());337 object->set Number(ASCIILiteral("y"), point.y());336 object->setDouble(ASCIILiteral("x"), point.x()); 337 object->setDouble(ASCIILiteral("y"), point.y()); 338 338 return object.release(); 339 339 } … … 342 342 { 343 343 RefPtr<InspectorObject> object = InspectorObject::create(); 344 object->set Number(ASCIILiteral("x"), rect.x());345 object->set Number(ASCIILiteral("y"), rect.y());346 object->set Number(ASCIILiteral("width"), rect.width());347 object->set Number(ASCIILiteral("height"), rect.height());344 object->setDouble(ASCIILiteral("x"), rect.x()); 345 object->setDouble(ASCIILiteral("y"), rect.y()); 346 object->setDouble(ASCIILiteral("width"), rect.width()); 347 object->setDouble(ASCIILiteral("height"), rect.height()); 348 348 return object.release(); 349 349 } … … 441 441 { 442 442 RefPtr<InspectorObject> result = InspectorObject::create(); 443 result->set Number("width", size.width());444 result->set Number("height", size.height());443 result->setInteger("width", size.width()); 444 result->setInteger("height", size.height()); 445 445 return result.release(); 446 446 } … … 600 600 point = info->shapeOutsideInfo->shapeToRendererPoint(points[i]); 601 601 point = localPointToRoot(info->renderer, info->rootView, info->view, point); 602 info->array->push Number(point.x());603 info->array->push Number(point.y());602 info->array->pushDouble(point.x()); 603 info->array->pushDouble(point.y()); 604 604 } 605 605 } … … 860 860 { 861 861 RefPtr<InspectorObject> resetData = InspectorObject::create(); 862 resetData->set Number("deviceScaleFactor", m_page.deviceScaleFactor());862 resetData->setDouble("deviceScaleFactor", m_page.deviceScaleFactor()); 863 863 resetData->setObject("viewportSize", buildObjectForSize(viewportSize)); 864 864 resetData->setObject("frameViewFullSize", buildObjectForSize(frameViewFullSize)); -
trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp
r172930 r173554 341 341 { 342 342 ReplayPosition position; 343 if (!positionObject->get Number(ASCIILiteral("segmentOffset"), &position.segmentOffset)) {343 if (!positionObject->getInteger(ASCIILiteral("segmentOffset"), &position.segmentOffset)) { 344 344 *errorString = ASCIILiteral("Couldn't decode ReplayPosition segment offset provided to ReplayAgent.replayToPosition."); 345 345 return; 346 346 } 347 347 348 if (!positionObject->get Number(ASCIILiteral("inputOffset"), &position.inputOffset)) {348 if (!positionObject->getInteger(ASCIILiteral("inputOffset"), &position.inputOffset)) { 349 349 *errorString = ASCIILiteral("Couldn't decode ReplayPosition input offset provided to ReplayAgent.replayToPosition."); 350 350 return; -
trunk/Source/WebCore/inspector/InspectorStyleSheet.h
r172930 r173554 70 70 71 71 RefPtr<Inspector::InspectorValue> ordinalValue = value->get("ordinal"); 72 if (!ordinalValue || !ordinalValue->as Number(&m_ordinal))72 if (!ordinalValue || !ordinalValue->asInteger(&m_ordinal)) 73 73 m_styleSheetId = ""; 74 74 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r172930 r173554 357 357 if (!m_recordStack.isEmpty()) { 358 358 const TimelineRecordEntry& entry = m_recordStack.last(); 359 entry.data->set Number("endLine", endLine);359 entry.data->setInteger("endLine", endLine); 360 360 didCompleteCurrentRecord(TimelineRecordType::ParseHTML); 361 361 } … … 671 671 entry.record->setObject(ASCIILiteral("data"), entry.data); 672 672 entry.record->setArray(ASCIILiteral("children"), entry.children); 673 entry.record->set Number(ASCIILiteral("endTime"), timestamp());673 entry.record->setDouble(ASCIILiteral("endTime"), timestamp()); 674 674 addRecordToTimeline(entry.record, entry.type); 675 675 } -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r173199 r173554 57 57 { 58 58 RefPtr<InspectorObject> record = InspectorObject::create(); 59 record->set Number("startTime", startTime);59 record->setDouble("startTime", startTime); 60 60 61 61 if (maxCallStackDepth) { … … 70 70 { 71 71 RefPtr<InspectorObject> record = InspectorObject::create(); 72 record->set Number("startTime", startTime);72 record->setDouble("startTime", startTime); 73 73 record->setString("thread", threadName); 74 74 return record.release(); … … 78 78 { 79 79 RefPtr<InspectorObject> data = InspectorObject::create(); 80 data->set Number("usedHeapSizeDelta", usedHeapSizeDelta);80 data->setInteger("usedHeapSizeDelta", usedHeapSizeDelta); 81 81 return data.release(); 82 82 } … … 86 86 RefPtr<InspectorObject> data = InspectorObject::create(); 87 87 data->setString("scriptName", scriptName); 88 data->set Number("scriptLine", scriptLine);88 data->setInteger("scriptLine", scriptLine); 89 89 return data.release(); 90 90 } … … 100 100 { 101 101 RefPtr<InspectorObject> data = InspectorObject::create(); 102 data->set Number(ASCIILiteral("probeId"), action.identifier);103 data->set Number(ASCIILiteral("hitCount"), hitCount);102 data->setInteger(ASCIILiteral("probeId"), action.identifier); 103 data->setInteger(ASCIILiteral("hitCount"), hitCount); 104 104 return data.release(); 105 105 } … … 115 115 { 116 116 RefPtr<InspectorObject> data = InspectorObject::create(); 117 data->set Number("timerId", timerId);117 data->setInteger("timerId", timerId); 118 118 return data.release(); 119 119 } … … 122 122 { 123 123 RefPtr<InspectorObject> data = InspectorObject::create(); 124 data->set Number("timerId", timerId);125 data->set Number("timeout", timeout);124 data->setInteger("timerId", timerId); 125 data->setInteger("timeout", timeout); 126 126 data->setBoolean("singleShot", singleShot); 127 127 return data.release(); … … 132 132 RefPtr<InspectorObject> data = InspectorObject::create(); 133 133 data->setString("url", url); 134 data->set Number("readyState", readyState);134 data->setInteger("readyState", readyState); 135 135 return data.release(); 136 136 } … … 147 147 RefPtr<InspectorObject> data = InspectorObject::create(); 148 148 data->setString("url", url); 149 data->set Number("lineNumber", lineNumber);149 data->setInteger("lineNumber", lineNumber); 150 150 return data.release(); 151 151 } … … 178 178 RefPtr<InspectorObject> data = InspectorObject::create(); 179 179 data->setString("requestId", requestId); 180 data->set Number("statusCode", response.httpStatusCode());180 data->setInteger("statusCode", response.httpStatusCode()); 181 181 data->setString("mimeType", response.mimeType()); 182 182 return data.release(); … … 189 189 data->setBoolean("didFail", didFail); 190 190 if (finishTime) 191 data->set Number("networkTime", finishTime);191 data->setDouble("networkTime", finishTime); 192 192 return data.release(); 193 193 } … … 197 197 RefPtr<InspectorObject> data = InspectorObject::create(); 198 198 data->setString("requestId", requestId); 199 data->set Number("encodedDataLength", length);199 data->setInteger("encodedDataLength", length); 200 200 return data.release(); 201 201 } … … 204 204 { 205 205 RefPtr<InspectorObject> data = InspectorObject::create(); 206 data->set Number("dirtyObjects", dirtyObjects);207 data->set Number("totalObjects", totalObjects);206 data->setInteger("dirtyObjects", dirtyObjects); 207 data->setInteger("totalObjects", totalObjects); 208 208 data->setBoolean("partialLayout", partialLayout); 209 209 return data.release(); … … 234 234 { 235 235 RefPtr<InspectorObject> data = InspectorObject::create(); 236 data->set Number("startLine", startLine);236 data->setInteger("startLine", startLine); 237 237 return data.release(); 238 238 } … … 241 241 { 242 242 RefPtr<InspectorObject> data = InspectorObject::create(); 243 data->set Number("id", callbackId);243 data->setInteger("id", callbackId); 244 244 return data.release(); 245 245 } … … 248 248 { 249 249 RefPtr<InspectorArray> array = InspectorArray::create(); 250 array->push Number(quad.p1().x());251 array->push Number(quad.p1().y());252 array->push Number(quad.p2().x());253 array->push Number(quad.p2().y());254 array->push Number(quad.p3().x());255 array->push Number(quad.p3().y());256 array->push Number(quad.p4().x());257 array->push Number(quad.p4().y());250 array->pushDouble(quad.p1().x()); 251 array->pushDouble(quad.p1().y()); 252 array->pushDouble(quad.p2().x()); 253 array->pushDouble(quad.p2().y()); 254 array->pushDouble(quad.p3().x()); 255 array->pushDouble(quad.p3().y()); 256 array->pushDouble(quad.p4().x()); 257 array->pushDouble(quad.p4().y()); 258 258 return array.release(); 259 259 } -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r171195 r173554 112 112 { 113 113 RefPtr<Inspector::InspectorObject> data = Inspector::InspectorObject::create(); 114 data->set Number("identifier", identifier);114 data->setInteger("identifier", identifier); 115 115 data->setString("url", url.string()); 116 116 if (!protocol.isNull()) … … 122 122 { 123 123 RefPtr<Inspector::InspectorObject> data = Inspector::InspectorObject::create(); 124 data->set Number("identifier", identifier);124 data->setInteger("identifier", identifier); 125 125 return data.release(); 126 126 } -
trunk/Source/WebCore/page/ContentSecurityPolicy.cpp
r173142 r173554 1662 1662 URL source = URL(URL(), callFrame->sourceURL()); 1663 1663 cspReport->setString(ASCIILiteral("source-file"), stripURLForUseInReport(document, source)); 1664 cspReport->set Number(ASCIILiteral("line-number"), callFrame->lineNumber());1664 cspReport->setInteger(ASCIILiteral("line-number"), callFrame->lineNumber()); 1665 1665 } 1666 1666
Note:
See TracChangeset
for help on using the changeset viewer.