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/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/proxy/dispatcher.h" | 10 #include "ppapi/proxy/dispatcher.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // that returns a var. This means the message handler didn't write to the | 107 // that returns a var. This means the message handler didn't write to the |
108 // output parameter, or possibly you used the wrong helper class | 108 // output parameter, or possibly you used the wrong helper class |
109 // (normally SerializedVarReturnValue). | 109 // (normally SerializedVarReturnValue). |
110 DCHECK(serialization_rules_.get()); | 110 DCHECK(serialization_rules_.get()); |
111 | 111 |
112 #ifndef NDEBUG | 112 #ifndef NDEBUG |
113 // We should only be serializing something once. | 113 // We should only be serializing something once. |
114 DCHECK(!has_been_serialized_); | 114 DCHECK(!has_been_serialized_); |
115 has_been_serialized_ = true; | 115 has_been_serialized_ = true; |
116 #endif | 116 #endif |
117 scoped_ptr<RawVarDataGraph> data = RawVarDataGraph::Create(var_, instance_); | 117 std::unique_ptr<RawVarDataGraph> data = |
| 118 RawVarDataGraph::Create(var_, instance_); |
118 if (data) { | 119 if (data) { |
119 m->WriteBool(true); // Success. | 120 m->WriteBool(true); // Success. |
120 data->Write(m, base::Bind(&DefaultHandleWriter)); | 121 data->Write(m, base::Bind(&DefaultHandleWriter)); |
121 } else { | 122 } else { |
122 m->WriteBool(false); // Failure. | 123 m->WriteBool(false); // Failure. |
123 } | 124 } |
124 } | 125 } |
125 | 126 |
126 void SerializedVar::Inner::WriteDataToMessage( | 127 void SerializedVar::Inner::WriteDataToMessage( |
127 base::Pickle* m, | 128 base::Pickle* m, |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 const std::string& str) { | 459 const std::string& str) { |
459 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); | 460 inner_->ForceSetVarValueForTest(StringVar::StringToPPVar(str)); |
460 } | 461 } |
461 | 462 |
462 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) | 463 SerializedVarTestReader::SerializedVarTestReader(const SerializedVar& var) |
463 : SerializedVar(var) { | 464 : SerializedVar(var) { |
464 } | 465 } |
465 | 466 |
466 } // namespace proxy | 467 } // namespace proxy |
467 } // namespace ppapi | 468 } // namespace ppapi |
OLD | NEW |