Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: ppapi/proxy/serialized_var.h

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.cc ('k') | ppapi/proxy/serialized_var.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.cc ('k') | ppapi/proxy/serialized_var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698