OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |