Commit b44a1337 authored by kareng's avatar kareng Committed by Commit bot

Revert of Hold the Pepper proxy lock for all Pepper GL calls. (patchset #3...

Revert of Hold the Pepper proxy lock for all Pepper GL calls. (patchset #3 id:40001 of https://codereview.chromium.org/692683003/)

Reason for revert:
causing huge crashes in canary. bug=429446

Original issue's description:
> Hold the Pepper proxy lock for all Pepper GL calls.
>
> BUG=418651
>
> Committed: https://crrev.com/057f7a69dd40c93550b375b4287dba70d719316a
> Cr-Commit-Position: refs/heads/master@{#302303}

TBR=dmichael@chromium.org,dmichael@google.com,penghuang@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=418651

Review URL: https://codereview.chromium.org/698463006

Cr-Commit-Position: refs/heads/master@{#302391}
parent 90f19fbf
...@@ -211,15 +211,6 @@ bool PluginDispatcher::Send(IPC::Message* msg) { ...@@ -211,15 +211,6 @@ bool PluginDispatcher::Send(IPC::Message* msg) {
return SendMessage(msg); return SendMessage(msg);
} }
bool PluginDispatcher::SendAndStayLocked(IPC::Message* msg) {
TRACE_EVENT2("ppapi proxy", "PluginDispatcher::SendAndStayLocked",
"Class", IPC_MESSAGE_ID_CLASS(msg->type()),
"Line", IPC_MESSAGE_ID_LINE(msg->type()));
if (!msg->is_reply())
msg->set_unblock(true);
return SendMessage(msg);
}
bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) {
// We need to grab the proxy lock to ensure that we don't collide with the // We need to grab the proxy lock to ensure that we don't collide with the
// plugin making pepper calls on a different thread. // plugin making pepper calls on a different thread.
......
...@@ -140,15 +140,12 @@ class PPAPI_PROXY_EXPORT PluginDispatcher ...@@ -140,15 +140,12 @@ class PPAPI_PROXY_EXPORT PluginDispatcher
bool is_client); bool is_client);
// Dispatcher overrides. // Dispatcher overrides.
bool IsPlugin() const override; virtual bool IsPlugin() const;
bool Send(IPC::Message* msg) override; virtual bool Send(IPC::Message* msg);
// Unlike |Send()|, this function continues to hold the Pepper proxy lock
// unconditionally.
bool SendAndStayLocked(IPC::Message* msg) override;
// IPC::Listener implementation. // IPC::Listener implementation.
bool OnMessageReceived(const IPC::Message& msg) override; virtual bool OnMessageReceived(const IPC::Message& msg);
void OnChannelError() override; virtual void OnChannelError();
// Keeps track of which dispatcher to use for each instance, active instances // Keeps track of which dispatcher to use for each instance, active instances
// and tracks associated data like the current size. // and tracks associated data like the current size.
......
...@@ -219,10 +219,7 @@ int32 PpapiCommandBufferProxy::CreateGpuMemoryBufferImage( ...@@ -219,10 +219,7 @@ int32 PpapiCommandBufferProxy::CreateGpuMemoryBufferImage(
bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { bool PpapiCommandBufferProxy::Send(IPC::Message* msg) {
DCHECK(last_state_.error == gpu::error::kNoError); DCHECK(last_state_.error == gpu::error::kNoError);
// We need hold the Pepper proxy lock for sync IPC, because GPU command buffer if (channel_->Send(msg))
// may use a sync IPC with another lock held. It may cause deadlock.
// http://crbug.com/418651
if (channel_->SendAndStayLocked(msg))
return true; return true;
last_state_.error = gpu::error::kLostContext; last_state_.error = gpu::error::kLostContext;
......
...@@ -85,9 +85,5 @@ bool ProxyChannel::Send(IPC::Message* msg) { ...@@ -85,9 +85,5 @@ bool ProxyChannel::Send(IPC::Message* msg) {
return false; return false;
} }
bool ProxyChannel::SendAndStayLocked(IPC::Message* msg) {
return Send(msg);
}
} // namespace proxy } // namespace proxy
} // namespace ppapi } // namespace ppapi
...@@ -73,8 +73,6 @@ class PPAPI_PROXY_EXPORT ProxyChannel ...@@ -73,8 +73,6 @@ class PPAPI_PROXY_EXPORT ProxyChannel
// IPC::Sender implementation. // IPC::Sender implementation.
virtual bool Send(IPC::Message* msg) override; virtual bool Send(IPC::Message* msg) override;
virtual bool SendAndStayLocked(IPC::Message* msg);
// IPC::Listener implementation. // IPC::Listener implementation.
virtual void OnChannelError() override; virtual void OnChannelError() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment