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

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

Issue 53123002: Rename HandleConverter to NaClMessageScanner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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: 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 8134d3c751a034253b4ac244d5f7df4fed844afb..644ec7ff24f98d6733522bbeffc45731c198f9c0 100644
--- a/components/nacl/loader/nacl_ipc_adapter.cc
+++ b/components/nacl/loader/nacl_ipc_adapter.cc
@@ -377,10 +377,8 @@ bool NaClIPCAdapter::OnMessageReceived(const IPC::Message& msg) {
typedef std::vector<ppapi::proxy::SerializedHandle> Handles;
Handles handles;
- scoped_ptr<IPC::Message> new_msg_ptr;
- bool success = locked_data_.handle_converter_.ConvertNativeHandlesToPosix(
- msg, &handles, &new_msg_ptr);
- if (!success)
+ scoped_ptr<IPC::Message> new_msg;
+ if (!locked_data_.nacl_msg_scanner_.ScanMessage(msg, &handles, &new_msg))
return false;
// Now add any descriptors we found to rewritten_msg. |handles| is usually
@@ -459,8 +457,8 @@ bool NaClIPCAdapter::OnMessageReceived(const IPC::Message& msg) {
if (nacl_desc.get())
rewritten_msg->AddDescriptor(nacl_desc.release());
}
- if (new_msg_ptr && !handles.empty())
- SaveMessage(*new_msg_ptr, rewritten_msg.get());
+ if (new_msg && !handles.empty())
bbudge 2013/10/30 19:01:34 I wonder if we really need to check 'handles' afte
dmichael (off chromium) 2013/10/30 20:57:57 I think the issue is that ScanMessage only writes
+ SaveMessage(*new_msg, rewritten_msg.get());
else
SaveMessage(msg, rewritten_msg.get());
}
@@ -514,8 +512,7 @@ bool NaClIPCAdapter::SendCompleteMessage(const char* buffer,
// We actually discard the flags and only copy the ones we care about. This
// is just because message doesn't have a constructor that takes raw flags.
- scoped_ptr<IPC::Message> msg(
- new IPC::Message(header->routing, header->type));
+ scoped_ptr<IPC::Message> msg(new IPC::Message(header->routing, header->type));
if (header->flags & IPC::Message::SYNC_BIT)
msg->set_sync();
if (header->flags & IPC::Message::REPLY_BIT)
@@ -537,7 +534,7 @@ bool NaClIPCAdapter::SendCompleteMessage(const char* buffer,
return false; // TODO(brettw) clean up handles here when we add support!
if (msg->is_sync()) {
- locked_data_.handle_converter_.RegisterSyncMessageForReply(*msg);
+ locked_data_.nacl_msg_scanner_.RegisterSyncMessageForReply(*msg);
}
// Actual send must be done on the I/O thread.
task_runner_->PostTask(FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698