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

Side by Side Diff: Source/platform/exported/WebCryptoResult.cpp

Issue 338993002: [webcrypto] exportKey() now returns dictionary when format='jwk' (CL 2 of 2). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and fix rsa-oaep-key-manipulation.html 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/CryptoResult.h ('k') | public/platform/WebCrypto.h » ('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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 void WebCryptoResult::completeWithBuffer(const void* bytes, unsigned bytesSize) 54 void WebCryptoResult::completeWithBuffer(const void* bytes, unsigned bytesSize)
55 { 55 {
56 WebArrayBuffer buffer = blink::WebArrayBuffer::create(bytesSize, 1); 56 WebArrayBuffer buffer = blink::WebArrayBuffer::create(bytesSize, 1);
57 RELEASE_ASSERT(!buffer.isNull()); 57 RELEASE_ASSERT(!buffer.isNull());
58 memcpy(buffer.data(), bytes, bytesSize); 58 memcpy(buffer.data(), bytes, bytesSize);
59 completeWithBuffer(buffer); 59 completeWithBuffer(buffer);
60 } 60 }
61 61
62 void WebCryptoResult::completeWithJson(const char* utf8Data, unsigned length)
63 {
64 m_impl->completeWithJson(utf8Data, length);
65 reset();
66 }
67
62 void WebCryptoResult::completeWithBoolean(bool b) 68 void WebCryptoResult::completeWithBoolean(bool b)
63 { 69 {
64 m_impl->completeWithBoolean(b); 70 m_impl->completeWithBoolean(b);
65 reset(); 71 reset();
66 } 72 }
67 73
68 void WebCryptoResult::completeWithKey(const WebCryptoKey& key) 74 void WebCryptoResult::completeWithKey(const WebCryptoKey& key)
69 { 75 {
70 ASSERT(!key.isNull()); 76 ASSERT(!key.isNull());
71 m_impl->completeWithKey(key); 77 m_impl->completeWithKey(key);
(...skipping 18 matching lines...) Expand all
90 { 96 {
91 m_impl.reset(); 97 m_impl.reset();
92 } 98 }
93 99
94 void WebCryptoResult::assign(const WebCryptoResult& o) 100 void WebCryptoResult::assign(const WebCryptoResult& o)
95 { 101 {
96 m_impl = o.m_impl; 102 m_impl = o.m_impl;
97 } 103 }
98 104
99 } // namespace blink 105 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/CryptoResult.h ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698