| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 RTCSessionDescriptionRequestImpl* request = new RTCSessionDescriptionRequest
Impl(context, requester, successCallback, errorCallback); | 46 RTCSessionDescriptionRequestImpl* request = new RTCSessionDescriptionRequest
Impl(context, requester, successCallback, errorCallback); |
| 47 request->suspendIfNeeded(); | 47 request->suspendIfNeeded(); |
| 48 return request; | 48 return request; |
| 49 } | 49 } |
| 50 | 50 |
| 51 RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ExecutionCont
ext* context, RTCPeerConnection* requester, RTCSessionDescriptionCallback* succe
ssCallback, RTCErrorCallback* errorCallback) | 51 RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ExecutionCont
ext* context, RTCPeerConnection* requester, RTCSessionDescriptionCallback* succe
ssCallback, RTCErrorCallback* errorCallback) |
| 52 : ActiveDOMObject(context) | 52 : ActiveDOMObject(context) |
| 53 , m_successCallback(successCallback) | 53 , m_successCallback(successCallback) |
| 54 , m_errorCallback(errorCallback) | 54 , m_errorCallback(errorCallback) |
| 55 , m_requester(requester) | 55 , m_requester(requester) |
| 56 , m_context(context) |
| 56 { | 57 { |
| 57 ASSERT(m_requester); | 58 ASSERT(m_requester); |
| 58 } | 59 } |
| 59 | 60 |
| 60 RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl() | 61 RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl() |
| 61 { | 62 { |
| 62 } | 63 } |
| 63 | 64 |
| 64 void RTCSessionDescriptionRequestImpl::requestSucceeded(const WebRTCSessionDescr
iption& webSessionDescription) | 65 void RTCSessionDescriptionRequestImpl::requestSucceeded(const WebRTCSessionDescr
iption& webSessionDescription) |
| 65 { | 66 { |
| 66 bool shouldFireCallback = m_requester ? m_requester->shouldFireDefaultCallba
cks() : false; | 67 bool shouldFireCallback = m_requester ? m_requester->shouldFireDefaultCallba
cks() : false; |
| 67 if (shouldFireCallback && m_successCallback) | 68 if (shouldFireCallback && m_successCallback) |
| 68 m_successCallback->handleEvent(RTCSessionDescription::create(webSessionD
escription)); | 69 m_successCallback->handleEvent(RTCSessionDescription::create(m_context,
webSessionDescription)); |
| 69 clear(); | 70 clear(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void RTCSessionDescriptionRequestImpl::requestFailed(const String& error) | 73 void RTCSessionDescriptionRequestImpl::requestFailed(const String& error) |
| 73 { | 74 { |
| 74 bool shouldFireCallback = m_requester ? m_requester->shouldFireDefaultCallba
cks() : false; | 75 bool shouldFireCallback = m_requester ? m_requester->shouldFireDefaultCallba
cks() : false; |
| 75 if (shouldFireCallback && m_errorCallback) | 76 if (shouldFireCallback && m_errorCallback) |
| 76 m_errorCallback->handleEvent(error); | 77 m_errorCallback->handleEvent(error); |
| 77 | 78 |
| 78 clear(); | 79 clear(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 93 DEFINE_TRACE(RTCSessionDescriptionRequestImpl) | 94 DEFINE_TRACE(RTCSessionDescriptionRequestImpl) |
| 94 { | 95 { |
| 95 visitor->trace(m_successCallback); | 96 visitor->trace(m_successCallback); |
| 96 visitor->trace(m_errorCallback); | 97 visitor->trace(m_errorCallback); |
| 97 visitor->trace(m_requester); | 98 visitor->trace(m_requester); |
| 98 RTCSessionDescriptionRequest::trace(visitor); | 99 RTCSessionDescriptionRequest::trace(visitor); |
| 99 ActiveDOMObject::trace(visitor); | 100 ActiveDOMObject::trace(visitor); |
| 100 } | 101 } |
| 101 | 102 |
| 102 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |