| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void CryptoOperationImpl::completeWithArrayBuffer(const WebKit::WebArrayBuffer&
buffer) | 114 void CryptoOperationImpl::completeWithArrayBuffer(const WebKit::WebArrayBuffer&
buffer) |
| 115 { | 115 { |
| 116 ASSERT(m_state == Processing || m_state == Finishing); | 116 ASSERT(m_state == Processing || m_state == Finishing); |
| 117 | 117 |
| 118 m_impl = 0; | 118 m_impl = 0; |
| 119 m_state = Done; | 119 m_state = Done; |
| 120 promiseResolver()->fulfill(PassRefPtr<ArrayBuffer>(buffer)); | 120 promiseResolver()->fulfill(PassRefPtr<ArrayBuffer>(buffer)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void CryptoOperationImpl::completeWithBoolean(bool b) |
| 124 { |
| 125 ASSERT(m_state == Processing || m_state == Finishing); |
| 126 |
| 127 m_impl = 0; |
| 128 m_state = Done; |
| 129 promiseResolver()->fulfill(ScriptValue::createBoolean(b)); |
| 130 } |
| 131 |
| 123 void CryptoOperationImpl::process(const void* bytes, size_t size) | 132 void CryptoOperationImpl::process(const void* bytes, size_t size) |
| 124 { | 133 { |
| 125 switch (m_state) { | 134 switch (m_state) { |
| 126 case Initializing: | 135 case Initializing: |
| 127 ASSERT_NOT_REACHED(); | 136 ASSERT_NOT_REACHED(); |
| 128 case Processing: | 137 case Processing: |
| 129 m_impl->process(reinterpret_cast<const unsigned char*>(bytes), size); | 138 m_impl->process(reinterpret_cast<const unsigned char*>(bytes), size); |
| 130 break; | 139 break; |
| 131 case Finishing: | 140 case Finishing: |
| 132 case Done: | 141 case Done: |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 240 } |
| 232 | 241 |
| 233 Algorithm* CryptoOperation::algorithm() | 242 Algorithm* CryptoOperation::algorithm() |
| 234 { | 243 { |
| 235 if (!m_algorithmNode) | 244 if (!m_algorithmNode) |
| 236 m_algorithmNode = Algorithm::create(m_algorithm); | 245 m_algorithmNode = Algorithm::create(m_algorithm); |
| 237 return m_algorithmNode.get(); | 246 return m_algorithmNode.get(); |
| 238 } | 247 } |
| 239 | 248 |
| 240 } // namespace WebCore | 249 } // namespace WebCore |
| OLD | NEW |