Title: [138752] trunk/Source/WebKit2
Revision
138752
Author
commit-qu...@webkit.org
Date
2013-01-03 15:19:41 -0800 (Thu, 03 Jan 2013)

Log Message

Ensure autorelease pool exists when calling WKNSProcessInfoProcessAssertionWithTypes on Mac
https://bugs.webkit.org/show_bug.cgi?id=105674

Patch by Kiran Muppala <cmupp...@apple.com> on 2013-01-03
Reviewed by Sam Weinig.

The function WKNSProcessInfoProcessAssertionWithTypes returns a autoreleased object and since,
it is called during process initialization prior to the runloop being started in PluginProcess
and SharedWorkerProcess, an autorelease pool must be explictly created.

* PluginProcess/mac/PluginProcessMainMac.mm:
(WebKit::PluginProcessMain): Enclose process initialization code in an @autoreleasepool block.
* SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm:
(WebKit::SharedWorkerProcessMain): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (138751 => 138752)


--- trunk/Source/WebKit2/ChangeLog	2013-01-03 23:17:52 UTC (rev 138751)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-03 23:19:41 UTC (rev 138752)
@@ -1,3 +1,19 @@
+2013-01-03  Kiran Muppala  <cmupp...@apple.com>
+
+        Ensure autorelease pool exists when calling WKNSProcessInfoProcessAssertionWithTypes on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=105674
+
+        Reviewed by Sam Weinig.
+
+        The function WKNSProcessInfoProcessAssertionWithTypes returns a autoreleased object and since,
+        it is called during process initialization prior to the runloop being started in PluginProcess
+        and SharedWorkerProcess, an autorelease pool must be explictly created.
+
+        * PluginProcess/mac/PluginProcessMainMac.mm:
+        (WebKit::PluginProcessMain): Enclose process initialization code in an @autoreleasepool block.
+        * SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm:
+        (WebKit::SharedWorkerProcessMain): Ditto.
+
 2013-01-03  Csaba Osztrogonác  <o...@webkit.org>
 
         [Qt] Unreviewed debug buildfix after r138723.

Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm (138751 => 138752)


--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm	2013-01-03 23:17:52 UTC (rev 138751)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm	2013-01-03 23:19:41 UTC (rev 138752)
@@ -109,26 +109,28 @@
     signal(SIGSEGV, _exit);
 #endif
 
-    // FIXME: It would be better to proxy set cursor calls over to the UI process instead of
-    // allowing plug-ins to change the mouse cursor at any time.
-    WKEnableSettingCursorWhenInBackground();
+    @autoreleasepool {
+        // FIXME: It would be better to proxy set cursor calls over to the UI process instead of
+        // allowing plug-ins to change the mouse cursor at any time.
+        WKEnableSettingCursorWhenInBackground();
 
-    JSC::initializeThreading();
-    WTF::initializeMainThread();
-    RunLoop::initializeMainRunLoop();
+        JSC::initializeThreading();
+        WTF::initializeMainThread();
+        RunLoop::initializeMainRunLoop();
 
 #if defined(__i386__)
-    // Initialize the shim for 32-bit only.
-    PluginProcess::shared().initializeShim();
+        // Initialize the shim for 32-bit only.
+        PluginProcess::shared().initializeShim();
 #endif
 
-    // Initialize Cocoa overrides. 
-    PluginProcess::shared().initializeCocoaOverrides();
+        // Initialize Cocoa overrides.
+        PluginProcess::shared().initializeCocoaOverrides();
 
-    // Initialize the plug-in process connection.
-    PluginProcess::shared().initialize(CoreIPC::Connection::Identifier(serverPort), RunLoop::main());
+        // Initialize the plug-in process connection.
+        PluginProcess::shared().initialize(CoreIPC::Connection::Identifier(serverPort), RunLoop::main());
 
-    [NSApplication sharedApplication];
+        [NSApplication sharedApplication];
+    }
 
     RunLoop::run();
     

Modified: trunk/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm (138751 => 138752)


--- trunk/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm	2013-01-03 23:17:52 UTC (rev 138751)
+++ trunk/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm	2013-01-03 23:19:41 UTC (rev 138752)
@@ -92,14 +92,16 @@
     signal(SIGSEGV, _exit);
 #endif
 
-    JSC::initializeThreading();
-    WTF::initializeMainThread();
-    RunLoop::initializeMainRunLoop();
+    @autoreleasepool {
+        JSC::initializeThreading();
+        WTF::initializeMainThread();
+        RunLoop::initializeMainRunLoop();
 
-    // Initialize the shared worker process connection.
-    SharedWorkerProcess::shared().initialize(CoreIPC::Connection::Identifier(serverPort), RunLoop::main());
+        // Initialize the shared worker process connection.
+        SharedWorkerProcess::shared().initialize(CoreIPC::Connection::Identifier(serverPort), RunLoop::main());
 
-    [NSApplication sharedApplication];
+        [NSApplication sharedApplication];
+    }
 
     RunLoop::run();
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to