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

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp

Issue 2520273002: binding: Makes Dictionary::hasProperty rethrow an exception. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp ('k') | no next file » | 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) 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 ScriptPromise promise = result->promise(); 843 ScriptPromise promise = result->promise();
844 result->completeWithError(error.errorType, error.errorDetails); 844 result->completeWithError(error.errorType, error.errorDetails);
845 return promise; 845 return promise;
846 } 846 }
847 847
848 // Check if |keygenAlgorithm| contains the optional DOMTimeStamp |expires| 848 // Check if |keygenAlgorithm| contains the optional DOMTimeStamp |expires|
849 // attribute. 849 // attribute.
850 Nullable<DOMTimeStamp> expires; 850 Nullable<DOMTimeStamp> expires;
851 if (keygenAlgorithm.isDictionary()) { 851 if (keygenAlgorithm.isDictionary()) {
852 Dictionary keygenAlgorithmDict = keygenAlgorithm.getAsDictionary(); 852 Dictionary keygenAlgorithmDict = keygenAlgorithm.getAsDictionary();
853 if (keygenAlgorithmDict.hasProperty("expires")) { 853 if (keygenAlgorithmDict.hasProperty("expires", exceptionState)) {
854 v8::Local<v8::Value> expiresValue; 854 v8::Local<v8::Value> expiresValue;
855 keygenAlgorithmDict.get("expires", expiresValue); 855 keygenAlgorithmDict.get("expires", expiresValue);
856 if (expiresValue->IsNumber()) { 856 if (expiresValue->IsNumber()) {
857 double expiresDouble = 857 double expiresDouble =
858 expiresValue->ToNumber(scriptState->isolate()->GetCurrentContext()) 858 expiresValue->ToNumber(scriptState->isolate()->GetCurrentContext())
859 .ToLocalChecked() 859 .ToLocalChecked()
860 ->Value(); 860 ->Value();
861 if (expiresDouble >= 0) { 861 if (expiresDouble >= 0) {
862 expires.set(static_cast<DOMTimeStamp>(expiresDouble)); 862 expires.set(static_cast<DOMTimeStamp>(expiresDouble));
863 } 863 }
864 } 864 }
865 } 865 }
866 } 866 }
867 if (exceptionState.hadException()) {
868 return ScriptPromise();
869 }
867 870
868 // Convert from WebCrypto representation to recognized WebRTCKeyParams. WebRTC 871 // Convert from WebCrypto representation to recognized WebRTCKeyParams. WebRTC
869 // supports a small subset of what are valid AlgorithmIdentifiers. 872 // supports a small subset of what are valid AlgorithmIdentifiers.
870 const char* unsupportedParamsString = 873 const char* unsupportedParamsString =
871 "The 1st argument provided is an AlgorithmIdentifier with a supported " 874 "The 1st argument provided is an AlgorithmIdentifier with a supported "
872 "algorithm name, but the parameters are not supported."; 875 "algorithm name, but the parameters are not supported.";
873 Nullable<WebRTCKeyParams> keyParams; 876 Nullable<WebRTCKeyParams> keyParams;
874 switch (cryptoAlgorithm.id()) { 877 switch (cryptoAlgorithm.id()) {
875 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5: 878 case WebCryptoAlgorithmIdRsaSsaPkcs1v1_5:
876 // name: "RSASSA-PKCS1-v1_5" 879 // name: "RSASSA-PKCS1-v1_5"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 DEFINE_TRACE(RTCPeerConnection) { 1484 DEFINE_TRACE(RTCPeerConnection) {
1482 visitor->trace(m_localStreams); 1485 visitor->trace(m_localStreams);
1483 visitor->trace(m_remoteStreams); 1486 visitor->trace(m_remoteStreams);
1484 visitor->trace(m_dispatchScheduledEventRunner); 1487 visitor->trace(m_dispatchScheduledEventRunner);
1485 visitor->trace(m_scheduledEvents); 1488 visitor->trace(m_scheduledEvents);
1486 EventTargetWithInlineData::trace(visitor); 1489 EventTargetWithInlineData::trace(visitor);
1487 ActiveDOMObject::trace(visitor); 1490 ActiveDOMObject::trace(visitor);
1488 } 1491 }
1489 1492
1490 } // namespace blink 1493 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698