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

Side by Side Diff: Source/modules/mediastream/UserMediaRequest.cpp

Issue 23444052: MediaStream API: Updating NavigatorUserMediaError (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added a test Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/mediastream/NavigatorUserMediaError.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/modules/mediastream/NavigatorUserMediaError.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698