Index: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
index 2e0b3c628a37ee585eb2561fe61c5c4d76396df6..3b7d348eba50e9ca354ef7289553c1c503673764 100644 |
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
@@ -377,22 +377,31 @@ void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( |
render_view_host != pending_render_view_host_) |
return; |
FrameNavigationState::FrameID frame_id(frame_num, render_view_host); |
- FrameNavigationState::FrameID id_to_skip; |
- if (render_view_host == render_view_host_) |
- id_to_skip = frame_id; |
- if (is_main_frame) |
- SendErrorEvents(web_contents(), render_view_host_, id_to_skip); |
- render_view_host_ = render_view_host; |
- pending_render_view_host_ = NULL; |
- |
- if (!navigation_state_.CanSendEvents(frame_id)) |
- return; |
bool is_reference_fragment_navigation = |
IsReferenceFragmentNavigation(frame_id, url); |
bool is_history_navigation = |
navigation_state_.GetNavigationCommitted(frame_id); |
+ if (is_main_frame && render_view_host_ == render_view_host) { |
Matt Perry
2012/08/06 20:00:51
this branch confuses to me. how could the current
jochen (gone - plz use gerrit)
2012/08/06 21:08:39
pending means that it's in a different process. Th
Matt Perry
2012/08/06 21:16:26
Actually, the RVHM uses "pending" to refer to a na
Charlie Reis
2012/08/06 21:30:26
Pending is ambiguous here. NavigationController h
jochen (gone - plz use gerrit)
2012/08/06 21:42:32
I added a comment to the defintion in the header.
|
+ if (!is_reference_fragment_navigation && !is_history_navigation) |
Charlie Reis
2012/08/06 20:04:13
Please add comments here, since this code is diffi
jochen (gone - plz use gerrit)
2012/08/06 21:08:39
I added a comment and clarified the variable name:
|
+ SendErrorEvents(web_contents(), render_view_host_, frame_id); |
+ if (pending_render_view_host_) { |
Matt Perry
2012/08/06 20:00:51
is it ever possible for pending_rvh_ to be the sam
jochen (gone - plz use gerrit)
2012/08/06 21:08:39
No (see above)
|
+ SendErrorEvents(web_contents(), |
+ pending_render_view_host_, |
+ FrameNavigationState::FrameID()); |
+ pending_render_view_host_ = NULL; |
+ } |
+ } else if (pending_render_view_host_ == render_view_host) { |
+ SendErrorEvents( |
+ web_contents(), render_view_host_, FrameNavigationState::FrameID()); |
+ render_view_host_ = pending_render_view_host_; |
+ pending_render_view_host_ = NULL; |
+ } |
+ |
+ if (!navigation_state_.CanSendEvents(frame_id)) |
+ return; |
+ |
// Update the URL as it might have changed. |
navigation_state_.UpdateFrame(frame_id, url); |
navigation_state_.SetNavigationCommitted(frame_id); |