| Index: ppapi/proxy/serialized_var.h
|
| diff --git a/ppapi/proxy/serialized_var.h b/ppapi/proxy/serialized_var.h
|
| index f2835909233fccac7c670207fd1976845e6ff62f..7c3349f79920529e359c47bce67719b8c8b5e177 100644
|
| --- a/ppapi/proxy/serialized_var.h
|
| +++ b/ppapi/proxy/serialized_var.h
|
| @@ -15,6 +15,7 @@
|
| #include "ppapi/c/pp_instance.h"
|
| #include "ppapi/c/pp_var.h"
|
| #include "ppapi/proxy/ppapi_proxy_export.h"
|
| +#include "ppapi/proxy/raw_var_data.h"
|
| #include "ppapi/proxy/serialized_handle.h"
|
| #include "ppapi/proxy/serialized_structs.h"
|
| #include "ppapi/proxy/var_serialization_rules.h"
|
| @@ -83,12 +84,8 @@ class PPAPI_PROXY_EXPORT SerializedVar {
|
| return inner_->ReadFromMessage(m, iter);
|
| }
|
|
|
| - // Used by chrome/nacl/nacl_ipc_adapter.cc
|
| - SerializedHandle* GetPluginShmemHandle() const {
|
| - return inner_->GetPluginShmemHandle();
|
| - }
|
| - void WriteRawVarHeader(IPC::Message* m) const {
|
| - inner_->WriteRawVarHeader(m);
|
| + RawVarDataGraph* raw_var_data() const {
|
| + return inner_->raw_var_data();
|
| }
|
|
|
| protected:
|
| @@ -113,6 +110,10 @@ class PPAPI_PROXY_EXPORT SerializedVar {
|
| serialization_rules_ = serialization_rules;
|
| }
|
|
|
| + RawVarDataGraph* raw_var_data() {
|
| + return raw_var_data_.get();
|
| + }
|
| +
|
| // See outer class's declarations above.
|
| PP_Var GetVar();
|
| void SetVar(PP_Var var);
|
| @@ -129,12 +130,6 @@ class PPAPI_PROXY_EXPORT SerializedVar {
|
| void SetCleanupModeToEndSendPassRef();
|
| void SetCleanupModeToEndReceiveCallerOwned();
|
|
|
| - // Returns a handle in the underlying data, if it exists.
|
| - SerializedHandle* GetPluginShmemHandle() const;
|
| -
|
| - // Writes raw var data, excluding handles.
|
| - void WriteRawVarHeader(IPC::Message* m) const;
|
| -
|
| private:
|
| enum CleanupMode {
|
| // The serialized var won't do anything special in the destructor
|
| @@ -148,32 +143,6 @@ class PPAPI_PROXY_EXPORT SerializedVar {
|
| END_RECEIVE_CALLER_OWNED
|
| };
|
|
|
| - // Enum for array buffer message types.
|
| - enum ShmemType {
|
| - ARRAY_BUFFER_NO_SHMEM,
|
| - ARRAY_BUFFER_SHMEM_HOST,
|
| - ARRAY_BUFFER_SHMEM_PLUGIN,
|
| - };
|
| -
|
| - // ReadFromMessage() may be called on the I/O thread, e.g., when reading the
|
| - // reply to a sync message. We cannot use the var tracker on the I/O thread,
|
| - // which means we cannot create PP_Var for PP_VARTYPE_STRING and
|
| - // PP_VARTYPE_ARRAY_BUFFER in ReadFromMessage(). So we save the raw var data
|
| - // and create PP_Var later when GetVar() is called, which should happen on
|
| - // the main thread.
|
| - struct RawVarData {
|
| - PP_VarType type;
|
| - ShmemType shmem_type;
|
| - std::string data;
|
| - uint32 shmem_size;
|
| - int host_handle_id;
|
| - SerializedHandle plugin_handle;
|
| - };
|
| -
|
| - // Converts |raw_var_data_| to |var_|. It is a no-op if |raw_var_data_| is
|
| - // NULL.
|
| - void ConvertRawVarData();
|
| -
|
| // Rules for serializing and deserializing vars for this process type.
|
| // This may be NULL, but must be set before trying to serialize to IPC when
|
| // sending, or before converting back to a PP_Var when receiving.
|
| @@ -200,10 +169,12 @@ class PPAPI_PROXY_EXPORT SerializedVar {
|
| mutable bool has_been_deserialized_;
|
| #endif
|
|
|
| - // It will be non-NULL if there is PP_VARTYPE_STRING or
|
| - // PP_VARTYPE_ARRAY_BUFFER data from ReadFromMessage() that hasn't been
|
| - // converted to PP_Var.
|
| - scoped_ptr<RawVarData> raw_var_data_;
|
| + // ReadFromMessage() may be called on the I/O thread, e.g., when reading the
|
| + // reply to a sync message. We cannot use the var tracker on the I/O thread,
|
| + // which means we cannot create some types of PP_Var
|
| + // (e.g. PP_VARTYPE_STRING). The data is stored in |raw_var_data_| and the
|
| + // PP_Var is constructed when |GetVar()| is called.
|
| + scoped_ptr<RawVarDataGraph> raw_var_data_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(Inner);
|
| };
|
| @@ -499,9 +470,6 @@ class PPAPI_PROXY_EXPORT SerializedVarTestReader : public SerializedVar {
|
| public:
|
| explicit SerializedVarTestReader(const SerializedVar& var);
|
|
|
| - // The "incomplete" var is the one sent over the wire. Strings and object
|
| - // IDs have not yet been converted, so this is the thing that tests will
|
| - // actually want to check.
|
| PP_Var GetVar() const { return inner_->GetVar(); }
|
| };
|
|
|
|
|