| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/raw_var_data.h" | 5 #include "ppapi/proxy/raw_var_data.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 std::unique_ptr<RawVarDataGraph> result(new RawVarDataGraph); | 191 std::unique_ptr<RawVarDataGraph> result(new RawVarDataGraph); |
| 192 uint32_t size = 0; | 192 uint32_t size = 0; |
| 193 if (!iter->ReadUInt32(&size)) | 193 if (!iter->ReadUInt32(&size)) |
| 194 return nullptr; | 194 return nullptr; |
| 195 for (uint32_t i = 0; i < size; ++i) { | 195 for (uint32_t i = 0; i < size; ++i) { |
| 196 int32_t type; | 196 int32_t type; |
| 197 if (!iter->ReadInt(&type)) | 197 if (!iter->ReadInt(&type)) |
| 198 return nullptr; | 198 return nullptr; |
| 199 PP_VarType var_type = static_cast<PP_VarType>(type); | 199 PP_VarType var_type = static_cast<PP_VarType>(type); |
| 200 result->data_.push_back(base::WrapUnique(RawVarData::Create(var_type))); | 200 result->data_.push_back(base::WrapUnique(RawVarData::Create(var_type))); |
| 201 if (!result->data_.back()) |
| 202 return nullptr; |
| 201 if (!result->data_.back()->Read(var_type, m, iter)) | 203 if (!result->data_.back()->Read(var_type, m, iter)) |
| 202 return nullptr; | 204 return nullptr; |
| 203 } | 205 } |
| 204 return result; | 206 return result; |
| 205 } | 207 } |
| 206 | 208 |
| 207 std::vector<SerializedHandle*> RawVarDataGraph::GetHandles() { | 209 std::vector<SerializedHandle*> RawVarDataGraph::GetHandles() { |
| 208 std::vector<SerializedHandle*> result; | 210 std::vector<SerializedHandle*> result; |
| 209 for (size_t i = 0; i < data_.size(); ++i) { | 211 for (size_t i = 0; i < data_.size(); ++i) { |
| 210 SerializedHandle* handle = data_[i]->GetHandle(); | 212 SerializedHandle* handle = data_[i]->GetHandle(); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 if (!IPC::ReadParam(m, iter, creation_message_.get())) | 742 if (!IPC::ReadParam(m, iter, creation_message_.get())) |
| 741 return false; | 743 return false; |
| 742 } else { | 744 } else { |
| 743 creation_message_.reset(); | 745 creation_message_.reset(); |
| 744 } | 746 } |
| 745 return true; | 747 return true; |
| 746 } | 748 } |
| 747 | 749 |
| 748 } // namespace proxy | 750 } // namespace proxy |
| 749 } // namespace ppapi | 751 } // namespace ppapi |
| OLD | NEW |