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

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: yhirano's comments 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:
philipj_slow 2016/02/15 10:22:21 Also s/DOMError/DOMException/ here?
Guido Urdaneta 2016/02/15 16:56:51 Done.
110 return m_message;
111 case ConstraintError:
112 // This is for the cases where we can't pass back a
113 // NavigatorUserMediaError.
114 // So far, we have this in the constructor of RTCPeerConnection,
115 // which is due to be deprecated.
116 // TODO(hta): Remove this code. https://crbug.com/576581
117 return "Unsatisfiable constraint " + m_constraint;
haraken 2016/02/13 15:07:18 Shall we add: default: ASSERT_NOT_REACHED()
Guido Urdaneta 2016/02/15 16:56:51 Done.
118 }
119
120 return String();
121 }
122
102 NavigatorUserMediaError* MediaErrorState::createError() 123 NavigatorUserMediaError* MediaErrorState::createError()
103 { 124 {
104 ASSERT(m_errorType == ConstraintError); 125 ASSERT(m_errorType == ConstraintError);
105 return NavigatorUserMediaError::create(NavigatorUserMediaError::NameConstrai ntNotSatisfied, m_message, m_constraint); 126 return NavigatorUserMediaError::create(NavigatorUserMediaError::NameConstrai ntNotSatisfied, m_message, m_constraint);
106 } 127 }
107 128
108 129
109 } // namespace blink 130 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698