Title: [104875] branches/safari-534.54-branch/Source/WebCore

Diff

Modified: branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in (104874 => 104875)


--- branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-01-13 00:19:10 UTC (rev 104874)
+++ branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-01-13 00:24:58 UTC (rev 104875)
@@ -559,6 +559,8 @@
 __ZN7WebCore19TextResourceDecoderC1ERKN3WTF6StringERKNS_12TextEncodingEb
 __ZN7WebCore19TextResourceDecoderD1Ev
 __ZN7WebCore19applicationIsSafariEv
+__ZN7WebCore20DisplaySleepDisablerC1EPKc
+__ZN7WebCore20DisplaySleepDisablerD1Ev
 __ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
 __ZN7WebCore20ResourceResponseBase11setMimeTypeERKN3WTF6StringE
 __ZN7WebCore20ResourceResponseBase17setHTTPStatusCodeEi

Modified: branches/safari-534.54-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (104874 => 104875)


--- branches/safari-534.54-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-01-13 00:19:10 UTC (rev 104874)
+++ branches/safari-534.54-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-01-13 00:24:58 UTC (rev 104875)
@@ -1393,6 +1393,8 @@
 		5D87BB8311E3ED8600702B6F /* ExportFileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D87BB8211E3ED8600702B6F /* ExportFileGenerator.cpp */; };
 		5D88EE9111407FD300BC3ABC /* DOMSVGFEMorphologyElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 84224189107E786F00766A87 /* DOMSVGFEMorphologyElement.h */; };
 		5D88EE9211407FF400BC3ABC /* DOMSVGFEMorphologyElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8422418B107E786F00766A87 /* DOMSVGFEMorphologyElementInternal.h */; };
+		5D8C4DBF1428222C0026CE72 /* DisplaySleepDisabler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D8C4DBD1428222C0026CE72 /* DisplaySleepDisabler.cpp */; }; 
+		5D8C4DC01428222C0026CE72 /* DisplaySleepDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D8C4DBE1428222C0026CE72 /* DisplaySleepDisabler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 
 		5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */; };
 		5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */; };
@@ -7922,6 +7924,8 @@
 		5D4B8C5211E52C8B00BBB62F /* WebCore.exp.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebCore.exp.in; sourceTree = "<group>"; };
 		5D87BB4F11E3EAEB00702B6F /* WebCoreExportFileGenerator */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebCoreExportFileGenerator; sourceTree = BUILT_PRODUCTS_DIR; };
 		5D87BB8211E3ED8600702B6F /* ExportFileGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExportFileGenerator.cpp; path = DerivedSources/WebCore/ExportFileGenerator.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+		5D8C4DBD1428222C0026CE72 /* DisplaySleepDisabler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisplaySleepDisabler.cpp; sourceTree = "<group>"; };
+		5D8C4DBE1428222C0026CE72 /* DisplaySleepDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplaySleepDisabler.h; sourceTree = "<group>"; }; 
 		5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollBehavior.cpp; sourceTree = "<group>"; };
 		5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollBehavior.h; sourceTree = "<group>"; };
 		5DA5E0FA102B953800088CF9 /* JSWebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocket.cpp; sourceTree = "<group>"; };
@@ -14014,6 +14018,8 @@
 				93B6A0E90B0BCA8400F5027A /* ContextMenuMac.mm */,
 				9352087609BD453400F2038D /* CookieJar.mm */,
 				F58784F002DE375901EA4122 /* CursorMac.mm */,
+				5D8C4DBE1428222C0026CE72 /* DisplaySleepDisabler.h */,
+				5D8C4DBD1428222C0026CE72 /* DisplaySleepDisabler.cpp */,
 				A795463D0B5C4C80007B438F /* DragDataMac.mm */,
 				A7CFB3D40B7ED1180070C32D /* DragImageMac.mm */,
 				5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */,
