Title: [268854] trunk/Source/WebKit
Revision
268854
Author
[email protected]
Date
2020-10-21 22:24:58 -0700 (Wed, 21 Oct 2020)

Log Message

Move function definitions in JSIPCBinding.h into cpp file
https://bugs.webkit.org/show_bug.cgi?id=218065

Reviewed by Wenson Hsieh.

Added JSIPCBinding.cpp and moved the code from JSIPCBinding.h to JSIPCBinding.cpp.

No new tests since there is no behavior change.

* Platform/IPC/JSIPCBinding.cpp: Added.
(IPC::jsValueForDecodedStringArgumentValue): Moved from .h.
(IPC::jsValueForDecodedArgumentValue<String>): Ditto.
(IPC::jsValueForDecodedArgumentValue<URL>): Ditto.
(IPC::jsValueForDecodedArgumentValue<RegistrableDomain>): Ditto.
(IPC::jsValueForDecodedNumericArgumentValue): Ditto.
(IPC::jsValueForDecodedArgumentValue<double>): Ditto.
(IPC::jsValueForDecodedArgumentValue<float>): Ditto.
(IPC::jsValueForDecodedArgumentValue<int8_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<int16_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<int32_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<int64_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<uint8_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<uint16_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<uint32_t>): Ditto.
(IPC::jsValueForDecodedArgumentValue<uint64_t>): Ditto.
(IPC::jsValueForDecodedArgumentRect): Ditto.
(IPC::jsValueForDecodedArgumentValue<IntRect>): Ditto.
(IPC::jsValueForDecodedArgumentValue<FloatRect>): Ditto.
* Platform/IPC/JSIPCBinding.h:
(IPC::jsValueForDecodedArgumentValue):
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (268853 => 268854)


--- trunk/Source/WebKit/ChangeLog	2020-10-22 05:24:47 UTC (rev 268853)
+++ trunk/Source/WebKit/ChangeLog	2020-10-22 05:24:58 UTC (rev 268854)
@@ -1,5 +1,40 @@
 2020-10-21  Ryosuke Niwa  <[email protected]>
 
+        Move function definitions in JSIPCBinding.h into cpp file
+        https://bugs.webkit.org/show_bug.cgi?id=218065
+
+        Reviewed by Wenson Hsieh.
+
+        Added JSIPCBinding.cpp and moved the code from JSIPCBinding.h to JSIPCBinding.cpp.
+
+        No new tests since there is no behavior change.
+
+        * Platform/IPC/JSIPCBinding.cpp: Added.
+        (IPC::jsValueForDecodedStringArgumentValue): Moved from .h.
+        (IPC::jsValueForDecodedArgumentValue<String>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<URL>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<RegistrableDomain>): Ditto.
+        (IPC::jsValueForDecodedNumericArgumentValue): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<double>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<float>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<int8_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<int16_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<int32_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<int64_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<uint8_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<uint16_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<uint32_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<uint64_t>): Ditto.
+        (IPC::jsValueForDecodedArgumentRect): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<IntRect>): Ditto.
+        (IPC::jsValueForDecodedArgumentValue<FloatRect>): Ditto.
+        * Platform/IPC/JSIPCBinding.h:
+        (IPC::jsValueForDecodedArgumentValue):
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+
+2020-10-21  Ryosuke Niwa  <[email protected]>
+
         IPC testing API should have the capability to observe messages being sent and received
         https://bugs.webkit.org/show_bug.cgi?id=217870
 

Added: trunk/Source/WebKit/Platform/IPC/JSIPCBinding.cpp (0 => 268854)


--- trunk/Source/WebKit/Platform/IPC/JSIPCBinding.cpp	                        (rev 0)
+++ trunk/Source/WebKit/Platform/IPC/JSIPCBinding.cpp	2020-10-22 05:24:58 UTC (rev 268854)
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSIPCBinding.h"
+
+#if ENABLE(IPC_TESTING_API)
+
+#include <_javascript_Core/JSCJSValueInlines.h>
+#include <WebCore/FloatRect.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/RegistrableDomain.h>
+#include <wtf/URL.h>
+
+namespace IPC {
+
+static JSC::JSValue jsValueForDecodedStringArgumentValue(JSC::JSGlobalObject* globalObject, const String& value, ASCIILiteral type)
+{
+    auto& vm = globalObject->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), value.isNull() ? JSC::jsNull() : JSC::jsString(vm, value));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    return object;
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const String& value)
+{
+    return jsValueForDecodedStringArgumentValue(globalObject, value, "String"_s);
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const URL& value)
+{
+    return jsValueForDecodedStringArgumentValue(globalObject, value.string(), "URL"_s);
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::RegistrableDomain& value)
+{
+    return jsValueForDecodedStringArgumentValue(globalObject, value.string(), "RegistrableDomain"_s);
+}
+
+template<typename NumericType>
+JSC::JSValue jsValueForDecodedNumericArgumentValue(JSC::JSGlobalObject* globalObject, NumericType value, const String& type)
+{
+    auto& vm = globalObject->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), JSC::JSValue(value));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    return object;
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, bool value)
+{
+    auto& vm = globalObject->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, "bool"));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), JSC::jsBoolean(value));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    return object;
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, double value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "double");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, float value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "float");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int8_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int8_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int16_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int16_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int32_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int32_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int64_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int64_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint8_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint8_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint16_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint16_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint32_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint32_t");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint64_t value)
+{
+    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint64_t");
+}
+
+template<typename RectType>
+JSC::JSValue jsValueForDecodedArgumentRect(JSC::JSGlobalObject* globalObject, const RectType& value, const String& type)
+{
+    auto& vm = globalObject->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "x"_s), JSC::JSValue(value.x()));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "y"_s), JSC::JSValue(value.y()));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "width"_s), JSC::JSValue(value.width()));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    object->putDirect(vm, JSC::Identifier::fromString(vm, "height"_s), JSC::JSValue(value.height()));
+    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
+    return object;
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::IntRect& value)
+{
+    return jsValueForDecodedArgumentRect(globalObject, value, "IntRect");
+}
+
+template<>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::FloatRect& value)
+{
+    return jsValueForDecodedArgumentRect(globalObject, value, "FloatRect");
+}
+
+}
+
+#endif

Modified: trunk/Source/WebKit/Platform/IPC/JSIPCBinding.h (268853 => 268854)


--- trunk/Source/WebKit/Platform/IPC/JSIPCBinding.h	2020-10-22 05:24:47 UTC (rev 268853)
+++ trunk/Source/WebKit/Platform/IPC/JSIPCBinding.h	2020-10-22 05:24:58 UTC (rev 268854)
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#if ENABLE(IPC_TESTING_API)
+
 #include "Decoder.h"
 #include "HandleMessage.h"
 #include <_javascript_Core/JSArray.h>
@@ -31,52 +33,35 @@
 #include <_javascript_Core/JSGlobalObject.h>
 #include <_javascript_Core/JSObject.h>
 #include <_javascript_Core/ObjectConstructor.h>
-#include <WebCore/FloatRect.h>
-#include <WebCore/IntRect.h>
-#include <WebCore/RegistrableDomain.h>
 #include <wtf/ObjectIdentifier.h>
-#include <wtf/URL.h>
 #include <wtf/text/WTFString.h>
 
-namespace IPC {
+namespace WTF {
 
-template<typename T, std::enable_if_t<!std::is_arithmetic<T>::value && !std::is_enum<T>::value>* = nullptr>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const T&)
-{
-    return JSC::jsUndefined();
-}
+class URL;
 
-inline JSC::JSValue jsValueForDecodedStringArgumentValue(JSC::JSGlobalObject* globalObject, const String& value, ASCIILiteral type)
-{
-    auto& vm = globalObject->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), value.isNull() ? JSC::jsNull() : JSC::jsString(vm, value));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    return object;
 }
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const String& value)
-{
-    return jsValueForDecodedStringArgumentValue(globalObject, value, "String"_s);
-}
+namespace WebCore {
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const URL& value)
-{
-    return jsValueForDecodedStringArgumentValue(globalObject, value.string(), "URL"_s);
+class FloatRect;
+class IntRect;
+class RegistrableDomain;
+
 }
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::RegistrableDomain& value)
+namespace IPC {
+
+template<typename T, std::enable_if_t<!std::is_arithmetic<T>::value && !std::is_enum<T>::value>* = nullptr>
+JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const T&)
 {
-    return jsValueForDecodedStringArgumentValue(globalObject, value.string(), "RegistrableDomain"_s);
+    return JSC::jsUndefined();
 }
 
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const String&);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const URL&);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const WebCore::RegistrableDomain&);
+
 template<typename T, std::enable_if_t<std::is_arithmetic<T>::value>* = nullptr>
 JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, T)
 {
@@ -88,94 +73,19 @@
     return jsValueForDecodedArgumentValue(globalObject, static_cast<std::underlying_type_t<E>>(value));
 }
 
-template<typename NumericType>
-JSC::JSValue jsValueForDecodedNumericArgumentValue(JSC::JSGlobalObject* globalObject, NumericType value, const String& type)
-{
-    auto& vm = globalObject->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), JSC::JSValue(value));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    return object;
-}
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, bool);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, double);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, float);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, int8_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, int16_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, int32_t);
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, bool value)
-{
-    auto& vm = globalObject->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, "bool"));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "value"_s), JSC::jsBoolean(value));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    return object;
-}
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, int64_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, uint8_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, uint16_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, uint32_t);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, uint64_t);
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, double value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "double");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, float value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "float");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int8_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int8_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int16_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int16_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int32_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int32_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, int64_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "int64_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint8_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint8_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint16_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint16_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint32_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint32_t");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, uint64_t value)
-{
-    return jsValueForDecodedNumericArgumentValue(globalObject, value, "uint64_t");
-}
-
 template<typename U>
 JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const ObjectIdentifier<U>& value)
 {
@@ -182,38 +92,9 @@
     return jsValueForDecodedArgumentValue(globalObject, value.toUInt64());
 }
 
-template<typename RectType>
-JSC::JSValue jsValueForDecodedArgumentRect(JSC::JSGlobalObject* globalObject, const RectType& value, const String& type)
-{
-    auto& vm = globalObject->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    auto* object = JSC::constructEmptyObject(globalObject, globalObject->objectPrototype());
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsNontrivialString(vm, type));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "x"_s), JSC::JSValue(value.x()));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "y"_s), JSC::JSValue(value.y()));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "width"_s), JSC::JSValue(value.width()));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    object->putDirect(vm, JSC::Identifier::fromString(vm, "height"_s), JSC::JSValue(value.height()));
-    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
-    return object;
-}
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const WebCore::IntRect&);
+template<> JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject*, const WebCore::FloatRect&);
 
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::IntRect& value)
-{
-    return jsValueForDecodedArgumentRect(globalObject, value, "IntRect");
-}
-
-template<>
-JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const WebCore::FloatRect& value)
-{
-    return jsValueForDecodedArgumentRect(globalObject, value, "FloatRect");
-}
-
 template<typename U>
 JSC::JSValue jsValueForDecodedArgumentValue(JSC::JSGlobalObject* globalObject, const OptionSet<U>& value)
 {    
@@ -274,3 +155,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebKit/Sources.txt (268853 => 268854)


--- trunk/Source/WebKit/Sources.txt	2020-10-22 05:24:47 UTC (rev 268853)
+++ trunk/Source/WebKit/Sources.txt	2020-10-22 05:24:58 UTC (rev 268854)
@@ -137,6 +137,7 @@
 Platform/IPC/DataReference.cpp @no-unify
 Platform/IPC/Decoder.cpp @no-unify
 Platform/IPC/Encoder.cpp @no-unify
+Platform/IPC/JSIPCBinding.cpp @no-unify
 Platform/IPC/MessageReceiverMap.cpp @no-unify
 Platform/IPC/MessageSender.cpp @no-unify
 Platform/IPC/SharedBufferCopy.cpp @no-unify

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (268853 => 268854)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-10-22 05:24:47 UTC (rev 268853)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2020-10-22 05:24:58 UTC (rev 268854)
@@ -1447,6 +1447,7 @@
 		9B5499B22362A7EC00DF8BA5 /* _WKTextManipulationExclusionRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B5499B02362A7EC00DF8BA5 /* _WKTextManipulationExclusionRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9B5BEC262400F4A90070C6EF /* WebMediaStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B5BEC242400F4A90070C6EF /* WebMediaStrategy.h */; };
 		9B5BEC2A240101580070C6EF /* RemoteAudioDestinationProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B5BEC28240101580070C6EF /* RemoteAudioDestinationProxy.h */; };
+		9BF5EC642541145600984E77 /* JSIPCBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BF5EC6325410E9900984E77 /* JSIPCBinding.cpp */; };
 		9EC532A32447FBAD00215216 /* GeolocationIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EC532A22447FBAD00215216 /* GeolocationIdentifier.h */; };
 		9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A102A7081EC0EEE900D81D82 /* com.macromedia.Flash Player ESR.plugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */; };
@@ -4583,6 +4584,7 @@
 		9B5BEC2E2401018C0070C6EF /* RemoteAudioDestinationProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = RemoteAudioDestinationProxy.messages.in; sourceTree = "<group>"; };
 		9BC59D6C1EFCCCB6001E8D09 /* CallbackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackID.h; sourceTree = "<group>"; };
 		9BC59D6D1EFCDC6D001E8D09 /* OptionalCallbackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionalCallbackID.h; sourceTree = "<group>"; };
+		9BF5EC6325410E9900984E77 /* JSIPCBinding.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIPCBinding.cpp; sourceTree = "<group>"; };
 		9EC532A22447FBAD00215216 /* GeolocationIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeolocationIdentifier.h; sourceTree = "<group>"; };
 		9F54F88E16488E87007DF81A /* AuxiliaryProcessMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AuxiliaryProcessMac.mm; sourceTree = "<group>"; };
 		9F54F8941648AE0E007DF81A /* PluginProcessManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessManagerMac.mm; sourceTree = "<group>"; };
@@ -6506,6 +6508,7 @@
 				4151E5C31FBB90A900E47E2D /* FormDataReference.h */,
 				C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
 				1C9AF36124134D2300D3EC02 /* ImageDataReference.h */,
+				9BF5EC6325410E9900984E77 /* JSIPCBinding.cpp */,
 				9B47908E253151CC00EC11AB /* JSIPCBinding.h */,
 				9B47908C25314D8300EC11AB /* MessageArgumentDescriptions.h */,
 				1AC4C82816B876A90069DCCD /* MessageFlags.h */,
@@ -12986,6 +12989,7 @@
 				C1A152D724E5A29A00978C8B /* HandleXPCEndpointMessages.mm in Sources */,
 				2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */,
 				2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */,
+				9BF5EC642541145600984E77 /* JSIPCBinding.cpp in Sources */,
 				2D913441212CF9F000128AFD /* JSNPMethod.cpp in Sources */,
 				2D913442212CF9F000128AFD /* JSNPObject.cpp in Sources */,
 				C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to