diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 21:53:12 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 21:53:12 +0000 |
commit | 26b627e55c5e9c1bd4d00bb6613fea7a6cb2c463 (patch) | |
tree | 4e7ae2b960c69828ec30df00c579b69cc75df7e0 /base | |
parent | 6f4280104722d792dfea82b40ed4d299c39e7786 (diff) | |
download | chromium_src-26b627e55c5e9c1bd4d00bb6613fea7a6cb2c463.zip chromium_src-26b627e55c5e9c1bd4d00bb6613fea7a6cb2c463.tar.gz chromium_src-26b627e55c5e9c1bd4d00bb6613fea7a6cb2c463.tar.bz2 |
Fix up mac test client and simple host for remoting.
Remoting's test client and simple host weren't initializing the NSApplication correctly which is required for MessageLoops to work on the Mac. These are just test apps that we use, so I felt it was ok to bring in code from base/test.
Also added a check to message_pump_mac.mm to verify that NSApp is initialized before we attempt to use it.
BUG=NONE
TEST=BUILD
Review URL: http://codereview.chromium.org/6461023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/message_pump_mac.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/message_pump_mac.mm b/base/message_pump_mac.mm index b9f188e..8feb56f 100644 --- a/base/message_pump_mac.mm +++ b/base/message_pump_mac.mm @@ -631,6 +631,13 @@ MessagePumpNSApplication::MessagePumpNSApplication() void MessagePumpNSApplication::DoRun(Delegate* delegate) { bool last_running_own_loop_ = running_own_loop_; + // NSApp must be initialized by calling: + // [{some class which implements CrAppProtocol} sharedApplication] + // Most likely candidates are CrApplication or BrowserCrApplication. + // These can be initialized from C++ code by calling + // RegisterCrApp() or RegisterBrowserCrApp(). + CHECK(NSApp); + if (![NSApp isRunning]) { running_own_loop_ = false; // NSApplication manages autorelease pools itself when run this way. |