| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 #if defined(OS_MACOSX) | defined(OS_LINUX) | 291 #if defined(OS_MACOSX) | defined(OS_LINUX) |
| 292 if (message_length == 0) { // EOF | 292 if (message_length == 0) { // EOF |
| 293 *length = 0; | 293 *length = 0; |
| 294 return true; | 294 return true; |
| 295 } | 295 } |
| 296 #endif | 296 #endif |
| 297 | 297 |
| 298 // Valid messages must always contain at least the ID of the message | 298 // Valid messages must always contain at least the ID of the message |
| 299 if (message_length >= sizeof(*message_id)) { | 299 if (message_length >= static_cast<int>(sizeof(*message_id))) { |
| 300 // Check if the incoming message requires more space than we have | 300 // Check if the incoming message requires more space than we have |
| 301 // currently allocated. | 301 // currently allocated. |
| 302 if (header->flags & nacl::kMessageTruncated) { | 302 if (header->flags & nacl::kMessageTruncated) { |
| 303 LOG(ERROR) << "Incoming message was truncated"; | 303 LOG(ERROR) << "Incoming message was truncated"; |
| 304 return false; | 304 return false; |
| 305 } | 305 } |
| 306 | 306 |
| 307 // Extract the ID of the message just received. | 307 // Extract the ID of the message just received. |
| 308 MessageId id_found = *(reinterpret_cast<MessageId*>(header->iov[0].base)); | 308 MessageId id_found = *(reinterpret_cast<MessageId*>(header->iov[0].base)); |
| 309 if (id_found <= INVALID_ID || id_found >= MAX_NUM_IDS) { | 309 if (id_found <= INVALID_ID || id_found >= MAX_NUM_IDS) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 memcpy(texture_data, target_address, number_of_bytes); | 575 memcpy(texture_data, target_address, number_of_bytes); |
| 576 | 576 |
| 577 texture_object->Unlock(level); | 577 texture_object->Unlock(level); |
| 578 | 578 |
| 579 SendBooleanResponse(client->client_handle(), true); | 579 SendBooleanResponse(client->client_handle(), true); |
| 580 return true; | 580 return true; |
| 581 } | 581 } |
| 582 | 582 |
| 583 | 583 |
| 584 } // namespace o3d | 584 } // namespace o3d |
| OLD | NEW |