Ignore:
Timestamp:
Dec 6, 2005, 1:21:15 AM (19 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Eric.

  • add PassRefPtr, a smart pointer class that works in conjunction with RefPtr but has transfer-of-ownership semantics
  • apply RefPtr and PassRefPtr to UString
  • cleaned up UString a little so that it doesn't need to have so many friend classes
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/identifier.cpp: (KJS::Identifier::add):
  • kjs/identifier.h: (KJS::Identifier::Identifier): (KJS::Identifier::equal):
  • kjs/property_map.cpp: (KJS::PropertyMap::get): (KJS::PropertyMap::getLocation): (KJS::PropertyMap::put): (KJS::PropertyMap::remove):
  • kjs/ustring.cpp: (KJS::UCharReference::operator=): (KJS::UCharReference::ref): (KJS::UString::Rep::createCopying): (KJS::UString::Rep::create): (KJS::UString::usedCapacity): (KJS::UString::usedPreCapacity): (KJS::UString::expandCapacity): (KJS::UString::expandPreCapacity): (KJS::UString::UString): (KJS::UString::spliceSubstringsWithSeparators): (KJS::UString::append): (KJS::UString::operator=): (KJS::UString::toStrictUInt32): (KJS::UString::substr): (KJS::UString::copyForWriting): (KJS::operator==):
  • kjs/ustring.h: (KJS::UString::UString): (KJS::UString::~UString): (KJS::UString::data): (KJS::UString::isNull): (KJS::UString::isEmpty): (KJS::UString::size): (KJS::UString::rep):
  • kxmlcore/RefPtr.h: (KXMLCore::RefPtr::RefPtr): (KXMLCore::RefPtr::operator*): (KXMLCore::::operator): (KXMLCore::operator==): (KXMLCore::operator!=): (KXMLCore::static_pointer_cast): (KXMLCore::const_pointer_cast):

WebCore:

Reviewed by Eric.

  • add PassRefPtr, a smart pointer class that works in conjunction with RefPtr but has transfer-of-ownership semantics
  • apply RefPtr and PassRefPtr to UString
  • khtml/ecma/kjs_binding.cpp: (KJS::UString::UString):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/identifier.h

    r10563 r11472  
    3535        Identifier(const char *s) : _ustring(add(s)) { }
    3636        Identifier(const UChar *s, int length) : _ustring(add(s, length)) { }
    37         explicit Identifier(const UString &s) : _ustring(add(s.rep)) { }
     37        explicit Identifier(UString::Rep *rep) : _ustring(add(rep)) { }
     38        explicit Identifier(const UString &s) : _ustring(add(s.rep())) { }
    3839       
    3940        const UString &ustring() const { return _ustring; }
     
    7374
    7475        static bool equal(const Identifier &a, const Identifier &b)
    75             { return a._ustring.rep == b._ustring.rep; }
     76            { return a._ustring.rep() == b._ustring.rep(); }
    7677        static bool equal(const Identifier &a, const char *b)
    77             { return equal(a._ustring.rep, b); }
     78            { return equal(a._ustring.rep(), b); }
    7879       
    7980        static UString::Rep *add(const char *);
Note: See TracChangeset for help on using the changeset viewer.