diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 19:44:07 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 19:44:07 +0000 |
commit | a0f625c3dd467cb72b0a0a2c20dd2e42b8eaaae6 (patch) | |
tree | 7f23ed9e536e3f3698aa10fb15609685ffcde934 /chrome | |
parent | fd7b7c97553ad90ca9c4e6b83b320c076e902af8 (diff) | |
download | chromium_src-a0f625c3dd467cb72b0a0a2c20dd2e42b8eaaae6.zip chromium_src-a0f625c3dd467cb72b0a0a2c20dd2e42b8eaaae6.tar.gz chromium_src-a0f625c3dd467cb72b0a0a2c20dd2e42b8eaaae6.tar.bz2 |
Remove special event pumping now that r21355 is in and we can specify to use a UI loop for the renderer.
BUG=http://crbug.com/13893
TEST=things should stay working, not crash, and not go "Not Responding" in the Activity Monitor
Review URL: http://codereview.chromium.org/174156
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/renderer_main.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/renderer_main_platform_delegate_mac.mm | 34 |
2 files changed, 6 insertions, 34 deletions
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index b2b392c..48060c4 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -97,10 +97,16 @@ int RendererMain(const MainFunctionParams& parameters) { StatsScope<StatsCounterTimer> startup_timer(chrome::Counters::renderer_main()); +#if defined(OS_MACOSX) + // As long as we use Cocoa in the renderer (for the forseeable future as of + // now; see http://crbug.com/13890 for info) we need to have a UI loop. + MessageLoop main_message_loop(MessageLoop::TYPE_UI); +#else // The main message loop of the renderer services doesn't have IO or UI tasks, // unless in-process-plugins is used. MessageLoop main_message_loop(RenderProcess::InProcessPlugins() ? MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); +#endif std::wstring app_name = chrome::kBrowserAppName; PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); diff --git a/chrome/renderer/renderer_main_platform_delegate_mac.mm b/chrome/renderer/renderer_main_platform_delegate_mac.mm index b94c6f0..c194d7d 100644 --- a/chrome/renderer/renderer_main_platform_delegate_mac.mm +++ b/chrome/renderer/renderer_main_platform_delegate_mac.mm @@ -5,7 +5,6 @@ #include "chrome/renderer/renderer_main_platform_delegate.h" #include "base/debug_util.h" -#include "base/message_loop.h" #import <Foundation/Foundation.h> #import <ApplicationServices/ApplicationServices.h> @@ -76,34 +75,6 @@ void SandboxWarmup() { } } -namespace { - -// Since we use Cocoa in the renderer process <http://crbug.com/13890>, the -// windowserver believes we are a UI process and sends events to us. If we do -// not process them (or at least remove them from the queue), the windowserver -// will mark us as "not responding" and will start doing bad things like run -// spindump on us (see <http://crbug.com/11319>). This function just keeps the -// event queue empty. It uses a custom run loop mode so that no timers or -// notifications fire and surprise Cocoa that's running in another thread. -// TODO(avi):Once Cocoa is gone from the renderer, remove this code -// <http://crbug.com/13893>. -void PullAccumulatedWindowserverEvents() { - base::ScopedNSAutoreleasePool scoped_pool; - - while ([[NSApplication sharedApplication] - nextEventMatchingMask:NSAnyEventMask - untilDate:nil - inMode:@"org.chromium.CustomRunLoopModeSoThatNothingFires" - dequeue:YES]) { - // just drop all pending events on the floor - } - - MessageLoop::current()->PostDelayedTask(FROM_HERE, - NewRunnableFunction(PullAccumulatedWindowserverEvents), 1000); -} - -} // namepsace - // TODO(mac-port): Any code needed to initialize a process for // purposes of running a renderer needs to also be reflected in // chrome_dll_main.cc for --single-process support. @@ -124,11 +95,6 @@ void RendererMainPlatformDelegate::PlatformInitialize() { // Initialize Cocoa. Without this call, drawing of native UI // elements (e.g. buttons) in WebKit will explode. [NSApplication sharedApplication]; - - // Start up the windowserver event pumping. (See comment on - // PullAccumulatedWindowserverEvents above.) - MessageLoop::current()->PostDelayedTask(FROM_HERE, - NewRunnableFunction(PullAccumulatedWindowserverEvents), 1000); } void RendererMainPlatformDelegate::PlatformUninitialize() { |