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

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

Issue 299833008: Move AcceptWithResponder() out of the MessageReceiver interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <algorithm> 5 #include <algorithm>
6 #include <ostream> 6 #include <ostream>
7 #include <string> 7 #include <string>
8 8
9 #include "mojo/public/cpp/bindings/allocation_scope.h" 9 #include "mojo/public/cpp/bindings/allocation_scope.h"
10 #include "mojo/public/cpp/environment/environment.h" 10 #include "mojo/public/cpp/environment/environment.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 int depth = 1; 280 int depth = 1;
281 Print(depth, "foo", foo); 281 Print(depth, "foo", foo);
282 Print(depth, "baz", baz); 282 Print(depth, "baz", baz);
283 Print(depth, "port", port.get()); 283 Print(depth, "port", port.get());
284 } 284 }
285 } 285 }
286 }; 286 };
287 287
288 class ServiceProxyImpl : public ServiceProxy { 288 class ServiceProxyImpl : public ServiceProxy {
289 public: 289 public:
290 explicit ServiceProxyImpl(mojo::MessageReceiver* receiver) 290 explicit ServiceProxyImpl(mojo::MessageReceiverWithResponder* receiver)
291 : ServiceProxy(receiver) { 291 : ServiceProxy(receiver) {
292 } 292 }
293 }; 293 };
294 294
295 class SimpleMessageReceiver : public mojo::MessageReceiver { 295 class SimpleMessageReceiver : public mojo::MessageReceiverWithResponder {
296 public: 296 public:
297 virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE { 297 virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE {
298 // Imagine some IPC happened here. 298 // Imagine some IPC happened here.
299 299
300 if (g_dump_message_as_hex) { 300 if (g_dump_message_as_hex) {
301 DumpHex(reinterpret_cast<const uint8_t*>(message->data()), 301 DumpHex(reinterpret_cast<const uint8_t*>(message->data()),
302 message->data_num_bytes()); 302 message->data_num_bytes());
303 } 303 }
304 304
305 // In the receiving process, an implementation of ServiceStub is known to 305 // In the receiving process, an implementation of ServiceStub is known to
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 EXPECT_DOUBLE_EQ(1E10, full.a15()); 368 EXPECT_DOUBLE_EQ(1E10, full.a15());
369 EXPECT_DOUBLE_EQ(-1.2E+20, full.a16()); 369 EXPECT_DOUBLE_EQ(-1.2E+20, full.a16());
370 EXPECT_DOUBLE_EQ(1.23E-20, full.a17()); 370 EXPECT_DOUBLE_EQ(1.23E-20, full.a17());
371 EXPECT_TRUE(full.a18().is_null()); 371 EXPECT_TRUE(full.a18().is_null());
372 EXPECT_TRUE(full.a19().is_null()); 372 EXPECT_TRUE(full.a19().is_null());
373 EXPECT_TRUE(full.a20().is_null()); 373 EXPECT_TRUE(full.a20().is_null());
374 } 374 }
375 375
376 } // namespace 376 } // namespace
377 } // namespace sample 377 } // namespace sample
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/router_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