| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/serialized_var.h" | 5 #include "ppapi/proxy/serialized_var.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ipc/ipc_message_utils.h" | 8 #include "ipc/ipc_message_utils.h" |
| 9 #include "ppapi/proxy/dispatcher.h" | 9 #include "ppapi/proxy/dispatcher.h" |
| 10 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 serialized_[i].inner_->SetVar( | 397 serialized_[i].inner_->SetVar( |
| 398 serialized_[i].inner_->serialization_rules()->BeginReceiveCallerOwned( | 398 serialized_[i].inner_->serialization_rules()->BeginReceiveCallerOwned( |
| 399 serialized_[i].inner_->GetIncompleteVar(), | 399 serialized_[i].inner_->GetIncompleteVar(), |
| 400 serialized_[i].inner_->GetStringPtr(), | 400 serialized_[i].inner_->GetStringPtr(), |
| 401 dispatcher)); | 401 dispatcher)); |
| 402 deserialized_[i] = serialized_[i].inner_->GetVar(); | 402 deserialized_[i] = serialized_[i].inner_->GetVar(); |
| 403 } | 403 } |
| 404 | 404 |
| 405 *array_size = static_cast<uint32_t>(serialized_.size()); | 405 *array_size = static_cast<uint32_t>(serialized_.size()); |
| 406 return deserialized_.size() > 0 ? &deserialized_[0] : NULL; | 406 return deserialized_.empty() ? NULL : &deserialized_[0]; |
| 407 } | 407 } |
| 408 | 408 |
| 409 // SerializedVarReturnValue ---------------------------------------------------- | 409 // SerializedVarReturnValue ---------------------------------------------------- |
| 410 | 410 |
| 411 SerializedVarReturnValue::SerializedVarReturnValue(SerializedVar* serialized) | 411 SerializedVarReturnValue::SerializedVarReturnValue(SerializedVar* serialized) |
| 412 : serialized_(serialized) { | 412 : serialized_(serialized) { |
| 413 } | 413 } |
| 414 | 414 |
| 415 void SerializedVarReturnValue::Return(Dispatcher* dispatcher, | 415 void SerializedVarReturnValue::Return(Dispatcher* dispatcher, |
| 416 const PP_Var& var) { | 416 const PP_Var& var) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 *inner_->GetStringPtr() = str; | 517 *inner_->GetStringPtr() = str; |
| 518 } | 518 } |
| 519 | 519 |
| 520 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 520 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
| 521 : SerializedVar(var) { | 521 : SerializedVar(var) { |
| 522 } | 522 } |
| 523 | 523 |
| 524 } // namespace proxy | 524 } // namespace proxy |
| 525 } // namespace pp | 525 } // namespace pp |
| 526 | 526 |
| OLD | NEW |