| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/proxy/dispatcher.h" | 10 #include "ppapi/proxy/dispatcher.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 break; | 61 break; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 PP_Var SerializedVar::Inner::GetVar() { | 65 PP_Var SerializedVar::Inner::GetVar() { |
| 66 DCHECK(serialization_rules_.get()); | 66 DCHECK(serialization_rules_.get()); |
| 67 | 67 |
| 68 #if defined(NACL_WIN64) | 68 #if defined(NACL_WIN64) |
| 69 NOTREACHED(); | 69 NOTREACHED(); |
| 70 return PP_MakeUndefined(); | 70 return PP_MakeUndefined(); |
| 71 #endif | 71 #else |
| 72 | |
| 73 if (raw_var_data_.get()) { | 72 if (raw_var_data_.get()) { |
| 74 var_ = raw_var_data_->CreatePPVar(instance_); | 73 var_ = raw_var_data_->CreatePPVar(instance_); |
| 75 raw_var_data_.reset(NULL); | 74 raw_var_data_.reset(NULL); |
| 76 } | 75 } |
| 77 | 76 |
| 78 return var_; | 77 return var_; |
| 78 #endif |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SerializedVar::Inner::SetVar(PP_Var var) { | 81 void SerializedVar::Inner::SetVar(PP_Var var) { |
| 82 // Sanity check, when updating the var we should have received a | 82 // Sanity check, when updating the var we should have received a |
| 83 // serialization rules pointer already. | 83 // serialization rules pointer already. |
| 84 DCHECK(serialization_rules_.get()); | 84 DCHECK(serialization_rules_.get()); |
| 85 var_ = var; | 85 var_ = var; |
| 86 raw_var_data_.reset(NULL); | 86 raw_var_data_.reset(NULL); |
| 87 } | 87 } |
| 88 | 88 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 const std::string& str) { | 458 const std::string& str) { |
| 459 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); | 459 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); |
| 460 } | 460 } |
| 461 | 461 |
| 462 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 462 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
| 463 : SerializedVar(var) { | 463 : SerializedVar(var) { |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace proxy | 466 } // namespace proxy |
| 467 } // namespace ppapi | 467 } // namespace ppapi |
| OLD | NEW |