diff options
author | hayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 06:21:53 +0000 |
---|---|---|
committer | hayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 06:21:53 +0000 |
commit | 978df34538607d50bf4690f2d679c1bef860398c (patch) | |
tree | b99abc0b44316c0bfa16374746996ac209e363a6 /chrome/browser | |
parent | 391bbb3fb3fbb0fb7d072878b9cb45e99a519e6e (diff) | |
download | chromium_src-978df34538607d50bf4690f2d679c1bef860398c.zip chromium_src-978df34538607d50bf4690f2d679c1bef860398c.tar.gz chromium_src-978df34538607d50bf4690f2d679c1bef860398c.tar.bz2 |
Move base64 from 'net/base' into 'base'.
BUG=13572
TEST=none
Review URL: http://codereview.chromium.org/399068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32918 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chrome_plugin_host.cc | 1 | ||||
-rw-r--r-- | chrome/browser/extensions/convert_user_script.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_creator.cc | 1 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/sandboxed_extension_unpacker.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gears_integration.cc | 4 | ||||
-rw-r--r-- | chrome/browser/importer/nss_decryptor.cc | 6 | ||||
-rw-r--r-- | chrome/browser/metrics/metrics_log.cc | 4 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.cc | 4 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_util.cc | 6 |
11 files changed, 20 insertions, 22 deletions
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)) |