Changeset 199242 in webkit


Ignore:
Timestamp:
Apr 8, 2016 12:59:25 PM (8 years ago)
Author:
BJ Burg
Message:

Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
https://bugs.webkit.org/show_bug.cgi?id=156407
<rdar://problem/25627659>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

There's no point having these subclasses as they don't save any space.
Add m_stringValue to the union and merge some implementations of writeJSON.
Move uses of the subclass to InspectorValue and delete redundant methods.
Now, most InspectorValue methods are non-virtual so they can be templated.

  • bindings/ScriptValue.cpp:

(Deprecated::jsToInspectorValue):

  • inspector/InjectedScriptBase.cpp:

(Inspector::InjectedScriptBase::makeCall):
Don't used deleted subclasses.

  • inspector/InspectorValues.cpp:

(Inspector::InspectorValue::null):
(Inspector::InspectorValue::create):
(Inspector::InspectorValue::asValue):
(Inspector::InspectorValue::asBoolean):
(Inspector::InspectorValue::asDouble):
(Inspector::InspectorValue::asInteger):
(Inspector::InspectorValue::asString):
These only need one implementation now.

(Inspector::InspectorValue::writeJSON):
Still a virtual method since Object and Array need their members.

(Inspector::InspectorObjectBase::InspectorObjectBase):
(Inspector::InspectorBasicValue::asBoolean): Deleted.
(Inspector::InspectorBasicValue::asDouble): Deleted.
(Inspector::InspectorBasicValue::asInteger): Deleted.
(Inspector::InspectorBasicValue::writeJSON): Deleted.
(Inspector::InspectorString::asString): Deleted.
(Inspector::InspectorString::writeJSON): Deleted.
(Inspector::InspectorString::create): Deleted.
(Inspector::InspectorBasicValue::create): Deleted.

  • inspector/InspectorValues.h:

(Inspector::InspectorObjectBase::setBoolean):
(Inspector::InspectorObjectBase::setInteger):
(Inspector::InspectorObjectBase::setDouble):
(Inspector::InspectorObjectBase::setString):
(Inspector::InspectorArrayBase::pushBoolean):
(Inspector::InspectorArrayBase::pushInteger):
(Inspector::InspectorArrayBase::pushDouble):
(Inspector::InspectorArrayBase::pushString):
Use new factory methods.

  • replay/EncodedValue.cpp:

(JSC::ScalarEncodingTraits<bool>::encodeValue):
(JSC::ScalarEncodingTraits<double>::encodeValue):
(JSC::ScalarEncodingTraits<float>::encodeValue):
(JSC::ScalarEncodingTraits<int32_t>::encodeValue):
(JSC::ScalarEncodingTraits<int64_t>::encodeValue):
(JSC::ScalarEncodingTraits<uint32_t>::encodeValue):
(JSC::ScalarEncodingTraits<uint64_t>::encodeValue):

  • replay/EncodedValue.h:

Use new factory methods.

