[Mac] Don't crash when selecting closed window from Dock menu.

The Dock menu contains an automagic section where you can select
amongst open windows.  This is wired up to send to the window as a
target, but if JavaScript closes the window in the meanwhile, it
messages a freed object.  This short-circuits the specific selector if
the window is no longer valid.

http://crbug.com/14003
TEST=Bug contains instructions and an example html file to help.

Review URL: http://codereview.chromium.org/259001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27769 0039d316-1c4b-4281-b951-d872f2087c98
1 file changed