OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "dbus/test_service.h" | 5 #include "dbus/test_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
11 #include "dbus/exported_object.h" | 11 #include "dbus/exported_object.h" |
12 #include "dbus/message.h" | 12 #include "dbus/message.h" |
13 | 13 |
14 namespace dbus { | 14 namespace dbus { |
15 | 15 |
16 // Echo, SlowEcho, BrokenMethod. | 16 // Echo, SlowEcho, BrokenMethod. |
17 const int TestService::kNumMethodsToExport = 3; | 17 const int TestService::kNumMethodsToExport = 3; |
18 | 18 |
19 TestService::Options::Options() | 19 TestService::Options::Options() { |
20 : dbus_thread(NULL) { | |
21 } | 20 } |
22 | 21 |
23 TestService::Options::~Options() { | 22 TestService::Options::~Options() { |
24 } | 23 } |
25 | 24 |
26 TestService::TestService(const Options& options) | 25 TestService::TestService(const Options& options) |
27 : base::Thread("TestService"), | 26 : base::Thread("TestService"), |
28 dbus_thread_(options.dbus_thread), | 27 dbus_thread_(options.dbus_thread), |
29 on_all_methods_exported_(false, false), | 28 on_all_methods_exported_(false, false), |
30 num_exported_methods_(0) { | 29 num_exported_methods_(0) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 Response* TestService::SlowEcho(MethodCall* method_call) { | 157 Response* TestService::SlowEcho(MethodCall* method_call) { |
159 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms()); | 158 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms()); |
160 return Echo(method_call); | 159 return Echo(method_call); |
161 } | 160 } |
162 | 161 |
163 Response* TestService::BrokenMethod(MethodCall* method_call) { | 162 Response* TestService::BrokenMethod(MethodCall* method_call) { |
164 return NULL; | 163 return NULL; |
165 } | 164 } |
166 | 165 |
167 } // namespace dbus | 166 } // namespace dbus |
OLD | NEW |