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

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

Issue 410743002: [refactor] Replace custom utility function with base's "vector_as_array()" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/webcrypto/shared_crypto_unittest.cc ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_impl.cc
diff --git a/content/child/webcrypto/webcrypto_impl.cc b/content/child/webcrypto/webcrypto_impl.cc
index 437d947584c8b825c324f466084674c929527bc7..e367ae641b011de7ad3a5c2197f8d5bb392b38ba 100644
--- a/content/child/webcrypto/webcrypto_impl.cc
+++ b/content/child/webcrypto/webcrypto_impl.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"
+#include "base/stl_util.h"
#include "base/task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -119,8 +120,7 @@ void CompleteWithBufferOrError(const Status& status,
// theoretically this could overflow.
CompleteWithError(Status::ErrorUnexpected(), result);
} else {
- result->completeWithBuffer(webcrypto::Uint8VectorStart(buffer),
- buffer.size());
+ result->completeWithBuffer(vector_as_array(&buffer), buffer.size());
}
}
}
@@ -481,8 +481,7 @@ void DoExportKeyReply(scoped_ptr<ExportKeyState> state) {
CompleteWithError(state->status, &state->result);
} else {
state->result.completeWithJson(
- reinterpret_cast<const char*>(
- webcrypto::Uint8VectorStart(&state->buffer)),
+ reinterpret_cast<const char*>(vector_as_array(&state->buffer)),
state->buffer.size());
}
}
« no previous file with comments | « content/child/webcrypto/shared_crypto_unittest.cc ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698