| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 MediaStreamTrackVector videoTracks = stream->getVideoTracks(); | 147 MediaStreamTrackVector videoTracks = stream->getVideoTracks(); |
| 148 for (MediaStreamTrackVector::iterator iter = videoTracks.begin(); iter != vi
deoTracks.end(); ++iter) { | 148 for (MediaStreamTrackVector::iterator iter = videoTracks.begin(); iter != vi
deoTracks.end(); ++iter) { |
| 149 (*iter)->component()->source()->setConstraints(m_video); | 149 (*iter)->component()->source()->setConstraints(m_video); |
| 150 } | 150 } |
| 151 | 151 |
| 152 m_successCallback->handleEvent(stream.get()); | 152 m_successCallback->handleEvent(stream.get()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void UserMediaRequest::fail(const String& description) | 155 void UserMediaRequest::failPermissionDenied(const String& message) |
| 156 { | 156 { |
| 157 if (!executionContext()) | 157 if (!executionContext()) |
| 158 return; | 158 return; |
| 159 | 159 |
| 160 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(Navi
gatorUserMediaError::NamePermissionDenied, description, String()); | 160 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(Navi
gatorUserMediaError::NamePermissionDenied, message, String()); |
| 161 m_errorCallback->handleEvent(error.get()); | 161 m_errorCallback->handleEvent(error.get()); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void UserMediaRequest::failConstraint(const String& constraintName, const String
& description) | 164 void UserMediaRequest::failConstraint(const String& constraintName, const String
& message) |
| 165 { | 165 { |
| 166 ASSERT(!constraintName.isEmpty()); | 166 ASSERT(!constraintName.isEmpty()); |
| 167 if (!executionContext()) | 167 if (!executionContext()) |
| 168 return; | 168 return; |
| 169 | 169 |
| 170 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(Navi
gatorUserMediaError::NameConstraintNotSatisfied, description, constraintName); | 170 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(Navi
gatorUserMediaError::NameConstraintNotSatisfied, message, constraintName); |
| 171 m_errorCallback->handleEvent(error.get()); | 171 m_errorCallback->handleEvent(error.get()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void UserMediaRequest::failUASpecific(const String& name, const String& message,
const String& constraintName) |
| 175 { |
| 176 ASSERT(!name.isEmpty()); |
| 177 if (!executionContext()) |
| 178 return; |
| 179 |
| 180 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(name
, message, constraintName); |
| 181 m_errorCallback->handleEvent(error.get()); |
| 182 } |
| 183 |
| 174 void UserMediaRequest::contextDestroyed() | 184 void UserMediaRequest::contextDestroyed() |
| 175 { | 185 { |
| 176 RefPtr<UserMediaRequest> protect(this); | 186 RefPtr<UserMediaRequest> protect(this); |
| 177 | 187 |
| 178 if (m_controller) { | 188 if (m_controller) { |
| 179 m_controller->cancelUserMediaRequest(this); | 189 m_controller->cancelUserMediaRequest(this); |
| 180 m_controller = 0; | 190 m_controller = 0; |
| 181 } | 191 } |
| 182 | 192 |
| 183 ContextLifecycleObserver::contextDestroyed(); | 193 ContextLifecycleObserver::contextDestroyed(); |
| 184 } | 194 } |
| 185 | 195 |
| 186 } // namespace WebCore | 196 } // namespace WebCore |
| OLD | NEW |