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

Side by Side Diff: dbus/test_service.cc

Issue 8427007: Thread::Stop() must be called before any subclass's destructor completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest version as trybot-ted Created 9 years, 1 month 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
« no previous file with comments | « content/test/test_browser_thread.cc ('k') | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 TestService::TestService(const Options& options) 25 TestService::TestService(const Options& options)
26 : base::Thread("TestService"), 26 : base::Thread("TestService"),
27 dbus_thread_message_loop_proxy_(options.dbus_thread_message_loop_proxy), 27 dbus_thread_message_loop_proxy_(options.dbus_thread_message_loop_proxy),
28 on_all_methods_exported_(false, false), 28 on_all_methods_exported_(false, false),
29 num_exported_methods_(0) { 29 num_exported_methods_(0) {
30 } 30 }
31 31
32 TestService::~TestService() { 32 TestService::~TestService() {
33 Stop();
33 } 34 }
34 35
35 bool TestService::StartService() { 36 bool TestService::StartService() {
36 base::Thread::Options thread_options; 37 base::Thread::Options thread_options;
37 thread_options.message_loop_type = MessageLoop::TYPE_IO; 38 thread_options.message_loop_type = MessageLoop::TYPE_IO;
38 return StartWithOptions(thread_options); 39 return StartWithOptions(thread_options);
39 } 40 }
40 41
41 bool TestService::WaitUntilServiceIsStarted() { 42 bool TestService::WaitUntilServiceIsStarted() {
42 const base::TimeDelta timeout( 43 const base::TimeDelta timeout(
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 Response* TestService::SlowEcho(MethodCall* method_call) { 178 Response* TestService::SlowEcho(MethodCall* method_call) {
178 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms()); 179 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms());
179 return Echo(method_call); 180 return Echo(method_call);
180 } 181 }
181 182
182 Response* TestService::BrokenMethod(MethodCall* method_call) { 183 Response* TestService::BrokenMethod(MethodCall* method_call) {
183 return NULL; 184 return NULL;
184 } 185 }
185 186
186 } // namespace dbus 187 } // namespace dbus
OLDNEW
« no previous file with comments | « content/test/test_browser_thread.cc ('k') | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698