summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-23 17:35:09 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-23 17:35:09 +0000
commitaacd1d7eda186c0b32d2736c0f38d9749b6006b8 (patch)
tree0ab3883448a1d082f5a78cad4a08577530364ddf /content/browser/renderer_host
parent87d5c05993b8a457cbf0cce00ec97fc3fcc1d270 (diff)
downloadchromium_src-aacd1d7eda186c0b32d2736c0f38d9749b6006b8.zip
chromium_src-aacd1d7eda186c0b32d2736c0f38d9749b6006b8.tar.gz
chromium_src-aacd1d7eda186c0b32d2736c0f38d9749b6006b8.tar.bz2
Fix regression of bug 205 where a plugin in a window shown with window.open may not have the correct parent window. PluginTest.OpenPopupWindowWithPlugin covers this, but this bug is a race condition which is why the test works most of the time (although it shows up on the flakiness dashboard). When I tried to move this test to content_browsertests, the timing was different so it showed up most of the time.
BUG=205 Review URL: https://chromiumcodereview.appspot.com/10809051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc4
-rw-r--r--content/browser/renderer_host/render_process_host_impl.h1
-rw-r--r--content/browser/renderer_host/render_widget_helper.cc25
-rw-r--r--content/browser/renderer_host/render_widget_helper.h5
-rw-r--r--content/browser/renderer_host/render_widget_host_impl.cc2
5 files changed, 24 insertions, 13 deletions
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 33f3458..ee22628 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1135,6 +1135,10 @@ void RenderProcessHostImpl::SurfaceUpdated(int32 surface_id) {
surface_id));
}
+void RenderProcessHostImpl::ResumeRequestsForView(int route_id) {
+ widget_helper_->ResumeRequestsForView(route_id);
+}
+
IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() {
return channel_.get();
}
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index ef25087..1d568ad 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -88,6 +88,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
virtual bool FastShutdownStarted() const OVERRIDE;
virtual base::TimeDelta GetChildProcessIdleTime() const OVERRIDE;
virtual void SurfaceUpdated(int32 surface_id) OVERRIDE;
+ virtual void ResumeRequestsForView(int route_id) OVERRIDE;
// IPC::Sender via RenderProcessHost.
virtual bool Send(IPC::Message* msg) OVERRIDE;
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc
index 961f320..300d0ac 100644
--- a/content/browser/renderer_host/render_widget_helper.cc
+++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -143,9 +143,7 @@ void RenderWidgetHelper::CrossSiteSwapOutACK(
}
bool RenderWidgetHelper::WaitForBackingStoreMsg(
- int render_widget_id,
- const base::TimeDelta& max_delay,
- IPC::Message* msg) {
+ int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg) {
base::TimeTicks time_start = base::TimeTicks::Now();
for (;;) {
@@ -189,6 +187,17 @@ bool RenderWidgetHelper::WaitForBackingStoreMsg(
return false;
}
+void RenderWidgetHelper::ResumeRequestsForView(int route_id) {
+ // We only need to resume blocked requests if we used a valid route_id.
+ // See CreateNewWindow.
+ if (route_id != MSG_ROUTING_NONE) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&RenderWidgetHelper::OnResumeRequestsForView,
+ this, route_id));
+ }
+}
+
void RenderWidgetHelper::DidReceiveBackingStoreMsg(const IPC::Message& msg) {
int render_widget_id = msg.routing_id();
@@ -288,17 +297,9 @@ void RenderWidgetHelper::OnCreateWindowOnUI(
RenderViewHostImpl::FromID(render_process_id_, params.opener_id);
if (host)
host->CreateNewWindow(route_id, params, session_storage_namespace);
-
- // We only need to resume blocked requests if we used a valid route_id.
- // See CreateNewWindow.
- if (route_id != MSG_ROUTING_NONE) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&RenderWidgetHelper::OnCreateWindowOnIO, this, route_id));
- }
}
-void RenderWidgetHelper::OnCreateWindowOnIO(int route_id) {
+void RenderWidgetHelper::OnResumeRequestsForView(int route_id) {
resource_dispatcher_host_->ResumeBlockedRequestsForRoute(
render_process_id_, route_id);
}
diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h
index 66feeed..e16c952 100644
--- a/content/browser/renderer_host/render_widget_helper.h
+++ b/content/browser/renderer_host/render_widget_helper.h
@@ -130,6 +130,9 @@ class RenderWidgetHelper
bool WaitForBackingStoreMsg(int render_widget_id,
const base::TimeDelta& max_delay,
IPC::Message* msg);
+ // Called to resume the requests for a view after it's ready. The view was
+ // created by CreateNewWindow which initially blocked the requests.
+ void ResumeRequestsForView(int route_id);
#if defined(OS_MACOSX)
// Given the id of a transport DIB, return a mapping to it or NULL on error.
@@ -197,7 +200,7 @@ class RenderWidgetHelper
SessionStorageNamespace* session_storage_namespace);
// Called on the IO thread after a window was created on the UI thread.
- void OnCreateWindowOnIO(int route_id);
+ void OnResumeRequestsForView(int route_id);
// Called on the UI thread to finish creating a widget.
void OnCreateWidgetOnUI(int opener_id,
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 414b071..104b751 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -245,6 +245,8 @@ void RenderWidgetHostImpl::Init() {
// Send the ack along with the information on placement.
Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId()));
+ GetProcess()->ResumeRequestsForView(routing_id_);
+
WasResized();
}