Modified: trunk/Source/WebCore/ChangeLog (143549 => 143550)
--- trunk/Source/WebCore/ChangeLog 2013-02-21 02:24:46 UTC (rev 143549)
+++ trunk/Source/WebCore/ChangeLog 2013-02-21 02:25:54 UTC (rev 143550)
@@ -1,3 +1,23 @@
+2013-02-20 David Kilzer <ddkil...@apple.com>
+
+ Upstream SharedTimerIOS.mm
+ <http://webkit.org/b/110161>
+
+ Reviewed by Benjamin Poulain.
+
+ * Configurations/WebCore.xcconfig:
+ (EXCLUDED_SOURCE_FILE_NAMES_iphoneos): Add SharedTimerMac.mm.
+ * WebCore.xcodeproj/project.pbxproj: Add SharedTimerIOS.mm.
+ * platform/ios/SharedTimerIOS.mm: Add.
+ (WebCore):
+ (-[WebCoreResumeNotifierIOS init]):
+ (-[WebCoreResumeNotifierIOS dealloc]):
+ (-[WebCoreResumeNotifierIOS didWake]):
+ (WebCore::setSharedTimerFiredFunction):
+ (WebCore::timerFired):
+ (WebCore::setSharedTimerFireInterval):
+ (WebCore::stopSharedTimer):
+
2013-02-20 Ojan Vafai <o...@chromium.org>
Speculative fix for EFL and Windows compilers not realizing
Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (143549 => 143550)
--- trunk/Source/WebCore/Configurations/WebCore.xcconfig 2013-02-21 02:24:46 UTC (rev 143549)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig 2013-02-21 02:25:54 UTC (rev 143550)
@@ -105,7 +105,7 @@
EXCLUDED_SOURCE_FILE_NAMES_SVG_DOM_OBJC_BINDINGS_ENABLE_SVG_DOM_OBJC_BINDINGS = ;
EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME)) $(EXCLUDED_SOURCE_FILE_NAMES_$(CONFIGURATION)_$(PLATFORM_NAME)) $(EXCLUDED_SOURCE_FILE_NAMES_SVG_DOM_OBJC_BINDINGS);
-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm EventHandlerMac.mm HTMLConverter.mm KillRingMac.mm PlatformEventFactoryMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm localizedStrings.js;
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm EventHandlerMac.mm HTMLConverter.mm KillRingMac.mm PlatformEventFactoryMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm SharedTimerMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm localizedStrings.js;
EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm KillRingNone.cpp;
EXCLUDED_SOURCE_FILE_NAMES_Production_macosx = localizedStrings.js;
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (143549 => 143550)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-02-21 02:24:46 UTC (rev 143549)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2013-02-21 02:25:54 UTC (rev 143550)
@@ -6321,6 +6321,7 @@
E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = E44B4BB2141650D7002B1D8B /* SelectorChecker.h */; };
E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45322A9140CE267005A0F92 /* SelectorQuery.cpp */; };
E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; };
+ E45390460EAFD637003695C8 /* SharedTimerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390350EAFD637003695C8 /* SharedTimerIOS.mm */; };
E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */; };
E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */; };
@@ -13995,6 +13996,7 @@
E44B4BB2141650D7002B1D8B /* SelectorChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorChecker.h; sourceTree = "<group>"; };
E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = "<group>"; };
E45322AA140CE267005A0F92 /* SelectorQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorQuery.h; sourceTree = "<group>"; };
+ E45390350EAFD637003695C8 /* SharedTimerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SharedTimerIOS.mm; path = ios/SharedTimerIOS.mm; sourceTree = "<group>"; };
E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; };
E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomEvent.cpp; sourceTree = "<group>"; };
E4778B7E115A581A00B5D372 /* JSCustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomEvent.h; sourceTree = "<group>"; };
@@ -18840,6 +18842,7 @@
26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */,
265541371489811C000DFC5D /* KeyEventCodesIOS.h */,
265541381489811C000DFC5D /* KeyEventIOS.mm */,
+ E45390350EAFD637003695C8 /* SharedTimerIOS.mm */,
);
name = ios;
sourceTree = "<group>";
@@ -29257,6 +29260,7 @@
1A4A954D0B4EDCCB002D8C3C /* SharedBuffer.cpp in Sources */,
512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */,
97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */,
+ E45390460EAFD637003695C8 /* SharedTimerIOS.mm in Sources */,
1A4A95520B4EDCFF002D8C3C /* SharedBufferMac.mm in Sources */,
93309EA2099EB78C0056E581 /* SharedTimerMac.mm in Sources */,
41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */,
Added: trunk/Source/WebCore/platform/ios/SharedTimerIOS.mm (0 => 143550)
--- trunk/Source/WebCore/platform/ios/SharedTimerIOS.mm (rev 0)
+++ trunk/Source/WebCore/platform/ios/SharedTimerIOS.mm 2013-02-21 02:25:54 UTC (rev 143550)
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2006, 2010, 2011, 2013 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.
+ */
+
+#import "config.h"
+#import "SharedTimer.h"
+
+#import "WebCoreThread.h"
+#import "WebCoreThreadRun.h"
+#import <wtf/Assertions.h>
+
+using namespace WebCore;
+
+namespace WebCore {
+static CFRunLoopTimerRef sharedTimer;
+static void timerFired(CFRunLoopTimerRef, void*);
+}
+
+@interface WebCoreResumeNotifierIOS : NSObject
+- (void)didWake;
+@end
+
+@implementation WebCoreResumeNotifierIOS
+
+- (id)init
+{
+ if (!(self = [super init])) {
+ ASSERT_NOT_REACHED();
+ return nil;
+ }
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didWake) name:@"UIApplicationDidBecomeActiveNotification" object:nil];
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super dealloc];
+}
+
+- (void)didWake
+{
+ WebThreadRun(^{
+ if (!sharedTimer)
+ return;
+
+ stopSharedTimer();
+ timerFired(0, 0);
+ });
+}
+
+@end
+
+namespace WebCore {
+
+static WebCoreResumeNotifierIOS *resumeNotifier;
+typedef void (*SharedTimerFiredFunction)();
+static SharedTimerFiredFunction sharedTimerFiredFunction;
+
+void setSharedTimerFiredFunction(SharedTimerFiredFunction function)
+{
+ ASSERT(!sharedTimerFiredFunction || sharedTimerFiredFunction == function);
+
+ sharedTimerFiredFunction = function;
+}
+
+static void timerFired(CFRunLoopTimerRef, void*)
+{
+ // FIXME: We can remove this global catch-all if we fix <rdar://problem/5299018>.
+ @autoreleasepool {
+ sharedTimerFiredFunction();
+ }
+}
+
+void setSharedTimerFireInterval(double interval)
+{
+ ASSERT(sharedTimerFiredFunction);
+
+ if (sharedTimer) {
+ CFRunLoopTimerInvalidate(sharedTimer);
+ CFRelease(sharedTimer);
+ }
+
+ CFAbsoluteTime fireDate = CFAbsoluteTimeGetCurrent() + interval;
+ sharedTimer = CFRunLoopTimerCreate(0, fireDate, 0, 0, 0, timerFired, 0);
+ CFRunLoopAddTimer(WebThreadRunLoop(), sharedTimer, kCFRunLoopCommonModes);
+
+ if (!resumeNotifier)
+ resumeNotifier = [[WebCoreResumeNotifierIOS alloc] init];
+}
+
+void stopSharedTimer()
+{
+ if (!sharedTimer)
+ return;
+
+ CFRunLoopTimerInvalidate(sharedTimer);
+ CFRelease(sharedTimer);
+ sharedTimer = 0;
+}
+
+} // namespace WebCore