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

Unified Diff: chrome/browser/automation/automation_resource_message_filter.cc

Issue 8414030: Relanding this as the earlier attempt broke chrome frame tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/external_tab_container_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_resource_message_filter.cc
===================================================================
--- chrome/browser/automation/automation_resource_message_filter.cc (revision 107404)
+++ chrome/browser/automation/automation_resource_message_filter.cc (working copy)
@@ -265,6 +265,16 @@
if (automation_details_iter != filtered_render_views_.Get().end()) {
DCHECK_GT(automation_details_iter->second.ref_count, 0);
automation_details_iter->second.ref_count++;
+ // The tab handle may have changed:-
+ // 1.A external tab container is being destroyed and a new one is being
+ // created.
+ // 2.The external tab container being destroyed receives a RVH created
+ // notification for the new RVH created to host the newly created tab.
+ // In this case the tab handle in the AutomationDetails structure would
+ // be invalid as it points to a destroyed tab.
+ // We need to replace the handle of the external tab being destroyed with
+ // the new one that is being created."
+ automation_details_iter->second.tab_handle = tab_handle;
} else {
filtered_render_views_.Get()[renderer_key] =
AutomationDetails(tab_handle, filter, pending_view);
@@ -471,15 +481,14 @@
DCHECK(new_filter != NULL);
RequestMap pending_requests = old_filter->pending_request_map_;
+ old_filter->pending_request_map_.clear();
- for (RequestMap::iterator index = old_filter->pending_request_map_.begin();
- index != old_filter->pending_request_map_.end(); index++) {
+ for (RequestMap::iterator index = pending_requests.begin();
+ index != pending_requests.end(); index++) {
URLRequestAutomationJob* job = (*index).second;
DCHECK_EQ(job->message_filter(), old_filter);
DCHECK(job->is_pending());
// StartPendingJob will register the job with the new filter.
job->StartPendingJob(tab_handle, new_filter);
}
-
- old_filter->pending_request_map_.clear();
}
« no previous file with comments | « no previous file | chrome/browser/external_tab_container_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698