Source/WebCore:

  • inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r199240 r199242  
     12016-04-08  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
     4        https://bugs.webkit.org/show_bug.cgi?id=156407
     5        <rdar://problem/25627659>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        There's no point having these subclasses as they don't save any space.
     10        Add m_stringValue to the union and merge some implementations of writeJSON.
     11        Move uses of the subclass to InspectorValue and delete redundant methods.
     12        Now, most InspectorValue methods are non-virtual so they can be templated.
     13
     14        * bindings/ScriptValue.cpp:
     15        (Deprecated::jsToInspectorValue):
     16        * inspector/InjectedScriptBase.cpp:
     17        (Inspector::InjectedScriptBase::makeCall):
     18        Don't used deleted subclasses.
     19
     20        * inspector/InspectorValues.cpp:
     21        (Inspector::InspectorValue::null):
     22        (Inspector::InspectorValue::create):
     23        (Inspector::InspectorValue::asValue):
     24        (Inspector::InspectorValue::asBoolean):
     25        (Inspector::InspectorValue::asDouble):
     26        (Inspector::InspectorValue::asInteger):
     27        (Inspector::InspectorValue::asString):
     28        These only need one implementation now.
     29
     30        (Inspector::InspectorValue::writeJSON):
     31        Still a virtual method since Object and Array need their members.
     32
     33        (Inspector::InspectorObjectBase::InspectorObjectBase):
     34        (Inspector::InspectorBasicValue::asBoolean): Deleted.
     35        (Inspector::InspectorBasicValue::asDouble): Deleted.
     36        (Inspector::InspectorBasicValue::asInteger): Deleted.
     37        (Inspector::InspectorBasicValue::writeJSON): Deleted.
     38        (Inspector::InspectorString::asString): Deleted.
     39        (Inspector::InspectorString::writeJSON): Deleted.
     40        (Inspector::InspectorString::create): Deleted.
     41        (Inspector::InspectorBasicValue::create): Deleted.
     42
     43        * inspector/InspectorValues.h:
     44        (Inspector::InspectorObjectBase::setBoolean):
     45        (Inspector::InspectorObjectBase::setInteger):
     46        (Inspector::InspectorObjectBase::setDouble):
     47        (Inspector::InspectorObjectBase::setString):
     48        (Inspector::InspectorArrayBase::pushBoolean):
     49        (Inspector::InspectorArrayBase::pushInteger):
     50        (Inspector::InspectorArrayBase::pushDouble):
     51        (Inspector::InspectorArrayBase::pushString):
     52        Use new factory methods.
     53
     54        * replay/EncodedValue.cpp:
     55        (JSC::ScalarEncodingTraits<bool>::encodeValue):
     56        (JSC::ScalarEncodingTraits<double>::encodeValue):
     57        (JSC::ScalarEncodingTraits<float>::encodeValue):
     58        (JSC::ScalarEncodingTraits<int32_t>::encodeValue):
     59        (JSC::ScalarEncodingTraits<int64_t>::encodeValue):
     60        (JSC::ScalarEncodingTraits<uint32_t>::encodeValue):
     61        (JSC::ScalarEncodingTraits<uint64_t>::encodeValue):
     62        * replay/EncodedValue.h:
     63        Use new factory methods.
     64
    1652016-04-08  Filip Pizlo  <fpizlo@apple.com>
    266
  • trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp

    r197614 r199242  
    113113        return InspectorValue::null();
    114114    if (value.isBoolean())
    115         return InspectorBasicValue::create(value.asBoolean());
     115        return InspectorValue::create(value.asBoolean());
    116116    if (value.isNumber() && value.isDouble())
    117         return InspectorBasicValue::create(value.asNumber());
     117        return InspectorValue::create(value.asNumber());
    118118    if (value.isNumber() && value.isMachineInt())
    119         return InspectorBasicValue::create(static_cast<int>(value.asMachineInt()));
     119        return InspectorValue::create(static_cast<int>(value.asMachineInt()));
    120120    if (value.isString())
    121         return InspectorString::create(value.getString(scriptState));
     121        return InspectorValue::create(value.getString(scriptState));
    122122
    123123    if (value.isObject()) {
  • trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp

    r194242 r199242  
    100100        *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState());
    101101        if (!*result)
    102             *result = InspectorString::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
     102            *result = InspectorValue::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
    103103    } else
    104         *result = InspectorString::create("Exception while making a call.");
     104        *result = InspectorValue::create("Exception while making a call.");
    105105}
    106106
  • trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp

    r194496 r199242  
    364364        break;
    365365    case BOOL_TRUE:
    366         result = InspectorBasicValue::create(true);
     366        result = InspectorValue::create(true);
    367367        break;
    368368    case BOOL_FALSE:
    369         result = InspectorBasicValue::create(false);
     369        result = InspectorValue::create(false);
    370370        break;
    371371    case NUMBER: {
     
    374374        if (!ok)
    375375            return nullptr;
    376         result = InspectorBasicValue::create(value);
     376        result = InspectorValue::create(value);
    377377        break;
    378378    }
     
    382382        if (!ok)
    383383            return nullptr;
    384         result = InspectorString::create(value);
     384        result = InspectorValue::create(value);
    385385        break;
    386386    }
     
    499499} // anonymous namespace
    500500
    501 bool InspectorValue::asBoolean(bool&) const
    502 {
    503     return false;
    504 }
    505 
    506 bool InspectorValue::asDouble(double&) const
    507 {
    508     return false;
    509 }
    510 
    511 bool InspectorValue::asDouble(float&) const
    512 {
    513     return false;
    514 }
    515 
    516 bool InspectorValue::asInteger(int&) const
    517 {
    518     return false;
    519 }
    520 
    521 bool InspectorValue::asInteger(unsigned&) const
    522 {
    523     return false;
    524 }
    525 
    526 bool InspectorValue::asInteger(long&) const
    527 {
    528     return false;
    529 }
    530 
    531 bool InspectorValue::asInteger(long long&) const
    532 {
    533     return false;
    534 }
    535 
    536 bool InspectorValue::asInteger(unsigned long&) const
    537 {
    538     return false;
    539 }
    540 
    541 bool InspectorValue::asInteger(unsigned long long&) const
    542 {
    543     return false;
    544 }
    545 
    546 bool InspectorValue::asString(String&) const
    547 {
    548     return false;
    549 }
    550 
    551 bool InspectorValue::asValue(RefPtr<InspectorValue>& output)
    552 {
    553     output = this;
     501Ref<InspectorValue> InspectorValue::null()
     502{
     503    return adoptRef(*new InspectorValue);
     504}
     505
     506Ref<InspectorValue> InspectorValue::create(bool value)
     507{
     508    return adoptRef(*new InspectorValue(value));
     509}
     510
     511Ref<InspectorValue> InspectorValue::create(int value)
     512{
     513    return adoptRef(*new InspectorValue(value));
     514}
     515
     516Ref<InspectorValue> InspectorValue::create(double value)
     517{
     518    return adoptRef(*new InspectorValue(value));
     519}
     520
     521Ref<InspectorValue> InspectorValue::create(const String& value)
     522{
     523    return adoptRef(*new InspectorValue(value));
     524}
     525
     526Ref<InspectorValue> InspectorValue::create(const char* value)
     527{
     528    return adoptRef(*new InspectorValue(value));
     529}
     530
     531bool InspectorValue::asValue(RefPtr<Inspector::InspectorValue> & value)
     532{
     533    value = this;
    554534    return true;
    555535}
     
    588568}
    589569
     570bool InspectorValue::asBoolean(bool& output) const
     571{
     572    if (type() != Type::Boolean)
     573        return false;
     574
     575    output = m_booleanValue;
     576    return true;
     577}
     578
     579bool InspectorValue::asDouble(double& output) const
     580{
     581    if (type() != Type::Double)
     582        return false;
     583
     584    output = m_doubleValue;
     585    return true;
     586}
     587
     588bool InspectorValue::asDouble(float& output) const
     589{
     590    if (type() != Type::Double)
     591        return false;
     592
     593    output = static_cast<float>(m_doubleValue);
     594    return true;
     595}
     596
     597bool InspectorValue::asInteger(int& output) const
     598{
     599    if (type() != Type::Integer && type() != Type::Double)
     600        return false;
     601
     602    output = static_cast<int>(m_doubleValue);
     603    return true;
     604}
     605
     606bool InspectorValue::asInteger(unsigned& output) const
     607{
     608    if (type() != Type::Integer && type() != Type::Double)
     609        return false;
     610
     611    output = static_cast<unsigned>(m_doubleValue);
     612    return true;
     613}
     614
     615bool InspectorValue::asInteger(long& output) const
     616{
     617    if (type() != Type::Integer && type() != Type::Double)
     618        return false;
     619
     620    output = static_cast<long>(m_doubleValue);
     621    return true;
     622}
     623
     624bool InspectorValue::asInteger(long long& output) const
     625{
     626    if (type() != Type::Integer && type() != Type::Double)
     627        return false;
     628
     629    output = static_cast<long long>(m_doubleValue);
     630    return true;
     631}
     632
     633bool InspectorValue::asInteger(unsigned long& output) const
     634{
     635    if (type() != Type::Integer && type() != Type::Double)
     636        return false;
     637
     638    output = static_cast<unsigned long>(m_doubleValue);
     639    return true;
     640}
     641
     642bool InspectorValue::asInteger(unsigned long long& output) const
     643{
     644    if (type() != Type::Integer && type() != Type::Double)
     645        return false;
     646
     647    output = static_cast<unsigned long long>(m_doubleValue);
     648    return true;
     649}
     650
     651bool InspectorValue::asString(String& output) const
     652{
     653    if (type() != Type::String)
     654        return false;
     655
     656    output = m_stringValue;
     657    return true;
     658}
     659
    590660void InspectorValue::writeJSON(StringBuilder& output) const
    591661{
    592     ASSERT(m_type == Type::Null);
    593 
    594     output.appendLiteral("null");
    595 }
    596 
    597 bool InspectorBasicValue::asBoolean(bool& output) const
    598 {
    599     if (type() != Type::Boolean)
    600         return false;
    601 
    602     output = m_booleanValue;
    603     return true;
    604 }
    605 
    606 bool InspectorBasicValue::asDouble(double& output) const
    607 {
    608     if (type() != Type::Double)
    609         return false;
    610 
    611     output = m_doubleValue;
    612     return true;
    613 }
    614 
    615 bool InspectorBasicValue::asDouble(float& output) const
    616 {
    617     if (type() != Type::Double)
    618         return false;
    619 
    620     output = static_cast<float>(m_doubleValue);
    621     return true;
    622 }
    623 
    624 bool InspectorBasicValue::asInteger(int& output) const
    625 {
    626     if (type() != Type::Integer && type() != Type::Double)
    627         return false;
    628 
    629     output = static_cast<int>(m_doubleValue);
    630     return true;
    631 }
    632 
    633 bool InspectorBasicValue::asInteger(unsigned& output) const
    634 {
    635     if (type() != Type::Integer && type() != Type::Double)
    636         return false;
    637 
    638     output = static_cast<unsigned>(m_doubleValue);
    639     return true;
    640 }
    641 
    642 bool InspectorBasicValue::asInteger(long& output) const
    643 {
    644     if (type() != Type::Integer && type() != Type::Double)
    645         return false;
    646 
    647     output = static_cast<long>(m_doubleValue);
    648     return true;
    649 }
    650 
    651 bool InspectorBasicValue::asInteger(long long& output) const
    652 {
    653     if (type() != Type::Integer && type() != Type::Double)
    654         return false;
    655 
    656     output = static_cast<long long>(m_doubleValue);
    657     return true;
    658 }
    659 
    660 bool InspectorBasicValue::asInteger(unsigned long& output) const
    661 {
    662     if (type() != Type::Integer && type() != Type::Double)
    663         return false;
    664 
    665     output = static_cast<unsigned long>(m_doubleValue);
    666     return true;
    667 }
    668 
    669 bool InspectorBasicValue::asInteger(unsigned long long& output) const
    670 {
    671     if (type() != Type::Integer && type() != Type::Double)
    672         return false;
    673 
    674     output = static_cast<unsigned long long>(m_doubleValue);
    675     return true;
    676 }
    677 
    678 void InspectorBasicValue::writeJSON(StringBuilder& output) const
    679 {
    680     ASSERT(type() == Type::Boolean || type() == Type::Double || type() == Type::Integer);
    681 
    682     if (type() == Type::Boolean) {
     662    switch (m_type) {
     663    case Type::Null:
     664        output.appendLiteral("null");
     665        break;
     666    case Type::Boolean:
    683667        if (m_booleanValue)
    684668            output.appendLiteral("true");
    685669        else
    686670            output.appendLiteral("false");
    687     } else if (type() == Type::Double || type() == Type::Integer) {
     671        break;
     672    case Type::String:
     673        doubleQuoteString(m_stringValue, output);
     674        break;
     675    case Type::Double:
     676    case Type::Integer: {
    688677        NumberToLStringBuffer buffer;
    689678        if (!std::isfinite(m_doubleValue)) {
     
    704693            length = decimal.toStringDecimal(buffer, WTF::NumberToStringBufferLength);
    705694        output.append(buffer, length);
    706     }
    707 }
    708 
    709 bool InspectorString::asString(String& output) const
    710 {
    711     output = m_stringValue;
    712     return true;
    713 }
    714 
    715 void InspectorString::writeJSON(StringBuilder& output) const
    716 {
    717     ASSERT(type() == Type::String);
    718     doubleQuoteString(m_stringValue, output);
     695        break;
     696    }
     697    default:
     698        ASSERT_NOT_REACHED();
     699    }
    719700}
    720701
     
    806787
    807788InspectorObjectBase::InspectorObjectBase()
    808     : InspectorValue(Type::Object)
     789    : Inspector::InspectorValue(Type::Object)
    809790    , m_data()
    810791    , m_order()
     
    856837}
    857838
    858 Ref<InspectorValue> InspectorValue::null()
    859 {
    860     return adoptRef(*new InspectorValue);
    861 }
    862 
    863 Ref<InspectorString> InspectorString::create(const String& value)
    864 {
    865     return adoptRef(*new InspectorString(value));
    866 }
    867 
    868 Ref<InspectorString> InspectorString::create(const char* value)
    869 {
    870     return adoptRef(*new InspectorString(value));
    871 }
    872 
    873 Ref<InspectorBasicValue> InspectorBasicValue::create(bool value)
    874 {
    875     return adoptRef(*new InspectorBasicValue(value));
    876 }
    877 
    878 Ref<InspectorBasicValue> InspectorBasicValue::create(int value)
    879 {
    880     return adoptRef(*new InspectorBasicValue(value));
    881 }
    882 
    883 Ref<InspectorBasicValue> InspectorBasicValue::create(double value)
    884 {
    885     return adoptRef(*new InspectorBasicValue(value));
    886 }
    887 
    888839} // namespace Inspector
  • trunk/Source/JavaScriptCore/inspector/InspectorValues.h

    r197563 r199242  
    5252    static const int maxDepth = 1000;
    5353
    54     InspectorValue()
    55         : m_type(Type::Null) { }
    5654    virtual ~InspectorValue() { }
    5755
    5856    static Ref<InspectorValue> null();
     57    static Ref<InspectorValue> create(bool);
     58    static Ref<InspectorValue> create(int);
     59    static Ref<InspectorValue> create(double);
     60    static Ref<InspectorValue> create(const String&);
     61    static Ref<InspectorValue> create(const char*);
    5962
    6063    enum class Type {
     
    6568        String,
    6669        Object,
    67         Array
     70        Array,
    6871    };
    6972
    7073    Type type() const { return m_type; }
    71 
    7274    bool isNull() const { return m_type == Type::Null; }
    7375
    74     virtual bool asBoolean(bool&) const;
    75     virtual bool asInteger(int&) const;
    76     virtual bool asInteger(unsigned&) const;
    77     virtual bool asInteger(long&) const;
    78     virtual bool asInteger(long long&) const;
    79     virtual bool asInteger(unsigned long&) const;
    80     virtual bool asInteger(unsigned long long&) const;
    81     virtual bool asDouble(double&) const;
    82     virtual bool asDouble(float&) const;
    83     virtual bool asString(String&) const;
    84     virtual bool asValue(RefPtr<InspectorValue>&);
     76    bool asBoolean(bool&) const;
     77    bool asInteger(int&) const;
     78    bool asInteger(unsigned&) const;
     79    bool asInteger(long&) const;
     80    bool asInteger(long long&) const;
     81    bool asInteger(unsigned long&) const;
     82    bool asInteger(unsigned long long&) const;
     83    bool asDouble(double&) const;
     84    bool asDouble(float&) const;
     85    bool asString(String&) const;
     86    bool asValue(RefPtr<InspectorValue>&);
     87
    8588    virtual bool asObject(RefPtr<InspectorObject>&);
    8689    virtual bool asArray(RefPtr<InspectorArray>&);
     
    9295
    9396protected:
    94     explicit InspectorValue(Type type) : m_type(type) { }
     97    InspectorValue()
     98        : m_type(Type::Null) { }
     99
     100    explicit InspectorValue(Type type)
     101        : m_type(type) { }
     102
     103    explicit InspectorValue(bool value)
     104        : m_type(Type::Boolean)
     105        , m_booleanValue(value) { }
     106
     107    explicit InspectorValue(int value)
     108        : m_type(Type::Integer)
     109        , m_doubleValue(static_cast<double>(value)) { }
     110
     111    explicit InspectorValue(double value)
     112        : m_type(Type::Double)
     113        , m_doubleValue(value) { }
     114
     115    explicit InspectorValue(const String& value)
     116        : m_type(Type::String)
     117        , m_stringValue(value) { }
     118
     119    explicit InspectorValue(const char* value)
     120        : m_type(Type::String)
     121        , m_stringValue(value) { }
    95122
    96123private:
    97     Type m_type;
    98 };
    99 
    100 class JS_EXPORT_PRIVATE InspectorBasicValue : public InspectorValue {
    101 public:
    102 
    103     static Ref<InspectorBasicValue> create(bool);
    104     static Ref<InspectorBasicValue> create(int);
    105     static Ref<InspectorBasicValue> create(double);
    106 
    107     bool asBoolean(bool&) 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     bool asInteger(int&) const override;
    111     bool asInteger(unsigned&) const override;
    112     bool asInteger(long&) const override;
    113     bool asInteger(long long&) const override;
    114     bool asInteger(unsigned long&) const override;
    115     bool asInteger(unsigned long long&) const override;
    116     bool asDouble(double&) const override;
    117     bool asDouble(float&) const override;
    118 
    119     void writeJSON(StringBuilder& output) const override;
    120 
    121 private:
    122     explicit InspectorBasicValue(bool value)
    123         : InspectorValue(Type::Boolean)
    124         , m_booleanValue(value) { }
    125 
    126     explicit InspectorBasicValue(int value)
    127         : InspectorValue(Type::Integer)
    128         , m_doubleValue(static_cast<double>(value)) { }
    129 
    130     explicit InspectorBasicValue(double value)
    131         : InspectorValue(Type::Double)
    132         , m_doubleValue(value) { }
    133 
     124    Type m_type { Type::Null };
    134125    union {
    135126        bool m_booleanValue;
    136127        double m_doubleValue;
     128        String m_stringValue;
    137129    };
    138 };
    139 
    140 class JS_EXPORT_PRIVATE InspectorString : public InspectorValue {
    141 public:
    142     static Ref<InspectorString> create(const String&);
    143     static Ref<InspectorString> create(const char*);
    144 
    145     bool asString(String& output) const override;
    146 
    147     void writeJSON(StringBuilder& output) const override;
    148 
    149 private:
    150     explicit InspectorString(const String& value)
    151         : InspectorValue(Type::String)
    152         , m_stringValue(value) { }
    153 
    154     explicit InspectorString(const char* value)
    155         : InspectorValue(Type::String)
    156         , m_stringValue(value) { }
    157 
    158     String m_stringValue;
    159130};
    160131
     
    330301inline void InspectorObjectBase::setBoolean(const String& name, bool value)
    331302{
    332     setValue(name, InspectorBasicValue::create(value));
     303    setValue(name, InspectorValue::create(value));
    333304}
    334305
    335306inline void InspectorObjectBase::setInteger(const String& name, int value)
    336307{
    337     setValue(name, InspectorBasicValue::create(value));
     308    setValue(name, InspectorValue::create(value));
    338309}
    339310
    340311inline void InspectorObjectBase::setDouble(const String& name, double value)
    341312{
    342     setValue(name, InspectorBasicValue::create(value));
     313    setValue(name, InspectorValue::create(value));
    343314}
    344315
    345316inline void InspectorObjectBase::setString(const String& name, const String& value)
    346317{
    347     setValue(name, InspectorString::create(value));
     318    setValue(name, InspectorValue::create(value));
    348319}
    349320
     
    371342inline void InspectorArrayBase::pushBoolean(bool value)
    372343{
    373     m_data.append(InspectorBasicValue::create(value));
     344    m_data.append(InspectorValue::create(value));
    374345}
    375346
    376347inline void InspectorArrayBase::pushInteger(int value)
    377348{
    378     m_data.append(InspectorBasicValue::create(value));
     349    m_data.append(InspectorValue::create(value));
    379350}
    380351
    381352inline void InspectorArrayBase::pushDouble(double value)
    382353{
    383     m_data.append(InspectorBasicValue::create(value));
     354    m_data.append(InspectorValue::create(value));
    384355}
    385356
    386357inline void InspectorArrayBase::pushString(const String& value)
    387358{
    388     m_data.append(InspectorString::create(value));
     359    m_data.append(InspectorValue::create(value));
    389360}
    390361
  • trunk/Source/JavaScriptCore/replay/EncodedValue.cpp

    r194496 r199242  
    6868template<> EncodedValue ScalarEncodingTraits<bool>::encodeValue(const bool& value)
    6969{
    70     return EncodedValue(InspectorBasicValue::create(value));
     70    return EncodedValue(InspectorValue::create(value));
    7171}
    7272
    7373template<> EncodedValue ScalarEncodingTraits<double>::encodeValue(const double& value)
    7474{
    75     return EncodedValue(InspectorBasicValue::create(value));
     75    return EncodedValue(InspectorValue::create(value));
    7676}
    7777
    7878template<> EncodedValue ScalarEncodingTraits<float>::encodeValue(const float& value)
    7979{
    80     return EncodedValue(InspectorBasicValue::create((double)value));
     80    return EncodedValue(InspectorValue::create((double)value));
    8181}
    8282
    8383template<> EncodedValue ScalarEncodingTraits<int32_t>::encodeValue(const int32_t& value)
    8484{
    85     return EncodedValue(InspectorBasicValue::create((double)value));
     85    return EncodedValue(InspectorValue::create((double)value));
    8686}
    8787
    8888template<> EncodedValue ScalarEncodingTraits<int64_t>::encodeValue(const int64_t& value)
    8989{
    90     return EncodedValue(InspectorBasicValue::create((double)value));
     90    return EncodedValue(InspectorValue::create((double)value));
    9191}
    9292
    9393template<> EncodedValue ScalarEncodingTraits<uint32_t>::encodeValue(const uint32_t& value)
    9494{
    95     return EncodedValue(InspectorBasicValue::create((double)value));
     95    return EncodedValue(InspectorValue::create((double)value));
    9696}
    9797
    9898template<> EncodedValue ScalarEncodingTraits<uint64_t>::encodeValue(const uint64_t& value)
    9999{
    100     return EncodedValue(InspectorBasicValue::create((double)value));
     100    return EncodedValue(InspectorValue::create((double)value));
    101101}
    102102
  • trunk/Source/JavaScriptCore/replay/EncodedValue.h

    r194470 r199242  
    6060    static EncodedValue createString(const String& value)
    6161    {
    62         return EncodedValue(Inspector::InspectorString::create(value));
     62        return EncodedValue(Inspector::InspectorValue::create(value));
    6363    }
    6464
    6565    static EncodedValue createString(const char* value)
    6666    {
    67         return EncodedValue(Inspector::InspectorString::create(value));
     67        return EncodedValue(Inspector::InspectorValue::create(value));
    6868    }
    6969
  • trunk/Source/WebCore/ChangeLog

    r199238 r199242  
     12016-04-08  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
     4        https://bugs.webkit.org/show_bug.cgi?id=156407
     5        <rdar://problem/25627659>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
     10
    1112016-04-08  Beth Dakin  <bdakin@apple.com>
    212
  • trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp

    r197563 r199242  
    8888            RefPtr<InspectorValue> inspectorValue;
    8989            switch (value.type()) {
    90             case SQLValue::StringValue: inspectorValue = InspectorString::create(value.string()); break;
    91             case SQLValue::NumberValue: inspectorValue = InspectorBasicValue::create(value.number()); break;
     90            case SQLValue::StringValue: inspectorValue = InspectorValue::create(value.string()); break;
     91            case SQLValue::NumberValue: inspectorValue = InspectorValue::create(value.number()); break;
    9292            case SQLValue::NullValue: inspectorValue = InspectorValue::null(); break;
    9393            }
Note: See TracChangeset for help on using the changeset viewer.