WebCore:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 17:45:17 +0000 (17:45 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2008 17:45:17 +0000 (17:45 +0000)
2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * css/CSSRule.cpp:
        (WebCore::CSSRule::setCssText):
        * css/CSSRule.h:
        * html/HTMLFormElement.cpp:
        (WebCore::pathGetFilename):
        * html/HTMLMediaElement.cpp:
        (WebCore::parseTimeOffset):
        * page/EditorClient.h:
        * platform/SecurityOrigin.cpp:
        (WebCore::isDefaultPortForProtocol):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::load):
        * platform/graphics/MediaPlayer.h:
        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlInputElement::MediaControlInputElement):
        * rendering/MediaControlElements.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::Condition::Condition):
        * svg/animation/SVGSMILElement.h:
        * svg/graphics/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyEditorClient::shouldInsertText):
        * xml/XSLTProcessor.cpp:
        (WebCore::createFragmentFromSource):

WebKit/gtk:

2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * WebCoreSupport/EditorClientGtk.cpp:
        (WebKit::EditorClient::shouldInsertText):
        * WebCoreSupport/EditorClientGtk.h:

WebKit/mac:

2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * WebCoreSupport/WebEditorClient.h:
        * WebCoreSupport/WebEditorClient.mm:
        (WebEditorClient::shouldInsertText):

WebKit/qt:

2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * WebCoreSupport/EditorClientQt.cpp:
        (WebCore::EditorClientQt::shouldInsertText):
        * WebCoreSupport/EditorClientQt.h:

WebKit/win:

2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * WebCoreSupport/WebEditorClient.cpp:
        (WebEditorClient::shouldInsertText):
        * WebCoreSupport/WebEditorClient.h:

WebKit/wx:

2008-04-24  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Change some String arguments to be const references instead.

        * WebKitSupport/EditorClientWx.cpp:
        (WebCore::EditorClientWx::shouldInsertText):
        * WebKitSupport/EditorClientWx.h:

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

30 files changed:
WebCore/ChangeLog
WebCore/css/CSSRule.cpp
WebCore/css/CSSRule.h
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLMediaElement.cpp
WebCore/page/EditorClient.h
WebCore/platform/SecurityOrigin.cpp
WebCore/platform/graphics/MediaPlayer.cpp
WebCore/platform/graphics/MediaPlayer.h
WebCore/rendering/MediaControlElements.cpp
WebCore/rendering/MediaControlElements.h
WebCore/svg/animation/SVGSMILElement.cpp
WebCore/svg/animation/SVGSMILElement.h
WebCore/svg/graphics/SVGImageEmptyClients.h
WebCore/xml/XSLTProcessor.cpp
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
WebKit/gtk/WebCoreSupport/EditorClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebEditorClient.h
WebKit/mac/WebCoreSupport/WebEditorClient.mm
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.cpp
WebKit/qt/WebCoreSupport/EditorClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebEditorClient.cpp
WebKit/win/WebCoreSupport/WebEditorClient.h
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/EditorClientWx.cpp
WebKit/wx/WebKitSupport/EditorClientWx.h

index b2d06ab1637acfc0ac1e2d21817ab10122a8408d..0539a5c0b3020ad9a8581c5c7b37abb6c960ac5c 100644 (file)
@@ -1,3 +1,33 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+        
+        * css/CSSRule.cpp:
+        (WebCore::CSSRule::setCssText):
+        * css/CSSRule.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::pathGetFilename):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::parseTimeOffset):
+        * page/EditorClient.h:
+        * platform/SecurityOrigin.cpp:
+        (WebCore::isDefaultPortForProtocol):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::load):
+        * platform/graphics/MediaPlayer.h:
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlInputElement::MediaControlInputElement):
+        * rendering/MediaControlElements.h:
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::Condition::Condition):
+        * svg/animation/SVGSMILElement.h:
+        * svg/graphics/SVGImageEmptyClients.h:
+        (WebCore::SVGEmptyEditorClient::shouldInsertText):
+        * xml/XSLTProcessor.cpp:
+        (WebCore::createFragmentFromSource):
+
 2008-04-24  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Darin Adler.
