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

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

Issue 19384009: Rename WebCrypto::digest2 --> WebCrypto::digest (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | public/platform/WebCrypto.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 m_result->completeWithArrayBuffer(buffer); 96 m_result->completeWithArrayBuffer(buffer);
97 delete this; 97 delete this;
98 } 98 }
99 99
100 private: 100 private:
101 SHA1 m_sha1; 101 SHA1 m_sha1;
102 }; 102 };
103 103
104 class MockPlatformCrypto : public WebKit::WebCrypto { 104 class MockPlatformCrypto : public WebKit::WebCrypto {
105 public: 105 public:
106 // FIXME: delete 106 virtual void digest(const WebKit::WebCryptoAlgorithm& algorithm, WebKit::Web CryptoOperationResult* result) OVERRIDE
107 virtual WebKit::WebCryptoOperation* digest(const WebKit::WebCryptoAlgorithm& ) { return 0; }
108
109 virtual void digest2(const WebKit::WebCryptoAlgorithm& algorithm, WebKit::We bCryptoOperationResult* result) OVERRIDE
110 { 107 {
111 if (algorithm.id() == WebKit::WebCryptoAlgorithmIdSha1) { 108 if (algorithm.id() == WebKit::WebCryptoAlgorithmIdSha1) {
112 result->initializationSucceded(new MockSha1Operation(result)); 109 result->initializationSucceded(new MockSha1Operation(result));
113 } else { 110 } else {
114 // Don't fail synchronously, since existing layout tests rely on 111 // Don't fail synchronously, since existing layout tests rely on
115 // digest for testing algorithm normalization. 112 // digest for testing algorithm normalization.
116 result->initializationSucceded(new DummyOperation(result)); 113 result->initializationSucceded(new DummyOperation(result));
117 } 114 }
118 } 115 }
119 }; 116 };
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (!platformCrypto) { 166 if (!platformCrypto) {
170 ec = NotSupportedError; 167 ec = NotSupportedError;
171 return 0; 168 return 0;
172 } 169 }
173 170
174 WebKit::WebCryptoAlgorithm algorithm; 171 WebKit::WebCryptoAlgorithm algorithm;
175 if (!normalizeAlgorithm(rawAlgorithm, Digest, algorithm, ec)) 172 if (!normalizeAlgorithm(rawAlgorithm, Digest, algorithm, ec))
176 return 0; 173 return 0;
177 174
178 RefPtr<CryptoOperation> op = CryptoOperation::create(algorithm, &ec); 175 RefPtr<CryptoOperation> op = CryptoOperation::create(algorithm, &ec);
179 platformCrypto->digest2(algorithm, op.get()); 176 platformCrypto->digest(algorithm, op.get());
180 return op.release(); 177 return op.release();
181 } 178 }
182 179
183 } // namespace WebCore 180 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698