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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 m_successCallback->handleEvent(stream.get()); | 148 m_successCallback->handleEvent(stream.get()); |
149 } | 149 } |
150 | 150 |
151 void UserMediaRequest::fail(const String& description) | 151 void UserMediaRequest::fail(const String& description) |
152 { | 152 { |
153 if (!scriptExecutionContext()) | 153 if (!scriptExecutionContext()) |
154 return; | 154 return; |
155 | 155 |
156 if (m_errorCallback) { | 156 if (m_errorCallback) { |
157 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(
"PERMISSION_DENIED", description, String()); | 157 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(
NavigatorUserMediaError::NamePermissionDenied, description, String()); |
158 m_errorCallback->handleEvent(error.get()); | 158 m_errorCallback->handleEvent(error.get()); |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 void UserMediaRequest::failConstraint(const String& constraintName, const String
& description) | 162 void UserMediaRequest::failConstraint(const String& constraintName, const String
& description) |
163 { | 163 { |
164 ASSERT(!constraintName.isEmpty()); | 164 ASSERT(!constraintName.isEmpty()); |
165 if (!scriptExecutionContext()) | 165 if (!scriptExecutionContext()) |
166 return; | 166 return; |
167 | 167 |
168 if (m_errorCallback) { | 168 if (m_errorCallback) { |
169 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(
"CONSTRAINT_NOT_SATISFIED", description, constraintName); | 169 RefPtr<NavigatorUserMediaError> error = NavigatorUserMediaError::create(
NavigatorUserMediaError::NameConstraintNotSatisfied, description, constraintName
); |
170 m_errorCallback->handleEvent(error.get()); | 170 m_errorCallback->handleEvent(error.get()); |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 void UserMediaRequest::contextDestroyed() | 174 void UserMediaRequest::contextDestroyed() |
175 { | 175 { |
176 RefPtr<UserMediaRequest> protect(this); | 176 RefPtr<UserMediaRequest> protect(this); |
177 | 177 |
178 if (m_controller) { | 178 if (m_controller) { |
179 m_controller->cancelUserMediaRequest(this); | 179 m_controller->cancelUserMediaRequest(this); |
180 m_controller = 0; | 180 m_controller = 0; |
181 } | 181 } |
182 | 182 |
183 ContextLifecycleObserver::contextDestroyed(); | 183 ContextLifecycleObserver::contextDestroyed(); |
184 } | 184 } |
185 | 185 |
186 } // namespace WebCore | 186 } // namespace WebCore |
OLD | NEW |