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

Unified Diff: base/base64.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 | « base/base64.h ('k') | base/base64_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base64.cc
diff --git a/base/base64.cc b/base/base64.cc
deleted file mode 100644
index 8ed1249257d6fd7de3472a5cc3e87a69edbe3e28..0000000000000000000000000000000000000000
--- a/base/base64.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/base64.h"
-
-#include "third_party/modp_b64/modp_b64.h"
-
-namespace base {
-
-void Base64Encode(const StringPiece& input, std::string* output) {
- std::string temp;
- temp.resize(modp_b64_encode_len(input.size())); // makes room for null byte
-
- // modp_b64_encode_len() returns at least 1, so temp[0] is safe to use.
- size_t output_size = modp_b64_encode(&(temp[0]), input.data(), input.size());
-
- temp.resize(output_size); // strips off null byte
- output->swap(temp);
-}
-
-bool Base64Decode(const StringPiece& input, std::string* output) {
- std::string temp;
- temp.resize(modp_b64_decode_len(input.size()));
-
- // does not null terminate result since result is binary data!
- size_t input_size = input.size();
- size_t output_size = modp_b64_decode(&(temp[0]), input.data(), input_size);
- if (output_size == MODP_B64_ERROR)
- return false;
-
- temp.resize(output_size);
- output->swap(temp);
- return true;
-}
-
-} // namespace base
« no previous file with comments | « base/base64.h ('k') | base/base64_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698