OLD | NEW |
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 #include "mojo/public/cpp/bindings/tests/router_test_util.h" | 5 #include "mojo/public/cpp/bindings/tests/router_test_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 ResponseGenerator::ResponseGenerator() {} | 52 ResponseGenerator::ResponseGenerator() {} |
53 | 53 |
54 bool ResponseGenerator::Accept(Message* message) { | 54 bool ResponseGenerator::Accept(Message* message) { |
55 return false; | 55 return false; |
56 } | 56 } |
57 | 57 |
58 bool ResponseGenerator::AcceptWithResponder( | 58 bool ResponseGenerator::AcceptWithResponder( |
59 Message* message, | 59 Message* message, |
60 MessageReceiverWithStatus* responder) { | 60 MessageReceiverWithStatus* responder) { |
61 EXPECT_TRUE(message->has_flag(internal::kMessageExpectsResponse)); | 61 EXPECT_TRUE(message->has_flag(Message::kFlagExpectsResponse)); |
62 | 62 |
63 bool result = SendResponse(message->name(), message->request_id(), | 63 bool result = SendResponse(message->name(), message->request_id(), |
64 reinterpret_cast<const char*>(message->payload()), | 64 reinterpret_cast<const char*>(message->payload()), |
65 responder); | 65 responder); |
66 EXPECT_TRUE(responder->IsValid()); | 66 EXPECT_TRUE(responder->IsValid()); |
67 delete responder; | 67 delete responder; |
68 return result; | 68 return result; |
69 } | 69 } |
70 | 70 |
71 bool ResponseGenerator::SendResponse(uint32_t name, | 71 bool ResponseGenerator::SendResponse(uint32_t name, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void LazyResponseGenerator::Complete(bool send_response) { | 105 void LazyResponseGenerator::Complete(bool send_response) { |
106 if (send_response) { | 106 if (send_response) { |
107 SendResponse(name_, request_id_, request_string_.c_str(), responder_); | 107 SendResponse(name_, request_id_, request_string_.c_str(), responder_); |
108 } | 108 } |
109 delete responder_; | 109 delete responder_; |
110 responder_ = nullptr; | 110 responder_ = nullptr; |
111 } | 111 } |
112 | 112 |
113 } // namespace test | 113 } // namespace test |
114 } // namespace mojo | 114 } // namespace mojo |
OLD | NEW |