Commit 8076d148 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Make RtcEventLogOutputSink GC-ed by Oilpan

This way we are avoid raw pointers referencing to it
(see rtc_peer_connection_handler.cc|h).

BUG=787254
R=guidou@chromium.org

Change-Id: I0b3375336c6051d6ac21776335ae325a849a3d7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944370
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722466}
parent 4cfa8dfe
......@@ -834,7 +834,9 @@ class RTCPeerConnectionHandler::WebRtcSetDescriptionObserverImpl
class RTCPeerConnectionHandler::Observer
: public GarbageCollected<RTCPeerConnectionHandler::Observer>,
public PeerConnectionObserver,
public blink::RtcEventLogOutputSink {
public RtcEventLogOutputSink {
USING_GARBAGE_COLLECTED_MIXIN(Observer);
public:
Observer(const base::WeakPtr<RTCPeerConnectionHandler>& handler,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
......@@ -854,7 +856,7 @@ class RTCPeerConnectionHandler::Observer
}
}
void Trace(Visitor* visitor) {}
void Trace(Visitor* visitor) override {}
protected:
// TODO(hbos): Remove once no longer mandatory to implement.
......
......@@ -5,11 +5,12 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_EVENT_LOG_OUTPUT_SINK_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_EVENT_LOG_OUTPUT_SINK_H_
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/platform_export.h"
namespace blink {
class PLATFORM_EXPORT RtcEventLogOutputSink {
class PLATFORM_EXPORT RtcEventLogOutputSink : public GarbageCollectedMixin {
public:
virtual ~RtcEventLogOutputSink() = default;
......
......@@ -7,6 +7,7 @@
#include <memory>
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/webrtc/api/rtc_event_log_output.h"
......@@ -29,7 +30,7 @@ class PLATFORM_EXPORT RtcEventLogOutputSinkProxy final
bool Write(const std::string& output) override;
private:
RtcEventLogOutputSink* const sink_;
CrossThreadWeakPersistent<RtcEventLogOutputSink> sink_;
};
} // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment