Title: [264732] trunk/Source/WebKit
Revision
264732
Author
ddkil...@apple.com
Date
2020-07-22 16:36:22 -0700 (Wed, 22 Jul 2020)

Log Message

Follow-up: [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
<https://webkit.org/b/214618>
<rdar://problem/65777899>

Unreviewed fix to get rid of extra namespace blocks.

* Shared/mac/ObjCObjectGraph.mm:
(enum class WebKit::ObjCType):
- Move enum class definition back to its original location.
(WTF::EnumTraits<WebKit::ObjCType>):
- Move to the end of the file.  Noticed this worked in
  ColorSpaceData.mm.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (264731 => 264732)


--- trunk/Source/WebKit/ChangeLog	2020-07-22 22:31:05 UTC (rev 264731)
+++ trunk/Source/WebKit/ChangeLog	2020-07-22 23:36:22 UTC (rev 264732)
@@ -1,5 +1,20 @@
 2020-07-22  David Kilzer  <ddkil...@apple.com>
 
+        Follow-up: [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
+        <https://webkit.org/b/214618>
+        <rdar://problem/65777899>
+
+        Unreviewed fix to get rid of extra namespace blocks.
+
+        * Shared/mac/ObjCObjectGraph.mm:
+        (enum class WebKit::ObjCType):
+        - Move enum class definition back to its original location.
+        (WTF::EnumTraits<WebKit::ObjCType>):
+        - Move to the end of the file.  Noticed this worked in
+          ColorSpaceData.mm.
+
+2020-07-22  David Kilzer  <ddkil...@apple.com>
+
         [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
         <https://webkit.org/b/214618>
         <rdar://problem/65777899>

Modified: trunk/Source/WebKit/Shared/mac/ObjCObjectGraph.mm (264731 => 264732)


--- trunk/Source/WebKit/Shared/mac/ObjCObjectGraph.mm	2020-07-22 22:31:05 UTC (rev 264731)
+++ trunk/Source/WebKit/Shared/mac/ObjCObjectGraph.mm	2020-07-22 23:36:22 UTC (rev 264732)
@@ -38,43 +38,6 @@
 
 namespace WebKit {
 
-enum class ObjCType : uint8_t {
-    Null,
-
-    NSArray,
-    NSData,
-    NSDate,
-    NSDictionary,
-    NSNumber,
-    NSString,
-
-    WKBrowsingContextHandle,
-    WKTypeRefWrapper,
-};
-
-} // namespace WebKit
-
-namespace WTF {
-
-template<> struct EnumTraits<WebKit::ObjCType> {
-    using values = EnumValues<
-        WebKit::ObjCType,
-        WebKit::ObjCType::Null,
-        WebKit::ObjCType::NSArray,
-        WebKit::ObjCType::NSData,
-        WebKit::ObjCType::NSDate,
-        WebKit::ObjCType::NSDictionary,
-        WebKit::ObjCType::NSNumber,
-        WebKit::ObjCType::NSString,
-        WebKit::ObjCType::WKBrowsingContextHandle,
-        WebKit::ObjCType::WKTypeRefWrapper
-    >;
-};
-
-} // namespace WTF
-
-namespace WebKit {
-
 static bool shouldTransformGraph(id object, const ObjCObjectGraph::Transformer& transformer)
 {
     if (NSArray *array = dynamic_objc_cast<NSArray>(object)) {
@@ -132,6 +95,20 @@
     return transformGraph(object, transformer);
 }
 
+enum class ObjCType : uint8_t {
+    Null,
+
+    NSArray,
+    NSData,
+    NSDate,
+    NSDictionary,
+    NSNumber,
+    NSString,
+
+    WKBrowsingContextHandle,
+    WKTypeRefWrapper,
+};
+
 static Optional<ObjCType> typeFromObject(id object)
 {
     ASSERT(object);
@@ -370,3 +347,22 @@
 }
 
 } // namespace WebKit
+
+namespace WTF {
+
+template<> struct EnumTraits<WebKit::ObjCType> {
+    using values = EnumValues<
+        WebKit::ObjCType,
+        WebKit::ObjCType::Null,
+        WebKit::ObjCType::NSArray,
+        WebKit::ObjCType::NSData,
+        WebKit::ObjCType::NSDate,
+        WebKit::ObjCType::NSDictionary,
+        WebKit::ObjCType::NSNumber,
+        WebKit::ObjCType::NSString,
+        WebKit::ObjCType::WKBrowsingContextHandle,
+        WebKit::ObjCType::WKTypeRefWrapper
+    >;
+};
+
+} // namespace WTF
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to