Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc

Issue 10834125: When committing a provisional load that didn't change the RVH, still abort pending navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc
diff --git a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc
index 8a5c546ff37d0c74020c33b4489ecca3d53a0220..b1ec1e826338f40508c97b943b7cf70a07775a2d 100644
--- a/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc
+++ b/chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc
@@ -103,10 +103,12 @@ void FrameNavigationState::TrackFrame(FrameID frame_id,
}
void FrameNavigationState::StopTrackingFramesInRVH(
- content::RenderViewHost* render_view_host) {
+ content::RenderViewHost* render_view_host,
+ FrameID id_to_skip) {
for (std::set<FrameID>::iterator frame = frame_ids_.begin();
frame != frame_ids_.end();) {
- if (frame->render_view_host != render_view_host) {
+ if (frame->render_view_host != render_view_host ||
+ *frame == id_to_skip) {
++frame;
continue;
}
@@ -182,8 +184,10 @@ bool FrameNavigationState::GetNavigationCompleted(FrameID frame_id) const {
void FrameNavigationState::SetNavigationCommitted(FrameID frame_id) {
DCHECK(frame_state_map_.find(frame_id) != frame_state_map_.end());
frame_state_map_[frame_id].is_committed = true;
- if (frame_state_map_[frame_id].is_main_frame)
+ if (frame_state_map_[frame_id].is_main_frame) {
+ DCHECK_EQ(1u, frame_ids_.size());
main_frame_id_ = frame_id;
+ }
}
bool FrameNavigationState::GetNavigationCommitted(FrameID frame_id) const {

Powered by Google App Engine
This is Rietveld 408576698