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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaErrorState.cpp

Issue 1661493002: Add promise-based addIceCandidate, setLocalDescription and setRemoteDescription to RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // This is for the cases where we can't pass back a 92 // This is for the cases where we can't pass back a
93 // NavigatorUserMediaError. 93 // NavigatorUserMediaError.
94 // So far, we have this in the constructor of RTCPeerConnection, 94 // So far, we have this in the constructor of RTCPeerConnection,
95 // which is due to be deprecated. 95 // which is due to be deprecated.
96 // TODO(hta): Remove this code. https://crbug.com/576581 96 // TODO(hta): Remove this code. https://crbug.com/576581
97 target.throwDOMException(NotSupportedError, "Unsatisfiable constraint " + m_constraint); 97 target.throwDOMException(NotSupportedError, "Unsatisfiable constraint " + m_constraint);
98 break; 98 break;
99 } 99 }
100 } 100 }
101 101
102 String MediaErrorState::getErrorMessage()
103 {
104 switch (m_errorType) {
105 case NoError:
106 ASSERT_NOT_REACHED();
107 break;
108 case TypeError:
109 case DOMError:
110 return m_message;
111 break;
yhirano 2016/02/10 18:13:22 Is this "break" needed?
Guido Urdaneta 2016/02/10 20:21:28 Done.
112 case ConstraintError:
113 // This is for the cases where we can't pass back a
114 // NavigatorUserMediaError.
115 // So far, we have this in the constructor of RTCPeerConnection,
116 // which is due to be deprecated.
117 // TODO(hta): Remove this code. https://crbug.com/576581
118 return String("Unsatisfiable constraint " + m_constraint);
yhirano 2016/02/10 18:13:22 return "Unsatisfiable constant" + m_constraint;
Guido Urdaneta 2016/02/10 20:21:28 Done.
119 break;
yhirano 2016/02/10 18:13:22 ditto
Guido Urdaneta 2016/02/10 20:21:28 Done.
120 }
121
122 return String();
123 }
124
102 NavigatorUserMediaError* MediaErrorState::createError() 125 NavigatorUserMediaError* MediaErrorState::createError()
103 { 126 {
104 ASSERT(m_errorType == ConstraintError); 127 ASSERT(m_errorType == ConstraintError);
105 return NavigatorUserMediaError::create(NavigatorUserMediaError::NameConstrai ntNotSatisfied, m_message, m_constraint); 128 return NavigatorUserMediaError::create(NavigatorUserMediaError::NameConstrai ntNotSatisfied, m_message, m_constraint);
106 } 129 }
107 130
108 131
109 } // namespace blink 132 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698