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

Side by Side Diff: mojo/public/cpp/bindings/tests/connector_unittest.cc

Issue 2660733002: Mojo C++ bindings: introduce an optional array to store transferred interface IDs in messages. (Closed)
Patch Set: . Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/public/cpp/bindings/connector.h" 5 #include "mojo/public/cpp/bindings/connector.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <utility> 10 #include <utility>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ConnectorTest() {} 92 ConnectorTest() {}
93 93
94 void SetUp() override { 94 void SetUp() override {
95 CreateMessagePipe(nullptr, &handle0_, &handle1_); 95 CreateMessagePipe(nullptr, &handle0_, &handle1_);
96 } 96 }
97 97
98 void TearDown() override {} 98 void TearDown() override {}
99 99
100 void AllocMessage(const char* text, Message* message) { 100 void AllocMessage(const char* text, Message* message) {
101 size_t payload_size = strlen(text) + 1; // Plus null terminator. 101 size_t payload_size = strlen(text) + 1; // Plus null terminator.
102 internal::MessageBuilder builder(1, payload_size); 102 internal::MessageBuilder builder(1, 0, payload_size, 0);
103 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size); 103 memcpy(builder.buffer()->Allocate(payload_size), text, payload_size);
104 104
105 *message = std::move(*builder.message()); 105 *message = std::move(*builder.message());
106 } 106 }
107 107
108 protected: 108 protected:
109 ScopedMessagePipeHandle handle0_; 109 ScopedMessagePipeHandle handle0_;
110 ScopedMessagePipeHandle handle1_; 110 ScopedMessagePipeHandle handle1_;
111 111
112 private: 112 private:
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 [](std::unique_ptr<Connector> connector) { connector.reset(); }, 590 [](std::unique_ptr<Connector> connector) { connector.reset(); },
591 base::Passed(std::move(connector))), 591 base::Passed(std::move(connector))),
592 run_loop.QuitClosure()); 592 run_loop.QuitClosure());
593 593
594 run_loop.Run(); 594 run_loop.Run();
595 } 595 }
596 596
597 } // namespace 597 } // namespace
598 } // namespace test 598 } // namespace test
599 } // namespace mojo 599 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/bindings_perftest.cc ('k') | mojo/public/cpp/bindings/tests/router_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698