index 0b141b1bc11fd5bd94c09abaf97d5e6253431a96..74cc7d31beee3510baa92a75d15b93e22ac88520 100644 (file)
@@ -44,7 +44,7 @@ String CSSRule::cssText() const
     return String();
 }
 
-void CSSRule::setCssText(String /*cssText*/, ExceptionCode& /*ec*/)
+void CSSRule::setCssText(const String& /*cssText*/, ExceptionCode& /*ec*/)
 {
     // FIXME: Implement!
 }
index ad865b3b7062bdce883238580fa1a65ea3628922..dfe57fc16cbce7c66d66aeb160c059f9e5717a03 100644 (file)
@@ -57,7 +57,7 @@ public:
     CSSRule* parentRule() const;
 
     virtual String cssText() const;
-    void setCssText(String, ExceptionCode&);
+    void setCssText(const String&, ExceptionCode&);
 };
 
 } // namespace WebCore
index 7d9e095e3bc47c687171eeda3e9e979d8aa2f562..d0e5879a48b94f9d9cd865567d524bb05e3d7b78 100644 (file)
@@ -211,7 +211,7 @@ static int randomNumber()
 // Warning: this helper doesn't currently have a reliable cross-platform behavior in
 // certain edge cases (see basename(3) specification for examples).
 // Consider this if it ever needs to become a general purpose method.
-static String pathGetFilename(String path)
+static String pathGetFilename(const String& path)
 {
 #if PLATFORM(QT)
     return QFileInfo(path).fileName();
index bac3093dbf298389fabb84b477ac03a543e0855a..42bb6559d7b2afe260098371eb4205c2282d8521 100644 (file)
@@ -197,12 +197,16 @@ String serializeTimeOffset(float time)
     return timeString;
 }
 
-float parseTimeOffset(String timeString, bool* ok = 0)
+float parseTimeOffset(const String& timeString, bool* ok = 0)
 {
-    if (timeString.endsWith("s"))
-        timeString = timeString.left(timeString.length() - 1);
+    const UChar* characters = timeString.characters();
+    unsigned length = timeString.length();
+    
+    if (characters[length - 1] == 's')
+        length--;
+    
     // FIXME parse time offset values (format not specified yet)
-    float val = (float)timeString.toDouble(ok);
+    float val = charactersToFloat(characters, length, ok);
     return val;
 }
 
index ead36ece0942113892676746c06bb7863bf9860f..1ee79af920f975de2873ce25ab8dc260579fc09b 100644 (file)
@@ -80,7 +80,7 @@ public:
     virtual bool shouldBeginEditing(Range*) = 0;
     virtual bool shouldEndEditing(Range*) = 0;
     virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction) = 0;
-    virtual bool shouldInsertText(String, Range*, EditorInsertAction) = 0;
+    virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) = 0;
     virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) = 0;
     
     virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*) = 0;
index 32030833b21f1d1ca429cf81298da3152072904f..be538e6407564544ea2e277022a8ceee5f3a159e 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-static bool isDefaultPortForProtocol(unsigned short port, String protocol)
+static bool isDefaultPortForProtocol(unsigned short port, const String& protocol)
 {
     if (protocol.isEmpty())
         return false;
index d152eb12fa4bca670a8abe76798271ebb031d1b4..75216dc9e33ddce50136837b6e66af881522b470 100644 (file)
@@ -58,7 +58,7 @@ MediaPlayer::~MediaPlayer()
     delete m_private;
 }
 
-void MediaPlayer::load(String url)
+void MediaPlayer::load(const String& url)
 {
     m_private->load(url);
 }    
