Web Inspector: remove some dead code in IdentifiersFactory
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2018 01:12:44 +0000 (01:12 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2018 01:12:44 +0000 (01:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184839

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

This was never used on non-Chrome ports, so the identifier always has a
prefix of '0.'. We may change this in the future, but for now remove this.
Using a PID for this purpose is problematic anyway.

* inspector/IdentifiersFactory.cpp:
(Inspector::addPrefixToIdentifier):
(Inspector::IdentifiersFactory::createIdentifier):
(Inspector::IdentifiersFactory::requestId):
(Inspector::IdentifiersFactory::addProcessIdPrefixTo): Deleted.
* inspector/IdentifiersFactory.h:

Source/WebCore:

* inspector/InspectorController.cpp:
(WebCore::InspectorController::setProcessId): Deleted.
* inspector/InspectorController.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/IdentifiersFactory.cpp
Source/JavaScriptCore/inspector/IdentifiersFactory.h
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorController.cpp

index c8fb418..9c5d578 100644 (file)
@@ -1,3 +1,21 @@
+2018-04-20  Brian Burg  <bburg@apple.com>
+
+        Web Inspector: remove some dead code in IdentifiersFactory
+        https://bugs.webkit.org/show_bug.cgi?id=184839
+
+        Reviewed by Timothy Hatcher.
+
+        This was never used on non-Chrome ports, so the identifier always has a
+        prefix of '0.'. We may change this in the future, but for now remove this.
+        Using a PID for this purpose is problematic anyway.
+
+        * inspector/IdentifiersFactory.cpp:
+        (Inspector::addPrefixToIdentifier):
+        (Inspector::IdentifiersFactory::createIdentifier):
+        (Inspector::IdentifiersFactory::requestId):
+        (Inspector::IdentifiersFactory::addProcessIdPrefixTo): Deleted.
+        * inspector/IdentifiersFactory.h:
+
 2018-04-20  Mark Lam  <mark.lam@apple.com>
 
         Add the ability to use a hash for setting PtrTag enum values.
index 7e145be..95cd87b 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc.  All rights reserved.
+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include "config.h"
 #include "IdentifiersFactory.h"
 
-#include <wtf/text/StringBuilder.h>
-
 namespace Inspector {
 
 namespace {
 static long s_lastUsedIdentifier = 0;
 }
 
-long IdentifiersFactory::s_processId = 0;
+static String addPrefixToIdentifier(const String& identifier)
+{
+    return makeString("0.", identifier);
+}
 
 String IdentifiersFactory::createIdentifier()
 {
-    return addProcessIdPrefixTo(String::number(++s_lastUsedIdentifier));
+    return addPrefixToIdentifier(String::number(++s_lastUsedIdentifier));
 }
 
 String IdentifiersFactory::requestId(unsigned long identifier)
 {
     if (identifier)
-        return addProcessIdPrefixTo(String::number(identifier));
+        return addPrefixToIdentifier(String::number(identifier));
     return String();
 }
 
-String IdentifiersFactory::addProcessIdPrefixTo(const String& id)
-{
-    StringBuilder builder;
-    builder.appendNumber(s_processId);
-    builder.append('.');
-    builder.append(id);
-    return builder.toString();
-}
-
 } // namespace Inspector
-
index 3a3b75a..eb25aed 100644 (file)
@@ -31,14 +31,8 @@ namespace Inspector {
 
 class JS_EXPORT_PRIVATE IdentifiersFactory {
 public:
-    static void setProcessId(long processId) { s_processId = processId; }
     static String createIdentifier();
     static String requestId(unsigned long identifier);
-
-private:
-    static String addProcessIdPrefixTo(const String& id);
-
-    static long s_processId;
 };
 
 } // namespace Inspector
index 7942e05..74d56eb 100644 (file)
@@ -1,3 +1,14 @@
+2018-04-20  Brian Burg  <bburg@apple.com>
+
+        Web Inspector: remove some dead code in IdentifiersFactory
+        https://bugs.webkit.org/show_bug.cgi?id=184839
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setProcessId): Deleted.
+        * inspector/InspectorController.h:
+
 2018-04-20  Chris Dumez  <cdumez@apple.com>
 
         Use WindowProxy in DOMWindow.idl
index 1c3a033..e9ea1c5 100644 (file)
@@ -356,11 +356,6 @@ void InspectorController::show()
         connectFrontend(frontendChannel);
 }
 
-void InspectorController::setProcessId(long processId)
-{
-    IdentifiersFactory::setProcessId(processId);
-}
-
 void InspectorController::setIsUnderTest(bool value)
 {
     if (value == m_isUnderTest)