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

Side by Side Diff: Source/modules/crypto/CryptoOperation.cpp

Issue 21561004: WebCrypto: Add crypto.subtle.verify() to the platform interfaces. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing file common.js Created 7 years, 4 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/modules/crypto/CryptoOperation.h ('k') | Source/modules/crypto/SubtleCrypto.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/modules/crypto/CryptoOperation.h ('k') | Source/modules/crypto/SubtleCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698