index e6e605d5059e4069d57310b29f52cef40fb3d3ee..6813068859a898a8f0a268068cd140a26bfa34c7 100644 (file)
@@ -68,7 +68,7 @@ public:
     IntRect rect() const { return m_rect; }
     void setRect(const IntRect& r);
     
-    void load(String url);
+    void load(const String& url);
     void cancelLoad();
     
     bool visible() const;
index d46690f47df744fae0640041f239394d5fa70b1f..cfaff94fcf7ffa6618887ebf14f00e9214b9affd 100644 (file)
@@ -68,7 +68,7 @@ MediaControlShadowRootElement::MediaControlShadowRootElement(Document* doc, HTML
 
 // ----------------------------
 
-MediaControlInputElement::MediaControlInputElement(Document* doc, RenderStyle::PseudoId pseudo, String type, HTMLMediaElement* mediaElement) 
+MediaControlInputElement::MediaControlInputElement(Document* doc, RenderStyle::PseudoId pseudo, const String& type, HTMLMediaElement* mediaElement) 
     : HTMLInputElement(doc)
     , m_mediaElement(mediaElement)
 {
index 2deaa45d9f00b3bf3d191431e49aab90ffc96360..8ff726bccbdbc773eff0c52b87e70a297b679b36 100644 (file)
@@ -58,7 +58,7 @@ private:
 
 class MediaControlInputElement : public HTMLInputElement {
 public:
-    MediaControlInputElement(Document*, RenderStyle::PseudoId, String type, HTMLMediaElement*);
+    MediaControlInputElement(Document*, RenderStyle::PseudoId, const String& type, HTMLMediaElement*);
     void attachToParent(Element*);
     void update();
 protected:
index c29c7900fc96b950c6a503039b44941ca77391ea..b1f6c6a3eeca68350029c89f848cb35eeed651f0 100644 (file)
@@ -78,7 +78,7 @@ private:
     Element* m_eventBase;
 };
     
-SVGSMILElement::Condition::Condition(Type type, BeginOrEnd beginOrEnd, String baseID, const String& name, SMILTime offset, int repeats)
+SVGSMILElement::Condition::Condition(Type type, BeginOrEnd beginOrEnd, const String& baseID, const String& name, SMILTime offset, int repeats)
     : m_type(type)
     , m_beginOrEnd(beginOrEnd)
     , m_baseID(baseID)
index 01e8bcdb542689c8e01c164b14acfc541ae09ea5..fac102e6d3ecb21f671657fbb7ebe52f865397bf 100644 (file)
@@ -122,7 +122,7 @@ private:
         // for example <animate begin="otherElement.begin + 8s; button.click" ... />
         struct Condition {
             enum Type { EventBase, Syncbase, AccessKey };
-            Condition(Type, BeginOrEnd beginOrEnd, String baseID, const String& name, SMILTime offset, int repeats = -1);
+            Condition(Type, BeginOrEnd beginOrEnd, const String& baseID, const String& name, SMILTime offset, int repeats = -1);
             Type m_type;
             BeginOrEnd m_beginOrEnd;
             String m_baseID;
index fe804f86ae04a9f03e5b6aacd97f28dac7b69752..73061775a870662229a71335080cfa8549d3f16b 100644 (file)
@@ -284,7 +284,7 @@ public:
     virtual bool shouldEndEditing(Range*) { return false; }
     virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction) { return false; }
     //  virtual bool shouldInsertNode(Node*, Range* replacingRange, WebViewInsertAction) { return false; }
-    virtual bool shouldInsertText(String, Range*, EditorInsertAction) { return false; }
+    virtual bool shouldInsertText(const String&, Range*, EditorInsertAction) { return false; }
     virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) { return false; }
 
     virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*) { return false; }
index 07406869bb10dd64de7ea98be4a17338840c093f..30c3549ddee136317bcb0a6c85e24836e00591a4 100644 (file)
@@ -273,7 +273,7 @@ RefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourceStr
     return result;
 }
 
