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

Unified Diff: content/child/webcrypto/webcrypto_impl.cc

Issue 334333004: [webcrypto] exportKey() now returns dictionary when format='jwk' (CL 1 of 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, for funzies Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_impl.cc
diff --git a/content/child/webcrypto/webcrypto_impl.cc b/content/child/webcrypto/webcrypto_impl.cc
index ef0740ba6629b69dd6efbd6beb6df0c2dd9071f9..3eed92769c9eab0fe1ae854a2ca48cb2169402f1 100644
--- a/content/child/webcrypto/webcrypto_impl.cc
+++ b/content/child/webcrypto/webcrypto_impl.cc
@@ -457,7 +457,24 @@ void DoImportKey(scoped_ptr<ImportKeyState> passed_state) {
}
void DoExportKeyReply(scoped_ptr<ExportKeyState> state) {
+#ifndef WEBCRYPTO_RESULT_ACCEPTS_JSON
+ // TODO(eroman): Remove idfef once blink rolls.
CompleteWithBufferOrError(state->status, state->buffer, &state->result);
+#else
+ if (state->format != blink::WebCryptoKeyFormatJwk) {
+ CompleteWithBufferOrError(state->status, state->buffer, &state->result);
+ return;
+ }
+
+ if (state->status.IsError()) {
+ CompleteWithError(state->status, &state->result);
+ } else {
+ state->result.completeWithJson(
+ reinterpret_cast<const char*>(
+ webcrypto::Uint8VectorStart(&state->buffer)),
+ state->buffer.size());
Ryan Sleevi 2014/06/17 19:15:20 This feels like there's a dependent CL here (perha
+ }
+#endif
}
void DoExportKey(scoped_ptr<ExportKeyState> passed_state) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698