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

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

Issue 1755003002: Remove MOJO_DISALLOW_COPY_AND_ASSIGN and MOJO_ALLOW_UNUSED_LOCAL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 <stddef.h> 5 #include <stddef.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "mojo/message_pump/message_pump_mojo.h" 9 #include "mojo/message_pump/message_pump_mojo.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 14 matching lines...) Expand all
25 25
26 class PingServiceImpl : public test::PingService { 26 class PingServiceImpl : public test::PingService {
27 public: 27 public:
28 explicit PingServiceImpl() {} 28 explicit PingServiceImpl() {}
29 ~PingServiceImpl() override {} 29 ~PingServiceImpl() override {}
30 30
31 // |PingService| methods: 31 // |PingService| methods:
32 void Ping(const Callback<void()>& callback) override; 32 void Ping(const Callback<void()>& callback) override;
33 33
34 private: 34 private:
35 MOJO_DISALLOW_COPY_AND_ASSIGN(PingServiceImpl); 35 DISALLOW_COPY_AND_ASSIGN(PingServiceImpl);
36 }; 36 };
37 37
38 void PingServiceImpl::Ping(const Callback<void()>& callback) { 38 void PingServiceImpl::Ping(const Callback<void()>& callback) {
39 callback.Run(); 39 callback.Run();
40 } 40 }
41 41
42 class PingPongTest { 42 class PingPongTest {
43 public: 43 public:
44 explicit PingPongTest(test::PingServicePtr service); 44 explicit PingPongTest(test::PingServicePtr service);
45 45
46 void Run(unsigned int iterations); 46 void Run(unsigned int iterations);
47 47
48 private: 48 private:
49 void OnPingDone(); 49 void OnPingDone();
50 50
51 test::PingServicePtr service_; 51 test::PingServicePtr service_;
52 unsigned int iterations_to_run_; 52 unsigned int iterations_to_run_;
53 unsigned int current_iterations_; 53 unsigned int current_iterations_;
54 54
55 MOJO_DISALLOW_COPY_AND_ASSIGN(PingPongTest); 55 DISALLOW_COPY_AND_ASSIGN(PingPongTest);
56 }; 56 };
57 57
58 PingPongTest::PingPongTest(test::PingServicePtr service) 58 PingPongTest::PingPongTest(test::PingServicePtr service)
59 : service_(std::move(service)) {} 59 : service_(std::move(service)) {}
60 60
61 void PingPongTest::Run(unsigned int iterations) { 61 void PingPongTest::Run(unsigned int iterations) {
62 iterations_to_run_ = iterations; 62 iterations_to_run_ = iterations;
63 current_iterations_ = 0; 63 current_iterations_ = 0;
64 64
65 service_->Ping([this]() { OnPingDone(); }); 65 service_->Ping([this]() { OnPingDone(); });
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 "InProcessPingPong", "1000_Inactive", 124 "InProcessPingPong", "1000_Inactive",
125 kIterations / MojoTicksToSeconds(end_time - start_time), 125 kIterations / MojoTicksToSeconds(end_time - start_time),
126 "pings/second"); 126 "pings/second");
127 127
128 delete[] inactive_services; 128 delete[] inactive_services;
129 } 129 }
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 } // namespace mojo 133 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/binding_unittest.cc ('k') | mojo/public/cpp/bindings/tests/equals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698