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

Side by Side Diff: mojo/public/cpp/bindings/tests/pickled_struct_blink.h

Issue 1832703002: Mojo: Simplify typemap usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-bindings-variant-import
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 14 matching lines...) Expand all
25 // An implementation of a hypothetical PickledStruct type specifically for 25 // An implementation of a hypothetical PickledStruct type specifically for
26 // consumers in Blink. 26 // consumers in Blink.
27 // 27 //
28 // To make things slightly more interesting, this variation of the type doesn't 28 // To make things slightly more interesting, this variation of the type doesn't
29 // support negative values. It'll DCHECK if you try to construct it with any, 29 // support negative values. It'll DCHECK if you try to construct it with any,
30 // and it will fail deserialization if negative values are decoded. 30 // and it will fail deserialization if negative values are decoded.
31 class PickledStructBlink { 31 class PickledStructBlink {
32 public: 32 public:
33 PickledStructBlink(); 33 PickledStructBlink();
34 PickledStructBlink(int foo, int bar); 34 PickledStructBlink(int foo, int bar);
35 PickledStructBlink(PickledStructBlink&& other) = default;
35 ~PickledStructBlink(); 36 ~PickledStructBlink();
36 37
38 PickledStructBlink& operator=(PickledStructBlink&& other) = default;
39
37 int foo() const { return foo_; } 40 int foo() const { return foo_; }
38 void set_foo(int foo) { 41 void set_foo(int foo) {
39 DCHECK_GE(foo, 0); 42 DCHECK_GE(foo, 0);
40 foo_ = foo; 43 foo_ = foo;
41 } 44 }
42 45
43 int bar() const { return bar_; } 46 int bar() const { return bar_; }
44 void set_bar(int bar) { 47 void set_bar(int bar) {
45 DCHECK_GE(bar, 0); 48 DCHECK_GE(bar, 0);
46 bar_ = bar; 49 bar_ = bar;
(...skipping 19 matching lines...) Expand all
66 static void Write(base::Pickle* m, const param_type& p); 69 static void Write(base::Pickle* m, const param_type& p);
67 static bool Read(const base::Pickle* m, 70 static bool Read(const base::Pickle* m,
68 base::PickleIterator* iter, 71 base::PickleIterator* iter,
69 param_type* r); 72 param_type* r);
70 static void Log(const param_type& p, std::string* l) {} 73 static void Log(const param_type& p, std::string* l) {}
71 }; 74 };
72 75
73 } // namespace IPC 76 } // namespace IPC
74 77
75 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_ 78 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_PICKLED_STRUCT_BLINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698