12013-10-08 Anders Carlsson <andersca@apple.com>
2
3 WebProcess crash on SAP WebCycle web app
4 https://bugs.webkit.org/show_bug.cgi?id=122520
5 <rdar://problem/15030605>
6
7 Reviewed by NOBODY (OOPS!).
8
9 Stop trying to use RunLoop to manage the top-level run loop and just have the child process and their
10 delegate subclasses start and stop the run loops. This fixes a bug with showModalDialog where we would
11 unintentionally call -[NSApp stop] when closing a modal dialog.
12
13 This also lets us move all knowledge of NSApplication from RunLoop. (Both the web process and plug-in process
14 need to use -[NSApp run] and -[NSApp stop:]).
15
16 * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
17 (WebKit::PluginProcessMainDelegate::doPreInitializationWork):
18 Remove call to RunLoop::setUseApplicationRunLoopOnMainRunLoop. Add a startRunLoop override that calls
19 -[NSApp run].
20
21 * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
22 (PluginServiceInitializer):
23 Remove call to RunLoop::setUseApplicationRunLoopOnMainRunLoop.
24
25 * PluginProcess/PluginProcess.h:
26 Add stopRunLoop() override on Mac.
27
28 * PluginProcess/mac/PluginProcessMac.mm:
29 (WebKit::PluginProcess::stopRunLoop):
30 Call -[NSApp stop:] and tickle the event system.
31
32 * Shared/ChildProcess.cpp:
33 (WebKit::ChildProcess::stopRunLoop):
34 Add default implementation that just calls RunLoop::main()->stop().
35
36 (WebKit::ChildProcess::terminate):
37 Call stopRunLoop().
38
39 * Shared/ChildProcess.h:
40 * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h:
41 Add startRunLoop member function and call it instead of RunLoop::run().
42
43 * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.mm:
44 (WebKit::ChildProcessMainDelegate::startRunLoop):
45 Call RunLoop::run().
46
47 * WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm:
48 (WebKit::WebContentProcessMainDelegate::doPreInitializationWork):
49 Remove call to RunLoop::setUseApplicationRunLoopOnMainRunLoop.
50 Add startRunLoop override that calls -[NSApp run].
51
52 * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
53 (WebContentServiceInitializer):
54 Remove call to RunLoop::setUseApplicationRunLoopOnMainRunLoop.
55
56 * WebProcess/WebProcess.cpp:
57 (WebKit::WebProcess::didClose):
58 Call stopRunLoop().
59
60 * WebProcess/WebProcess.h:
61 Add stopRunLoop override.
62
63 * WebProcess/mac/WebProcessMac.mm:
64 (WebKit::WebProcess::stopRunLoop):
65 Call -[NSApp stop:] and tickle the event system.
66