Bug 144769

Summary: Pass String as reference in more places
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, ap, benjamin, burg, commit-queue, darin, dbates, esprehn+autocc, joepeck, jsbell, kangil.han, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix dbates: review+

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