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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // | 142 // |
143 // One place this has happened in the past is using | 143 // One place this has happened in the past is using |
144 // std::vector<SerializedVar>.resize(). If you're doing this manually instead | 144 // std::vector<SerializedVar>.resize(). If you're doing this manually instead |
145 // of using the helper classes for handling in/out vectors of vars, be | 145 // of using the helper classes for handling in/out vectors of vars, be |
146 // sure you use the same pattern as the SerializedVarVector classes. | 146 // sure you use the same pattern as the SerializedVarVector classes. |
147 DCHECK(!has_been_deserialized_); | 147 DCHECK(!has_been_deserialized_); |
148 has_been_deserialized_ = true; | 148 has_been_deserialized_ = true; |
149 #endif | 149 #endif |
150 // When reading, the dispatcher should be set when we get a Deserialize | 150 // When reading, the dispatcher should be set when we get a Deserialize |
151 // call (which will supply a dispatcher). | 151 // call (which will supply a dispatcher). |
152 if (!iter->ReadBool(&is_valid_var_)) | 152 if (!m->ReadBool(iter, &is_valid_var_)) |
153 return false; | 153 return false; |
154 if (is_valid_var_) { | 154 if (is_valid_var_) { |
155 raw_var_data_ = RawVarDataGraph::Read(m, iter); | 155 raw_var_data_ = RawVarDataGraph::Read(m, iter); |
156 if (!raw_var_data_) | 156 if (!raw_var_data_) |
157 return false; | 157 return false; |
158 } | 158 } |
159 | 159 |
160 return true; | 160 return true; |
161 } | 161 } |
162 | 162 |
(...skipping 295 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 |