Diff
Modified: trunk/Source/WTF/ChangeLog (177318 => 177319)
--- trunk/Source/WTF/ChangeLog 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WTF/ChangeLog 2014-12-15 23:53:43 UTC (rev 177319)
@@ -1,3 +1,13 @@
+2014-12-12 Anders Carlsson <[email protected]>
+
+ Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
+ https://bugs.webkit.org/show_bug.cgi?id=139613
+
+ Reviewed by Sam Weinig.
+
+ * wtf/Platform.h:
+ Remove the #define.
+
2014-12-15 Commit Queue <[email protected]>
Unreviewed, rolling out r177284.
Modified: trunk/Source/WTF/wtf/Platform.h (177318 => 177319)
--- trunk/Source/WTF/wtf/Platform.h 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WTF/wtf/Platform.h 2014-12-15 23:53:43 UTC (rev 177319)
@@ -512,7 +512,6 @@
#if PLATFORM(IOS)
-#define DONT_FINALIZE_ON_MAIN_THREAD 1
#define HAVE_READLINE 1
#if USE(APPLE_INTERNAL_SDK)
#define WTF_USE_CFNETWORK 1
Modified: trunk/Source/WebCore/ChangeLog (177318 => 177319)
--- trunk/Source/WebCore/ChangeLog 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WebCore/ChangeLog 2014-12-15 23:53:43 UTC (rev 177319)
@@ -1,3 +1,26 @@
+2014-12-12 Anders Carlsson <[email protected]>
+
+ Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
+ https://bugs.webkit.org/show_bug.cgi?id=139613
+
+ Reviewed by Sam Weinig.
+
+ * WebCore.exp.in:
+ Update symbols.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Remove -Wno-deprecated-declarations from the WebCoreObjCExtras.mm build flags.
+
+ * platform/mac/WebCoreObjCExtras.h:
+ If OBJC_NO_GC is defined to 1, just make WebCoreObjCFinalizeOnMainThread a no-op inline function.
+
+ * platform/mac/WebCoreObjCExtras.mm:
+ (WebCoreObjCFinalizeOnMainThread):
+ Move this to the .h file for easier inlining.
+
+ (WebCoreObjCScheduleDeallocateOnMainThread):
+ Use a lambda.
+
2014-12-15 Gavin Barraclough <[email protected]>
Separate counted and hysteresis activities in PageThrottler
Modified: trunk/Source/WebCore/WebCore.exp.in (177318 => 177319)
--- trunk/Source/WebCore/WebCore.exp.in 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-12-15 23:53:43 UTC (rev 177319)
@@ -44,8 +44,6 @@
_DOMException
_DOMRangeException
_DOMXPathException
-_WebCoreObjCFinalizeOnMainThread
-_WebCoreObjCScheduleDeallocateOnMainThread
__Z26ReportBlockedObjCExceptionP11NSException
__Z3kitPN7WebCore11HTMLElementE
__Z3kitPN7WebCore15HTMLFormElementE
@@ -57,6 +55,7 @@
__Z3kitPN7WebCore5RangeE
__Z3kitPN7WebCore7ElementE
__Z3kitPN7WebCore8DocumentE
+__Z41WebCoreObjCScheduleDeallocateOnMainThreadP10objc_classP11objc_object
__Z4coreP10DOMElement
__Z4coreP11DOMDocument
__Z4coreP13DOMWheelEvent
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (177318 => 177319)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-12-15 23:53:43 UTC (rev 177319)
@@ -4939,7 +4939,7 @@
B2FA3E170AB75A6F000E5AC4 /* JSSVGViewElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3D2F0AB75A6F000E5AC4 /* JSSVGViewElement.h */; };
B2FA3E180AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3D300AB75A6F000E5AC4 /* JSSVGZoomEvent.cpp */; };
B2FA3E190AB75A6F000E5AC4 /* JSSVGZoomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3D310AB75A6F000E5AC4 /* JSSVGZoomEvent.h */; };
- B50F5B810E96CD9900AD71A6 /* WebCoreObjCExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = B50F5B800E96CD9900AD71A6 /* WebCoreObjCExtras.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ B50F5B810E96CD9900AD71A6 /* WebCoreObjCExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = B50F5B800E96CD9900AD71A6 /* WebCoreObjCExtras.mm */; };
B51A2F3F17D7D3AE0072517A /* ImageQualityController.h in Headers */ = {isa = PBXBuildFile; fileRef = B51A2F3E17D7D3A40072517A /* ImageQualityController.h */; };
B51A2F4117D7D5DE0072517A /* ImageQualityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B51A2F4017D7D5DA0072517A /* ImageQualityController.cpp */; };
B525A96511CA2340003A23A8 /* JSSQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B525A96311CA2340003A23A8 /* JSSQLException.h */; };
@@ -9484,8 +9484,8 @@
724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTBlendMinMax.cpp; path = canvas/EXTBlendMinMax.cpp; sourceTree = "<group>"; };
724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTBlendMinMax.h; path = canvas/EXTBlendMinMax.h; sourceTree = "<group>"; };
724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTBlendMinMax.idl; path = canvas/EXTBlendMinMax.idl; sourceTree = "<group>"; };
- 724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEXTBlendMinMax.cpp; path = "JSEXTBlendMinMax.cpp"; sourceTree = "<group>"; };
- 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEXTBlendMinMax.h; path = "JSEXTBlendMinMax.h"; sourceTree = "<group>"; };
+ 724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTBlendMinMax.cpp; sourceTree = "<group>"; };
+ 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTBlendMinMax.h; sourceTree = "<group>"; };
72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTsRGB.cpp; path = canvas/EXTsRGB.cpp; sourceTree = "<group>"; };
727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTsRGB.h; path = canvas/EXTsRGB.h; sourceTree = "<group>"; };
@@ -9495,8 +9495,8 @@
72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EXTFragDepth.cpp; path = canvas/EXTFragDepth.cpp; sourceTree = "<group>"; };
72F1ADA01A3904C300014E18 /* EXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EXTFragDepth.h; path = canvas/EXTFragDepth.h; sourceTree = "<group>"; };
72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = EXTFragDepth.idl; path = canvas/EXTFragDepth.idl; sourceTree = "<group>"; };
- 72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEXTFragDepth.cpp; path = "JSEXTFragDepth.cpp"; sourceTree = "<group>"; };
- 72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEXTFragDepth.h; path = "JSEXTFragDepth.h"; sourceTree = "<group>"; };
+ 72F1ADA31A390B9F00014E18 /* JSEXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTFragDepth.cpp; sourceTree = "<group>"; };
+ 72F1ADA41A390B9F00014E18 /* JSEXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTFragDepth.h; sourceTree = "<group>"; };
754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
Modified: trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.h (177318 => 177319)
--- trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.h 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.h 2014-12-15 23:53:43 UTC (rev 177319)
@@ -26,19 +26,28 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef WebCoreObjCExtras_h
+#define WebCoreObjCExtras_h
+
#include <CoreFoundation/CFBase.h>
-#include <objc/objc.h>
+#include <objc/objc-auto.h>
-#ifdef __cplusplus
-extern "C" {
+inline void WebCoreObjCFinalizeOnMainThread(Class cls)
+{
+#ifndef OBJC_NO_GC
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ // This method relies on threading being initialized by the caller, otherwise
+ // WebCoreObjCScheduleDeallocateOnMainThread will crash.
+ objc_finalizeOnMainThread(cls);
+#pragma clang diagnostic pop
+#else
+ UNUSED_PARAM(cls);
#endif
+}
-WEBCORE_EXPORT void WebCoreObjCFinalizeOnMainThread(Class cls);
-
// The 'Class' that should be passed in here is the class of the
// object that implements the dealloc method that this function is called from.
WEBCORE_EXPORT bool WebCoreObjCScheduleDeallocateOnMainThread(Class cls, id);
-#ifdef __cplusplus
-}
-#endif
+#endif // WebCoreObjCExtras_h
Modified: trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.mm (177318 => 177319)
--- trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.mm 2014-12-15 23:52:50 UTC (rev 177318)
+++ trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.mm 2014-12-15 23:53:43 UTC (rev 177319)
@@ -26,41 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This file intentionally calls objc_finalizeOnMainThread, which is deprecated.
-// According to http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
-// we need to place this directive before any data or functions are defined.
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
#include "config.h"
#include "WebCoreObjCExtras.h"
-#include <objc/objc-auto.h>
#include <utility>
#include <wtf/Assertions.h>
-#include <wtf/Functional.h>
#include <wtf/MainThread.h>
#include <wtf/ObjcRuntimeExtras.h>
#include <wtf/Threading.h>
-void WebCoreObjCFinalizeOnMainThread(Class cls)
-{
- // This method relies on threading being initialized by the caller, otherwise
- // WebCoreObjCScheduleDeallocateOnMainThread will crash.
-#ifndef DONT_FINALIZE_ON_MAIN_THREAD
- objc_finalizeOnMainThread(cls);
-#else
- UNUSED_PARAM(cls);
-#endif
-}
-
-static void deallocCallback(Class cls, id object)
-{
- Method method = class_getInstanceMethod(cls, @selector(dealloc));
-
- IMP imp = method_getImplementation(method);
- wtfCallIMP<void>(imp, object, @selector(dealloc));
-}
-
bool WebCoreObjCScheduleDeallocateOnMainThread(Class cls, id object)
{
ASSERT([object isKindOfClass:cls]);
@@ -68,7 +42,12 @@
if (isMainThread())
return false;
- callOnMainThread(bind(deallocCallback, cls, object));
+ callOnMainThread([cls, object] {
+ Method method = class_getInstanceMethod(cls, @selector(dealloc));
+ IMP imp = method_getImplementation(method);
+ wtfCallIMP<void>(imp, object, @selector(dealloc));
+ });
+
return true;
}