Title: [193455] branches/safari-601.1.46-branch/Source/_javascript_Core
Revision
193455
Author
timo...@apple.com
Date
2015-12-04 12:53:49 -0800 (Fri, 04 Dec 2015)

Log Message

Merge r188897. rdar://problem/23581597

Modified Paths

Diff

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog (193454 => 193455)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog	2015-12-04 20:53:45 UTC (rev 193454)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/ChangeLog	2015-12-04 20:53:49 UTC (rev 193455)
@@ -1,3 +1,20 @@
+2015-12-02  Timothy Hatcher  <timo...@apple.com>
+
+        Merge r188897. rdar://problem/23581597
+
+    2015-08-24  Brian Burg  <bb...@apple.com>
+
+            Web Inspector: add protocol test for existing error handling performed by the backend
+            https://bugs.webkit.org/show_bug.cgi?id=147097
+
+            Reviewed by Joseph Pecoraro.
+
+            A new test revealed that the protocol "method" parameter was being parsed in a naive way.
+            Rewrite it to use String::split and improve error checking to avoid failing later.
+
+            * inspector/InspectorBackendDispatcher.cpp:
+            (Inspector::BackendDispatcher::dispatch):
+
 2015-12-04  Timothy Hatcher  <timo...@apple.com>
 
         Merge r188656. rdar://problem/23581597

Modified: branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp (193454 => 193455)


--- branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp	2015-12-04 20:53:45 UTC (rev 193454)
+++ branches/safari-601.1.46-branch/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp	2015-12-04 20:53:49 UTC (rev 193455)
@@ -106,27 +106,28 @@
         return;
     }
 
-    String method;
-    if (!methodValue->asString(method)) {
+    String methodString;
+    if (!methodValue->asString(methodString)) {
         reportProtocolError(&callId, InvalidRequest, ASCIILiteral("The type of 'method' property must be string"));
         return;
     }
 
-    size_t position = method.find('.');
-    if (position == WTF::notFound) {
+    Vector<String> domainAndMethod;
+    methodString.split('.', true, domainAndMethod);
+    if (domainAndMethod.size() != 2 || !domainAndMethod[0].length() || !domainAndMethod[1].length()) {
         reportProtocolError(&callId, InvalidRequest, ASCIILiteral("The 'method' property was formatted incorrectly. It should be 'Domain.method'"));
         return;
     }
 
-    String domain = method.substring(0, position);
+    String domain = domainAndMethod[0];
     SupplementalBackendDispatcher* domainDispatcher = m_dispatchers.get(domain);
     if (!domainDispatcher) {
         reportProtocolError(&callId, MethodNotFound, "'" + domain + "' domain was not found");
         return;
     }
 
-    String domainMethod = method.substring(position + 1);
-    domainDispatcher->dispatch(callId, domainMethod, messageObject.releaseNonNull());
+    String method = domainAndMethod[1];
+    domainDispatcher->dispatch(callId, method, messageObject.releaseNonNull());
 }
 
 void BackendDispatcher::sendResponse(long callId, RefPtr<InspectorObject>&& result, const ErrorString& invocationError)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to