| OLD | NEW |
| 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/error_handler.h" | 5 #include "mojo/public/cpp/bindings/error_handler.h" |
| 6 #include "mojo/public/cpp/environment/environment.h" | 6 #include "mojo/public/cpp/environment/environment.h" |
| 7 #include "mojo/public/cpp/utility/run_loop.h" | 7 #include "mojo/public/cpp/utility/run_loop.h" |
| 8 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" | 8 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" |
| 9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" | 9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 private: | 66 private: |
| 67 double total_; | 67 double total_; |
| 68 bool got_connection_; | 68 bool got_connection_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class MathCalculatorUIImpl : public math::CalculatorUI { | 71 class MathCalculatorUIImpl : public math::CalculatorUI { |
| 72 public: | 72 public: |
| 73 explicit MathCalculatorUIImpl(math::CalculatorPtr calculator) | 73 explicit MathCalculatorUIImpl(math::CalculatorPtr calculator) |
| 74 : calculator_(calculator.Pass()), | 74 : calculator_(calculator.Pass()), |
| 75 output_(0.0) { | 75 output_(0.0) { |
| 76 calculator_->SetClient(this); | 76 calculator_.set_client(this); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool encountered_error() const { | 79 bool encountered_error() const { |
| 80 return calculator_.encountered_error(); | 80 return calculator_.encountered_error(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void Add(double value) { | 83 void Add(double value) { |
| 84 calculator_->Add(value); | 84 calculator_->Add(value); |
| 85 } | 85 } |
| 86 | 86 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // This is a test to ensure the following compiles. The sample::Port interface | 241 // This is a test to ensure the following compiles. The sample::Port interface |
| 242 // does not have an explicit Client attribute. | 242 // does not have an explicit Client attribute. |
| 243 sample::PortPtr port; | 243 sample::PortPtr port; |
| 244 MessagePipe pipe; | 244 MessagePipe pipe; |
| 245 port.Bind(pipe.handle0.Pass()); | 245 port.Bind(pipe.handle0.Pass()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace | 248 } // namespace |
| 249 } // namespace test | 249 } // namespace test |
| 250 } // namespace mojo | 250 } // namespace mojo |
| OLD | NEW |