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

Side by Side Diff: Source/modules/crypto/SubtleCrypto.cpp

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/crypto/CryptoKey.cpp ('k') | Source/modules/device_light/DeviceLightEvent.cpp » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i) 184 for (unsigned i = 0; i < WTF_ARRAY_LENGTH(propertyNames); ++i)
185 copyStringProperty(propertyNames[i], dict, jsonObject.get()); 185 copyStringProperty(propertyNames[i], dict, jsonObject.get());
186 186
187 String json = jsonObject->toJSONString(); 187 String json = jsonObject->toJSONString();
188 jsonUtf8 = json.utf8(); 188 jsonUtf8 = json.utf8();
189 return true; 189 return true;
190 } 190 }
191 191
192 SubtleCrypto::SubtleCrypto() 192 SubtleCrypto::SubtleCrypto()
193 { 193 {
194 ScriptWrappable::init(this);
195 } 194 }
196 195
197 ScriptPromise SubtleCrypto::encrypt(ScriptState* scriptState, const Dictionary& rawAlgorithm, CryptoKey* key, const ArrayPiece& data) 196 ScriptPromise SubtleCrypto::encrypt(ScriptState* scriptState, const Dictionary& rawAlgorithm, CryptoKey* key, const ArrayPiece& data)
198 { 197 {
199 return startCryptoOperation(scriptState, rawAlgorithm, key, WebCryptoOperati onEncrypt, ArrayPiece(), data); 198 return startCryptoOperation(scriptState, rawAlgorithm, key, WebCryptoOperati onEncrypt, ArrayPiece(), data);
200 } 199 }
201 200
202 ScriptPromise SubtleCrypto::decrypt(ScriptState* scriptState, const Dictionary& rawAlgorithm, CryptoKey* key, const ArrayPiece& data) 201 ScriptPromise SubtleCrypto::decrypt(ScriptState* scriptState, const Dictionary& rawAlgorithm, CryptoKey* key, const ArrayPiece& data)
203 { 202 {
204 return startCryptoOperation(scriptState, rawAlgorithm, key, WebCryptoOperati onDecrypt, ArrayPiece(), data); 203 return startCryptoOperation(scriptState, rawAlgorithm, key, WebCryptoOperati onDecrypt, ArrayPiece(), data);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 return promise; 391 return promise;
393 392
394 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio nUnwrapKey, result.get())) 393 if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoOperatio nUnwrapKey, result.get()))
395 return promise; 394 return promise;
396 395
397 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result()); 396 Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrapped Key.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result());
398 return promise; 397 return promise;
399 } 398 }
400 399
401 } // namespace blink 400 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/crypto/CryptoKey.cpp ('k') | Source/modules/device_light/DeviceLightEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698