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 25 matching lines...) Expand all Loading... |
36 namespace WebKit { | 36 namespace WebKit { |
37 | 37 |
38 void WebCryptoResult::completeWithError() | 38 void WebCryptoResult::completeWithError() |
39 { | 39 { |
40 m_impl->completeWithError(); | 40 m_impl->completeWithError(); |
41 reset(); | 41 reset(); |
42 } | 42 } |
43 | 43 |
44 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer) | 44 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer) |
45 { | 45 { |
| 46 RELEASE_ASSERT(!buffer.isNull()); |
46 m_impl->completeWithBuffer(buffer); | 47 m_impl->completeWithBuffer(buffer); |
47 reset(); | 48 reset(); |
48 } | 49 } |
49 | 50 |
50 void WebCryptoResult::completeWithBuffer(const void* bytes, size_t bytesSize) | 51 void WebCryptoResult::completeWithBuffer(const void* bytes, size_t bytesSize) |
51 { | 52 { |
52 WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1); | 53 WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1); |
| 54 RELEASE_ASSERT(!buffer.isNull()); |
53 memcpy(buffer.data(), bytes, bytesSize); | 55 memcpy(buffer.data(), bytes, bytesSize); |
54 completeWithBuffer(buffer); | 56 completeWithBuffer(buffer); |
55 } | 57 } |
56 | 58 |
57 void WebCryptoResult::completeWithBoolean(bool b) | 59 void WebCryptoResult::completeWithBoolean(bool b) |
58 { | 60 { |
59 m_impl->completeWithBoolean(b); | 61 m_impl->completeWithBoolean(b); |
60 reset(); | 62 reset(); |
61 } | 63 } |
62 | 64 |
(...skipping 12 matching lines...) Expand all Loading... |
75 { | 77 { |
76 m_impl = o.m_impl; | 78 m_impl = o.m_impl; |
77 } | 79 } |
78 | 80 |
79 void WebCryptoResult::assign(WebCryptoResultPrivate* impl) | 81 void WebCryptoResult::assign(WebCryptoResultPrivate* impl) |
80 { | 82 { |
81 m_impl = impl; | 83 m_impl = impl; |
82 } | 84 } |
83 | 85 |
84 } // namespace WebKit | 86 } // namespace WebKit |
OLD | NEW |