Changeset 158361 in webkit
- Timestamp:
- Oct 31, 2013 9:28:14 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158360 r158361 1 2013-10-30 Alexey Proskuryakov <ap@apple.com> 2 3 CryptoAlgorithmDescriptionBuilder should support producing nested algorithms 4 https://bugs.webkit.org/show_bug.cgi?id=123461 5 6 Reviewed by Darin Adler. 7 8 To add a nested algorithm, clone a builder with createEmptyClone(), fill it, 9 and add it using add(). 10 11 * bindings/js/JSCryptoAlgorithmBuilder.h: 12 * crypto/CryptoAlgorithmDescriptionBuilder.h: 13 * bindings/js/JSCryptoAlgorithmBuilder.cpp: 14 (WebCore::JSCryptoAlgorithmBuilder::createEmptyClone): 15 (WebCore::JSCryptoAlgorithmBuilder::add): Keep VM in a local variable for marginally 16 better performance. 17 1 18 2013-10-31 Philippe Normand <pnormand@igalia.com> 2 19 -
trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
r157936 r158361 45 45 } 46 46 47 void JSCryptoAlgorithmBuilder::add(const char* key, unsigned long value) 47 std::unique_ptr<CryptoAlgorithmDescriptionBuilder> JSCryptoAlgorithmBuilder::createEmptyClone() const 48 48 { 49 Identifier identifier(m_exec, key); 50 m_dictionary->putDirect(m_exec->vm(), identifier, jsNumber(value)); 49 return std::make_unique<JSCryptoAlgorithmBuilder>(m_exec); 50 } 51 52 void JSCryptoAlgorithmBuilder::add(const char* key, unsigned value) 53 { 54 VM& vm = m_exec->vm(); 55 Identifier identifier(&vm, key); 56 m_dictionary->putDirect(vm, identifier, jsNumber(value)); 51 57 } 52 58 53 59 void JSCryptoAlgorithmBuilder::add(const char* key, const String& value) 54 60 { 55 Identifier identifier(m_exec, key); 56 m_dictionary->putDirect(m_exec->vm(), identifier, jsString(m_exec, value)); 61 VM& vm = m_exec->vm(); 62 Identifier identifier(&vm, key); 63 m_dictionary->putDirect(vm, identifier, jsString(m_exec, value)); 64 } 65 66 void JSCryptoAlgorithmBuilder::add(const char* key, const CryptoAlgorithmDescriptionBuilder& nestedBuilder) 67 { 68 VM& vm = m_exec->vm(); 69 Identifier identifier(&vm, key); 70 const JSCryptoAlgorithmBuilder& jsBuilder = static_cast<const JSCryptoAlgorithmBuilder&>(nestedBuilder); 71 m_dictionary->putDirect(vm, identifier, jsBuilder.result()); 57 72 } 58 73 -
trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h
r157936 r158361 43 43 virtual ~JSCryptoAlgorithmBuilder(); 44 44 45 JSC::JSObject* result() { return m_dictionary; }45 JSC::JSObject* result() const { return m_dictionary; } 46 46 47 virtual void add(const char*, unsigned long) OVERRIDE; 47 virtual std::unique_ptr<CryptoAlgorithmDescriptionBuilder> createEmptyClone() const OVERRIDE; 48 49 virtual void add(const char*, unsigned) OVERRIDE; 48 50 virtual void add(const char*, const String&) OVERRIDE; 51 virtual void add(const char*, const CryptoAlgorithmDescriptionBuilder&) OVERRIDE; 49 52 50 53 private: -
trunk/Source/WebCore/crypto/CryptoAlgorithmDescriptionBuilder.h
r157936 r158361 40 40 virtual ~CryptoAlgorithmDescriptionBuilder(); 41 41 42 virtual void add(const char*, unsigned long) = 0; 42 virtual std::unique_ptr<CryptoAlgorithmDescriptionBuilder> createEmptyClone() const = 0; 43 44 virtual void add(const char*, unsigned) = 0; 43 45 virtual void add(const char*, const String&) = 0; 46 virtual void add(const char*, const CryptoAlgorithmDescriptionBuilder&) = 0; 44 47 }; 45 48
Note: See TracChangeset
for help on using the changeset viewer.