summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/DEPS1
-rw-r--r--base/base.gyp6
-rw-r--r--base/base64.cc (renamed from net/base/base64.cc)6
-rw-r--r--base/base64.h (renamed from net/base/base64.h)10
-rw-r--r--base/base64_unittest.cc (renamed from net/base/base64_unittest.cc)6
-rw-r--r--chrome/browser/chrome_plugin_host.cc1
-rw-r--r--chrome/browser/extensions/convert_user_script.cc4
-rw-r--r--chrome/browser/extensions/extension_creator.cc1
-rw-r--r--chrome/browser/extensions/extension_tabs_module.cc4
-rw-r--r--chrome/browser/extensions/extensions_ui.cc4
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.cc4
-rw-r--r--chrome/browser/gears_integration.cc4
-rw-r--r--chrome/browser/importer/nss_decryptor.cc6
-rw-r--r--chrome/browser/metrics/metrics_log.cc4
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_util.cc6
-rw-r--r--chrome/common/extensions/extension.cc6
-rw-r--r--net/DEPS1
-rw-r--r--net/base/data_url.cc4
-rw-r--r--net/base/net_util.cc4
-rw-r--r--net/base/sdch_manager.cc4
-rw-r--r--net/base/strict_transport_security_state.cc6
-rw-r--r--net/http/http_auth_handler_basic.cc10
-rw-r--r--net/http/http_auth_handler_ntlm.cc6
-rw-r--r--net/net.gyp5
25 files changed, 59 insertions, 58 deletions
diff --git a/base/DEPS b/base/DEPS
index c454d70..5df72a6 100644
--- a/base/DEPS
+++ b/base/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+third_party/libevent",
"+third_party/dmg_fp",
+ "+third_party/modp_b64",
"+third_party/tcmalloc",
# Testing stuff shouldn't be used by the general base code.
diff --git a/base/base.gyp b/base/base.gyp
index 5ba7d4b..75ce295 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -11,6 +11,9 @@
'target_name': 'base',
'type': '<(library)',
'msvs_guid': '1832A374-8A74-4F9E-B536-69A699B3E165',
+ 'dependencies': [
+ '../third_party/modp_b64/modp_b64.gyp:modp_b64',
+ ],
'sources': [
'../build/build_config.h',
'crypto/cssm_init.cc',
@@ -70,6 +73,8 @@
'atomicops.h',
'atomicops_internals_x86_msvc.h',
'auto_reset.h',
+ 'base64.cc',
+ 'base64.h',
'base_drag_source.cc',
'base_drag_source.h',
'base_drop_target.cc',
@@ -605,6 +610,7 @@
'at_exit_unittest.cc',
'atomic_flag_unittest.cc',
'atomicops_unittest.cc',
+ 'base64_unittest.cc',
'bits_unittest.cc',
'command_line_unittest.cc',
'condition_variable_unittest.cc',
diff --git a/net/base/base64.cc b/base/base64.cc
index ee5605e..56a577d 100644
--- a/net/base/base64.cc
+++ b/base/base64.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/base64.h"
+#include "base/base64.h"
#include "third_party/modp_b64/modp_b64.h"
-namespace net {
+namespace base {
bool Base64Encode(const std::string& input, std::string* output) {
std::string temp;
@@ -38,4 +38,4 @@ bool Base64Decode(const std::string& input, std::string* output) {
return true;
}
-} // namespace net
+} // namespace base
diff --git a/net/base/base64.h b/base/base64.h
index b2e532a..d45a8a3 100644
--- a/net/base/base64.h
+++ b/base/base64.h
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_BASE_BASE64_H__
-#define NET_BASE_BASE64_H__
+#ifndef BASE_BASE64_H__
+#define BASE_BASE64_H__
#include <string>
-namespace net {
+namespace base {
// Encodes the input string in base64. Returns true if successful and false
// otherwise. The output string is only modified if successful.
@@ -17,6 +17,6 @@ bool Base64Encode(const std::string& input, std::string* output);
// otherwise. The output string is only modified if successful.
bool Base64Decode(const std::string& input, std::string* output);
-} // namespace net
+} // namespace base
-#endif // NET_BASE_BASE64_H__
+#endif // BASE_BASE64_H__
diff --git a/net/base/base64_unittest.cc b/base/base64_unittest.cc
index e2b55b2..1d11b1e 100644
--- a/net/base/base64_unittest.cc
+++ b/base/base64_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/base64.h"
+#include "base/base64.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -19,11 +19,11 @@ TEST(Base64Test, Basic) {
std::string encoded, decoded;
bool ok;
- ok = net::Base64Encode(kText, &encoded);
+ ok = base::Base64Encode(kText, &encoded);
EXPECT_TRUE(ok);
EXPECT_EQ(kBase64Text, encoded);
- ok = net::Base64Decode(encoded, &decoded);
+ ok = base::Base64Decode(encoded, &decoded);
EXPECT_TRUE(ok);
EXPECT_EQ(kText, decoded);
}
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc
index defc466..03e23ac 100644
--- a/chrome/browser/chrome_plugin_host.cc
+++ b/chrome/browser/chrome_plugin_host.cc
@@ -38,7 +38,6 @@
#include "chrome/common/net/url_request_intercept_job.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/common/render_messages.h"
-#include "net/base/base64.h"
#include "net/base/cookie_monster.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 1f5d027..814d17f 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+#include "base/base64.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/scoped_temp_dir.h"
@@ -18,7 +19,6 @@
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/json_value_serializer.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
namespace keys = extension_manifest_keys;
@@ -62,7 +62,7 @@ Extension* ConvertUserScriptToExtension(const FilePath& user_script_path,
char raw[base::SHA256_LENGTH] = {0};
std::string key;
base::SHA256HashString(script_name, raw, base::SHA256_LENGTH);
- net::Base64Encode(std::string(raw, base::SHA256_LENGTH), &key);
+ base::Base64Encode(std::string(raw, base::SHA256_LENGTH), &key);
// The script may not have a name field, but we need one for an extension. If
// it is missing, use the filename of the original URL.
diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc
index 9b8f31e..3d1fc64 100644
--- a/chrome/browser/extensions/extension_creator.cc
+++ b/chrome/browser/extensions/extension_creator.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/zip.h"
-#include "net/base/base64.h"
namespace {
const int kRSAKeySize = 1024;
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 059b97f..64ee348 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "app/gfx/codec/jpeg_codec.h"
+#include "base/base64.h"
#include "base/string_util.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
@@ -22,7 +23,6 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/url_constants.h"
-#include "net/base/base64.h"
#include "skia/ext/image_operations.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -804,7 +804,7 @@ bool CaptureVisibleTabFunction::RunImpl() {
reinterpret_cast<const char*>(&jpeg_data->data[0]),
jpeg_data->data.size());
- net::Base64Encode(stream_as_string, &base64_result);
+ base::Base64Encode(stream_as_string, &base64_result);
base64_result.insert(0, "data:image/jpg;base64,");
result_.reset(new StringValue(base64_result));
return true;
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 1025ec0..857bfee 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -9,6 +9,7 @@
#include "app/gfx/skbitmap_operations.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+#include "base/base64.h"
#include "base/file_util.h"
#include "base/string_util.h"
#include "base/thread.h"
@@ -40,7 +41,6 @@
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
-#include "net/base/base64.h"
#include "net/base/net_util.h"
#include "webkit/glue/image_decoder.h"
@@ -206,7 +206,7 @@ void ExtensionsDOMHandler::IconLoader::LoadIconsOnFileThread(
// Create a data URL (all icons are converted to PNGs during unpacking).
std::string base64_encoded;
- net::Base64Encode(file_contents, &base64_encoded);
+ base::Base64Encode(file_contents, &base64_encoded);
GURL icon_url("data:image/png;base64," + base64_encoded);
extension->SetString(L"icon", icon_url.spec());
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 65ccded..a32304e 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -7,6 +7,7 @@
#include <set>
#include "app/gfx/codec/png_codec.h"
+#include "base/base64.h"
#include "base/crypto/signature_verifier.h"
#include "base/file_util.h"
#include "base/message_loop.h"
@@ -20,7 +21,6 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_unpacker.h"
#include "chrome/common/json_value_serializer.h"
-#include "net/base/base64.h"
#include "third_party/skia/include/core/SkBitmap.h"
const char SandboxedExtensionUnpacker::kExtensionHeaderMagic[] = "Cr24";
@@ -230,7 +230,7 @@ bool SandboxedExtensionUnpacker::ValidateSignature() {
return false;
}
- net::Base64Encode(std::string(reinterpret_cast<char*>(&key.front()),
+ base::Base64Encode(std::string(reinterpret_cast<char*>(&key.front()),
key.size()), &public_key_);
return true;
}
diff --git a/chrome/browser/gears_integration.cc b/chrome/browser/gears_integration.cc
index da08df3..83da75f 100644
--- a/chrome/browser/gears_integration.cc
+++ b/chrome/browser/gears_integration.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/gears_integration.h"
#include "app/gfx/codec/png_codec.h"
+#include "base/base64.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -12,7 +13,6 @@
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/gears_api.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/dom_operations.h"
@@ -122,7 +122,7 @@ static GURL ConvertSkBitmapToDataURL(const SkBitmap& icon) {
std::string icon_data_str(reinterpret_cast<char*>(&icon_data[0]),
icon_data.size());
std::string icon_base64_encoded;
- net::Base64Encode(icon_data_str, &icon_base64_encoded);
+ base::Base64Encode(icon_data_str, &icon_base64_encoded);
GURL icon_url("data:image/png;base64," + icon_base64_encoded);
return icon_url;
diff --git a/chrome/browser/importer/nss_decryptor.cc b/chrome/browser/importer/nss_decryptor.cc
index db2c89f..38b1a66f 100644
--- a/chrome/browser/importer/nss_decryptor.cc
+++ b/chrome/browser/importer/nss_decryptor.cc
@@ -13,8 +13,8 @@
#include <pk11sdr.h>
#endif // defined(OS_LINUX)
+#include "base/base64.h"
#include "base/string_util.h"
-#include "net/base/base64.h"
#include "webkit/glue/password_form.h"
using webkit_glue::PasswordForm;
@@ -69,7 +69,7 @@ string16 NSSDecryptor::Decrypt(const std::string& crypt) const {
std::string plain;
if (crypt[0] != '~') {
std::string decoded_data;
- net::Base64Decode(crypt, &decoded_data);
+ base::Base64Decode(crypt, &decoded_data);
PK11SlotInfo* slot = GetKeySlotForDB();
SECStatus result = PK11_Authenticate(slot, PR_TRUE, NULL);
if (result != SECSuccess) {
@@ -96,7 +96,7 @@ string16 NSSDecryptor::Decrypt(const std::string& crypt) const {
FreeSlot(slot);
} else {
// Deletes the leading '~' before decoding.
- net::Base64Decode(crypt.substr(1), &plain);
+ base::Base64Decode(crypt.substr(1), &plain);
}
return UTF8ToUTF16(plain);
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index dbf3e97..922b004 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/metrics/metrics_log.h"
+#include "base/base64.h"
#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/file_version_info.h"
@@ -17,7 +18,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
#define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name)
@@ -129,7 +129,7 @@ std::string MetricsLog::CreateHash(const std::string& value) {
std::string MetricsLog::CreateBase64Hash(const std::string& string) {
std::string encoded_digest;
- if (net::Base64Encode(CreateHash(string), &encoded_digest)) {
+ if (base::Base64Encode(CreateHash(string), &encoded_digest)) {
DLOG(INFO) << "Metrics: Hash [" << encoded_digest << "]=[" << string << "]";
return encoded_digest;
}
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index b11265f..e27b46b 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/safe_browsing/protocol_manager.h"
+#include "base/base64.h"
#include "base/file_version_info.h"
#include "base/histogram.h"
#include "base/logging.h"
@@ -19,7 +20,6 @@
#include "chrome/browser/safe_browsing/protocol_parser.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/env_vars.h"
-#include "net/base/base64.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
@@ -386,7 +386,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url,
std::string data_str;
data_str.assign(data, length);
std::string encoded_chunk;
- net::Base64Encode(data, &encoded_chunk);
+ base::Base64Encode(data, &encoded_chunk);
SB_DLOG(INFO) << "ParseChunk error for chunk: " << chunk_url.url
<< ", client_key: " << client_key_
<< ", wrapped_key: " << wrapped_key_
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index 089c490..4ee5529 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/safe_browsing/safe_browsing_util.h"
+#include "base/base64.h"
#include "base/hmac.h"
#include "base/logging.h"
#include "base/sha2.h"
#include "base/string_util.h"
#include "chrome/browser/google_util.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
#include "net/base/escape.h"
#include "unicode/locid.h"
@@ -163,12 +163,12 @@ bool VerifyMAC(const std::string& key, const std::string& mac,
std::string key_copy = key;
DecodeWebSafe(&key_copy);
std::string decoded_key;
- net::Base64Decode(key_copy, &decoded_key);
+ base::Base64Decode(key_copy, &decoded_key);
std::string mac_copy = mac;
DecodeWebSafe(&mac_copy);
std::string decoded_mac;
- net::Base64Decode(mac_copy, &decoded_mac);
+ base::Base64Decode(mac_copy, &decoded_mac);
base::HMAC hmac(base::HMAC::SHA1);
if (!hmac.Init(decoded_key))
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index ce31c80..fd22f24 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -5,6 +5,7 @@
#include "chrome/common/extensions/extension.h"
#include "app/resource_bundle.h"
+#include "base/base64.h"
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/file_path.h"
@@ -23,7 +24,6 @@
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/url_constants.h"
-#include "net/base/base64.h"
#if defined(OS_WIN)
#include "base/registry.h"
@@ -543,7 +543,7 @@ bool Extension::ParsePEMKeyBytes(const std::string& input,
return false;
}
- return net::Base64Decode(working, output);
+ return base::Base64Decode(working, output);
}
bool Extension::ProducePEM(const std::string& input,
@@ -552,7 +552,7 @@ bool Extension::ProducePEM(const std::string& input,
if (input.length() == 0)
return false;
- return net::Base64Encode(input, output);
+ return base::Base64Encode(input, output);
}
bool Extension::FormatPEMForFileOutput(const std::string input,
diff --git a/net/DEPS b/net/DEPS
index 1fdb987..3395ecf 100644
--- a/net/DEPS
+++ b/net/DEPS
@@ -1,5 +1,4 @@
include_rules = [
- "+third_party/modp_b64",
"+third_party/libevent",
"+third_party/zlib",
"+sdch/open_vcdiff",
diff --git a/net/base/data_url.cc b/net/base/data_url.cc
index fb7de68..e30f7da 100644
--- a/net/base/data_url.cc
+++ b/net/base/data_url.cc
@@ -8,9 +8,9 @@
#include "net/base/data_url.h"
+#include "base/base64.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
#include "net/base/escape.h"
namespace net {
@@ -93,7 +93,7 @@ bool DataURL::Parse(const GURL& url, std::string* mime_type,
}
if (base64_encoded)
- return Base64Decode(temp_data, data);
+ return base::Base64Decode(temp_data, data);
temp_data.swap(*data);
return true;
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index af090bd..2677abd 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -26,6 +26,7 @@
#include <fcntl.h>
#endif
+#include "base/base64.h"
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -54,7 +55,6 @@
#if defined(OS_WIN)
#include "net/base/winsock_init.h"
#endif
-#include "net/base/base64.h"
#include "unicode/datefmt.h"
@@ -225,7 +225,7 @@ bool DecodeBQEncoding(const std::string& part, RFC2047EncodingType enc_type,
const std::string& charset, std::string* output) {
std::string decoded;
if (enc_type == B_ENCODING) {
- if (!net::Base64Decode(part, &decoded)) {
+ if (!base::Base64Decode(part, &decoded)) {
return false;
}
} else {
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc
index e617ea3..b30a171 100644
--- a/net/base/sdch_manager.cc
+++ b/net/base/sdch_manager.cc
@@ -2,12 +2,12 @@
// 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 "base/field_trial.h"
#include "base/histogram.h"
#include "base/logging.h"
#include "base/sha2.h"
#include "base/string_util.h"
-#include "net/base/base64.h"
#include "net/base/registry_controlled_domain.h"
#include "net/base/sdch_manager.h"
#include "net/url_request/url_request_http_job.h"
@@ -349,7 +349,7 @@ void SdchManager::UrlSafeBase64Encode(const std::string& input,
std::string* output) {
// Since this is only done during a dictionary load, and hashes are only 8
// characters, we just do the simple fixup, rather than rewriting the encoder.
- net::Base64Encode(input, output);
+ base::Base64Encode(input, output);
for (size_t i = 0; i < output->size(); ++i) {
switch (output->data()[i]) {
case '+':
diff --git a/net/base/strict_transport_security_state.cc b/net/base/strict_transport_security_state.cc
index 8318185..609241c 100644
--- a/net/base/strict_transport_security_state.cc
+++ b/net/base/strict_transport_security_state.cc
@@ -4,6 +4,7 @@
#include "net/base/strict_transport_security_state.h"
+#include "base/base64.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
@@ -13,7 +14,6 @@
#include "base/string_util.h"
#include "base/values.h"
#include "googleurl/src/gurl.h"
-#include "net/base/base64.h"
#include "net/base/dns_util.h"
namespace net {
@@ -198,7 +198,7 @@ void StrictTransportSecurityState::SetDelegate(
// |enabled_hosts_|, to a base64 string which we can include in a JSON file.
static std::wstring HashedDomainToExternalString(const std::string& hashed) {
std::string out;
- CHECK(Base64Encode(hashed, &out));
+ CHECK(base::Base64Encode(hashed, &out));
return ASCIIToWide(out);
}
@@ -207,7 +207,7 @@ static std::wstring HashedDomainToExternalString(const std::string& hashed) {
static std::string ExternalStringToHashedDomain(const std::wstring& external) {
std::string external_ascii = WideToASCII(external);
std::string out;
- if (!Base64Decode(external_ascii, &out) ||
+ if (!base::Base64Decode(external_ascii, &out) ||
out.size() != base::SHA256_LENGTH) {
return std::string();
}
diff --git a/net/http/http_auth_handler_basic.cc b/net/http/http_auth_handler_basic.cc
index 0052dbf..71c310c 100644
--- a/net/http/http_auth_handler_basic.cc
+++ b/net/http/http_auth_handler_basic.cc
@@ -4,9 +4,11 @@
#include "net/http/http_auth_handler_basic.h"
+#include <string>
+
+#include "base/base64.h"
#include "base/string_util.h"
#include "net/http/http_auth.h"
-#include "net/base/base64.h"
namespace net {
@@ -46,9 +48,9 @@ std::string HttpAuthHandlerBasic::GenerateCredentials(
const ProxyInfo*) {
// TODO(eroman): is this the right encoding of username/password?
std::string base64_username_password;
- if (!Base64Encode(WideToUTF8(username) + ":" + WideToUTF8(password),
- &base64_username_password))
- return std::string(); // FAIL
+ if (!base::Base64Encode(WideToUTF8(username) + ":" + WideToUTF8(password),
+ &base64_username_password))
+ return std::string(); // FAIL
return std::string("Basic ") + base64_username_password;
}
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc
index 99488ba..3dcf9b4 100644
--- a/net/http/http_auth_handler_ntlm.cc
+++ b/net/http/http_auth_handler_ntlm.cc
@@ -4,8 +4,8 @@
#include "net/http/http_auth_handler_ntlm.h"
+#include "base/base64.h"
#include "base/string_util.h"
-#include "net/base/base64.h"
#include "net/base/net_errors.h"
namespace net {
@@ -57,7 +57,7 @@ std::string HttpAuthHandlerNTLM::GenerateCredentials(
len--;
auth_data_.erase(len);
- if (!Base64Decode(auth_data_, &decoded_auth_data))
+ if (!base::Base64Decode(auth_data_, &decoded_auth_data))
return std::string(); // Improper base64 encoding
in_buf_len = decoded_auth_data.length();
in_buf = decoded_auth_data.data();
@@ -70,7 +70,7 @@ std::string HttpAuthHandlerNTLM::GenerateCredentials(
// Base64 encode data in output buffer and prepend "NTLM ".
std::string encode_input(static_cast<char*>(out_buf), out_buf_len);
std::string encode_output;
- bool ok = Base64Encode(encode_input, &encode_output);
+ bool ok = base::Base64Encode(encode_input, &encode_output);
// OK, we are done with |out_buf|
free(out_buf);
if (!ok)
diff --git a/net/net.gyp b/net/net.gyp
index 4a302f98..5a7f7b2 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -18,7 +18,6 @@
'../third_party/bzip2/bzip2.gyp:bzip2',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
- '../third_party/modp_b64/modp_b64.gyp:modp_b64',
'../third_party/zlib/zlib.gyp:zlib',
'net_resources',
],
@@ -27,8 +26,6 @@
'base/address_list.cc',
'base/address_list.h',
'base/auth.h',
- 'base/base64.cc',
- 'base/base64.h',
'base/bzip2_filter.cc',
'base/bzip2_filter.h',
'base/cache_type.h',
@@ -221,7 +218,6 @@
'../third_party/bzip2/bzip2.gyp:bzip2',
'../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc',
- '../third_party/modp_b64/modp_b64.gyp:modp_b64',
'../third_party/zlib/zlib.gyp:zlib',
'net_base',
'net_resources',
@@ -566,7 +562,6 @@
'msvs_guid': 'E99DA267-BE90-4F45-88A1-6919DB2C7567',
'sources': [
'base/address_list_unittest.cc',
- 'base/base64_unittest.cc',
'base/bzip2_filter_unittest.cc',
'base/cookie_monster_unittest.cc',
'base/cookie_policy_unittest.cc',