summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 21:29:42 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 21:29:42 +0000
commit59a74142e90e463622aca40f68b210ff360a6bf8 (patch)
treedefb7f383289948bc89decce1b9dd7b7e8eb20b4 /chrome/browser/renderer_host
parent4d5223d547585b7baca9f93b4c5d96cbf91eaf10 (diff)
downloadchromium_src-59a74142e90e463622aca40f68b210ff360a6bf8.zip
chromium_src-59a74142e90e463622aca40f68b210ff360a6bf8.tar.gz
chromium_src-59a74142e90e463622aca40f68b210ff360a6bf8.tar.bz2
Merge 82990 - Move the synchronous GPU messages to the IO thread to avoid deadlock.
I patched in Jonathan's change from http://codereview.chromium.org/6881105/ for the CreateViewCommandBuffer message, and also added the Synchronize and EstablishChannel. The latter required making GpuDataManager callable from the IO thread. I moved the code that loads the blacklist from the prefs and web to Chrome code, since I wanted to do that anyways so that GpuProcessHostUIShim and GpuDataManager can move to content (I'll do that later). Since the messages are filtered on the IO thread, it's now GpuProcessHost that creates GpuProcessHostUIShim. Accordingly, all the code that used to call GpuProcessHostUIShim to send a message now has to call GpuProcessHost, since the logic of when to create a process is there. Also, since there's no IO thread object for the in-process case, I've had to break that in the meantime. Al will take a look at that later. BUG=77536 Review URL: http://codereview.chromium.org/6902021 TBR=jam@chromium.org Review URL: http://codereview.chromium.org/6902087 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@83219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm55
1 files changed, 10 insertions, 45 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 3708e09..d8ef5e5 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1101,14 +1101,12 @@ void RenderWidgetHostViewMac::DeallocFakePluginWindowHandle(
// channel error.
if (render_widget_host_ &&
plugin_container_manager_.IsRootContainer(window)) {
- GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::GetForRenderer(
+ GpuProcessHost::SendOnIO(
render_widget_host_->process()->id(),
- content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH);
- if (ui_shim) {
- ui_shim->DidDestroyAcceleratedSurface(
- render_widget_host_->process()->id(),
- render_widget_host_->routing_id());
- }
+ content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH,
+ new GpuMsg_DestroyCommandBuffer(
+ render_widget_host_->process()->id(),
+ render_widget_host_->routing_id()));
}
plugin_container_manager_.DestroyFakePluginWindowHandle(window);
@@ -1214,39 +1212,6 @@ void RenderWidgetHostViewMac::HandleDelayedGpuViewHiding() {
}
}
-namespace {
-class BuffersSwappedAcknowledger : public Task {
- public:
- BuffersSwappedAcknowledger(
- int gpu_host_id,
- int renderer_id,
- int32 route_id,
- uint64 swap_buffers_count)
- : gpu_host_id_(gpu_host_id),
- renderer_id_(renderer_id),
- route_id_(route_id),
- swap_buffers_count_(swap_buffers_count) {
- }
-
- void Run() {
- GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
- if (!host)
- return;
-
- host->Send(new GpuMsg_AcceleratedSurfaceBuffersSwappedACK(
- renderer_id_, route_id_, swap_buffers_count_));
- }
-
- private:
- int gpu_host_id_;
- int renderer_id_;
- int32 route_id_;
- uint64 swap_buffers_count_;
-
- DISALLOW_COPY_AND_ASSIGN(BuffersSwappedAcknowledger);
-};
-} // anonymous namespace
-
void RenderWidgetHostViewMac::AcknowledgeSwapBuffers(
int renderer_id,
int32 route_id,
@@ -1279,11 +1244,11 @@ void RenderWidgetHostViewMac::AcknowledgeSwapBuffers(
route_id,
swap_buffers_count)));
} else {
- BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- new BuffersSwappedAcknowledger(
- gpu_host_id, renderer_id, route_id, swap_buffers_count));
+ GpuProcessHost::SendOnIO(
+ gpu_host_id,
+ content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH,
+ new GpuMsg_AcceleratedSurfaceBuffersSwappedACK(
+ renderer_id, route_id, swap_buffers_count));
}
}