-static inline RefPtr<DocumentFragment> createFragmentFromSource(String sourceString, String sourceMIMEType, Node* sourceNode, Document* outputDoc)
+static inline RefPtr<DocumentFragment> createFragmentFromSource(const String& sourceString, const String& sourceMIMEType, Node* sourceNode, Document* outputDoc)
 {
     RefPtr<DocumentFragment> fragment = new DocumentFragment(outputDoc);
     
index 8190eeec3a575e17882f6d5486142c459d837c4b..d0f34eb5537f14aad99781c2a44eeb5c345e9a1c 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::shouldInsertText):
+        * WebCoreSupport/EditorClientGtk.h:
+
 2008-04-23  Christian Dywan  <christian@twotoasts.de>
 
         Reviewed by Alp Toker.
index 80f1089fb4c2924028ffc9cea33e1623f91c7261..702e4deaffd95c88e79895e1c488fd72eccf1e51 100644 (file)
@@ -81,7 +81,7 @@ bool EditorClient::shouldEndEditing(WebCore::Range*)
     return true;
 }
 
-bool EditorClient::shouldInsertText(String, Range*, EditorInsertAction)
+bool EditorClient::shouldInsertText(const String&, Range*, EditorInsertAction)
 {
     notImplemented();
     return true;
index f2bc194ddb011b071ad2fc15f961673953432620..de31842d45d7cc8d810e64dfc8b93c61d37bca0d 100644 (file)
@@ -64,7 +64,7 @@ namespace WebKit {
         virtual bool shouldBeginEditing(WebCore::Range*);
         virtual bool shouldEndEditing(WebCore::Range*);
         virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
-        virtual bool shouldInsertText(WebCore::String, WebCore::Range*, WebCore::EditorInsertAction);
+        virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction);
         virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting);
 
         virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
index efe89c08cade6d2de58e59bd93559378250da844..0de178a808d1c86c3ba41e87c845c44323067c9c 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::shouldInsertText):
+
 2008-04-24  John Sullivan  <sullivan@apple.com>
 
         Mac build fix
index 0b53fb114815c6a07066cd5c707ae1962ed829d0..c6227867d7e74a54489772dde4c182d4630d57ef 100644 (file)
@@ -56,7 +56,7 @@ public:
     virtual bool shouldBeginEditing(WebCore::Range*);
     virtual bool shouldEndEditing(WebCore::Range*);
     virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction);
-    virtual bool shouldInsertText(WebCore::String, WebCore::Range*, WebCore::EditorInsertAction);
+    virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction);
     virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting);
 
     virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*);
index 436899549f5b8183a2fa176de91955ab6c760c25..a1cbf38d8800a86268630dbae2722c7ca6ab1353 100644 (file)
@@ -245,7 +245,7 @@ bool WebEditorClient::shouldEndEditing(Range* range)
                              shouldEndEditingInDOMRange:kit(range)];
 }
 
-bool WebEditorClient::shouldInsertText(String text, Range* range, EditorInsertAction action)
+bool WebEditorClient::shouldInsertText(const String& text, Range* range, EditorInsertAction action)
 {
     WebView* webView = m_webView;
     return [[webView _editingDelegateForwarder] webView:webView shouldInsertText:text replacingDOMRange:kit(range) givenAction:kit(action)];
index 5034ed76b466f7d1a13e32cc9fa13572be3067d8..894fc46e65088666c5d752accc90689f8c861e30 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::shouldInsertText):
+        * WebCoreSupport/EditorClientQt.h:
+
 2008-04-24  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Simon.
index a39a4453148c3faa941bb78076c4814dc31deb6a..1b73b31216cd18713d40a495b5b0192ccd999f63 100644 (file)
@@ -143,7 +143,7 @@ bool EditorClientQt::shouldEndEditing(WebCore::Range* range)
     return true;
 }
 
