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

Unified Diff: services/url_response_disk_cache/url_response_disk_cache_db.cc

Issue 1358353002: * Change C++ serialization/deserialization to not be move-only operations (with the except of |Ha… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: (*it).get() to it->, and other formatting Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/url_response_disk_cache/url_response_disk_cache_db.cc
diff --git a/services/url_response_disk_cache/url_response_disk_cache_db.cc b/services/url_response_disk_cache/url_response_disk_cache_db.cc
index 1991b623e38995aaeb9e1d1599d895932353461c..f7eb587a0411b890aed49108c34e4a22e01e6557 100644
--- a/services/url_response_disk_cache/url_response_disk_cache_db.cc
+++ b/services/url_response_disk_cache/url_response_disk_cache_db.cc
@@ -28,7 +28,7 @@ const char kVersionKey[] = "\1version";
template <typename T>
void Serialize(T input, std::string* output) {
typedef typename mojo::internal::WrapperTraits<T>::DataType DataType;
- size_t size = GetSerializedSize_(input);
+ size_t size = GetSerializedSize_(*input);
output->clear();
output->resize(size);
@@ -37,7 +37,7 @@ void Serialize(T input, std::string* output) {
buf.Initialize(&output->at(0), size);
DataType data_type;
- Serialize_(input.Pass(), &buf, &data_type);
+ Serialize_(input.get(), &buf, &data_type);
std::vector<Handle> handles;
data_type->EncodePointersAndHandles(&handles);
}
@@ -52,7 +52,8 @@ bool Deserialize(void* data, size_t size, T* output) {
DataType data_type = reinterpret_cast<DataType>(data);
std::vector<Handle> handles;
data_type->DecodePointersAndHandles(&handles);
- Deserialize_(data_type, output);
+ *output = mojo::internal::RemoveStructPtr<T>::type::New();
+ Deserialize_(data_type, output->get());
return true;
}
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698