Pass String as reference in more places
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 May 2015 18:51:44 +0000 (18:51 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 May 2015 18:51:44 +0000 (18:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144769

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* debugger/Breakpoint.h:
(JSC::Breakpoint::Breakpoint):
* parser/Parser.h:
(JSC::Parser::setErrorMessage):
(JSC::Parser::updateErrorWithNameAndMessage):
* parser/ParserError.h:
(JSC::ParserError::ParserError):
* runtime/RegExp.cpp:
(JSC::RegExpFunctionalTestCollector::outputOneTest):
* runtime/RegExpObject.cpp:
(JSC::regExpObjectSourceInternal):
* runtime/TypeProfiler.cpp:
(JSC::TypeProfiler::typeInformationForExpressionAtOffset):
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* runtime/TypeProfilerLog.h:
* tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):
* inspector/scripts/codegen/generate_objc_conversion_helpers.py:
(ObjCConversionHelpersGenerator._generate_enum_from_protocol_string):

* inspector/scripts/codegen/objc_generator_templates.py:
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
Rebaseline tests after updating the generator.

Source/WebCore:

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpString):
(WebCore::CloneSerializer::dumpStringObject):
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
* dom/DocumentMarkerController.h:
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorNodeFinder.cpp:
(WebCore::stripCharacters):
(WebCore::InspectorNodeFinder::InspectorNodeFinder):
* inspector/InspectorNodeFinder.h:

Source/WebKit2:

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::showMainResourceForFrame):
* WebProcess/WebPage/WebInspectorUI.h:

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

36 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/Breakpoint.h
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_conversion_helpers.py
Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/ParserError.h
Source/JavaScriptCore/runtime/RegExp.cpp
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/TypeProfiler.cpp
Source/JavaScriptCore/runtime/TypeProfilerLog.cpp
Source/JavaScriptCore/runtime/TypeProfilerLog.h
Source/JavaScriptCore/tools/FunctionOverrides.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/DocumentMarkerController.h
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.h
Source/WebCore/inspector/InspectorNodeFinder.cpp
Source/WebCore/inspector/InspectorNodeFinder.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp
Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h

index 8cdd994..cc38876 100644 (file)
@@ -1,3 +1,47 @@
+2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Pass String as reference in more places
+        https://bugs.webkit.org/show_bug.cgi?id=144769
+
+        Reviewed by Daniel Bates.
+
+        * debugger/Breakpoint.h:
+        (JSC::Breakpoint::Breakpoint):
+        * parser/Parser.h:
+        (JSC::Parser::setErrorMessage):
+        (JSC::Parser::updateErrorWithNameAndMessage):
+        * parser/ParserError.h:
+        (JSC::ParserError::ParserError):
+        * runtime/RegExp.cpp:
+        (JSC::RegExpFunctionalTestCollector::outputOneTest):
+        * runtime/RegExpObject.cpp:
+        (JSC::regExpObjectSourceInternal):
+        * runtime/TypeProfiler.cpp:
+        (JSC::TypeProfiler::typeInformationForExpressionAtOffset):
+        * runtime/TypeProfilerLog.cpp:
+        (JSC::TypeProfilerLog::processLogEntries):
+        * runtime/TypeProfilerLog.h:
+        * tools/FunctionOverrides.cpp:
+        (JSC::initializeOverrideInfo):
+        * inspector/scripts/codegen/generate_objc_conversion_helpers.py:
+        (ObjCConversionHelpersGenerator._generate_enum_from_protocol_string):
+
+        * inspector/scripts/codegen/objc_generator_templates.py:
+        * inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
+        * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
+        * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
+        * inspector/scripts/tests/expected/enum-values.json-result:
+        * inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
+        * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
+        * inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
+        * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
+        * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-array-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-object-type.json-result:
+        * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
+        Rebaseline tests after updating the generator.
+
 2015-05-13  Michael Saboff  <msaboff@apple.com>
 
         com.apple.WebKit.WebContent crashed at JavaScriptCore: JSC::CodeBlock::finalizeUnconditionally
