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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 12356002: [NOT FOR COMMIT] Hacks to merge render compositor thread with UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New thread restriction allows (incomplete patch) Created 7 years, 10 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
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 49cb0a3ea35b1d44f1ffb06669d532acb81d7656..a2387ad54edb50d959fd3f4f7647be2cc38ddf12 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -149,9 +149,12 @@ bool CommandBufferProxyImpl::Initialize() {
return false;
bool result;
- if (!Send(new GpuCommandBufferMsg_Initialize(route_id_, handle, &result))) {
- LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize.";
- return false;
+ {
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ if (!Send(new GpuCommandBufferMsg_Initialize(route_id_, handle, &result))) {
boliu 2013/03/01 00:19:12 handler does not need DELAYED_RESPONSE, so should
+ LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize.";
+ return false;
+ }
}
if (!result) {
@@ -166,8 +169,12 @@ gpu::CommandBuffer::State CommandBufferProxyImpl::GetState() {
// Send will flag state with lost context if IPC fails.
if (last_state_.error == gpu::error::kNoError) {
gpu::CommandBuffer::State state;
- if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state)))
- OnUpdateState(state);
+ {
+ // Seems fine.
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state)))
boliu 2013/03/01 00:19:12 Again doesn't really need DELAYED_RESPONSE except
+ OnUpdateState(state);
+ }
}
TryUpdateState();
@@ -213,9 +220,12 @@ gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync(
// Send will flag state with lost context if IPC fails.
if (last_state_.error == gpu::error::kNoError) {
gpu::CommandBuffer::State state;
- if (Send(new GpuCommandBufferMsg_GetStateFast(route_id_,
- &state)))
- OnUpdateState(state);
+ {
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ if (Send(new GpuCommandBufferMsg_GetStateFast(route_id_,
boliu 2013/03/01 00:19:12 I changed handler to not use DELAYED_RESPONSE
+ &state)))
+ OnUpdateState(state);
+ }
}
TryUpdateState();
}
@@ -227,7 +237,11 @@ void CommandBufferProxyImpl::SetGetBuffer(int32 shm_id) {
if (last_state_.error != gpu::error::kNoError)
return;
- Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id));
+ {
+ // Seems safe, direct reply.
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ Send(new GpuCommandBufferMsg_SetGetBuffer(route_id_, shm_id));
boliu 2013/03/01 00:19:12 Changed handler to not use DELAYED_RESPONSE
+ }
last_put_offset_ = -1;
}

Powered by Google App Engine
This is Rietveld 408576698