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

Unified Diff: components/nacl/loader/nacl_ipc_adapter.cc

Issue 472073003: Pepper: Make pending_sync_msgs_ local to IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « components/nacl/loader/nacl_ipc_adapter.h ('k') | ppapi/proxy/nacl_message_scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_ipc_adapter.cc
diff --git a/components/nacl/loader/nacl_ipc_adapter.cc b/components/nacl/loader/nacl_ipc_adapter.cc
index d3160e4e51e09b7fd27baa4a3d1c47f041e60a5b..076594eff91f9a59a54047ff6ac88af5c10bc588 100644
--- a/components/nacl/loader/nacl_ipc_adapter.cc
+++ b/components/nacl/loader/nacl_ipc_adapter.cc
@@ -464,15 +464,28 @@ int NaClIPCAdapter::TakeClientFileDescriptor() {
#endif
bool NaClIPCAdapter::OnMessageReceived(const IPC::Message& msg) {
+ uint32_t type = msg.type();
+ if (type == IPC_REPLY_ID) {
+ int id = IPC::SyncMessage::GetMessageId(msg);
+ IOThreadData::PendingSyncMsgMap::iterator it =
+ io_thread_data_.pending_sync_msgs_.find(id);
+ DCHECK(it != io_thread_data_.pending_sync_msgs_.end());
+ if (it != io_thread_data_.pending_sync_msgs_.end()) {
+ type = it->second;
+ io_thread_data_.pending_sync_msgs_.erase(it);
+ }
+ }
+
{
base::AutoLock lock(lock_);
-
scoped_refptr<RewrittenMessage> rewritten_msg(new RewrittenMessage);
typedef std::vector<ppapi::proxy::SerializedHandle> Handles;
Handles handles;
scoped_ptr<IPC::Message> new_msg;
- if (!locked_data_.nacl_msg_scanner_.ScanMessage(msg, &handles, &new_msg))
+
+ if (!locked_data_.nacl_msg_scanner_.ScanMessage(
+ msg, type, &handles, &new_msg))
return false;
// Now add any descriptors we found to rewritten_msg. |handles| is usually
@@ -646,6 +659,12 @@ void NaClIPCAdapter::CloseChannelOnIOThread() {
}
void NaClIPCAdapter::SendMessageOnIOThread(scoped_ptr<IPC::Message> message) {
+ int id = IPC::SyncMessage::GetMessageId(*message.get());
+ DCHECK(io_thread_data_.pending_sync_msgs_.find(id) ==
+ io_thread_data_.pending_sync_msgs_.end());
+
+ if (message->is_sync())
+ io_thread_data_.pending_sync_msgs_[id] = message->type();
io_thread_data_.channel_->Send(message.release());
}
« no previous file with comments | « components/nacl/loader/nacl_ipc_adapter.h ('k') | ppapi/proxy/nacl_message_scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698