summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 19:12:44 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-15 19:12:44 +0000
commita8018a561b477277593554d08f99130f7bb7847b (patch)
treec3cd2f5826d838d25c8b7ac6d94d8ccb8767611f /chrome_frame
parenta316e8759a09e1abe6110a09fe94f47b7e9d3589 (diff)
downloadchromium_src-a8018a561b477277593554d08f99130f7bb7847b.zip
chromium_src-a8018a561b477277593554d08f99130f7bb7847b.tar.gz
chromium_src-a8018a561b477277593554d08f99130f7bb7847b.tar.bz2
Have Chrome Frame ignore NavigationStateChanged events for provisional navigations. These would not be added to the IE travel log but previously would have caused ChromeActiveDocument's navigation_info_ member to be updated. This would cause incorrect entries to be added to the travel log when the notification for the committed navigation came in.
Note, this fails only on one flaky test which I'll disable but notry-ing this in the meantime to unblock the change that needs it. BUG=9682 TEST=chrome_frame_tests.exe NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12710008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 7ee0026..8c076e4 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -830,11 +830,20 @@ void ChromeActiveDocument::UpdateNavigationState(
title.AsInput(), NULL);
}
- // It is important that we only update the navigation_info_ after we have
- // finalized the travel log. This is because IE will ask for information
- // such as navigation index when the travel log is finalized and we need
- // supply the old index and not the new one.
- *navigation_info_ = new_navigation_info;
+ // There are cases in which we receive NavigationStateChanged events for
+ // provisional loads. These events will contain a new URL but will not be
+ // considered new navigations since their navigation_index is 0. For these
+ // events, do not update the navigation_info_ state, as this will muck up the
+ // travel log when the subsequent committed navigation event takes place.
+ if (IsNewNavigation(new_navigation_info, flags) ||
+ new_navigation_info.url == navigation_info_->url) {
+ // It is important that we only update the navigation_info_ after we have
+ // finalized the travel log. This is because IE will ask for information
+ // such as navigation index when the travel log is finalized and we need
+ // supply the old index and not the new one.
+ *navigation_info_ = new_navigation_info;
+ }
+
// Update the IE zone here. Ideally we would like to do it when the active
// document is activated. However that does not work at times as the frame we
// get there is not the actual frame which handles the command.