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/proxy/dispatcher.h" | 9 #include "ppapi/proxy/dispatcher.h" |
10 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } else { | 133 } else { |
134 m->WriteData(NULL, 0); | 134 m->WriteData(NULL, 0); |
135 } | 135 } |
136 break; | 136 break; |
137 } | 137 } |
138 case PP_VARTYPE_OBJECT: | 138 case PP_VARTYPE_OBJECT: |
139 m->WriteInt64(var_.value.as_id); | 139 m->WriteInt64(var_.value.as_id); |
140 break; | 140 break; |
141 case PP_VARTYPE_ARRAY: | 141 case PP_VARTYPE_ARRAY: |
142 case PP_VARTYPE_DICTIONARY: | 142 case PP_VARTYPE_DICTIONARY: |
143 // TODO(brettw) when these are supported, implement this. | 143 // TODO(yzshen) when these are supported, implement this. |
144 NOTIMPLEMENTED(); | 144 NOTIMPLEMENTED(); |
145 break; | 145 break; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, | 149 bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, |
150 PickleIterator* iter) { | 150 PickleIterator* iter) { |
151 #ifndef NDEBUG | 151 #ifndef NDEBUG |
152 // We should only deserialize something once or will end up with leaked | 152 // We should only deserialize something once or will end up with leaked |
153 // references. | 153 // references. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 raw_var_data_->type = PP_VARTYPE_ARRAY_BUFFER; | 203 raw_var_data_->type = PP_VARTYPE_ARRAY_BUFFER; |
204 raw_var_data_->data.assign(message_bytes, length); | 204 raw_var_data_->data.assign(message_bytes, length); |
205 } | 205 } |
206 break; | 206 break; |
207 } | 207 } |
208 case PP_VARTYPE_OBJECT: | 208 case PP_VARTYPE_OBJECT: |
209 success = m->ReadInt64(iter, &var_.value.as_id); | 209 success = m->ReadInt64(iter, &var_.value.as_id); |
210 break; | 210 break; |
211 case PP_VARTYPE_ARRAY: | 211 case PP_VARTYPE_ARRAY: |
212 case PP_VARTYPE_DICTIONARY: | 212 case PP_VARTYPE_DICTIONARY: |
213 // TODO(brettw) when these types are supported, implement this. | 213 // TODO(yzshen) when these types are supported, implement this. |
214 NOTIMPLEMENTED(); | 214 NOTIMPLEMENTED(); |
215 break; | 215 break; |
216 default: | 216 default: |
217 // Leave success as false. | 217 // Leave success as false. |
218 break; | 218 break; |
219 } | 219 } |
220 | 220 |
221 // All success cases get here. We avoid writing the type above so that the | 221 // All success cases get here. We avoid writing the type above so that the |
222 // output param is untouched (defaults to VARTYPE_UNDEFINED) even in the | 222 // output param is untouched (defaults to VARTYPE_UNDEFINED) even in the |
223 // failure case. | 223 // failure case. |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 const std::string& str) { | 531 const std::string& str) { |
532 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); | 532 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); |
533 } | 533 } |
534 | 534 |
535 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 535 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
536 : SerializedVar(var) { | 536 : SerializedVar(var) { |
537 } | 537 } |
538 | 538 |
539 } // namespace proxy | 539 } // namespace proxy |
540 } // namespace ppapi | 540 } // namespace ppapi |
OLD | NEW |