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

Unified Diff: Source/modules/crypto/SubtleCrypto.cpp

Issue 373423002: Split Dictionary's get and convert into DictionaryHelper. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed LICENSE and windows build Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/crypto/SubtleCrypto.cpp
diff --git a/Source/modules/crypto/SubtleCrypto.cpp b/Source/modules/crypto/SubtleCrypto.cpp
index dcde256deb0ddf1ac8b28c54ca08141e145c3728..9583b2633fe9e6270ec6455aabde7ff40faf6e02 100644
--- a/Source/modules/crypto/SubtleCrypto.cpp
+++ b/Source/modules/crypto/SubtleCrypto.cpp
@@ -32,6 +32,7 @@
#include "modules/crypto/SubtleCrypto.h"
#include "bindings/core/v8/Dictionary.h"
+#include "bindings/core/v8/DictionaryHelper.h"
#include "core/dom/ExecutionContext.h"
#include "modules/crypto/CryptoKey.h"
#include "modules/crypto/CryptoResultImpl.h"
@@ -140,7 +141,7 @@ static ScriptPromise startCryptoOperation(ScriptState* scriptState, const Dictio
static bool copyStringProperty(const char* property, const Dictionary& source, JSONObject* destination)
{
String value;
- if (!source.get(property, value))
+ if (!DictionaryHelper::get(source, property, value))
return false;
destination->setString(property, value);
return true;
@@ -149,7 +150,7 @@ static bool copyStringProperty(const char* property, const Dictionary& source, J
static bool copySequenceOfStringProperty(const char* property, const Dictionary& source, JSONObject* destination)
{
Vector<String> value;
- if (!source.get(property, value))
+ if (!DictionaryHelper::get(source, property, value))
return false;
RefPtr<JSONArray> jsonArray = JSONArray::create();
for (unsigned i = 0; i < value.size(); ++i)
@@ -176,7 +177,7 @@ static bool copyJwkDictionaryToJson(const Dictionary& dict, CString& jsonUtf8, C
copyStringProperty("alg", dict, jsonObject.get());
bool ext;
- if (dict.get("ext", ext))
+ if (DictionaryHelper::get(dict, "ext", ext))
jsonObject->setBoolean("ext", ext);
const char* const propertyNames[] = { "d", "n", "e", "p", "q", "dp", "dq", "qi", "k" };

Powered by Google App Engine
This is Rietveld 408576698