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

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

Issue 2114523002: Move more Mojo bindings helpers out of internal namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@group-controller
Patch Set: rebase Created 4 years, 5 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 #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
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
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
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/connector_unittest.cc ('k') | mojo/public/cpp/bindings/tests/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698