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

Unified Diff: content/child/webcrypto/webcrypto_util.cc

Issue 233733004: [webcrypto] Make operations run on worker threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix argument ordering bug Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/child/webcrypto/webcrypto_util.cc
diff --git a/content/child/webcrypto/webcrypto_util.cc b/content/child/webcrypto/webcrypto_util.cc
index 04382743ccb08adb2b96deb44cdd630888c11578..f80fe32933a47605e3d68e1663e411d99b816f14 100644
--- a/content/child/webcrypto/webcrypto_util.cc
+++ b/content/child/webcrypto/webcrypto_util.cc
@@ -22,25 +22,10 @@ const uint8* Uint8VectorStart(const std::vector<uint8>& data) {
return &data[0];
}
-void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned int new_size) {
- DCHECK_LE(new_size, buffer->byteLength());
-
- if (new_size == buffer->byteLength())
- return;
-
- blink::WebArrayBuffer new_buffer = blink::WebArrayBuffer::create(new_size, 1);
- DCHECK(!new_buffer.isNull());
- memcpy(new_buffer.data(), buffer->data(), new_size);
- *buffer = new_buffer;
-}
-
-blink::WebArrayBuffer CreateArrayBuffer(const uint8* data,
- unsigned int data_size) {
- blink::WebArrayBuffer buffer = blink::WebArrayBuffer::create(data_size, 1);
- DCHECK(!buffer.isNull());
- if (data_size) // data_size == 0 might mean the data pointer is invalid
- memcpy(buffer.data(), data, data_size);
- return buffer;
+uint8* Uint8VectorStart(std::vector<uint8>* data) {
+ if (data->empty())
+ return NULL;
+ return &(*data)[0];
}
// This function decodes unpadded 'base64url' encoded data, as described in
« content/child/webcrypto/webcrypto_impl.cc ('K') | « content/child/webcrypto/webcrypto_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698