| 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 #ifndef PPAPI_PROXY_SERIALIZED_VAR_H_ | 5 #ifndef PPAPI_PROXY_SERIALIZED_VAR_H_ |
| 6 #define PPAPI_PROXY_SERIALIZED_VAR_H_ | 6 #define PPAPI_PROXY_SERIALIZED_VAR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
| 18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
| 19 #include "ppapi/proxy/ppapi_proxy_export.h" | 19 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 20 #include "ppapi/proxy/raw_var_data.h" | 20 #include "ppapi/proxy/raw_var_data.h" |
| 21 #include "ppapi/proxy/serialized_handle.h" | 21 #include "ppapi/proxy/serialized_handle.h" |
| 22 #include "ppapi/proxy/serialized_structs.h" | 22 #include "ppapi/proxy/serialized_structs.h" |
| 23 #include "ppapi/proxy/var_serialization_rules.h" | 23 #include "ppapi/proxy/var_serialization_rules.h" |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class PickleIterator; | 26 class PickleIterator; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // deserialized once. These flags help us assert this is true. | 191 // deserialized once. These flags help us assert this is true. |
| 192 mutable bool has_been_serialized_; | 192 mutable bool has_been_serialized_; |
| 193 mutable bool has_been_deserialized_; | 193 mutable bool has_been_deserialized_; |
| 194 #endif | 194 #endif |
| 195 | 195 |
| 196 // ReadFromMessage() may be called on the I/O thread, e.g., when reading the | 196 // ReadFromMessage() may be called on the I/O thread, e.g., when reading the |
| 197 // reply to a sync message. We cannot use the var tracker on the I/O thread, | 197 // reply to a sync message. We cannot use the var tracker on the I/O thread, |
| 198 // which means we cannot create some types of PP_Var | 198 // which means we cannot create some types of PP_Var |
| 199 // (e.g. PP_VARTYPE_STRING). The data is stored in |raw_var_data_| and the | 199 // (e.g. PP_VARTYPE_STRING). The data is stored in |raw_var_data_| and the |
| 200 // PP_Var is constructed when |GetVar()| is called. | 200 // PP_Var is constructed when |GetVar()| is called. |
| 201 scoped_ptr<RawVarDataGraph> raw_var_data_; | 201 std::unique_ptr<RawVarDataGraph> raw_var_data_; |
| 202 | 202 |
| 203 DISALLOW_COPY_AND_ASSIGN(Inner); | 203 DISALLOW_COPY_AND_ASSIGN(Inner); |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 SerializedVar(VarSerializationRules* serialization_rules); | 206 SerializedVar(VarSerializationRules* serialization_rules); |
| 207 | 207 |
| 208 mutable scoped_refptr<Inner> inner_; | 208 mutable scoped_refptr<Inner> inner_; |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 // Helpers for message sending side -------------------------------------------- | 211 // Helpers for message sending side -------------------------------------------- |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 public: | 495 public: |
| 496 explicit SerializedVarTestReader(const SerializedVar& var); | 496 explicit SerializedVarTestReader(const SerializedVar& var); |
| 497 | 497 |
| 498 PP_Var GetVar() const { return inner_->GetVar(); } | 498 PP_Var GetVar() const { return inner_->GetVar(); } |
| 499 }; | 499 }; |
| 500 | 500 |
| 501 } // namespace proxy | 501 } // namespace proxy |
| 502 } // namespace ppapi | 502 } // namespace ppapi |
| 503 | 503 |
| 504 #endif // PPAPI_PROXY_SERIALIZED_VAR_H_ | 504 #endif // PPAPI_PROXY_SERIALIZED_VAR_H_ |
| OLD | NEW |