OLD | NEW |
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 static String constructIllegalTypeExceptionMessage(const String& type) | 45 static String constructIllegalTypeExceptionMessage(const String& type) |
46 { | 46 { |
47 return "Illegal value of attribute 'type' : " + type; | 47 return "Illegal value of attribute 'type' : " + type; |
48 } | 48 } |
49 | 49 |
50 RTCSessionDescription* RTCSessionDescription::create(const Dictionary& descripti
onInitDict, ExceptionState& exceptionState) | 50 RTCSessionDescription* RTCSessionDescription::create(const Dictionary& descripti
onInitDict, ExceptionState& exceptionState) |
51 { | 51 { |
52 String type; | 52 String type; |
53 bool ok = DictionaryHelper::get(descriptionInitDict, "type", type); | 53 bool ok = descriptionInitDict.get("type", type); |
54 if (ok && !verifyType(type)) { | 54 if (ok && !verifyType(type)) { |
55 exceptionState.throwDOMException(TypeMismatchError, constructIllegalType
ExceptionMessage(type)); | 55 exceptionState.throwDOMException(TypeMismatchError, constructIllegalType
ExceptionMessage(type)); |
56 return nullptr; | 56 return nullptr; |
57 } | 57 } |
58 | 58 |
59 String sdp; | 59 String sdp; |
60 DictionaryHelper::get(descriptionInitDict, "sdp", sdp); | 60 descriptionInitDict.get("sdp", sdp); |
61 | 61 |
62 return new RTCSessionDescription(WebRTCSessionDescription(type, sdp)); | 62 return new RTCSessionDescription(WebRTCSessionDescription(type, sdp)); |
63 } | 63 } |
64 | 64 |
65 RTCSessionDescription* RTCSessionDescription::create(WebRTCSessionDescription we
bSessionDescription) | 65 RTCSessionDescription* RTCSessionDescription::create(WebRTCSessionDescription we
bSessionDescription) |
66 { | 66 { |
67 return new RTCSessionDescription(webSessionDescription); | 67 return new RTCSessionDescription(webSessionDescription); |
68 } | 68 } |
69 | 69 |
70 RTCSessionDescription::RTCSessionDescription(WebRTCSessionDescription webSession
Description) | 70 RTCSessionDescription::RTCSessionDescription(WebRTCSessionDescription webSession
Description) |
(...skipping 23 matching lines...) Expand all Loading... |
94 { | 94 { |
95 m_webSessionDescription.setSDP(sdp); | 95 m_webSessionDescription.setSDP(sdp); |
96 } | 96 } |
97 | 97 |
98 WebRTCSessionDescription RTCSessionDescription::webSessionDescription() | 98 WebRTCSessionDescription RTCSessionDescription::webSessionDescription() |
99 { | 99 { |
100 return m_webSessionDescription; | 100 return m_webSessionDescription; |
101 } | 101 } |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
OLD | NEW |