Fix crash due to race condition in ImportingProgressView.
commit5d455ec52e025b9322c6fa4cf96ea319cce9bc21
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 12 Aug 2008 03:13:44 +0000 (12 03:13 +0000)
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 12 Aug 2008 03:13:44 +0000 (12 03:13 +0000)
tree18a765f4f19054105f58977c2da95ff13c9495ee
parent4e44b4d3cc5f4ea5c57ce9b495d1357563388962
Fix crash due to race condition in ImportingProgressView.

What is happening is that the ImporterView creates an ImportingProgressView to show the progress of the import but the ImportingProgressView receives the Cancel event before ImportStarted, so importing_ is not set to true. Cancel will think import is done and returns true (allowing the view to be destroyed) and then the ImporterView will try to communicate with a dead observer.

By initializing importing_ to true this crash is avoided (we wouldn't be creating the view unless we were about to import, right?).

BUG=1320194
TEST=Open Import dialog, press Enter and then Esc really quickly and Chrome should not crash (try it 10 times to be sure).

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@702 0039d316-1c4b-4281-b951-d872f2087c98
chrome/browser/views/importing_progress_view.cc