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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h

Issue 1876703002: Oilpan: Replace EAGERLY_FINALIZE in EventTarget's hierarchy with pre-finalizers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class RTCPeerConnection; 42 class RTCPeerConnection;
43 class WebRTCDataChannelHandler; 43 class WebRTCDataChannelHandler;
44 class WebRTCPeerConnectionHandler; 44 class WebRTCPeerConnectionHandler;
45 struct WebRTCDataChannelInit; 45 struct WebRTCDataChannelInit;
46 46
47 class MODULES_EXPORT RTCDataChannel final 47 class MODULES_EXPORT RTCDataChannel final
48 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel> 48 : public RefCountedGarbageCollectedEventTargetWithInlineData<RTCDataChannel>
49 , WTF_NON_EXPORTED_BASE(public WebRTCDataChannelHandlerClient) { 49 , WTF_NON_EXPORTED_BASE(public WebRTCDataChannelHandlerClient) {
50 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCDataChannel); 50 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(RTCDataChannel);
51 DEFINE_WRAPPERTYPEINFO(); 51 DEFINE_WRAPPERTYPEINFO();
52 USING_PRE_FINALIZER(RTCDataChannel, dispose);
52 public: 53 public:
53 static RTCDataChannel* create(ExecutionContext*, PassOwnPtr<WebRTCDataChanne lHandler>); 54 static RTCDataChannel* create(ExecutionContext*, PassOwnPtr<WebRTCDataChanne lHandler>);
54 static RTCDataChannel* create(ExecutionContext*, WebRTCPeerConnectionHandler *, const String& label, const WebRTCDataChannelInit&, ExceptionState&); 55 static RTCDataChannel* create(ExecutionContext*, WebRTCPeerConnectionHandler *, const String& label, const WebRTCDataChannelInit&, ExceptionState&);
55 ~RTCDataChannel() override; 56 ~RTCDataChannel() override;
56 57
57 ReadyState getHandlerState() const; 58 ReadyState getHandlerState() const;
58 59
59 String label() const; 60 String label() const;
60 61
61 // DEPRECATED 62 // DEPRECATED
(...skipping 24 matching lines...) Expand all
86 DEFINE_ATTRIBUTE_EVENT_LISTENER(open); 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(open);
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(bufferedamountlow); 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(bufferedamountlow);
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 89 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
89 DEFINE_ATTRIBUTE_EVENT_LISTENER(close); 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
90 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
91 92
92 // EventTarget 93 // EventTarget
93 const AtomicString& interfaceName() const override; 94 const AtomicString& interfaceName() const override;
94 ExecutionContext* getExecutionContext() const override; 95 ExecutionContext* getExecutionContext() const override;
95 96
96 // Oilpan: need to eagerly finalize m_handler
97 EAGERLY_FINALIZE();
98 DECLARE_VIRTUAL_TRACE(); 97 DECLARE_VIRTUAL_TRACE();
99 98
100 // WebRTCDataChannelHandlerClient 99 // WebRTCDataChannelHandlerClient
101 void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState) overrid e; 100 void didChangeReadyState(WebRTCDataChannelHandlerClient::ReadyState) overrid e;
102 void didDecreaseBufferedAmount(unsigned) override; 101 void didDecreaseBufferedAmount(unsigned) override;
103 void didReceiveStringData(const WebString&) override; 102 void didReceiveStringData(const WebString&) override;
104 void didReceiveRawData(const char*, size_t) override; 103 void didReceiveRawData(const char*, size_t) override;
105 void didDetectError() override; 104 void didDetectError() override;
106 105
107 private: 106 private:
108 RTCDataChannel(ExecutionContext*, PassOwnPtr<WebRTCDataChannelHandler>); 107 RTCDataChannel(ExecutionContext*, PassOwnPtr<WebRTCDataChannelHandler>);
108 void dispose();
109 109
110 void scheduleDispatchEvent(Event*); 110 void scheduleDispatchEvent(Event*);
111 void scheduledEventTimerFired(Timer<RTCDataChannel>*); 111 void scheduledEventTimerFired(Timer<RTCDataChannel>*);
112 112
113 Member<ExecutionContext> m_executionContext; 113 Member<ExecutionContext> m_executionContext;
114 114
115 OwnPtr<WebRTCDataChannelHandler> m_handler; 115 OwnPtr<WebRTCDataChannelHandler> m_handler;
116 116
117 WebRTCDataChannelHandlerClient::ReadyState m_readyState; 117 WebRTCDataChannelHandlerClient::ReadyState m_readyState;
118 118
119 enum BinaryType { 119 enum BinaryType {
120 BinaryTypeBlob, 120 BinaryTypeBlob,
121 BinaryTypeArrayBuffer 121 BinaryTypeArrayBuffer
122 }; 122 };
123 BinaryType m_binaryType; 123 BinaryType m_binaryType;
124 124
125 Timer<RTCDataChannel> m_scheduledEventTimer; 125 Timer<RTCDataChannel> m_scheduledEventTimer;
126 HeapVector<Member<Event>> m_scheduledEvents; 126 HeapVector<Member<Event>> m_scheduledEvents;
127 127
128 unsigned m_bufferedAmountLowThreshold; 128 unsigned m_bufferedAmountLowThreshold;
129 129
130 FRIEND_TEST_ALL_PREFIXES(RTCDataChannelTest, BufferedAmountLow); 130 FRIEND_TEST_ALL_PREFIXES(RTCDataChannelTest, BufferedAmountLow);
131 }; 131 };
132 132
133 } // namespace blink 133 } // namespace blink
134 134
135 #endif // RTCDataChannel_h 135 #endif // RTCDataChannel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698