Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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()) | |
| 504 UseCounter::count(scriptState->getExecutionContext(), UseCounter::RTCPee rConnectionCreateOfferOptionsOfferToReceiveAudio); | |
|
Guido Urdaneta
2016/09/09 12:07:48
Would it be better to have a single counter and co
foolip
2016/09/09 12:17:00
Done.
| |
| 505 if (options.hasOfferToReceiveVideo()) | |
| 506 UseCounter::count(scriptState->getExecutionContext(), UseCounter::RTCPee rConnectionCreateOfferOptionsOfferToReceiveVideo); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |