OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/handle_converter.h" | 5 #include "ppapi/proxy/handle_converter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 int id = IPC::SyncMessage::GetMessageId(msg); | 252 int id = IPC::SyncMessage::GetMessageId(msg); |
253 PendingSyncMsgMap::iterator iter(pending_sync_msgs_.find(id)); | 253 PendingSyncMsgMap::iterator iter(pending_sync_msgs_.find(id)); |
254 if (iter == pending_sync_msgs_.end()) { | 254 if (iter == pending_sync_msgs_.end()) { |
255 NOTREACHED(); | 255 NOTREACHED(); |
256 return false; | 256 return false; |
257 } | 257 } |
258 uint32_t type = iter->second; | 258 uint32_t type = iter->second; |
259 pending_sync_msgs_.erase(iter); | 259 pending_sync_msgs_.erase(iter); |
260 switch (type) { | 260 switch (type) { |
261 CASE_FOR_REPLY(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer) | 261 CASE_FOR_REPLY(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer) |
262 CASE_FOR_REPLY(PpapiHostMsg_PPBImageData_CreateNaCl) | 262 CASE_FOR_REPLY(PpapiHostMsg_PPBImageData_CreateSimple) |
263 CASE_FOR_REPLY(PpapiHostMsg_ResourceSyncCall) | 263 CASE_FOR_REPLY(PpapiHostMsg_ResourceSyncCall) |
264 CASE_FOR_REPLY(PpapiHostMsg_SharedMemory_CreateSharedMemory) | 264 CASE_FOR_REPLY(PpapiHostMsg_SharedMemory_CreateSharedMemory) |
265 default: | 265 default: |
266 // Do nothing for messages we don't know. | 266 // Do nothing for messages we don't know. |
267 break; | 267 break; |
268 } | 268 } |
269 break; | 269 break; |
270 } | 270 } |
271 default: | 271 default: |
272 // Do nothing for messages we don't know. | 272 // Do nothing for messages we don't know. |
273 break; | 273 break; |
274 } | 274 } |
275 return true; | 275 return true; |
276 } | 276 } |
277 | 277 |
278 void HandleConverter::RegisterSyncMessageForReply(const IPC::Message& msg) { | 278 void HandleConverter::RegisterSyncMessageForReply(const IPC::Message& msg) { |
279 DCHECK(msg.is_sync()); | 279 DCHECK(msg.is_sync()); |
280 | 280 |
281 int msg_id = IPC::SyncMessage::GetMessageId(msg); | 281 int msg_id = IPC::SyncMessage::GetMessageId(msg); |
282 DCHECK(pending_sync_msgs_.find(msg_id) == pending_sync_msgs_.end()); | 282 DCHECK(pending_sync_msgs_.find(msg_id) == pending_sync_msgs_.end()); |
283 | 283 |
284 pending_sync_msgs_[msg_id] = msg.type(); | 284 pending_sync_msgs_[msg_id] = msg.type(); |
285 } | 285 } |
286 | 286 |
287 } // namespace proxy | 287 } // namespace proxy |
288 } // namespace ppapi | 288 } // namespace ppapi |
OLD | NEW |