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