diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-13 12:49:30 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-13 12:49:30 +0000 |
commit | 7fb0d58958805925537b7f39b71f1bb9327bbfa7 (patch) | |
tree | 530a8bceabe7bf094af91e78c3471595ca6626cd /chrome/installer/test | |
parent | 2a3542f5b064e676cd5c21a90cbc92e9af06770b (diff) | |
download | chromium_src-7fb0d58958805925537b7f39b71f1bb9327bbfa7.zip chromium_src-7fb0d58958805925537b7f39b71f1bb9327bbfa7.tar.gz chromium_src-7fb0d58958805925537b7f39b71f1bb9327bbfa7.tar.bz2 |
Prevent redirector from returning the current module in cases where it fails to look up the first module in. This prevents a bug that can cause user-level Chrome Frame to redirect to itself when a system-level Chrome Frame is present.
BUG=96016
TEST=Upgrade a user-level CF install to a system-level CF install while user-level CF is rendering. Observe that the current explorer instance does not hang when new CF tabs are created.
Review URL: http://codereview.chromium.org/7866043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/test')
-rw-r--r-- | chrome/installer/test/alternate_version_generator.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc index 0ba20d15a..e748078 100644 --- a/chrome/installer/test/alternate_version_generator.cc +++ b/chrome/installer/test/alternate_version_generator.cc @@ -90,6 +90,7 @@ class ScopedTempDirectory { DCHECK(!directory_.empty()); return directory_; } + private: FilePath directory_; DISALLOW_COPY_AND_ASSIGN(ScopedTempDirectory); @@ -336,7 +337,22 @@ bool UpdateVersionIfMatch(const FilePath& image_file, (base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_READ | base::PLATFORM_FILE_EXCLUSIVE_WRITE), NULL, NULL)); - if (image_handle.Get() != INVALID_HANDLE_VALUE) { + // It turns out that the underlying CreateFile can fail due to unhelpful + // security software locking the newly created DLL. So add a few brief + // retries to help tests that use this pass on machines thusly encumbered. + int retries = 3; + while (!image_handle.IsValid() && retries-- > 0) { + LOG(WARNING) << "Failed to open \"" << image_file.value() << "\"." + << " Retrying " << retries << " more times."; + Sleep(1000); + image_handle.Set(base::CreatePlatformFile( + image_file, + (base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ | + base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_READ | + base::PLATFORM_FILE_EXCLUSIVE_WRITE), NULL, NULL)); + } + + if (image_handle.IsValid()) { MappedFile image_mapping; if (image_mapping.Initialize(image_handle)) { base::win::PEImageAsData image( |