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

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

Issue 2329433002: Add use counter for offerToReceiveAudio/offerToReceiveVideo (Closed)
Patch Set: one counter Created 4 years, 3 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 * 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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 493 }
494 494
495 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTC OfferOptions& options) 495 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, const RTC OfferOptions& options)
496 { 496 {
497 if (m_signalingState == SignalingStateClosed) 497 if (m_signalingState == SignalingStateClosed)
498 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(InvalidStateError, kSignalingStateClosedMessage)); 498 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(InvalidStateError, kSignalingStateClosedMessage));
499 499
500 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 500 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
501 ScriptPromise promise = resolver->promise(); 501 ScriptPromise promise = resolver->promise();
502 RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestPromiseI mpl::create(this, resolver); 502 RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestPromiseI mpl::create(this, resolver);
503 if (options.hasOfferToReceiveAudio() || options.hasOfferToReceiveVideo()) {
504 ExecutionContext* context = scriptState->getExecutionContext();
505 UseCounter::count(context, UseCounter::RTCPeerConnectionCreateOfferOptio nsOfferToReceive);
506 }
503 m_peerHandler->createOffer(request, convertToWebRTCOfferOptions(options)); 507 m_peerHandler->createOffer(request, convertToWebRTCOfferOptions(options));
504 return promise; 508 return promise;
505 } 509 }
506 510
507 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, RTCSessio nDescriptionCallback* successCallback, RTCPeerConnectionErrorCallback* errorCall back, const Dictionary& rtcOfferOptions) 511 ScriptPromise RTCPeerConnection::createOffer(ScriptState* scriptState, RTCSessio nDescriptionCallback* successCallback, RTCPeerConnectionErrorCallback* errorCall back, const Dictionary& rtcOfferOptions)
508 { 512 {
509 DCHECK(successCallback); 513 DCHECK(successCallback);
510 DCHECK(errorCallback); 514 DCHECK(errorCallback);
511 ExecutionContext* context = scriptState->getExecutionContext(); 515 ExecutionContext* context = scriptState->getExecutionContext();
512 UseCounter::count(context, UseCounter::RTCPeerConnectionCreateOfferLegacyFai lureCallback); 516 UseCounter::count(context, UseCounter::RTCPeerConnectionCreateOfferLegacyFai lureCallback);
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 { 1279 {
1276 visitor->trace(m_localStreams); 1280 visitor->trace(m_localStreams);
1277 visitor->trace(m_remoteStreams); 1281 visitor->trace(m_remoteStreams);
1278 visitor->trace(m_dispatchScheduledEventRunner); 1282 visitor->trace(m_dispatchScheduledEventRunner);
1279 visitor->trace(m_scheduledEvents); 1283 visitor->trace(m_scheduledEvents);
1280 EventTargetWithInlineData::trace(visitor); 1284 EventTargetWithInlineData::trace(visitor);
1281 ActiveDOMObject::trace(visitor); 1285 ActiveDOMObject::trace(visitor);
1282 } 1286 }
1283 1287
1284 } // namespace blink 1288 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698