summaryrefslogtreecommitdiffstats
path: root/dbus/signal_sender_verification_unittest.cc
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-27 07:12:03 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-27 07:12:03 +0000
commitdb817802ed529f7064928426ef9ba8f0d427dc2b (patch)
tree365fc0475c271846eb1814c68efcabae8bda7fa1 /dbus/signal_sender_verification_unittest.cc
parenta20f4d8098964adad07825d629dc870804897544 (diff)
downloadchromium_src-db817802ed529f7064928426ef9ba8f0d427dc2b.zip
chromium_src-db817802ed529f7064928426ef9ba8f0d427dc2b.tar.gz
chromium_src-db817802ed529f7064928426ef9ba8f0d427dc2b.tar.bz2
dbus: Stop accessing ObjectProxy::name_owner_changed_callback_ on the D-Bus thread
Accessing the callback on the D-Bus thread while changing its value may result in a race condition. Change the type of SetNameOwnerChangedCallback's argument from Signal to strings to stop worrying about on which thread the Signal gets released. BUG=298747 TEST=dbus_unittests R=satorux@chromium.org Review URL: https://codereview.chromium.org/24673006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/signal_sender_verification_unittest.cc')
-rw-r--r--dbus/signal_sender_verification_unittest.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/dbus/signal_sender_verification_unittest.cc b/dbus/signal_sender_verification_unittest.cc
index cbf4b5f..1d8f6e1 100644
--- a/dbus/signal_sender_verification_unittest.cc
+++ b/dbus/signal_sender_verification_unittest.cc
@@ -120,12 +120,9 @@ class SignalSenderVerificationTest : public testing::Test {
message_loop_.Quit();
}
- void OnNameOwnerChanged(bool* called_flag, Signal* signal) {
- MessageReader reader(signal);
- std::string name, old_owner, new_owner;
- ASSERT_TRUE(reader.PopString(&name));
- ASSERT_TRUE(reader.PopString(&old_owner));
- ASSERT_TRUE(reader.PopString(&new_owner));
+ void OnNameOwnerChanged(bool* called_flag,
+ const std::string& old_owner,
+ const std::string& new_owner) {
latest_name_owner_ = new_owner;
*called_flag = true;
message_loop_.Quit();