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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.cpp

Issue 2583093002: Reduce SuspendableObjects (Closed)
Patch Set: Created 4 years 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 16 matching lines...) Expand all
27 #include "modules/mediastream/MediaStreamTrack.h" 27 #include "modules/mediastream/MediaStreamTrack.h"
28 #include "modules/peerconnection/RTCPeerConnection.h" 28 #include "modules/peerconnection/RTCPeerConnection.h"
29 #include "modules/peerconnection/RTCStatsCallback.h" 29 #include "modules/peerconnection/RTCStatsCallback.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 RTCStatsRequestImpl* RTCStatsRequestImpl::create(ExecutionContext* context, 33 RTCStatsRequestImpl* RTCStatsRequestImpl::create(ExecutionContext* context,
34 RTCPeerConnection* requester, 34 RTCPeerConnection* requester,
35 RTCStatsCallback* callback, 35 RTCStatsCallback* callback,
36 MediaStreamTrack* selector) { 36 MediaStreamTrack* selector) {
37 RTCStatsRequestImpl* request = 37 return new RTCStatsRequestImpl(context, requester, callback, selector);
38 new RTCStatsRequestImpl(context, requester, callback, selector);
39 request->suspendIfNeeded();
40 return request;
41 } 38 }
42 39
43 RTCStatsRequestImpl::RTCStatsRequestImpl(ExecutionContext* context, 40 RTCStatsRequestImpl::RTCStatsRequestImpl(ExecutionContext* context,
44 RTCPeerConnection* requester, 41 RTCPeerConnection* requester,
45 RTCStatsCallback* callback, 42 RTCStatsCallback* callback,
46 MediaStreamTrack* selector) 43 MediaStreamTrack* selector)
47 : SuspendableObject(context), 44 : ContextLifecycleObserver(context),
48 m_successCallback(callback), 45 m_successCallback(callback),
49 m_component(selector ? selector->component() : 0), 46 m_component(selector ? selector->component() : 0),
50 m_requester(requester) { 47 m_requester(requester) {
51 DCHECK(m_requester); 48 DCHECK(m_requester);
52 } 49 }
53 50
54 RTCStatsRequestImpl::~RTCStatsRequestImpl() {} 51 RTCStatsRequestImpl::~RTCStatsRequestImpl() {}
55 52
56 RTCStatsResponseBase* RTCStatsRequestImpl::createResponse() { 53 RTCStatsResponseBase* RTCStatsRequestImpl::createResponse() {
57 return RTCStatsResponse::create(); 54 return RTCStatsResponse::create();
(...skipping 22 matching lines...) Expand all
80 void RTCStatsRequestImpl::clear() { 77 void RTCStatsRequestImpl::clear() {
81 m_successCallback.clear(); 78 m_successCallback.clear();
82 m_requester.clear(); 79 m_requester.clear();
83 } 80 }
84 81
85 DEFINE_TRACE(RTCStatsRequestImpl) { 82 DEFINE_TRACE(RTCStatsRequestImpl) {
86 visitor->trace(m_successCallback); 83 visitor->trace(m_successCallback);
87 visitor->trace(m_component); 84 visitor->trace(m_component);
88 visitor->trace(m_requester); 85 visitor->trace(m_requester);
89 RTCStatsRequest::trace(visitor); 86 RTCStatsRequest::trace(visitor);
90 SuspendableObject::trace(visitor); 87 ContextLifecycleObserver::trace(visitor);
91 } 88 }
92 89
93 } // namespace blink 90 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698