| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 IPC::ParamTraits<double>::Write(m, var_.value.as_double); | 145 IPC::ParamTraits<double>::Write(m, var_.value.as_double); |
| 146 break; | 146 break; |
| 147 case PP_VARTYPE_STRING: | 147 case PP_VARTYPE_STRING: |
| 148 // TODO(brettw) in the case of an invalid string ID, it would be nice | 148 // TODO(brettw) in the case of an invalid string ID, it would be nice |
| 149 // to send something to the other side such that a 0 ID would be | 149 // to send something to the other side such that a 0 ID would be |
| 150 // generated there. Then the function implementing the interface can | 150 // generated there. Then the function implementing the interface can |
| 151 // handle the invalid string as if it was in process rather than seeing | 151 // handle the invalid string as if it was in process rather than seeing |
| 152 // what looks like a valid empty string. | 152 // what looks like a valid empty string. |
| 153 m->WriteString(string_value_); | 153 m->WriteString(string_value_); |
| 154 break; | 154 break; |
| 155 case PP_VARTYPE_ARRAY_BUFFER: |
| 156 // TODO(dmichael): Proxy ArrayBuffer. |
| 157 NOTIMPLEMENTED(); |
| 158 break; |
| 155 case PP_VARTYPE_OBJECT: | 159 case PP_VARTYPE_OBJECT: |
| 156 m->WriteInt64(var_.value.as_id); | 160 m->WriteInt64(var_.value.as_id); |
| 157 break; | 161 break; |
| 158 case PP_VARTYPE_ARRAY: | 162 case PP_VARTYPE_ARRAY: |
| 159 case PP_VARTYPE_DICTIONARY: | 163 case PP_VARTYPE_DICTIONARY: |
| 160 case PP_VARTYPE_ARRAY_BUFFER: | |
| 161 // TODO(brettw) when these are supported, implement this. | 164 // TODO(brettw) when these are supported, implement this. |
| 162 NOTIMPLEMENTED(); | 165 NOTIMPLEMENTED(); |
| 163 break; | 166 break; |
| 164 } | 167 } |
| 165 } | 168 } |
| 166 | 169 |
| 167 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { | 170 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { |
| 168 #ifndef NDEBUG | 171 #ifndef NDEBUG |
| 169 // We should only deserialize something once or will end up with leaked | 172 // We should only deserialize something once or will end up with leaked |
| 170 // references. | 173 // references. |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 inner_->ForceSetStringValueForTest(str); | 539 inner_->ForceSetStringValueForTest(str); |
| 537 } | 540 } |
| 538 | 541 |
| 539 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 542 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
| 540 : SerializedVar(var) { | 543 : SerializedVar(var) { |
| 541 } | 544 } |
| 542 | 545 |
| 543 } // namespace proxy | 546 } // namespace proxy |
| 544 } // namespace ppapi | 547 } // namespace ppapi |
| 545 | 548 |
| OLD | NEW |