@@ -19709,6 +19715,7 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				5D8C4DC01428222C0026CE72 /* DisplaySleepDisabler.h in Headers */,
 				B5B5DC6A119BB3D5002A8790 /* AbstractDatabase.h in Headers */,
 				41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
 				29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
@@ -23354,6 +23361,7 @@
 				893C48001248BD3A002B3D86 /* DirectoryEntrySync.cpp in Sources */,
 				89878554122CA064003AABDA /* DirectoryReader.cpp in Sources */,
 				893C48021248BD3A002B3D86 /* DirectoryReaderSync.cpp in Sources */,
+				5D8C4DBF1428222C0026CE72 /* DisplaySleepDisabler.cpp in Sources */,
 				FD31609012B026F700C1A359 /* Distance.cpp in Sources */,
 				A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */,
 				B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */,

Copied: branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp (from rev 95513, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp) (0 => 104875)


--- branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp	                        (rev 0)
+++ branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp	2012-01-13 00:24:58 UTC (rev 104875)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 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 "DisplaySleepDisabler.h"
+
+#include <IOKit/pwr_mgt/IOPMLib.h>
+#include <wtf/RetainPtr.h>
+
+#ifdef BUILDING_ON_LEOPARD
+#include <wtf/UnusedParam.h>
+#endif
+
+namespace WebCore {
+
+static const double systemActivityInterval = 1;
+
+DisplaySleepDisabler::DisplaySleepDisabler(const char* reason)
+    : m_disableDisplaySleepAssertion(0)
+#ifdef BUILDING_ON_LEOPARD
+    , m_systemActivityTimer(this, &DisplaySleepDisabler::systemActivityTimerFired)
+#endif
+{
+#ifndef BUILDING_ON_LEOPARD
+    RetainPtr<CFStringRef> reasonCF(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, reason, kCFStringEncodingUTF8));
+    IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonCF.get(), &m_disableDisplaySleepAssertion);
+#else
+    UNUSED_PARAM(reason);
+    IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &_idleDisplaySleepAssertion);
+    m_systemActivityTimer.startRepeating(systemActivityInterval);
+#endif
+}
+
+DisplaySleepDisabler::~DisplaySleepDisabler()
+{
+    IOPMAssertionRelease(m_disableDisplaySleepAssertion);
+}
+    
+#ifdef BUILDING_ON_LEOPARD
+void DisplaySleepDisabler::systemActivityTimerFired(Timer<DisplaySleepDisabler>*)
+{
+    UpdateSystemActivity(OverallAct);
+}
+#endif
+
+}

Copied: branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.h (from rev 95513, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h) (0 => 104875)


--- branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.h	                        (rev 0)
+++ branches/safari-534.54-branch/Source/WebCore/platform/mac/DisplaySleepDisabler.h	2012-01-13 00:24:58 UTC (rev 104875)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef DisplaySleepDisabler_h
+#define DisplaySleepDisabler_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/PassOwnPtr.h>
+
+#ifdef BUILDNG_ON_LEOPARD
+#include "Timer.h"
+#endif
+
+namespace WebCore {
+
+class DisplaySleepDisabler {
+    WTF_MAKE_NONCOPYABLE(DisplaySleepDisabler);
+public:
+    static PassOwnPtr<DisplaySleepDisabler> create(const char* reason) { return adoptPtr(new DisplaySleepDisabler(reason)); }
+    ~DisplaySleepDisabler();
+    
+private:
+    DisplaySleepDisabler(const char* reason);
+
+#ifdef BUILDNG_ON_LEOPARD
+    void systemActivityTimerFired(Timer<DisplaySleepDisabler>*);
+#endif
+    
+    uint32_t m_disableDisplaySleepAssertion;
+#ifdef BUILDNG_ON_LEOPARD
+    Timer<DisplaySleepDisabler> m_systemActivityTimer;
+#endif
+};
+
+}
+
+#endif // DisplaySleepDisabler_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to