| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ipc/ipc_message_utils.h" | 9 #include "ipc/ipc_message_utils.h" |
| 10 #include "ppapi/proxy/dispatcher.h" | 10 #include "ppapi/proxy/dispatcher.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 m->WriteInt64(var_.value.as_id); | 140 m->WriteInt64(var_.value.as_id); |
| 141 break; | 141 break; |
| 142 case PP_VARTYPE_ARRAY: | 142 case PP_VARTYPE_ARRAY: |
| 143 case PP_VARTYPE_DICTIONARY: | 143 case PP_VARTYPE_DICTIONARY: |
| 144 // TODO(brettw) when these are supported, implement this. | 144 // TODO(brettw) when these are supported, implement this. |
| 145 NOTIMPLEMENTED(); | 145 NOTIMPLEMENTED(); |
| 146 break; | 146 break; |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { | 150 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, |
| 151 PickleIterator* iter) { |
| 151 #ifndef NDEBUG | 152 #ifndef NDEBUG |
| 152 // We should only deserialize something once or will end up with leaked | 153 // We should only deserialize something once or will end up with leaked |
| 153 // references. | 154 // references. |
| 154 // | 155 // |
| 155 // One place this has happened in the past is using | 156 // One place this has happened in the past is using |
| 156 // std::vector<SerializedVar>.resize(). If you're doing this manually instead | 157 // std::vector<SerializedVar>.resize(). If you're doing this manually instead |
| 157 // of using the helper classes for handling in/out vectors of vars, be | 158 // of using the helper classes for handling in/out vectors of vars, be |
| 158 // sure you use the same pattern as the SerializedVarVector classes. | 159 // sure you use the same pattern as the SerializedVarVector classes. |
| 159 DCHECK(!has_been_deserialized_); | 160 DCHECK(!has_been_deserialized_); |
| 160 has_been_deserialized_ = true; | 161 has_been_deserialized_ = true; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); | 515 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); |
| 515 } | 516 } |
| 516 | 517 |
| 517 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 518 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
| 518 : SerializedVar(var) { | 519 : SerializedVar(var) { |
| 519 } | 520 } |
| 520 | 521 |
| 521 } // namespace proxy | 522 } // namespace proxy |
| 522 } // namespace ppapi | 523 } // namespace ppapi |
| 523 | 524 |
| OLD | NEW |