Reviewed by Darin.
Convert a bunch of RefPtr<StringImpl> to String.
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::didTellBridgeAboutLoad):
(WebCore::FrameMac::haveToldBridgeAboutLoad):
* dom/BeforeUnloadEvent.cpp:
(WebCore::BeforeUnloadEvent::storeResult):
* dom/BeforeUnloadEvent.h:
(WebCore::BeforeUnloadEvent::result):
* dom/Document.cpp:
(WebCore::Document::createEntityReference):
* dom/Entity.cpp:
(WebCore::Entity::Entity):
(WebCore::Entity::nodeName):
(WebCore::Entity::toString):
* dom/Entity.h:
(WebCore::Entity::publicId):
(WebCore::Entity::systemId):
(WebCore::Entity::notationName):
* dom/EntityReference.cpp:
(WebCore::EntityReference::EntityReference):
(WebCore::EntityReference::nodeName):
(WebCore::EntityReference::cloneNode):
(WebCore::EntityReference::toString):
* dom/EntityReference.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::initKeyboardEvent):
* dom/KeyboardEvent.h:
(WebCore::KeyboardEvent::keyIdentifier):
* dom/MutationEvent.cpp:
(WebCore::MutationEvent::MutationEvent):
(WebCore::MutationEvent::initMutationEvent):
* dom/MutationEvent.h:
(WebCore::MutationEvent::prevValue):
(WebCore::MutationEvent::newValue):
(WebCore::MutationEvent::attrName):
* dom/Notation.cpp:
(WebCore::Notation::Notation):
(WebCore::Notation::nodeName):
* dom/Notation.h:
(WebCore::Notation::publicId):
(WebCore::Notation::systemId):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::ProcessingInstruction):
(WebCore::ProcessingInstruction::setData):
(WebCore::ProcessingInstruction::nodeName):
(WebCore::ProcessingInstruction::nodeValue):
(WebCore::ProcessingInstruction::cloneNode):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::toString):
* dom/ProcessingInstruction.h:
(WebCore::ProcessingInstruction::target):
(WebCore::ProcessingInstruction::data):
(WebCore::ProcessingInstruction::localHref):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16885
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-07 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Darin.
+
+ Convert a bunch of RefPtr<StringImpl> to String.
+
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::didTellBridgeAboutLoad):
+ (WebCore::FrameMac::haveToldBridgeAboutLoad):
+ * dom/BeforeUnloadEvent.cpp:
+ (WebCore::BeforeUnloadEvent::storeResult):
+ * dom/BeforeUnloadEvent.h:
+ (WebCore::BeforeUnloadEvent::result):
+ * dom/Document.cpp:
+ (WebCore::Document::createEntityReference):
+ * dom/Entity.cpp:
+ (WebCore::Entity::Entity):
+ (WebCore::Entity::nodeName):
+ (WebCore::Entity::toString):
+ * dom/Entity.h:
+ (WebCore::Entity::publicId):
+ (WebCore::Entity::systemId):
+ (WebCore::Entity::notationName):
+ * dom/EntityReference.cpp:
+ (WebCore::EntityReference::EntityReference):
+ (WebCore::EntityReference::nodeName):
+ (WebCore::EntityReference::cloneNode):
+ (WebCore::EntityReference::toString):
+ * dom/EntityReference.h:
+ * dom/KeyboardEvent.cpp:
+ (WebCore::KeyboardEvent::KeyboardEvent):
+ (WebCore::KeyboardEvent::initKeyboardEvent):
+ * dom/KeyboardEvent.h:
+ (WebCore::KeyboardEvent::keyIdentifier):
+ * dom/MutationEvent.cpp:
+ (WebCore::MutationEvent::MutationEvent):
+ (WebCore::MutationEvent::initMutationEvent):
+ * dom/MutationEvent.h:
+ (WebCore::MutationEvent::prevValue):
+ (WebCore::MutationEvent::newValue):
+ (WebCore::MutationEvent::attrName):
+ * dom/Notation.cpp:
+ (WebCore::Notation::Notation):
+ (WebCore::Notation::nodeName):
+ * dom/Notation.h:
+ (WebCore::Notation::publicId):
+ (WebCore::Notation::systemId):
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::ProcessingInstruction):
+ (WebCore::ProcessingInstruction::setData):
+ (WebCore::ProcessingInstruction::nodeName):
+ (WebCore::ProcessingInstruction::nodeValue):
+ (WebCore::ProcessingInstruction::cloneNode):
+ (WebCore::ProcessingInstruction::checkStyleSheet):
+ (WebCore::ProcessingInstruction::toString):
+ * dom/ProcessingInstruction.h:
+ (WebCore::ProcessingInstruction::target):
+ (WebCore::ProcessingInstruction::data):
+ (WebCore::ProcessingInstruction::localHref):
+
2006-10-07 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Tim H.
bool _haveUndoRedoOperations;
- HashSet<RefPtr<StringImpl> > urlsBridgeKnowsAbout;
+ HashSet<String> urlsBridgeKnowsAbout;
friend class Frame;
void FrameMac::didTellBridgeAboutLoad(const String& URL)
{
- urlsBridgeKnowsAbout.add(URL.impl());
+ urlsBridgeKnowsAbout.add(URL);
}
bool FrameMac::haveToldBridgeAboutLoad(const String& URL)
{
- return urlsBridgeKnowsAbout.contains(URL.impl());
+ return urlsBridgeKnowsAbout.contains(URL);
}
void FrameMac::clear()
void BeforeUnloadEvent::storeResult(const String& s)
{
- m_result = s.impl();
+ m_result = s;
}
} // namespace WebCore
virtual bool storesResultAsString() const;
virtual void storeResult(const String&);
- String result() const { return m_result.get(); }
+ String result() const { return m_result; }
private:
- RefPtr<StringImpl> m_result;
+ String m_result;
};
} // namespace WebCore
ec = NOT_SUPPORTED_ERR;
return 0;
}
- return new EntityReference(this, name.impl());
+ return new EntityReference(this, name);
}
PassRefPtr<EditingText> Document::createEditingTextNode(const String &text)
Entity::Entity(Document* doc, const String& name)
: ContainerNode(doc)
- , m_name(name.impl())
+ , m_name(name)
{
}
Entity::Entity(Document* doc, const String& publicId, const String& systemId, const String& notationName)
: ContainerNode(doc)
- , m_publicId(publicId.impl())
- , m_systemId(systemId.impl())
- , m_notationName(notationName.impl())
+ , m_publicId(publicId)
+ , m_systemId(systemId)
+ , m_notationName(notationName)
{
}
String Entity::nodeName() const
{
- return m_name.get();
+ return m_name;
}
Node::NodeType Entity::nodeType() const
{
String result = "<!ENTITY' ";
- if (m_name && m_name->length()) {
+ if (!m_name.isEmpty()) {
result += " ";
- result += m_name.get();
+ result += m_name;
}
- if (m_publicId && m_publicId->length()) {
+ if (!m_publicId.isEmpty()) {
result += " PUBLIC \"";
- result += m_publicId.get();
+ result += m_publicId;
result += "\" \"";
- result += m_systemId.get();
+ result += m_systemId;
result += "\"";
- } else if (m_systemId && m_systemId->length()) {
+ } else if (!m_systemId.isEmpty()) {
result += " SYSTEM \"";
- result += m_systemId.get();
+ result += m_systemId;
result += "\"";
}
- if (m_notationName && m_notationName->length()) {
+ if (!m_notationName.isEmpty()) {
result += " NDATA ";
- result += m_notationName.get();
+ result += m_notationName;
}
result += ">";
Entity(Document*, const String& publicId, const String& systemId, const String& notationName);
// DOM methods & attributes for Entity
- String publicId() const { return m_publicId.get(); }
- String systemId() const { return m_systemId.get(); }
- String notationName() const { return m_notationName.get(); }
+ String publicId() const { return m_publicId; }
+ String systemId() const { return m_systemId; }
+ String notationName() const { return m_notationName; }
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual String toString() const;
private:
- RefPtr<StringImpl> m_publicId;
- RefPtr<StringImpl> m_systemId;
- RefPtr<StringImpl> m_notationName;
- RefPtr<StringImpl> m_name;
+ String m_publicId;
+ String m_systemId;
+ String m_notationName;
+ String m_name;
};
} //namespace
{
}
-EntityReference::EntityReference(Document* doc, StringImpl* entityName)
+EntityReference::EntityReference(Document* doc, const String& entityName)
: ContainerNode(doc)
, m_entityName(entityName)
{
String EntityReference::nodeName() const
{
- return m_entityName.get();
+ return m_entityName;
}
Node::NodeType EntityReference::nodeType() const
PassRefPtr<Node> EntityReference::cloneNode(bool deep)
{
- RefPtr<EntityReference> clone = new EntityReference(document(), m_entityName.get());
+ RefPtr<EntityReference> clone = new EntityReference(document(), m_entityName);
// ### make sure children are readonly
// ### since we are a reference, should we clone children anyway (even if not deep?)
if (deep)
String EntityReference::toString() const
{
String result = "&";
- result += m_entityName.get();
+ result += m_entityName;
result += ";";
return result;
{
public:
EntityReference(Document*);
- EntityReference(Document*, StringImpl* entityName);
+ EntityReference(Document*, const String& entityName);
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual String toString() const;
private:
- RefPtr<StringImpl> m_entityName;
+ String m_entityName;
};
} //namespace
: UIEventWithKeyState(key.isKeyUp() ? keyupEvent : key.isAutoRepeat() ? keypressEvent : keydownEvent,
true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
, m_keyEvent(new PlatformKeyboardEvent(key))
- , m_keyIdentifier(String(key.keyIdentifier()).impl())
+ , m_keyIdentifier(key.keyIdentifier())
, m_keyLocation(key.isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD)
, m_altGraphKey(false)
{
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey)
: UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, altKey, shiftKey, metaKey)
, m_keyEvent(0)
- , m_keyIdentifier(keyIdentifier.impl())
+ , m_keyIdentifier(keyIdentifier)
, m_keyLocation(keyLocation)
, m_altGraphKey(altGraphKey)
{
initUIEvent(type, canBubble, cancelable, view, 0);
- m_keyIdentifier = keyIdentifier.impl();
+ m_keyIdentifier = keyIdentifier;
m_keyLocation = keyLocation;
m_ctrlKey = ctrlKey;
m_shiftKey = shiftKey;
const String& keyIdentifier, unsigned keyLocation,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey = false);
- String keyIdentifier() const { return m_keyIdentifier.get(); }
+ String keyIdentifier() const { return m_keyIdentifier; }
unsigned keyLocation() const { return m_keyLocation; }
bool altGraphKey() const { return m_altGraphKey; }
private:
PlatformKeyboardEvent* m_keyEvent;
- RefPtr<StringImpl> m_keyIdentifier;
+ String m_keyIdentifier;
unsigned m_keyLocation;
bool m_altGraphKey : 1;
};
const String& attrName, unsigned short attrChange)
: Event(type, canBubble, cancelable)
, m_relatedNode(relatedNode)
- , m_prevValue(prevValue.impl())
- , m_newValue(newValue.impl())
- , m_attrName(attrName.impl())
+ , m_prevValue(prevValue)
+ , m_newValue(newValue)
+ , m_attrName(attrName)
, m_attrChange(attrChange)
{
}
initEvent(type, canBubble, cancelable);
m_relatedNode = relatedNode;
- m_prevValue = prevValue.impl();
- m_newValue = newValue.impl();
- m_attrName = attrName.impl();
+ m_prevValue = prevValue;
+ m_newValue = newValue;
+ m_attrName = attrName;
m_attrChange = attrChange;
}
const String& attrName, unsigned short attrChange);
Node* relatedNode() const { return m_relatedNode.get(); }
- String prevValue() const { return m_prevValue.get(); }
- String newValue() const { return m_newValue.get(); }
- String attrName() const { return m_attrName.get(); }
+ String prevValue() const { return m_prevValue; }
+ String newValue() const { return m_newValue; }
+ String attrName() const { return m_attrName; }
unsigned short attrChange() const { return m_attrChange; }
virtual bool isMutationEvent() const;
private:
RefPtr<Node> m_relatedNode;
- RefPtr<StringImpl> m_prevValue;
- RefPtr<StringImpl> m_newValue;
- RefPtr<StringImpl> m_attrName;
+ String m_prevValue;
+ String m_newValue;
+ String m_attrName;
unsigned short m_attrChange;
};
Notation::Notation(Document* doc, const String& name, const String& publicId, const String& systemId)
: ContainerNode(doc)
- , m_name(name.impl())
- , m_publicId(publicId.impl())
- , m_systemId(systemId.impl())
+ , m_name(name)
+ , m_publicId(publicId)
+ , m_systemId(systemId)
{
}
String Notation::nodeName() const
{
- return m_name.get();
+ return m_name;
}
Node::NodeType Notation::nodeType() const
Notation(Document*, const String& name, const String& publicId, const String& systemId);
// DOM methods & attributes for Notation
- String publicId() const { return m_publicId.get(); }
- String systemId() const { return m_systemId. get(); }
+ String publicId() const { return m_publicId; }
+ String systemId() const { return m_systemId; }
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual bool childTypeAllowed(NodeType);
private:
- RefPtr<StringImpl> m_name;
- RefPtr<StringImpl> m_publicId;
- RefPtr<StringImpl> m_systemId;
+ String m_name;
+ String m_publicId;
+ String m_systemId;
};
} //namespace
ProcessingInstruction::ProcessingInstruction(Document* doc, const String& target, const String& data)
: ContainerNode(doc)
- , m_target(target.impl())
- , m_data(data.impl())
+ , m_target(target)
+ , m_data(data)
, m_cachedSheet(0)
, m_loading(false)
#if XSLT_SUPPORT
ec = NO_MODIFICATION_ALLOWED_ERR;
return;
}
- m_data = data.impl();
+ m_data = data;
}
String ProcessingInstruction::nodeName() const
{
- return m_target.get();
+ return m_target;
}
Node::NodeType ProcessingInstruction::nodeType() const
String ProcessingInstruction::nodeValue() const
{
- return m_data.get();
+ return m_data;
}
void ProcessingInstruction::setNodeValue(const String& nodeValue, ExceptionCode& ec)
PassRefPtr<Node> ProcessingInstruction::cloneNode(bool /*deep*/)
{
// ### copy m_localHref
- return new ProcessingInstruction(document(), m_target.get(), m_data.get());
+ return new ProcessingInstruction(document(), m_target, m_data);
}
// DOM Section 1.1.1
bool ProcessingInstruction::checkStyleSheet()
{
- if (String(m_target.get()) == "xml-stylesheet") {
+ if (m_target == "xml-stylesheet") {
// see http://www.w3.org/TR/xml-stylesheet/
// ### support stylesheet included in a fragment of this (or another) document
// ### make sure this gets called when adding from javascript
bool attrsOk;
- const HashMap<String, String> attrs = parseAttributes(m_data.get(), attrsOk);
+ const HashMap<String, String> attrs = parseAttributes(m_data, attrsOk);
if (!attrsOk)
return true;
HashMap<String, String>::const_iterator i = attrs.find("type");
// We need to make a synthetic XSLStyleSheet that is embedded. It needs to be able
// to kick off import/include loads that can hang off some parent sheet.
if (m_isXSL) {
- m_sheet = new XSLStyleSheet(this, m_localHref.get(), true);
+ m_sheet = new XSLStyleSheet(this, m_localHref, true);
m_loading = false;
}
return !m_isXSL;
String ProcessingInstruction::toString() const
{
String result = "<?";
- result += m_target.get();
+ result += m_target;
result += " ";
- result += m_data.get();
+ result += m_data;
result += "?>";
return result;
}
virtual ~ProcessingInstruction();
// DOM methods & attributes for Notation
- String target() const { return m_target.get(); }
- String data() const { return m_data.get(); }
+ String target() const { return m_target; }
+ String data() const { return m_data; }
void setData(const String&, ExceptionCode&);
virtual String nodeName() const;
virtual bool offsetInCharacters() const;
// Other methods (not part of DOM)
- String localHref() const { return m_localHref.get(); }
+ String localHref() const { return m_localHref; }
StyleSheet* sheet() const { return m_sheet.get(); }
bool checkStyleSheet();
virtual void setCSSStyleSheet(const String& URL, const String& charset, const String& sheet);
private:
void parseStyleSheet(const String& sheet);
- RefPtr<StringImpl> m_target;
- RefPtr<StringImpl> m_data;
- RefPtr<StringImpl> m_localHref;
+ String m_target;
+ String m_data;
+ String m_localHref;
CachedResource* m_cachedSheet;
RefPtr<StyleSheet> m_sheet;
bool m_loading;