| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "public/platform/WebCrypto.h" | 32 #include "public/platform/WebCrypto.h" |
| 33 | 33 |
| 34 #include "platform/CryptoResult.h" | 34 #include "platform/CryptoResult.h" |
| 35 #include "public/platform/WebArrayBuffer.h" | 35 #include "public/platform/WebArrayBuffer.h" |
| 36 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
| 37 #include <string.h> | 37 #include <string.h> |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 void WebCryptoResult::completeWithError() | 41 void WebCryptoResult::completeWithError(WebCryptoErrorType errorType, const WebS
tring& errorDetails) |
| 42 { | 42 { |
| 43 m_impl->completeWithError(); | 43 m_impl->completeWithError(errorType, errorDetails); |
| 44 reset(); | 44 reset(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void WebCryptoResult::completeWithError(const WebString& errorDetails) | |
| 48 { | |
| 49 m_impl->completeWithError(errorDetails); | |
| 50 reset(); | |
| 51 } | |
| 52 | |
| 53 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer) | 47 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer) |
| 54 { | 48 { |
| 55 RELEASE_ASSERT(!buffer.isNull()); | 49 RELEASE_ASSERT(!buffer.isNull()); |
| 56 m_impl->completeWithBuffer(buffer); | 50 m_impl->completeWithBuffer(buffer); |
| 57 reset(); | 51 reset(); |
| 58 } | 52 } |
| 59 | 53 |
| 60 void WebCryptoResult::completeWithBuffer(const void* bytes, unsigned bytesSize) | 54 void WebCryptoResult::completeWithBuffer(const void* bytes, unsigned bytesSize) |
| 61 { | 55 { |
| 62 WebArrayBuffer buffer = blink::WebArrayBuffer::create(bytesSize, 1); | 56 WebArrayBuffer buffer = blink::WebArrayBuffer::create(bytesSize, 1); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 { | 90 { |
| 97 m_impl.reset(); | 91 m_impl.reset(); |
| 98 } | 92 } |
| 99 | 93 |
| 100 void WebCryptoResult::assign(const WebCryptoResult& o) | 94 void WebCryptoResult::assign(const WebCryptoResult& o) |
| 101 { | 95 { |
| 102 m_impl = o.m_impl; | 96 m_impl = o.m_impl; |
| 103 } | 97 } |
| 104 | 98 |
| 105 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |