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

Unified Diff: webrtc/base/sigslot.h

Issue 2854053002: Revert of Fixing sigslot copy constructors. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/base/sigslot_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sigslot.h
diff --git a/webrtc/base/sigslot.h b/webrtc/base/sigslot.h
index 45e0da216bf5c4acc09dd47f4e11c54edfbd2165..4534ec9dae4c4f5af97c068d1949ebf682d00c5c 100644
--- a/webrtc/base/sigslot.h
+++ b/webrtc/base/sigslot.h
@@ -407,12 +407,15 @@
_signal_base& operator= (_signal_base const& that);
public:
- _signal_base(const _signal_base& o) : _signal_base_interface(&_signal_base::do_slot_disconnect, &_signal_base::do_slot_duplicate) {
+ _signal_base(const _signal_base& s) : _signal_base_interface(&_signal_base::do_slot_disconnect, &_signal_base::do_slot_duplicate) {
lock_block<mt_policy> lock(this);
- for (const auto& connection : o.m_connected_slots)
- {
- connection.getdest()->signal_connect(this);
- m_connected_slots.push_back(connection);
+ connections_list::const_iterator it = m_connected_slots.begin();
+ connections_list::const_iterator itEnd = m_connected_slots.end();
+ while(it != itEnd)
+ {
+ it->getdest()->signal_connect(this);
+ m_connected_slots.push_back(*it);
+ ++it;
}
}
@@ -525,21 +528,13 @@
{
}
- has_slots(has_slots const& o) : has_slots_interface(&has_slots::do_signal_connect, &has_slots::do_signal_disconnect, &has_slots::do_disconnect_all)
- {
- lock_block<mt_policy> lock(this);
- for (auto* sender : o.m_senders) {
- sender->slot_duplicate(&o, this);
- m_senders.insert(sender);
- }
- }
-
~has_slots()
{
this->disconnect_all();
}
private:
+ has_slots(has_slots const&);
has_slots& operator= (has_slots const&);
static void do_signal_connect(has_slots_interface* p, _signal_base_interface* sender)
« no previous file with comments | « no previous file | webrtc/base/sigslot_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698