Commit 3cd8ef7a authored by darin@apple.com's avatar darin@apple.com

2008-03-28 Darin Adler <darin@apple.com>

        Reviewed by Adam.

        - eliminate a tiny bit of unnecessary refcount churn

        * bindings/js/JSEventTargetBase.cpp:
        (WebCore::eventNameForPropertyToken): Return const AtomicString&.
        * bindings/js/JSEventTargetBase.h:
        (WebCore::JSEventTargetBase::getValueProperty): Update for above change.
        (WebCore::JSEventTargetBase::putValueProperty): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7e31bd16
2008-03-28 Darin Adler <darin@apple.com>
Reviewed by Adam.
- eliminate a tiny bit of unnecessary refcount churn
* bindings/js/JSEventTargetBase.cpp:
(WebCore::eventNameForPropertyToken): Return const AtomicString&.
* bindings/js/JSEventTargetBase.h:
(WebCore::JSEventTargetBase::getValueProperty): Update for above change.
(WebCore::JSEventTargetBase::putValueProperty): Ditto.
2008-03-28 Simon Hausmann <hausmann@webkit.org>
Fix the Qt build.
......@@ -158,7 +158,7 @@ bool retrieveEventTargetAndCorrespondingNode(KJS::ExecState*, KJS::JSObject* thi
return true;
}
AtomicString eventNameForPropertyToken(int token)
const AtomicString& eventNameForPropertyToken(int token)
{
switch (token) {
case JSEventTargetProperties::OnAbort:
......@@ -243,7 +243,7 @@ AtomicString eventNameForPropertyToken(int token)
return unloadEvent;
}
return AtomicString();
return nullAtom;
}
JSValue* toJS(ExecState* exec, EventTarget* target)
......
......@@ -69,7 +69,7 @@ namespace WebCore {
KJS::JSValue* jsEventTargetDispatchEvent(KJS::ExecState*, KJS::JSObject*, const KJS::List&);
// Helper function for getValueProperty/putValueProperty
AtomicString eventNameForPropertyToken(int token);
const AtomicString& eventNameForPropertyToken(int token);
template<class JSEventTarget>
class JSEventTargetBase {
......@@ -78,7 +78,7 @@ namespace WebCore {
KJS::JSValue* getValueProperty(const JSEventTarget* owner, KJS::ExecState* exec, int token) const
{
AtomicString eventName = eventNameForPropertyToken(token);
const AtomicString& eventName = eventNameForPropertyToken(token);
if (!eventName.isEmpty())
return owner->getListener(eventName);
......@@ -87,7 +87,7 @@ namespace WebCore {
void putValueProperty(const JSEventTarget* owner, KJS::ExecState* exec, int token, KJS::JSValue* value)
{
AtomicString eventName = eventNameForPropertyToken(token);
const AtomicString& eventName = eventNameForPropertyToken(token);
if (!eventName.isEmpty())
owner->setListener(exec, eventName, value);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment