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

Unified Diff: mojo/public/bindings/sample/generated/sample_service_internal.h

Issue 60803002: Simpler bindings, fewer files! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move more to the .cc file Created 7 years, 1 month 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
Index: mojo/public/bindings/sample/generated/sample_service_internal.h
diff --git a/mojo/public/bindings/sample/generated/sample_foo_serialization.h b/mojo/public/bindings/sample/generated/sample_service_internal.h
similarity index 51%
rename from mojo/public/bindings/sample/generated/sample_foo_serialization.h
rename to mojo/public/bindings/sample/generated/sample_service_internal.h
index 58b771404b64e32825427334d7120f785e5b76f4..fde2b3d0ae002f21952584a59d7861c911599123 100644
--- a/mojo/public/bindings/sample/generated/sample_foo_serialization.h
+++ b/mojo/public/bindings/sample/generated/sample_service_internal.h
@@ -2,19 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_
-#define MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_
+#ifndef MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_
+#define MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_
-#include "mojo/public/bindings/lib/bindings_serialization.h"
+#include <string.h>
-namespace sample {
-class Foo;
-}
+#include "mojo/public/bindings/lib/bindings_serialization.h"
+#include "mojo/public/bindings/sample/generated/sample_service.h"
namespace mojo {
namespace internal {
template <>
+class ObjectTraits<sample::Bar> {
+ public:
+ static size_t ComputeSizeOf(const sample::Bar* bar);
+ static sample::Bar* Clone(const sample::Bar* bar, Buffer* buf);
+ static void EncodePointersAndHandles(sample::Bar* bar,
+ std::vector<mojo::Handle>* handles);
+ static bool DecodePointersAndHandles(sample::Bar* bar,
+ const mojo::Message& message);
+};
+
+template <>
class ObjectTraits<sample::Foo> {
public:
static size_t ComputeSizeOf(const sample::Foo* foo);
@@ -28,4 +38,4 @@ class ObjectTraits<sample::Foo> {
} // namespace internal
} // namespace mojo
-#endif // MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_
+#endif // MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_

Powered by Google App Engine
This is Rietveld 408576698