"ScriptValue" arguments of PopStateEvent methods should be "const ScriptValue&"
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 06:07:17 +0000 (06:07 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 06:07:17 +0000 (06:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68984

Reviewed by Darin Adler.

Just a follow-up fix for the bug 68345. For performance,
"ScriptValue" arguments of PopStateEvent methods should be "const ScriptValue&".

Tests: fast/events/constructors/pop-state-event-constructor.html
       fast/events/fire-popstate-event.html

* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::PopStateEvent):
(WebCore::PopStateEvent::create):
(WebCore::PopStateEvent::initPopStateEvent):
* dom/PopStateEvent.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/PopStateEvent.cpp
Source/WebCore/dom/PopStateEvent.h

index 0a4a47c..1815b39 100644 (file)
@@ -1,3 +1,22 @@
+2011-09-28  Kentaro Hara  <haraken@chromium.org>
+
+        "ScriptValue" arguments of PopStateEvent methods should be "const ScriptValue&"
+        https://bugs.webkit.org/show_bug.cgi?id=68984
+
+        Reviewed by Darin Adler.
+
+        Just a follow-up fix for the bug 68345. For performance,
+        "ScriptValue" arguments of PopStateEvent methods should be "const ScriptValue&".
+
+        Tests: fast/events/constructors/pop-state-event-constructor.html
+               fast/events/fire-popstate-event.html
+
+        * dom/PopStateEvent.cpp:
+        (WebCore::PopStateEvent::PopStateEvent):
+        (WebCore::PopStateEvent::create):
+        (WebCore::PopStateEvent::initPopStateEvent):
+        * dom/PopStateEvent.h:
+
 2011-09-28  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] Move drag-and-drop code which can be shared with WebKit2 to WebCore
index 60e9ca7..4e027f0 100644 (file)
@@ -48,7 +48,7 @@ PopStateEvent::PopStateEvent(const AtomicString& type, const PopStateEventInit&
 {
 }
 
-PopStateEvent::PopStateEvent(ScriptValue state)
+PopStateEvent::PopStateEvent(const ScriptValue& state)
     : Event(eventNames().popstateEvent, false, true)
     , m_state(state)
     , m_serializedState(0)
@@ -70,7 +70,7 @@ PassRefPtr<PopStateEvent> PopStateEvent::create()
     return adoptRef(new PopStateEvent);
 }
 
-PassRefPtr<PopStateEvent> PopStateEvent::create(ScriptValue state)
+PassRefPtr<PopStateEvent> PopStateEvent::create(const ScriptValue& state)
 {
     return adoptRef(new PopStateEvent(state));
 }
@@ -85,7 +85,7 @@ PassRefPtr<PopStateEvent> PopStateEvent::create(const AtomicString& type, const
     return adoptRef(new PopStateEvent(type, initializer));
 }
 
-void PopStateEvent::initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue state)
+void PopStateEvent::initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& state)
 {
     if (dispatched())
         return;
index 1e5d61a..030534b 100644 (file)
@@ -43,10 +43,10 @@ class PopStateEvent : public Event {
 public:
     virtual ~PopStateEvent();
     static PassRefPtr<PopStateEvent> create();
-    static PassRefPtr<PopStateEvent> create(ScriptValue);
+    static PassRefPtr<PopStateEvent> create(const ScriptValue&);
     static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>);
     static PassRefPtr<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
-    void initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue);
+    void initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue&);
     bool isPopStateEvent() const { return true; }
 
     SerializedScriptValue* serializedState() const { return m_serializedState.get(); }
@@ -55,7 +55,7 @@ public:
 private:
     PopStateEvent();
     PopStateEvent(const AtomicString&, const PopStateEventInit&);
-    explicit PopStateEvent(ScriptValue);
+    explicit PopStateEvent(const ScriptValue&);
     explicit PopStateEvent(PassRefPtr<SerializedScriptValue>);
 
     ScriptValue m_state;