Bug 144769 - Pass String as reference in more places
Summary: Pass String as reference in more places
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-07 15:21 PDT by Joseph Pecoraro
Modified: 2015-05-13 11:53 PDT (History)
12 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (35.18 KB, patch)
2015-05-07 16:59 PDT, Joseph Pecoraro
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-05-07 15:21:58 PDT
* SUMMARY
Pass String as reference in more places.

This covers all cases where a String was being passed as not a reference in JavaScriptCore. And a sprinkle of cases in WebCore/WebKit2. This doesn't cover all cases there because there are many.
Comment 1 Joseph Pecoraro 2015-05-07 16:59:49 PDT
Created attachment 252654 [details]
[PATCH] Proposed Fix

Use "const String&" in places where parameters were passing just a "String".
Comment 2 WebKit Commit Bot 2015-05-07 17:00:52 PDT
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Comment 3 Daniel Bates 2015-05-07 23:44:05 PDT
Comment on attachment 252654 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=252654&action=review

> Source/JavaScriptCore/parser/Parser.h:656
> +    void setErrorMessage(const String& msg)

For your consideration, I suggest we rename msg to message.

> Source/JavaScriptCore/parser/Parser.h:670
> +    NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, const String& name, const char* afterMsg)

For your consideration, I suggest we rename beforeMsg and afterMsg to beforeMessage and afterMessage, respectively.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:684
> +    void dumpString(const String& str)

For your consideration, I suggest we rename parameter str to string.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:694
> +    void dumpStringObject(const String& str)

Ditto.
Comment 4 Joseph Pecoraro 2015-05-13 11:53:34 PDT
http://trac.webkit.org/changeset/184291