-bool EditorClientQt::shouldInsertText(String string, Range* range, EditorInsertAction action)
+bool EditorClientQt::shouldInsertText(const String& string, Range* range, EditorInsertAction action)
 {
     if (dumpEditingCallbacks) {
         static const char *insertactionstring[] = {
index 41147b6cc57b0a36863ce9d4e6503138a99a3e73..35020b228392155c46851404a2023fd5b9dbee8d 100644 (file)
@@ -60,7 +60,7 @@ public:
     virtual bool shouldBeginEditing(Range*);
     virtual bool shouldEndEditing(Range*);
     virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
-    virtual bool shouldInsertText(String, Range*, EditorInsertAction);
+    virtual bool shouldInsertText(const String&, Range*, EditorInsertAction);
     virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
 
     virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
index 18fc94a07aba478e7abd02134c149fd241364808..903b99db85f996a51c5f756e3e63839d63719841 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+
+        * WebCoreSupport/WebEditorClient.cpp:
+        (WebEditorClient::shouldInsertText):
+        * WebCoreSupport/WebEditorClient.h:
+
 2008-04-23  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Sam Weinig
index 523bbb4a0af996ecf339cd8c6b72ff1e2d36ff93..e38cd0d2b70a2a50c0c36dd138460d5cc2060f5f 100644 (file)
@@ -249,7 +249,7 @@ bool WebEditorClient::shouldInsertNode(Node* /*node*/, Range* /*replacingRange*/
     return true; 
 }
 
-bool WebEditorClient::shouldInsertText(String /*str*/, Range* /* replacingRange */, EditorInsertAction /*givenAction*/)
+bool WebEditorClient::shouldInsertText(const String& /*str*/, Range* /* replacingRange */, EditorInsertAction /*givenAction*/)
 {     
     notImplemented(); 
     return true; 
index 0f1e57a86b3ef5c8b399c98af87edcd9b0ad4829..8c603f213534b8504e1c10eaf9551a2e1c33feac 100644 (file)
@@ -53,7 +53,7 @@ public:
 
     virtual bool shouldBeginEditing(WebCore::Range*);
     virtual bool shouldEndEditing(WebCore::Range*);
-    virtual bool shouldInsertText(WebCore::String, WebCore::Range*, WebCore::EditorInsertAction);
+    virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction);
 
     virtual void didBeginEditing();
     virtual void didEndEditing();
index 2740bb2f8b2be93aa46215f2096e9479507b5716..78a3d462566942f7e87dbc694b58d312cdd94a50 100644 (file)
@@ -1,3 +1,13 @@
+2008-04-24  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Change some String arguments to be const references instead.
+
+        * WebKitSupport/EditorClientWx.cpp:
+        (WebCore::EditorClientWx::shouldInsertText):
+        * WebKitSupport/EditorClientWx.h:
+
 2008-04-23  Kevin Ollivier  <kevino@theolliviers.com>
 
         Reviewed by Alp Toker.
index ef276323b0506ff59dba357c3f9f53ebd334625e..88ca9c231b333c2c99bd3aa3ce100629d1b5ef89 100644 (file)
@@ -143,7 +143,7 @@ bool EditorClientWx::shouldInsertNode(Node*, Range*,
     return true;
 }
 
-bool EditorClientWx::shouldInsertText(String, Range*,
+bool EditorClientWx::shouldInsertText(const String&, Range*,
                                        EditorInsertAction)
 {
     notImplemented();
index c2234d07487e0951139342e8117e45b420007385..51b820c611a94f066a820ee1cafff61089ac66f1 100644 (file)
@@ -55,7 +55,7 @@ public:
     virtual bool shouldEndEditing(Range*);
     virtual bool shouldInsertNode(Node*, Range*,
                                   EditorInsertAction);
-    virtual bool shouldInsertText(String, Range*,
+    virtual bool shouldInsertText(const String&, Range*,
                                   EditorInsertAction);
     virtual bool shouldApplyStyle(CSSStyleDeclaration*,
                                   Range*);