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

Side by Side Diff: Source/modules/mediastream/RTCPeerConnection.cpp

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 631
632 m_stopped = true; 632 m_stopped = true;
633 m_iceConnectionState = IceConnectionStateClosed; 633 m_iceConnectionState = IceConnectionStateClosed;
634 m_signalingState = SignalingStateClosed; 634 m_signalingState = SignalingStateClosed;
635 635
636 Vector<RefPtr<RTCDataChannel> >::iterator i = m_dataChannels.begin(); 636 Vector<RefPtr<RTCDataChannel> >::iterator i = m_dataChannels.begin();
637 for (; i != m_dataChannels.end(); ++i) 637 for (; i != m_dataChannels.end(); ++i)
638 (*i)->stop(); 638 (*i)->stop();
639 } 639 }
640 640
641 EventTargetData* RTCPeerConnection::eventTargetData()
642 {
643 return &m_eventTargetData;
644 }
645
646 EventTargetData* RTCPeerConnection::ensureEventTargetData()
647 {
648 return &m_eventTargetData;
649 }
650
651 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) 641 void RTCPeerConnection::changeSignalingState(SignalingState signalingState)
652 { 642 {
653 if (m_signalingState != SignalingStateClosed && m_signalingState != signalin gState) { 643 if (m_signalingState != SignalingStateClosed && m_signalingState != signalin gState) {
654 m_signalingState = signalingState; 644 m_signalingState = signalingState;
655 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange )); 645 scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange ));
656 } 646 }
657 } 647 }
658 648
659 void RTCPeerConnection::changeIceGatheringState(IceGatheringState iceGatheringSt ate) 649 void RTCPeerConnection::changeIceGatheringState(IceGatheringState iceGatheringSt ate)
660 { 650 {
(...skipping 25 matching lines...) Expand all
686 events.swap(m_scheduledEvents); 676 events.swap(m_scheduledEvents);
687 677
688 Vector<RefPtr<Event> >::iterator it = events.begin(); 678 Vector<RefPtr<Event> >::iterator it = events.begin();
689 for (; it != events.end(); ++it) 679 for (; it != events.end(); ++it)
690 dispatchEvent((*it).release()); 680 dispatchEvent((*it).release());
691 681
692 events.clear(); 682 events.clear();
693 } 683 }
694 684
695 } // namespace WebCore 685 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCPeerConnection.h ('k') | Source/modules/notifications/Notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698