| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |