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

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

Issue 235123002: Should throw TypeError instead of TypeMismatchError (modules) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 26 matching lines...) Expand all
37 #include "bindings/v8/ExceptionState.h" 37 #include "bindings/v8/ExceptionState.h"
38 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary , ExceptionState& exceptionState) 42 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary , ExceptionState& exceptionState)
43 { 43 {
44 String candidate; 44 String candidate;
45 bool ok = dictionary.get("candidate", candidate); 45 bool ok = dictionary.get("candidate", candidate);
46 if (!ok || !candidate.length()) { 46 if (!ok || !candidate.length()) {
47 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::i ncorrectPropertyType("candidate", "is not a string, or is empty.")); 47 exceptionState.throwDOMException(TypeError, ExceptionMessages::incorrect PropertyType("candidate", "is not a string, or is empty."));
48 return nullptr; 48 return nullptr;
49 } 49 }
50 50
51 String sdpMid; 51 String sdpMid;
52 dictionary.get("sdpMid", sdpMid); 52 dictionary.get("sdpMid", sdpMid);
53 53
54 unsigned short sdpMLineIndex = 0; 54 unsigned short sdpMLineIndex = 0;
55 dictionary.get("sdpMLineIndex", sdpMLineIndex); 55 dictionary.get("sdpMLineIndex", sdpMLineIndex);
56 56
57 return adoptRef(new RTCIceCandidate(blink::WebRTCICECandidate(candidate, sdp Mid, sdpMLineIndex))); 57 return adoptRef(new RTCIceCandidate(blink::WebRTCICECandidate(candidate, sdp Mid, sdpMLineIndex)));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 { 97 {
98 m_webCandidate.setSdpMid(sdpMid); 98 m_webCandidate.setSdpMid(sdpMid);
99 } 99 }
100 100
101 void RTCIceCandidate::setSdpMLineIndex(unsigned short sdpMLineIndex) 101 void RTCIceCandidate::setSdpMLineIndex(unsigned short sdpMLineIndex)
102 { 102 {
103 m_webCandidate.setSdpMLineIndex(sdpMLineIndex); 103 m_webCandidate.setSdpMLineIndex(sdpMLineIndex);
104 } 104 }
105 105
106 } // namespace WebCore 106 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/mediastream/RTCDataChannel.cpp ('k') | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698