WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch: not ready for commit
bug-105378-20121218220854.patch (text/plain), 8.09 KB, created by
Kiran Muppala
on 2012-12-18 22:11:37 PST
(
hide
)
Description:
Patch: not ready for commit
Filename:
MIME Type:
Creator:
Kiran Muppala
Created:
2012-12-18 22:11:37 PST
Size:
8.09 KB
patch
obsolete
>Subversion Revision: 138107 >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 0fcb7fb038a71517d47a97026a9bf5ec2ad388aa..9d5d659f97330b26a23e59d84143a8ca85cfcafa 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,26 @@ >+2012-12-18 Kiran Muppala <cmuppala@apple.com> >+ >+ Adopt new assertion SPI for process suppression on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=105378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Process suppression for WebKit2 child processes is currently enabled or disabled using AutomaticTermination. >+ This should be replaced with a new assertion SPI specific to process suppression. >+ >+ * Shared/ChildProcess.cpp: >+ (WebKit::ChildProcess::ChildProcess): Remove unused member variable m_applicationIsOccluded. >+ * Shared/ChildProcess.h: >+ (WebKit::ChildProcess::applicationIsOccluded): Infer occlusion state from m_processVisibleAssertion. >+ * Shared/mac/ChildProcessMac.mm: >+ (WebKit::ChildProcess::setApplicationIsOccluded): Use applicationIsOccluded() accessor to check if the >+ occlusion state has changed and call enable/disbaleProcessSuppression() accordingly. >+ (WebKit::ChildProcess::disableProcessSuppression): Take assertion using the new WKSI SPI wrapper function >+ WKNSProcessInfoProcessAssertionWithTypes(). >+ (WebKit::ChildProcess::enableProcessSuppression): Release assertion retained by m_processVisibleAssertion. >+ (WebKit::ChildProcess::platformInitialize): Remove call to initializeTimerCoalescingPolicy(), since taking >+ a process visible assertion also sets the timer coalescing policy appropriately. >+ > 2012-12-18 Jon Lee <jonlee@apple.com> > > [WK2] Create a context client >diff --git a/Source/WebKit2/Shared/ChildProcess.cpp b/Source/WebKit2/Shared/ChildProcess.cpp >index eff475f471c0f9e4cbf61f8dbab55e4b591b1834..9b99a37e48df1ea42969f500cced4a7a75f13422 100644 >--- a/Source/WebKit2/Shared/ChildProcess.cpp >+++ b/Source/WebKit2/Shared/ChildProcess.cpp >@@ -60,9 +60,6 @@ ChildProcess::ChildProcess() > : m_terminationTimeout(0) > , m_terminationCounter(0) > , m_terminationTimer(RunLoop::main(), this, &ChildProcess::terminationTimerFired) >-#if PLATFORM(MAC) >- , m_applicationIsOccluded(false) >-#endif > { > // FIXME: The termination timer should not be scheduled on the main run loop. > // It won't work with the threaded mode, but it's not really useful anyway as is. >diff --git a/Source/WebKit2/Shared/ChildProcess.h b/Source/WebKit2/Shared/ChildProcess.h >index 04226281d4e0f43b9942fd92841876396c773a92..2e3754bd9775a31d77bdb6e94488b3d73a11f73c 100644 >--- a/Source/WebKit2/Shared/ChildProcess.h >+++ b/Source/WebKit2/Shared/ChildProcess.h >@@ -28,6 +28,7 @@ > > #include "Connection.h" > #include <WebCore/RunLoop.h> >+#include <wtf/RetainPtr.h> > > #if PLATFORM(MAC) > OBJC_CLASS NSString; >@@ -62,7 +63,7 @@ public: > }; > > #if PLATFORM(MAC) >- bool applicationIsOccluded() const { return m_applicationIsOccluded; } >+ bool applicationIsOccluded() const { return !m_processVisibleAssertion; } > void setApplicationIsOccluded(bool); > #endif > >@@ -81,10 +82,8 @@ private: > virtual void terminate(); > > #if PLATFORM(MAC) >- void disableProcessSuppression(NSString *reason); >- void enableProcessSuppression(NSString *reason); >- >- static NSString * const processSuppressionVisibleApplicationReason; >+ void disableProcessSuppression(); >+ void enableProcessSuppression(); > #endif > > void platformInitialize(); >@@ -100,7 +99,7 @@ private: > WebCore::RunLoop::Timer<ChildProcess> m_terminationTimer; > > #if PLATFORM(MAC) >- bool m_applicationIsOccluded; >+ RetainPtr<id> m_processVisibleAssertion; > #endif > }; > >diff --git a/Source/WebKit2/Shared/mac/ChildProcessMac.mm b/Source/WebKit2/Shared/mac/ChildProcessMac.mm >index 8b54163f67b5848bd57e39d6b502357d9a00707c..f06f2c0460516a637a746145c59ec9d0b046dde0 100644 >--- a/Source/WebKit2/Shared/mac/ChildProcessMac.mm >+++ b/Source/WebKit2/Shared/mac/ChildProcessMac.mm >@@ -26,61 +26,47 @@ > #import "config.h" > #import "ChildProcess.h" > >+#import "WebKitSystemInterface.h" > #import <mach/task.h> > > namespace WebKit { > >-NSString * const ChildProcess::processSuppressionVisibleApplicationReason = @"Application is Visible"; >- > void ChildProcess::setApplicationIsOccluded(bool applicationIsOccluded) > { >- if (m_applicationIsOccluded == applicationIsOccluded) >+ if (this->applicationIsOccluded() == applicationIsOccluded) > return; > > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 >- m_applicationIsOccluded = applicationIsOccluded; >- if (m_applicationIsOccluded) >- enableProcessSuppression(processSuppressionVisibleApplicationReason); >+ if (applicationIsOccluded) >+ enableProcessSuppression(); > else >- disableProcessSuppression(processSuppressionVisibleApplicationReason); >+ disableProcessSuppression(); >+ >+ ASSERT(this->applicationIsOccluded() == applicationIsOccluded); > #endif > } > >-void ChildProcess::disableProcessSuppression(NSString *reason) >+void ChildProcess::disableProcessSuppression() > { > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 >- // The following assumes that a process enabling AutomaticTerminationSupport also >- // takes a AutomaticTermination assertion for the lifetime of the process. >- [[NSProcessInfo processInfo] disableAutomaticTermination:reason]; >+ if (!m_processVisibleAssertion) >+ m_processVisibleAssertion = WKNSProcessInfoProcessAssertionWithTypes(WKProcessAssertionTypeVisible); > #endif > } > >-void ChildProcess::enableProcessSuppression(NSString *reason) >+void ChildProcess::enableProcessSuppression() > { > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 >- // The following assumes that a process enabling AutomaticTerminationSupport also >- // takes a AutomaticTermination assertion for the lifetime of the process. >- [[NSProcessInfo processInfo] enableAutomaticTermination:reason]; >+ m_processVisibleAssertion.clear(); > #endif > } > >-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 >-static void initializeTimerCoalescingPolicy() >-{ >- // Set task_latency and task_throughput QOS tiers as appropriate for a visible application. >- struct task_qos_policy qosinfo = { LATENCY_QOS_TIER_0, THROUGHPUT_QOS_TIER_0 }; >- kern_return_t kr = task_policy_set(mach_task_self(), TASK_BASE_QOS_POLICY, (task_policy_t)&qosinfo, TASK_QOS_POLICY_COUNT); >- ASSERT_UNUSED(kr, kr == KERN_SUCCESS); >-} >-#endif >- > void ChildProcess::platformInitialize() > { > #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 > setpriority(PRIO_DARWIN_PROCESS, 0, 0); >- initializeTimerCoalescingPolicy(); > #endif >- disableProcessSuppression(processSuppressionVisibleApplicationReason); >+ disableProcessSuppression(); > } > > } >diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog >index 4171bbfad5cd53a606d447bf849d856c55aa4c25..dda1bf7c311a6eb97ff39cb4c7b53a39439a884b 100644 >--- a/WebKitLibraries/ChangeLog >+++ b/WebKitLibraries/ChangeLog >@@ -1,3 +1,14 @@ >+2012-12-18 Kiran Muppala <cmuppala@apple.com> >+ >+ Adopt new assertion SPI for process suppression on Mac >+ https://bugs.webkit.org/show_bug.cgi?id=105378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add WKNSProcessInfoProcessAssertionWithTypes(). >+ >+ * WebKitSystemInterface.h: >+ > 2012-12-12 Roger Fong <roger_fong@apple.com> > > Enable VIDEO_TRACK on Windows. >diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h >index 4b01bf8a9740ea25887dbd44b78ef3c35a123a89..ab1820ad087ad22c5d9cf65f21191f09a0946cf6 100644 >--- a/WebKitLibraries/WebKitSystemInterface.h >+++ b/WebKitLibraries/WebKitSystemInterface.h >@@ -530,6 +530,13 @@ typedef void (*WKOcclusionNotificationHandler)(uint32_t, void*, uint32_t, void*, > > bool WKRegisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler); > bool WKUnregisterOcclusionNotificationHandler(WKOcclusionNotificationType, WKOcclusionNotificationHandler); >+ >+enum { >+ WKProcessAssertionTypeVisible = (1UL << 10) >+}; >+ >+typedef NSUInteger WKProcessAssertionTypes; >+id WKNSProcessInfoProcessAssertionWithTypes(WKProcessAssertionTypes); > #endif > > bool WKIsJavaPlugInActive(void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 105378
:
180076
|
180077
|
180092
|
180261