summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/external_tab_container.cc27
-rw-r--r--chrome_frame/chrome_frame_automation.cc3
2 files changed, 16 insertions, 14 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 0132be2..c0c537d 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -201,20 +201,8 @@ bool ExternalTabContainer::Reinitialize(
automation_ = automation_provider;
automation_resource_message_filter_ = filter;
-
- if (load_requests_via_automation_) {
- InitializeAutomationRequestContext(tab_handle_);
-
- RenderViewHost* rvh = tab_contents_->render_view_host();
- if (rvh) {
- AutomationResourceMessageFilter::ResumePendingRenderView(
- rvh->process()->id(), rvh->routing_id(),
- tab_handle_, automation_resource_message_filter_);
- }
- }
-
- // We cannot send the navigation state right away as the automation channel
- // may not have been fully setup yet.
+ // Wait for the automation channel to be initialized before resuming pending
+ // render views and sending in the navigation state.
MessageLoop::current()->PostTask(
FROM_HERE,
external_method_factory_.NewRunnableMethod(
@@ -915,6 +903,17 @@ void ExternalTabContainer::LoadAccelerators() {
}
void ExternalTabContainer::OnReinitialize() {
+ if (load_requests_via_automation_) {
+ InitializeAutomationRequestContext(tab_handle_);
+
+ RenderViewHost* rvh = tab_contents_->render_view_host();
+ if (rvh) {
+ AutomationResourceMessageFilter::ResumePendingRenderView(
+ rvh->process()->id(), rvh->routing_id(),
+ tab_handle_, automation_resource_message_filter_);
+ }
+ }
+
NavigationStateChanged(tab_contents_, 0);
ServicePendingOpenURLRequests();
}
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 2fc968d..ec3d1f6 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -68,6 +68,9 @@ class ChromeFrameAutomationProxyImpl::TabProxyNotificationMessageFilter
if (tab) {
tab->OnMessageReceived(message);
tab->Release();
+ } else {
+ NOTREACHED() << "Failed to find TabProxy for tab:" << tab_handle;
+ return false;
}
return true;
}