index 60f4fd5..8518ce4 100644 (file)
@@ -43,7 +43,7 @@ struct Breakpoint : public DoublyLinkedListNode<Breakpoint> {
     {
     }
 
-    Breakpoint(SourceID sourceID, unsigned line, unsigned column, String condition, bool autoContinue)
+    Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String& condition, bool autoContinue)
         : id(noBreakpointID)
         , sourceID(sourceID)
         , line(line)
index 4bd5ab3..c31e991 100755 (executable)
@@ -144,7 +144,7 @@ class ObjCConversionHelpersGenerator(Generator):
     def _generate_enum_from_protocol_string(self, objc_enum_name, enum_values):
         lines = []
         lines.append('template<>')
-        lines.append('inline %s fromProtocolString(String value)' % objc_enum_name)
+        lines.append('inline %s fromProtocolString(const String& value)' % objc_enum_name)
         lines.append('{')
         for enum_value in enum_values:
             lines.append('    if (value == "%s")' % enum_value)
index a02f268..ef712b8 100755 (executable)
@@ -55,7 +55,7 @@ namespace Inspector {""")
 
     ConversionHelpersStandard = (
     """template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);""")
+ObjCEnumType fromProtocolString(const String& value);""")
 
     BackendDispatcherHeaderPrelude = (
     """${includes}
index 0c6c7fd..15d6a4d 100644 (file)
@@ -1226,7 +1226,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, int in
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolDatabasePrimaryColors value)
@@ -1242,7 +1242,7 @@ inline String toProtocolString(RWIProtocolDatabasePrimaryColors value)
 }
 
 template<>
-inline RWIProtocolDatabasePrimaryColors fromProtocolString(String value)
+inline RWIProtocolDatabasePrimaryColors fromProtocolString(const String& value)
 {
     if (value == "red")
         return RWIProtocolDatabasePrimaryColorsRed;
@@ -1269,7 +1269,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteSQLSyncOptionalReturnVa
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan;
@@ -1298,7 +1298,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnV
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan;
@@ -1327,7 +1327,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteSQLSyncPrintColor value
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteSQLSyncPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteSQLSyncPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteSQLSyncPrintColorCyan;
@@ -1356,7 +1356,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteSQLAsyncPrintColor valu
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteSQLAsyncPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteSQLAsyncPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteSQLAsyncPrintColorCyan;
index ca7e1a7..9004565 100644 (file)
@@ -1077,7 +1077,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long ca
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolDatabasePrimaryColors value)
@@ -1093,7 +1093,7 @@ inline String toProtocolString(RWIProtocolDatabasePrimaryColors value)
 }
 
 template<>
-inline RWIProtocolDatabasePrimaryColors fromProtocolString(String value)
+inline RWIProtocolDatabasePrimaryColors fromProtocolString(const String& value)
 {
     if (value == "red")
         return RWIProtocolDatabasePrimaryColorsRed;
@@ -1120,7 +1120,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteAllOptionalParametersPr
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
@@ -1149,7 +1149,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteAllOptionalParametersPr
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteAllOptionalParametersPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan;
@@ -1178,7 +1178,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteNoOptionalParametersPri
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
@@ -1207,7 +1207,7 @@ inline String toProtocolString(RWIProtocolDatabaseExecuteNoOptionalParametersPri
 }
 
 template<>
-inline RWIProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(String value)
+inline RWIProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolString(const String& value)
 {
     if (value == "cyan")
         return RWIProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan;
index dbf4cb6..190b260 100644 (file)
@@ -1103,7 +1103,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource7(long callId)
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 
index 667d42a..9d74853 100644 (file)
@@ -835,7 +835,7 @@ void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(lon
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolTypeDomainEnum value)
@@ -853,7 +853,7 @@ inline String toProtocolString(RWIProtocolTypeDomainEnum value)
 }
 
 template<>
-inline RWIProtocolTypeDomainEnum fromProtocolString(String value)
+inline RWIProtocolTypeDomainEnum fromProtocolString(const String& value)
 {
     if (value == "shared")
         return RWIProtocolTypeDomainEnumShared;
@@ -883,7 +883,7 @@ inline String toProtocolString(RWIProtocolCommandDomainCommandWithEnumReturnValu
 }
 
 template<>
-inline RWIProtocolCommandDomainCommandWithEnumReturnValueReturnValue fromProtocolString(String value)
+inline RWIProtocolCommandDomainCommandWithEnumReturnValueReturnValue fromProtocolString(const String& value)
 {
     if (value == "shared")
         return RWIProtocolCommandDomainCommandWithEnumReturnValueReturnValueShared;
@@ -911,7 +911,7 @@ inline String toProtocolString(RWIProtocolEventDomainEventWithEnumParameterParam
 }
 
 template<>
-inline RWIProtocolEventDomainEventWithEnumParameterParameter fromProtocolString(String value)
+inline RWIProtocolEventDomainEventWithEnumParameterParameter fromProtocolString(const String& value)
 {
     if (value == "shared")
         return RWIProtocolEventDomainEventWithEnumParameterParameterShared;
index ed2cb9c..bb8d29d 100644 (file)
@@ -881,7 +881,7 @@ void ObjCInspectorNetwork1BackendDispatcher::loadResource(long callId)
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 
index 3a61c52..a8186e0 100644 (file)
@@ -715,7 +715,7 @@ namespace Inspector {
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolRuntimeKeyPathType value)
@@ -731,7 +731,7 @@ inline String toProtocolString(RWIProtocolRuntimeKeyPathType value)
 }
 
 template<>
-inline RWIProtocolRuntimeKeyPathType fromProtocolString(String value)
+inline RWIProtocolRuntimeKeyPathType fromProtocolString(const String& value)
 {
     if (value == "null")
         return RWIProtocolRuntimeKeyPathTypeNull;
index 46fced9..7e9ef1e 100644 (file)
@@ -669,7 +669,7 @@ namespace Inspector {
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolDebuggerReason value)
@@ -685,7 +685,7 @@ inline String toProtocolString(RWIProtocolDebuggerReason value)
 }
 
 template<>
-inline RWIProtocolDebuggerReason fromProtocolString(String value)
+inline RWIProtocolDebuggerReason fromProtocolString(const String& value)
 {
     if (value == "Died")
         return RWIProtocolDebuggerReasonDied;
index f5d56b3..6d63dd5 100644 (file)
@@ -666,7 +666,7 @@ namespace Inspector {
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolRuntimeFarmAnimals value)
@@ -684,7 +684,7 @@ inline String toProtocolString(RWIProtocolRuntimeFarmAnimals value)
 }
 
 template<>
-inline RWIProtocolRuntimeFarmAnimals fromProtocolString(String value)
+inline RWIProtocolRuntimeFarmAnimals fromProtocolString(const String& value)
 {
     if (value == "Pigs")
         return RWIProtocolRuntimeFarmAnimalsPigs;
@@ -713,7 +713,7 @@ inline String toProtocolString(RWIProtocolRuntimeTwoLeggedAnimals value)
 }
 
 template<>
-inline RWIProtocolRuntimeTwoLeggedAnimals fromProtocolString(String value)
+inline RWIProtocolRuntimeTwoLeggedAnimals fromProtocolString(const String& value)
 {
     if (value == "Ducks")
         return RWIProtocolRuntimeTwoLeggedAnimalsDucks;
index f490756..9eb1d40 100644 (file)
@@ -993,7 +993,7 @@ namespace Inspector {
 namespace Inspector {
 
 template<typename ObjCEnumType>
-ObjCEnumType fromProtocolString(String value);
+ObjCEnumType fromProtocolString(const String& value);
 
 
 inline String toProtocolString(RWIProtocolTestUncastedAnimals value)
@@ -1011,7 +1011,7 @@ inline String toProtocolString(RWIProtocolTestUncastedAnimals value)
 }
 
 template<>
-inline RWIProtocolTestUncastedAnimals fromProtocolString(String value)
+inline RWIProtocolTestUncastedAnimals fromProtocolString(const String& value)
 {
     if (value == "Pigs")
         return RWIProtocolTestUncastedAnimalsPigs;
@@ -1040,7 +1040,7 @@ inline String toProtocolString(RWIProtocolTestCastedAnimals value)
 }
 
 template<>
-inline RWIProtocolTestCastedAnimals fromProtocolString(String value)
+inline RWIProtocolTestCastedAnimals fromProtocolString(const String& value)
 {
     if (value == "Ducks")
         return RWIProtocolTestCastedAnimalsDucks;
index 3dff8e4..2883daa 100644 (file)
@@ -653,9 +653,9 @@ private:
         return m_token.m_location;
     }
 
-    void setErrorMessage(String msg)
+    void setErrorMessage(const String& message)
     {
-        m_errorMessage = msg;
+        m_errorMessage = message;
     }
     
     NEVER_INLINE void logError(bool);
@@ -667,9 +667,9 @@ private:
     template <typename A, typename B, typename C, typename D, typename E, typename F> NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&, const E&, const F&);
     template <typename A, typename B, typename C, typename D, typename E, typename F, typename G> NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&, const E&, const F&, const G&);
     
-    NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, String name, const char* afterMsg)
+    NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMessage, const String& name, const char* afterMessage)
     {
-        m_errorMessage = makeString(beforeMsg, " '", name, "' ", afterMsg);
+        m_errorMessage = makeString(beforeMessage, " '", name, "' ", afterMessage);
     }
     
     NEVER_INLINE void updateErrorMessage(const char* msg)
index ce145d7..89a05ab 100644 (file)
@@ -70,7 +70,7 @@ public:
     {
     }
 
-    ParserError(ErrorType type, SyntaxErrorType syntaxError, JSToken token, String msg, int line)
+    ParserError(ErrorType type, SyntaxErrorType syntaxError, JSToken token, const String& msg, int line)
         : m_token(token)
         , m_message(msg)
         , m_line(line)
index 462b9e3..e182c78 100644 (file)
@@ -113,7 +113,7 @@ RegExpFunctionalTestCollector* RegExpFunctionalTestCollector::get()
     return s_instance;
 }
 
-void RegExpFunctionalTestCollector::outputOneTest(RegExp* regExp, String s, int startOffset, int* ovector, int result)
+void RegExpFunctionalTestCollector::outputOneTest(RegExp* regExp, const String& s, int startOffset, int* ovector, int result)
 {
     if ((!m_lastRegExp) || (m_lastRegExp != regExp)) {
         m_lastRegExp = regExp;
index 25c8585..74c29f0 100644 (file)
@@ -199,7 +199,7 @@ inline void appendLineTerminatorEscape<UChar>(StringBuilder& builder, UChar line
 }
 
 template <typename CharacterType>
-static inline JSValue regExpObjectSourceInternal(ExecState* exec, String pattern, const CharacterType* characters, unsigned length)
+static inline JSValue regExpObjectSourceInternal(ExecState* exec, const String& pattern, const CharacterType* characters, unsigned length)
 {
     bool previousCharacterWasBackslash = false;
     bool inBrackets = false;
index e0f06c9..338a1c2 100644 (file)
@@ -101,7 +101,6 @@ String TypeProfiler::typeInformationForExpressionAtOffset(TypeProfilerSearchDesc
     else
         json.appendLiteral("false");
 
-
     json.append('}');
     
     return json.toString();
index 476caf5..d0d930a 100644 (file)
@@ -52,7 +52,7 @@ TypeProfilerLog::~TypeProfilerLog()
     delete[] m_logStartPtr;
 }
 
-void TypeProfilerLog::processLogEntries(String reason)
+void TypeProfilerLog::processLogEntries(const String& reason)
 {
     if (verbose)
         dataLog("Process caller:'", reason, "'");
index c14b993..46eeaec 100644 (file)
@@ -63,7 +63,7 @@ public:
 
     ~TypeProfilerLog();
 
-    JS_EXPORT_PRIVATE void processLogEntries(String);
+    JS_EXPORT_PRIVATE void processLogEntries(const String&);
     LogEntry* logEndPtr() const { return m_logEndPtr; }
 
     static ptrdiff_t logStartOffset() { return OBJECT_OFFSETOF(TypeProfilerLog, m_logStartPtr); }
index 83e4f1c..23531bb 100644 (file)
@@ -104,7 +104,7 @@ FunctionOverrides::FunctionOverrides(const char* overridesFileName)
     parseOverridesInFile(overridesFileName);
 }
 
-static void initializeOverrideInfo(const SourceCode& origCode, String newBody, FunctionOverrides::OverrideInfo& info)
+static void initializeOverrideInfo(const SourceCode& origCode, const String& newBody, FunctionOverrides::OverrideInfo& info)
 {
     String origProviderStr = origCode.provider()->source();
     unsigned origBraceStart = origCode.startOffset();
index c4d6cd0..990f6e1 100644 (file)
@@ -1,3 +1,24 @@
+2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Pass String as reference in more places
+        https://bugs.webkit.org/show_bug.cgi?id=144769
+
+        Reviewed by Daniel Bates.
+
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::dumpString):
+        (WebCore::CloneSerializer::dumpStringObject):
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::addMarker):
+        * dom/DocumentMarkerController.h:
+        * inspector/InspectorApplicationCacheAgent.cpp:
+        (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
+        * inspector/InspectorApplicationCacheAgent.h:
+        * inspector/InspectorNodeFinder.cpp:
+        (WebCore::stripCharacters):
+        (WebCore::InspectorNodeFinder::InspectorNodeFinder):
+        * inspector/InspectorNodeFinder.h:
+
 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
 
         View scale changes are temporarily lost after restoring a page from the page cache
index ee15bd5..d96ed77 100644 (file)
@@ -681,23 +681,23 @@ private:
         }
     }
 
-    void dumpString(String str)
+    void dumpString(const String& string)
     {
-        if (str.isEmpty())
+        if (string.isEmpty())
             write(EmptyStringTag);
         else {
             write(StringTag);
-            write(str);
+            write(string);
         }
     }
 
-    void dumpStringObject(String str)
+    void dumpStringObject(const String& string)
     {
-        if (str.isEmpty())
+        if (string.isEmpty())
             write(EmptyStringObjectTag);
         else {
             write(StringObjectTag);
-            write(str);
+            write(string);
         }
     }
 
index 4a3ccf8..ce0507b 100644 (file)
@@ -108,7 +108,7 @@ void DocumentMarkerController::addTextMatchMarker(const Range* range, bool activ
 }
 
 #if PLATFORM(IOS)
-void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, String description, const Vector<String>& interpretations, const RetainPtr<id>& metadata)
+void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description, const Vector<String>& interpretations, const RetainPtr<id>& metadata)
 {
     // Use a TextIterator to visit the potentially multiple nodes the range covers.
     for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
index 32ca300..594ee69 100644 (file)
@@ -55,7 +55,7 @@ public:
     void addMarkerToNode(Node*, unsigned startOffset, unsigned length, DocumentMarker::MarkerType, PassRefPtr<DocumentMarkerDetails>);
     WEBCORE_EXPORT void addTextMatchMarker(const Range*, bool activeMatch);
 #if PLATFORM(IOS)
-    void addMarker(Range*, DocumentMarker::MarkerType, String description, const Vector<String>& interpretations, const RetainPtr<id>& metadata);
+    void addMarker(Range*, DocumentMarker::MarkerType, const String& description, const Vector<String>& interpretations, const RetainPtr<id>& metadata);
     void addDictationPhraseWithAlternativesMarker(Range*, const Vector<String>& interpretations);
     void addDictationResultMarker(Range*, const RetainPtr<id>& metadata);
 #endif
index 3e6f632..fd4caf6 100644 (file)
@@ -114,7 +114,7 @@ void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString&, RefPtr
     }
 }
 
-DocumentLoader* InspectorApplicationCacheAgent::assertFrameWithDocumentLoader(ErrorString& errorString, String frameId)
+DocumentLoader* InspectorApplicationCacheAgent::assertFrameWithDocumentLoader(ErrorString& errorString, const String& frameId)
 {
     Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
     if (!frame)
index f08ace2..2d6218d 100644 (file)
@@ -69,7 +69,7 @@ private:
     Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::ApplicationCacheResource>> buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
     Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
 
-    DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, String frameId);
+    DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, const String& frameId);
 
     InspectorPageAgent* m_pageAgent;
     std::unique_ptr<Inspector::ApplicationCacheFrontendDispatcher> m_frontendDispatcher;
index b51087d..1edbbfc 100644 (file)
@@ -42,7 +42,7 @@
 
 namespace WebCore {
 
-static String stripCharacters(String string, const char startCharacter, const char endCharacter, bool& startCharFound, bool& endCharFound)
+static String stripCharacters(const String& string, const char startCharacter, const char endCharacter, bool& startCharFound, bool& endCharFound)
 {
     startCharFound = string.startsWith(startCharacter);
     endCharFound = string.endsWith(endCharacter);
@@ -52,7 +52,7 @@ static String stripCharacters(String string, const char startCharacter, const ch
     return string.substring(start, end - start);
 }
 
-InspectorNodeFinder::InspectorNodeFinder(String whitespaceTrimmedQuery)
+InspectorNodeFinder::InspectorNodeFinder(const String& whitespaceTrimmedQuery)
     : m_whitespaceTrimmedQuery(whitespaceTrimmedQuery)
 {
     m_tagNameQuery = stripCharacters(whitespaceTrimmedQuery, '<', '>', m_startTagFound, m_endTagFound);
index e1a2256..6a42762 100644 (file)
@@ -42,7 +42,7 @@ class Node;
 
 class InspectorNodeFinder {
 public:
-    InspectorNodeFinder(String whitespaceTrimmedQuery);
+    InspectorNodeFinder(const String& whitespaceTrimmedQuery);
     void performSearch(Node*);
     const ListHashSet<Node*>& results() const { return m_results; }
 
index 3af36a5..6af9255 100644 (file)
@@ -1,3 +1,14 @@
+2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Pass String as reference in more places
+        https://bugs.webkit.org/show_bug.cgi?id=144769
+
+        Reviewed by Daniel Bates.
+
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::showMainResourceForFrame):
+        * WebProcess/WebPage/WebInspectorUI.h:
+
 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
 
         View scale changes are temporarily lost after restoring a page from the page cache
index 0ffedd2..320939f 100644 (file)
@@ -215,7 +215,7 @@ void WebInspectorUI::showResources()
     evaluateCommandOnLoad(ASCIILiteral("showResources"));
 }
 
-void WebInspectorUI::showMainResourceForFrame(String frameIdentifier)
+void WebInspectorUI::showMainResourceForFrame(const String& frameIdentifier)
 {
     evaluateCommandOnLoad(ASCIILiteral("showMainResourceForFrame"), frameIdentifier);
 }
index 5c15863..4180f63 100644 (file)
@@ -57,7 +57,7 @@ public:
     void showConsole();
     void showResources();
 
-    void showMainResourceForFrame(String frameIdentifier);
+    void showMainResourceForFrame(const String& frameIdentifier);
 
     void startPageProfiling();
     void stopPageProfiling();