diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 20:04:53 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 20:04:53 +0000 |
commit | b6775d788c0bcc4bc879731478a2eadc522dc767 (patch) | |
tree | cbe11af8995612881de1dc5d70cf958d4dc3e377 | |
parent | 6c3bf032651d5f912775e0c8cd7e962454145ced (diff) | |
download | chromium_src-b6775d788c0bcc4bc879731478a2eadc522dc767.zip chromium_src-b6775d788c0bcc4bc879731478a2eadc522dc767.tar.gz chromium_src-b6775d788c0bcc4bc879731478a2eadc522dc767.tar.bz2 |
Update some uses of char16 to use the base:: namespace.
BUG=329295
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/113403006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242503 0039d316-1c4b-4281-b951-d872f2087c98
97 files changed, 310 insertions, 297 deletions
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index 3d9e3ae..5159121 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc @@ -89,7 +89,7 @@ const SkColor kBorderColor = 0xffdcdcdc; // The invisible word joiner character, used as a marker to indicate the start // and end of the user's display name in the public account user card's text. -const char16 kDisplayNameMark[] = { 0x2060, 0 }; +const base::char16 kDisplayNameMark[] = { 0x2060, 0 }; const int kPublicAccountLogoutButtonBorderImagesNormal[] = { IDR_AURA_TRAY_POPUP_PUBLIC_ACCOUNT_LOGOUT_BUTTON_BORDER, diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index a2b637e..56e1efa 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -474,7 +474,7 @@ base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( const base::string16& formatted_url) { if (!net::CanStripTrailingSlash(url)) return formatted_url; - const base::string16 url_with_path(formatted_url + char16('/')); + const base::string16 url_with_path(formatted_url + base::char16('/')); return (AutocompleteInput::Parse(formatted_url, base::string16(), NULL, NULL, NULL) == AutocompleteInput::Parse(url_with_path, base::string16(), NULL, NULL, diff --git a/chrome/browser/autocomplete/autocomplete_match.cc b/chrome/browser/autocomplete/autocomplete_match.cc index 768d32f..e0a2ada 100644 --- a/chrome/browser/autocomplete/autocomplete_match.cc +++ b/chrome/browser/autocomplete/autocomplete_match.cc @@ -31,7 +31,7 @@ bool IsTrivialClassification(const ACMatchClassifications& classifications) { // AutocompleteMatch ---------------------------------------------------------- // static -const char16 AutocompleteMatch::kInvalidChars[] = { +const base::char16 AutocompleteMatch::kInvalidChars[] = { '\n', '\r', '\t', 0x2028, // Line separator 0x2029, // Paragraph separator diff --git a/chrome/browser/autocomplete/autocomplete_match.h b/chrome/browser/autocomplete/autocomplete_match.h index ad91c259a..26a9c25 100644 --- a/chrome/browser/autocomplete/autocomplete_match.h +++ b/chrome/browser/autocomplete/autocomplete_match.h @@ -79,7 +79,7 @@ struct AutocompleteMatch { // Null-terminated array of characters that are not valid within |contents| // and |description| strings. - static const char16 kInvalidChars[]; + static const base::char16 kInvalidChars[]; AutocompleteMatch(); AutocompleteMatch(AutocompleteProvider* provider, diff --git a/chrome/browser/autocomplete/autocomplete_provider.cc b/chrome/browser/autocomplete/autocomplete_provider.cc index 488741e..76f5074 100644 --- a/chrome/browser/autocomplete/autocomplete_provider.cc +++ b/chrome/browser/autocomplete/autocomplete_provider.cc @@ -214,7 +214,7 @@ size_t AutocompleteProvider::TrimHttpPrefix(base::string16* url) { if (!AutocompleteInput::HasHTTPScheme(*url)) return 0; size_t scheme_pos = - url->find(base::ASCIIToUTF16(content::kHttpScheme) + char16(':')); + url->find(base::ASCIIToUTF16(content::kHttpScheme) + base::char16(':')); DCHECK_NE(base::string16::npos, scheme_pos); // Erase scheme plus up to two slashes. diff --git a/chrome/browser/autocomplete/extension_app_provider.cc b/chrome/browser/autocomplete/extension_app_provider.cc index 88efea6..d6624fc 100644 --- a/chrome/browser/autocomplete/extension_app_provider.cc +++ b/chrome/browser/autocomplete/extension_app_provider.cc @@ -118,7 +118,7 @@ void ExtensionAppProvider::Start(const AutocompleteInput& input, base::string16::const_iterator name_iter = std::search(name.begin(), name.end(), input.text().begin(), input.text().end(), - base::CaseInsensitiveCompare<char16>()); + base::CaseInsensitiveCompare<base::char16>()); bool matches_name = name_iter != name.end(); size_t name_match_index = matches_name ? static_cast<size_t>(name_iter - name.begin()) : base::string16::npos; @@ -130,7 +130,7 @@ void ExtensionAppProvider::Start(const AutocompleteInput& input, base::string16::const_iterator url_iter = std::search(url.begin(), url.end(), input.text().begin(), input.text().end(), - base::CaseInsensitiveCompare<char16>()); + base::CaseInsensitiveCompare<base::char16>()); matches_url = url_iter != url.end() && input.type() != AutocompleteInput::FORCED_QUERY; url_match_index = matches_url ? diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index db57dfb..9685201 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -429,7 +429,7 @@ AutocompleteMatch SearchProvider::CreateSearchSuggestion( if (input.type() == AutocompleteInput::FORCED_QUERY) match.fill_into_edit.assign(base::ASCIIToUTF16("?")); if (is_keyword) - match.fill_into_edit.append(match.keyword + char16(' ')); + match.fill_into_edit.append(match.keyword + base::char16(' ')); if (!input.prevent_inline_autocomplete() && StartsWith(query_string, input_text, false)) { match.inline_autocompletion = query_string.substr(input_text.length()); diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 9d96424..579f31b 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -566,7 +566,7 @@ TEST_F(SearchProviderTest, QueryKeywordProvider) { EXPECT_FALSE(match.keyword.empty()); // The fill into edit should contain the keyword. - EXPECT_EQ(keyword_t_url_->keyword() + char16(' ') + keyword_term_, + EXPECT_EQ(keyword_t_url_->keyword() + base::char16(' ') + keyword_term_, match.fill_into_edit); } diff --git a/chrome/browser/autocomplete/shortcuts_provider.h b/chrome/browser/autocomplete/shortcuts_provider.h index 471d0ff..e93fbd2 100644 --- a/chrome/browser/autocomplete/shortcuts_provider.h +++ b/chrome/browser/autocomplete/shortcuts_provider.h @@ -41,7 +41,7 @@ class ShortcutsProvider friend class ClassifyTest; friend class history::ShortcutsProviderTest; - typedef std::multimap<char16, base::string16> WordMap; + typedef std::multimap<base::char16, base::string16> WordMap; virtual ~ShortcutsProvider(); diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 926526e..3b02b70 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -44,7 +44,7 @@ BookmarkNode* AsMutable(const BookmarkNode* node) { } // Whitespace characters to strip from bookmark titles. -const char16 kInvalidChars[] = { +const base::char16 kInvalidChars[] = { '\n', '\r', '\t', 0x2028, // Line separator 0x2029, // Paragraph separator diff --git a/chrome/browser/component_updater/background_downloader_win.cc b/chrome/browser/component_updater/background_downloader_win.cc index cb02663..66a1796 100644 --- a/chrome/browser/component_updater/background_downloader_win.cc +++ b/chrome/browser/component_updater/background_downloader_win.cc @@ -96,7 +96,7 @@ namespace { // All jobs created by this module have a specific description so they can // be found at run-time or by using system administration tools. -const char16 kJobDescription[] = L"Chrome Component Updater"; +const base::char16 kJobDescription[] = L"Chrome Component Updater"; // How often the code looks for changes in the BITS job state. const int kJobPollingIntervalSec = 10; @@ -167,7 +167,7 @@ HRESULT GetJobFileProperties(IBackgroundCopyFile* file, HRESULT hr = S_OK; if (local_name) { - ScopedCoMem<char16> name; + ScopedCoMem<base::char16> name; hr = file->GetLocalName(&name); if (FAILED(hr)) return hr; @@ -175,7 +175,7 @@ HRESULT GetJobFileProperties(IBackgroundCopyFile* file, } if (remote_name) { - ScopedCoMem<char16> name; + ScopedCoMem<base::char16> name; hr = file->GetRemoteName(&name); if (FAILED(hr)) return hr; @@ -194,7 +194,7 @@ HRESULT GetJobFileProperties(IBackgroundCopyFile* file, } HRESULT GetJobDescription(IBackgroundCopyJob* job, const base::string16* name) { - ScopedCoMem<char16> description; + ScopedCoMem<base::char16> description; return job->GetDescription(&description); } @@ -288,7 +288,7 @@ bool JobFileUrlEqual::operator()(IBackgroundCopyJob* job, return false; for (size_t i = 0; i != files.size(); ++i) { - ScopedCoMem<char16> name; + ScopedCoMem<base::char16> name; if (SUCCEEDED(files[i]->GetRemoteName(&name)) && remote_name.compare(name) == 0) return true; diff --git a/chrome/browser/download/download_query_unittest.cc b/chrome/browser/download/download_query_unittest.cc index 974c0b0..2d8163c 100644 --- a/chrome/browser/download/download_query_unittest.cc +++ b/chrome/browser/download/download_query_unittest.cc @@ -123,7 +123,7 @@ template<> void DownloadQueryTest::AddFilter( } template<> void DownloadQueryTest::AddFilter( - DownloadQuery::FilterType name, const char16* cpp_value) { + DownloadQuery::FilterType name, const base::char16* cpp_value) { scoped_ptr<base::Value> value( base::Value::CreateStringValue(base::string16(cpp_value))); CHECK(query_.AddFilter(name, *value.get())); diff --git a/chrome/browser/drive/drive_api_util.cc b/chrome/browser/drive/drive_api_util.cc index 1034589..610f735 100644 --- a/chrome/browser/drive/drive_api_util.cc +++ b/chrome/browser/drive/drive_api_util.cc @@ -162,7 +162,8 @@ std::string TranslateQuery(const std::string& original_query) { // In order to handle non-ascii white spaces correctly, convert to UTF16. base::string16 query = base::UTF8ToUTF16(original_query); const base::string16 kDelimiter( - base::kWhitespaceUTF16 + base::string16(1, static_cast<char16>('"'))); + base::kWhitespaceUTF16 + + base::string16(1, static_cast<base::char16>('"'))); std::string result; for (size_t index = query.find_first_not_of(base::kWhitespaceUTF16); diff --git a/chrome/browser/extensions/extension_error_ui.cc b/chrome/browser/extensions/extension_error_ui.cc index 9dca279..fb2b0ff 100644 --- a/chrome/browser/extensions/extension_error_ui.cc +++ b/chrome/browser/extensions/extension_error_ui.cc @@ -48,7 +48,7 @@ base::string16 ExtensionErrorUI::GenerateMessageSection( extension_service_->GetInstalledExtension(*iter); message += l10n_util::GetStringFUTF16( e->is_app() ? app_template_message_id : extension_template_message_id, - base::UTF8ToUTF16(e->name())) + char16('\n'); + base::UTF8ToUTF16(e->name())) + base::char16('\n'); } return message; } diff --git a/chrome/browser/history/in_memory_url_index_types.h b/chrome/browser/history/in_memory_url_index_types.h index 976e062..91ef29f 100644 --- a/chrome/browser/history/in_memory_url_index_types.h +++ b/chrome/browser/history/in_memory_url_index_types.h @@ -81,8 +81,8 @@ TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches, typedef std::vector<base::string16> String16Vector; typedef std::set<base::string16> String16Set; -typedef std::set<char16> Char16Set; -typedef std::vector<char16> Char16Vector; +typedef std::set<base::char16> Char16Set; +typedef std::vector<base::char16> Char16Vector; // A vector that contains the offsets at which each word starts within a string. typedef std::vector<size_t> WordStarts; @@ -143,7 +143,7 @@ typedef std::map<base::string16, WordID> WordMap; // A map from character to the word_ids of words containing that character. typedef std::set<WordID> WordIDSet; // An index into the WordList. -typedef std::map<char16, WordIDSet> CharWordIDMap; +typedef std::map<base::char16, WordIDSet> CharWordIDMap; // A map from word (by word_id) to history items containing that word. typedef history::URLID HistoryID; diff --git a/chrome/browser/history/url_index_private_data.cc b/chrome/browser/history/url_index_private_data.cc index 1e11e2ef..1efaefe 100644 --- a/chrome/browser/history/url_index_private_data.cc +++ b/chrome/browser/history/url_index_private_data.cc @@ -804,7 +804,7 @@ void URLIndexPrivateData::AddWordHistory(const base::string16& term, Char16Set characters = Char16SetFromString16(term); for (Char16Set::iterator uni_char_iter = characters.begin(); uni_char_iter != characters.end(); ++uni_char_iter) { - char16 uni_char = *uni_char_iter; + base::char16 uni_char = *uni_char_iter; CharWordIDMap::iterator char_iter = char_word_map_.find(uni_char); if (char_iter != char_word_map_.end()) { // Update existing entry in the char/word index. @@ -868,7 +868,7 @@ void URLIndexPrivateData::RemoveRowWordsFromIndex(const URLRow& row) { Char16Set characters = Char16SetFromString16(word); for (Char16Set::iterator uni_char_iter = characters.begin(); uni_char_iter != characters.end(); ++uni_char_iter) { - char16 uni_char = *uni_char_iter; + base::char16 uni_char = *uni_char_iter; char_word_map_[uni_char].erase(word_id); if (char_word_map_[uni_char].empty()) char_word_map_.erase(uni_char); // No longer in use. @@ -1120,7 +1120,7 @@ bool URLIndexPrivateData::RestoreCharWordMap( actual_item_count = iter->word_id_size(); if (actual_item_count == 0 || actual_item_count != expected_item_count) return false; - char16 uni_char = static_cast<char16>(iter->char_16()); + base::char16 uni_char = static_cast<base::char16>(iter->char_16()); WordIDSet word_id_set; const RepeatedField<int32>& word_ids(iter->word_id()); for (RepeatedField<int32>::const_iterator jiter = word_ids.begin(); diff --git a/chrome/browser/importer/ie_importer_browsertest_win.cc b/chrome/browser/importer/ie_importer_browsertest_win.cc index a1a10b0..39f5e96 100644 --- a/chrome/browser/importer/ie_importer_browsertest_win.cc +++ b/chrome/browser/importer/ie_importer_browsertest_win.cc @@ -83,12 +83,12 @@ const BookmarkInfo kIESortedBookmarks[] = { {false, 0, {}, L"c", "http://www.google.com/3"}, }; -const char16 kIEIdentifyUrl[] = +const base::char16 kIEIdentifyUrl[] = L"http://A79029D6-753E-4e27-B807-3D46AB1545DF.com:8080/path?key=value"; -const char16 kIEIdentifyTitle[] = +const base::char16 kIEIdentifyTitle[] = L"Unittest GUID"; -const char16 kFaviconStreamSuffix[] = L"url:favicon:$DATA"; +const base::char16 kFaviconStreamSuffix[] = L"url:favicon:$DATA"; const char kDummyFaviconImageData[] = "\x42\x4D" // Magic signature 'BM' "\x1E\x00\x00\x00" // File size @@ -101,8 +101,8 @@ const char kDummyFaviconImageData[] = "\x00\xFF\x00\x00"; // The pixel struct FaviconGroup { - const char16* favicon_url; - const char16* site_url[2]; + const base::char16* favicon_url; + const base::char16* site_url[2]; }; const FaviconGroup kIEFaviconGroup[2] = { @@ -216,7 +216,7 @@ void ClearPStoreType(IPStore* pstore, const GUID* type, const GUID* subtype) { base::win::ScopedComPtr<IEnumPStoreItems, NULL> item; HRESULT result = pstore->EnumItems(0, type, subtype, 0, item.Receive()); if (result == PST_E_OK) { - char16* item_name; + base::char16* item_name; while (SUCCEEDED(item->Next(1, &item_name, 0))) { pstore->DeleteItem(0, type, subtype, item_name, NULL, 0); CoTaskMemFree(item_name); @@ -228,7 +228,7 @@ void ClearPStoreType(IPStore* pstore, const GUID* type, const GUID* subtype) { void WritePStore(IPStore* pstore, const GUID* type, const GUID* subtype) { struct PStoreItem { - char16* name; + base::char16* name; int data_size; char* data; } items[] = { @@ -501,7 +501,7 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) { file_util::WriteFile(path.AppendASCII("InvalidUrlFile.url"), "x", 1); file_util::WriteFile(path.AppendASCII("PlainTextFile.txt"), "x", 1); - const char16* root_links[] = { + const base::char16* root_links[] = { L"Links", L"Google Home Page.url", L"TheLink.url", diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc index 8424183..178eb62 100644 --- a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc +++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc @@ -109,7 +109,7 @@ bool IsDirectory(IPortableDeviceValues* properties_values) { base::string16 GetObjectName(IPortableDeviceValues* properties_values, bool is_directory) { DCHECK(properties_values); - base::win::ScopedCoMem<char16> buffer; + base::win::ScopedCoMem<base::char16> buffer; REFPROPERTYKEY key = is_directory ? WPD_OBJECT_NAME : WPD_OBJECT_ORIGINAL_FILE_NAME; HRESULT hr = properties_values->GetStringValue(key, &buffer); @@ -269,7 +269,8 @@ bool GetMTPDeviceObjectEntries(IPortableDevice* device, const bool get_all_entries = object_name.empty(); for (HRESULT hr = S_OK; hr == S_OK;) { DWORD num_objects_fetched = 0; - scoped_ptr<char16*[]> object_ids(new char16*[num_objects_to_request]); + scoped_ptr<base::char16*[]> object_ids( + new base::char16*[num_objects_to_request]); hr = enum_object_ids->Next(num_objects_to_request, object_ids.get(), &num_objects_fetched); diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc index 0dfc554..7b29dc1 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc @@ -55,9 +55,9 @@ const char kProfileIconFileName[] = "Google Profile.ico"; // Characters that are not allowed in Windows filenames. Taken from // http://msdn.microsoft.com/en-us/library/aa365247.aspx -const char16 kReservedCharacters[] = L"<>:\"/\\|?*\x01\x02\x03\x04\x05\x06\x07" - L"\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19" - L"\x1A\x1B\x1C\x1D\x1E\x1F"; +const base::char16 kReservedCharacters[] = L"<>:\"/\\|?*\x01\x02\x03\x04\x05" + L"\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17" + L"\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; // The maximum number of characters allowed in profile shortcuts' file names. // Warning: migration code will be needed if this is changed later, since diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics.cc b/chrome/browser/spellchecker/spellcheck_host_metrics.cc index e2cb473..6e4f134 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics.cc @@ -60,7 +60,7 @@ void SpellCheckHostMetrics::RecordCheckedWordStats(const base::string16& word, // Collects actual number of checked words, excluding duplication. base::MD5Digest digest; base::MD5Sum(reinterpret_cast<const unsigned char*>(word.c_str()), - word.size() * sizeof(char16), &digest); + word.size() * sizeof(base::char16), &digest); checked_word_hashes_.insert(base::MD5DigestToBase16(digest)); RecordWordCounts(); diff --git a/chrome/browser/storage_monitor/portable_device_watcher_win.cc b/chrome/browser/storage_monitor/portable_device_watcher_win.cc index bef912d..a206de9 100644 --- a/chrome/browser/storage_monitor/portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/portable_device_watcher_win.cc @@ -28,7 +28,7 @@ namespace { // Name of the client application that communicates with the MTP device. -const char16 kClientName[] = L"Chromium"; +const base::char16 kClientName[] = L"Chromium"; // Name of the sequenced task runner. const char kMediaTaskRunnerName[] = "media-task-runner"; @@ -195,11 +195,11 @@ bool GetStringPropertyValue(IPortableDeviceValues* properties_values, base::string16* value) { DCHECK(properties_values); DCHECK(value); - base::win::ScopedCoMem<char16> buffer; + base::win::ScopedCoMem<base::char16> buffer; HRESULT hr = properties_values->GetStringValue(key, &buffer); if (FAILED(hr)) return false; - *value = static_cast<const char16*>(buffer); + *value = static_cast<const base::char16*>(buffer); return true; } @@ -413,7 +413,8 @@ bool EnumerateAttachedDevicesOnBlockingThread( if (FAILED(hr)) return false; - scoped_ptr<char16*[]> pnp_device_ids(new char16*[pnp_device_count]); + scoped_ptr<base::char16*[]> pnp_device_ids( + new base::char16*[pnp_device_count]); hr = portable_device_mgr->GetDevices(pnp_device_ids.get(), &pnp_device_count); if (FAILED(hr)) return false; diff --git a/chrome/browser/storage_monitor/removable_device_constants.cc b/chrome/browser/storage_monitor/removable_device_constants.cc index 0daddff..c8dacbe 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.cc +++ b/chrome/browser/storage_monitor/removable_device_constants.cc @@ -12,7 +12,8 @@ const char kVendorModelVolumeStoragePrefix[] = "VendorModelVolumeStorage:"; #endif #if defined(OS_WIN) -const char16 kWPDDevInterfaceGUID[] = L"{6ac27878-a6fa-4155-ba85-f98f491d4f33}"; +const base::char16 kWPDDevInterfaceGUID[] = + L"{6ac27878-a6fa-4155-ba85-f98f491d4f33}"; #endif const base::FilePath::CharType kDCIMDirectoryName[] = FILE_PATH_LITERAL("DCIM"); diff --git a/chrome/browser/storage_monitor/removable_device_constants.h b/chrome/browser/storage_monitor/removable_device_constants.h index a7d9363..2b3ede8 100644 --- a/chrome/browser/storage_monitor/removable_device_constants.h +++ b/chrome/browser/storage_monitor/removable_device_constants.h @@ -19,7 +19,7 @@ extern const char kVendorModelVolumeStoragePrefix[]; #if defined(OS_WIN) // Windows portable device interface GUID constant. -extern const char16 kWPDDevInterfaceGUID[]; +extern const base::char16 kWPDDevInterfaceGUID[]; #endif extern const base::FilePath::CharType kDCIMDirectoryName[]; diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.mm b/chrome/browser/storage_monitor/storage_monitor_mac.mm index 16ea943..a3439769d 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac.mm @@ -32,7 +32,7 @@ base::string16 JoinName(const base::string16& name, return name; if (name.empty()) return addition; - return name + static_cast<char16>(' ') + addition; + return name + static_cast<base::char16>(' ') + addition; } StorageInfo::Type GetDeviceType(bool is_removable, bool has_dcim) { diff --git a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc index 8798dc5..dc638bd 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc @@ -219,7 +219,7 @@ void StorageMonitorWinTest::DoMTPDeviceTest(const base::string16& pnp_device_id, if (FAILED(hr)) return; - size_t device_id_size = pnp_device_id.size() * sizeof(char16); + size_t device_id_size = pnp_device_id.size() * sizeof(base::char16); size_t size = sizeof(DEV_BROADCAST_DEVICEINTERFACE) + device_id_size; scoped_ptr_malloc<DEV_BROADCAST_DEVICEINTERFACE> dev_interface_broadcast( static_cast<DEV_BROADCAST_DEVICEINTERFACE*>(malloc(size))); diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc index c35254d..5bb1976 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc +++ b/chrome/browser/storage_monitor/test_portable_device_watcher_win.cc @@ -13,11 +13,11 @@ namespace { // Sample MTP device storage information. -const char16 kMTPDeviceFriendlyName[] = L"Camera V1.1"; -const char16 kStorageLabelA[] = L"Camera V1.1 (s10001)"; -const char16 kStorageLabelB[] = L"Camera V1.1 (s20001)"; -const char16 kStorageObjectIdA[] = L"s10001"; -const char16 kStorageObjectIdB[] = L"s20001"; +const base::char16 kMTPDeviceFriendlyName[] = L"Camera V1.1"; +const base::char16 kStorageLabelA[] = L"Camera V1.1 (s10001)"; +const base::char16 kStorageLabelB[] = L"Camera V1.1 (s20001)"; +const base::char16 kStorageObjectIdA[] = L"s10001"; +const base::char16 kStorageObjectIdB[] = L"s20001"; const char kStorageUniqueIdB[] = "mtp:StorageSerial:SID-{s20001, S, 2238}:123123"; @@ -40,11 +40,12 @@ base::string16 GetMTPStorageName(const base::string16& pnp_device_id, // TestPortableDeviceWatcherWin ------------------------------------------------ // static -const char16 TestPortableDeviceWatcherWin::kMTPDeviceWithMultipleStorages[] = +const base::char16 +TestPortableDeviceWatcherWin::kMTPDeviceWithMultipleStorages[] = L"\\?\\usb#vid_ff&pid_18#32&2&1#{ab33-1de4-f22e-1882-9724})"; -const char16 TestPortableDeviceWatcherWin::kMTPDeviceWithInvalidInfo[] = +const base::char16 TestPortableDeviceWatcherWin::kMTPDeviceWithInvalidInfo[] = L"\\?\\usb#vid_00&pid_00#0&2&1#{0000-0000-0000-0000-0000})"; -const char16 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo[] = +const base::char16 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo[] = L"\\?\\usb#vid_ff&pid_000f#32&2&1#{abcd-1234-ffde-1112-9172})"; const char TestPortableDeviceWatcherWin::kStorageUniqueIdA[] = "mtp:StorageSerial:SID-{s10001, D, 12378}:123123"; diff --git a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h b/chrome/browser/storage_monitor/test_portable_device_watcher_win.h index 61e544f..a81cb40 100644 --- a/chrome/browser/storage_monitor/test_portable_device_watcher_win.h +++ b/chrome/browser/storage_monitor/test_portable_device_watcher_win.h @@ -16,9 +16,9 @@ class TestPortableDeviceWatcherWin : public PortableDeviceWatcherWin { public: // MTP device PnP identifiers. - static const char16 kMTPDeviceWithMultipleStorages[]; - static const char16 kMTPDeviceWithInvalidInfo[]; - static const char16 kMTPDeviceWithValidInfo[]; + static const base::char16 kMTPDeviceWithMultipleStorages[]; + static const base::char16 kMTPDeviceWithInvalidInfo[]; + static const base::char16 kMTPDeviceWithValidInfo[]; // MTP device storage unique identifier. static const char kStorageUniqueIdA[]; diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 8dc4040..352792c 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -371,7 +371,7 @@ void DevToolsInspectElementAt(RenderViewHost* rvh, int x, int y) { // Helper function to escape "&" as "&&". void EscapeAmpersands(base::string16* text) { - const char16 ampersand[] = {'&', 0}; + const base::char16 ampersand[] = {'&', 0}; base::ReplaceChars(*text, ampersand, base::ASCIIToUTF16("&&"), text); } diff --git a/chrome/browser/tab_contents/render_view_context_menu_unittest.cc b/chrome/browser/tab_contents/render_view_context_menu_unittest.cc index fe1357b..88e7bfe 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_unittest.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_unittest.cc @@ -40,7 +40,7 @@ static content::ContextMenuParams CreateParams(int contexts) { rv.media_type = blink::WebContextMenuData::MediaTypeNone; rv.page_url = GURL("http://test.page/"); - static const char16 selected_text[] = { 's', 'e', 'l', 0 }; + static const base::char16 selected_text[] = { 's', 'e', 'l', 0 }; if (contexts & MenuItem::SELECTION) rv.selection_text = selected_text; diff --git a/chrome/browser/ui/app_list/search/term_break_iterator.cc b/chrome/browser/ui/app_list/search/term_break_iterator.cc index 5c7d44d..5ace7dc 100644 --- a/chrome/browser/ui/app_list/search/term_break_iterator.cc +++ b/chrome/browser/ui/app_list/search/term_break_iterator.cc @@ -53,7 +53,7 @@ const base::string16 TermBreakIterator::GetCurrentTerm() const { return word_.substr(prev_, pos_ - prev_); } -TermBreakIterator::State TermBreakIterator::GetNewState(char16 ch) { +TermBreakIterator::State TermBreakIterator::GetNewState(base::char16 ch) { if (IsAsciiDigit(ch) || ch == '.' || ch == ',') return STATE_NUMBER; diff --git a/chrome/browser/ui/app_list/search/term_break_iterator.h b/chrome/browser/ui/app_list/search/term_break_iterator.h index 3a88cf9..6ff877e 100644 --- a/chrome/browser/ui/app_list/search/term_break_iterator.h +++ b/chrome/browser/ui/app_list/search/term_break_iterator.h @@ -52,7 +52,7 @@ class TermBreakIterator { }; // Returns new state for given |ch|. - State GetNewState(char16 ch); + State GetNewState(base::char16 ch); const base::string16& word_; size_t prev_; diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index ebebb46e..c267fa5 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -946,7 +946,7 @@ base::string16 GetStockPreferencesMenuLabel() { GtkStockItem stock_item; base::string16 preferences; if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { - const char16 kUnderscore[] = { '_', 0 }; + const base::char16 kUnderscore[] = { '_', 0 }; base::RemoveChars(base::UTF8ToUTF16(stock_item.label), kUnderscore, &preferences); } diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc index 3241c50..0ddffb7 100644 --- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc +++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc @@ -1282,7 +1282,7 @@ base::string16 OmniboxEditModel::DisplayTextFromUserText( base::string16 OmniboxEditModel::UserTextFromDisplayText( const base::string16& text) const { - return KeywordIsSelected() ? (keyword_ + char16(' ') + text) : text; + return KeywordIsSelected() ? (keyword_ + base::char16(' ') + text) : text; } void OmniboxEditModel::GetInfoForCurrentText(AutocompleteMatch* match, diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc index df41d7b..4128dd1 100644 --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc @@ -782,7 +782,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_BasicTextOperations) { // Insert one character at the end. Make sure we won't insert // anything after the special ZWS mark used in gtk implementation. ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_A, 0)); - EXPECT_EQ(old_text + char16('a'), omnibox_view->GetText()); + EXPECT_EQ(old_text + base::char16('a'), omnibox_view->GetText()); // Delete one character from the end. Make sure we won't delete the special // ZWS mark used in gtk implementation. @@ -860,7 +860,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_AcceptKeywordBySpace) { // Keyword shouldn't be accepted by pressing space with a trailing // whitespace. - omnibox_view->SetWindowTextAndCaretPos(search_keyword + char16(' '), + omnibox_view->SetWindowTextAndCaretPos(search_keyword + base::char16(' '), search_keyword.length() + 1, false, false); ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_SPACE, 0)); ASSERT_TRUE(omnibox_view->model()->is_keyword_hint()); @@ -871,7 +871,7 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, MAYBE_AcceptKeywordBySpace) { ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_BACK, 0)); ASSERT_TRUE(omnibox_view->model()->is_keyword_hint()); ASSERT_EQ(search_keyword, omnibox_view->model()->keyword()); - ASSERT_EQ(search_keyword + char16(' '), omnibox_view->GetText()); + ASSERT_EQ(search_keyword + base::char16(' '), omnibox_view->GetText()); // Keyword shouldn't be accepted by pressing space before a trailing space. ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_LEFT, 0)); diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index ee6ca0e..0658bb5 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc @@ -1243,11 +1243,11 @@ void DownloadItemView::SizeLabelToMinWidth() { // This can be a low surrogate codepoint, but u_isUWhiteSpace will // return false and inserting a new line after a surrogate pair // is perfectly ok. - char16 line_end_char = current_text[pos - 1]; + base::char16 line_end_char = current_text[pos - 1]; if (u_isUWhiteSpace(line_end_char)) - current_text.replace(pos - 1, 1, 1, char16('\n')); + current_text.replace(pos - 1, 1, 1, base::char16('\n')); else - current_text.insert(pos, 1, char16('\n')); + current_text.insert(pos, 1, base::char16('\n')); dangerous_download_label_->SetText(current_text); size = dangerous_download_label_->GetPreferredSize(); @@ -1286,7 +1286,7 @@ void DownloadItemView::UpdateAccessibleName() { if (IsShowingWarningDialog()) { new_name = dangerous_download_label_->text(); } else { - new_name = status_text_ + char16(' ') + + new_name = status_text_ + base::char16(' ') + download()->GetFileNameToReportUser().LossyDisplayName(); } diff --git a/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc index f8260b5..3e940a9 100644 --- a/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc +++ b/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc @@ -241,7 +241,7 @@ void ExtensionMessageBubbleView::Init() { extensions->SetHorizontalAlignment(gfx::ALIGN_LEFT); std::vector<base::string16> extension_list; - char16 bullet_point = 0x2022; + base::char16 bullet_point = 0x2022; std::vector<base::string16> suspicious = delegate_->GetExtensions(); size_t i = 0; diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index 6a571a5..3d5defb 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc @@ -40,7 +40,7 @@ namespace { -const char16 kEllipsis[] = { 0x2026, 0x0 }; +const base::char16 kEllipsis[] = { 0x2026, 0x0 }; // The minimum distance between the top and bottom of the {icon|text} and the // top or bottom of the row. diff --git a/chrome/browser/usb/usb_device_handle.cc b/chrome/browser/usb/usb_device_handle.cc index 6d32be4..367ecfd 100644 --- a/chrome/browser/usb/usb_device_handle.cc +++ b/chrome/browser/usb/usb_device_handle.cc @@ -376,7 +376,7 @@ bool UsbDeviceHandle::GetSerial(base::string16* serial) { for (int i = 1; i <= language_count; ++i) { // Get the string using language ID. - char16 text[256] = { 0 }; + base::char16 text[256] = { 0 }; size = libusb_get_string_descriptor( handle_, desc.iSerialNumber, langid[i], reinterpret_cast<unsigned char*>(&text[0]), sizeof(text)); diff --git a/chrome/common/importer/ie_importer_utils_win.cc b/chrome/common/importer/ie_importer_utils_win.cc index bd4acf9..4275a8e 100644 --- a/chrome/common/importer/ie_importer_utils_win.cc +++ b/chrome/common/importer/ie_importer_utils_win.cc @@ -8,14 +8,14 @@ namespace { -const char16 kIEFavoritesOrderKey[] = +const base::char16 kIEFavoritesOrderKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\" L"MenuOrder\\Favorites"; -const char16 kIEStorage2Key[] = +const base::char16 kIEStorage2Key[] = L"Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2"; -const char16 kIESettingsMainKey[] = +const base::char16 kIESettingsMainKey[] = L"Software\\Microsoft\\Internet Explorer\\Main"; base::string16 GetPotentiallyOverridenIEKey( diff --git a/chrome/renderer/pepper/ppb_pdf_impl.cc b/chrome/renderer/pepper/ppb_pdf_impl.cc index 4b77044..2a43fb8 100644 --- a/chrome/renderer/pepper/ppb_pdf_impl.cc +++ b/chrome/renderer/pepper/ppb_pdf_impl.cc @@ -243,8 +243,10 @@ void SearchString(PP_Instance instance, bool case_sensitive, PP_PrivateFindResult** results, int* count) { - const char16* string = reinterpret_cast<const char16*>(input_string); - const char16* term = reinterpret_cast<const char16*>(input_term); + const base::char16* string = + reinterpret_cast<const base::char16*>(input_string); + const base::char16* term = + reinterpret_cast<const base::char16*>(input_term); UErrorCode status = U_ZERO_ERROR; UStringSearch* searcher = usearch_open( diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc index d4cafe4..f56ce48 100644 --- a/chrome/renderer/searchbox/searchbox_extension.cc +++ b/chrome/renderer/searchbox/searchbox_extension.cc @@ -58,7 +58,7 @@ const char kRTLHtmlTextDirection[] = "rtl"; // Converts a V8 value to a string16. base::string16 V8ValueToUTF16(v8::Handle<v8::Value> v) { v8::String::Value s(v); - return base::string16(reinterpret_cast<const char16*>(*s), s.length()); + return base::string16(reinterpret_cast<const base::char16*>(*s), s.length()); } // Converts string16 to V8 String. diff --git a/chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc b/chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc index dc9d50e..2e9f61e 100644 --- a/chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc +++ b/chrome/renderer/spellchecker/custom_dictionary_engine_unittest.cc @@ -25,6 +25,6 @@ TEST(CustomDictionaryTest, Basic) { } TEST(CustomDictionaryTest, HandlesNullCharacters) { - char16 data[4] = {'a', 0, 'b', 'c'}; + base::char16 data[4] = {'a', 0, 'b', 'c'}; EXPECT_FALSE(CustomDictionaryEngine().SpellCheckWord(data, 1, 1)); } diff --git a/chrome/renderer/spellchecker/spellcheck.cc b/chrome/renderer/spellchecker/spellcheck.cc index b08dfee..51c0ba9 100644 --- a/chrome/renderer/spellchecker/spellcheck.cc +++ b/chrome/renderer/spellchecker/spellcheck.cc @@ -175,7 +175,7 @@ void SpellCheck::Init(base::PlatformFile file, } bool SpellCheck::SpellCheckWord( - const char16* in_word, + const base::char16* in_word, int in_word_len, int tag, int* misspelling_start, @@ -258,9 +258,9 @@ base::string16 SpellCheck::GetAutoCorrectionWord(const base::string16& word, if (InitializeIfNeeded()) return autocorrect_word; - char16 misspelled_word[ + base::char16 misspelled_word[ chrome::spellcheck_common::kMaxAutoCorrectWordSize + 1]; - const char16* word_char = word.c_str(); + const base::char16* word_char = word.c_str(); for (int i = 0; i <= chrome::spellcheck_common::kMaxAutoCorrectWordSize; ++i) { if (i >= word_length) @@ -354,7 +354,7 @@ void SpellCheck::CreateTextCheckingResults( // Double-check misspelled words with our spellchecker and attach grammar // markers to them if our spellchecker tells they are correct words, i.e. they // are probably contextually-misspelled words. - const char16* text = line_text.c_str(); + const base::char16* text = line_text.c_str(); std::vector<WebTextCheckingResult> list; for (size_t i = 0; i < spellcheck_results.size(); ++i) { SpellCheckResult::Decoration decoration = spellcheck_results[i].decoration; diff --git a/chrome/renderer/spellchecker/spellcheck.h b/chrome/renderer/spellchecker/spellcheck.h index bfc6e71..95779c0 100644 --- a/chrome/renderer/spellchecker/spellcheck.h +++ b/chrome/renderer/spellchecker/spellcheck.h @@ -66,7 +66,7 @@ class SpellCheck : public content::RenderProcessObserver, // If the word is spelled correctly, the vector is empty. // If optional_suggestions is NULL, suggested words will not be looked up. // Note that Doing suggest lookups can be slow. - bool SpellCheckWord(const char16* in_word, + bool SpellCheckWord(const base::char16* in_word, int in_word_len, int tag, int* misspelling_start, diff --git a/chrome/renderer/spellchecker/spellcheck_language.cc b/chrome/renderer/spellchecker/spellcheck_language.cc index 662148c..e9d1015 100644 --- a/chrome/renderer/spellchecker/spellcheck_language.cc +++ b/chrome/renderer/spellchecker/spellcheck_language.cc @@ -33,7 +33,7 @@ bool SpellcheckLanguage::InitializeIfNeeded() { } bool SpellcheckLanguage::SpellCheckWord( - const char16* in_word, + const base::char16* in_word, int in_word_len, int tag, int* misspelling_start, diff --git a/chrome/renderer/spellchecker/spellcheck_language.h b/chrome/renderer/spellchecker/spellcheck_language.h index acd58f4..0cd2bba 100644 --- a/chrome/renderer/spellchecker/spellcheck_language.h +++ b/chrome/renderer/spellchecker/spellcheck_language.h @@ -34,7 +34,7 @@ class SpellcheckLanguage { // If the word is spelled correctly, the vector is empty. // If optional_suggestions is NULL, suggested words will not be looked up. // Note that doing suggest lookups can be slow. - bool SpellCheckWord(const char16* in_word, + bool SpellCheckWord(const base::char16* in_word, int in_word_len, int tag, int* misspelling_start, diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc index 84e18b7..191a686 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc @@ -241,7 +241,7 @@ void SpellCheckProvider::OnRespondSpellingService( bool SpellCheckProvider::HasWordCharacters( const base::string16& text, int index) const { - const char16* data = text.data(); + const base::char16* data = text.data(); int length = text.length(); while (index < length) { uint32 code = 0; diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator.cc b/chrome/renderer/spellchecker/spellcheck_worditerator.cc index 9d0e555..1297c5a 100644 --- a/chrome/renderer/spellchecker/spellcheck_worditerator.cc +++ b/chrome/renderer/spellchecker/spellcheck_worditerator.cc @@ -339,7 +339,7 @@ bool SpellcheckWordIterator::IsInitialized() const { return !!iterator_; } -bool SpellcheckWordIterator::SetText(const char16* text, size_t length) { +bool SpellcheckWordIterator::SetText(const base::char16* text, size_t length) { DCHECK(!!iterator_); // Set the text to be split by this iterator. diff --git a/chrome/renderer/spellchecker/spellcheck_worditerator.h b/chrome/renderer/spellchecker/spellcheck_worditerator.h index 3a757b9..09d54a6 100644 --- a/chrome/renderer/spellchecker/spellcheck_worditerator.h +++ b/chrome/renderer/spellchecker/spellcheck_worditerator.h @@ -122,7 +122,7 @@ class SpellcheckWordIterator { // Set text to be iterated. (This text does not have to be NULL-terminated.) // This function also resets internal state so we can reuse this iterator // without calling Initialize(). - bool SetText(const char16* text, size_t length); + bool SetText(const base::char16* text, size_t length); // Retrieves a word (or a contraction), stores its copy to 'word_string', and // stores the position and the length for input word to 'word_start'. Since @@ -154,7 +154,7 @@ class SpellcheckWordIterator { base::string16* output_string) const; // The pointer to the input string from which we are extracting words. - const char16* text_; + const base::char16* text_; // The length of the original string. int length_; diff --git a/chrome/test/chromedriver/key_converter.cc b/chrome/test/chromedriver/key_converter.cc index 6e40702..a384b96 100644 --- a/chrome/test/chromedriver/key_converter.cc +++ b/chrome/test/chromedriver/key_converter.cc @@ -91,11 +91,11 @@ const ui::KeyboardCode kSpecialWebDriverKeys[] = { ui::VKEY_F11, ui::VKEY_F12}; -const char16 kWebDriverNullKey = 0xE000U; -const char16 kWebDriverShiftKey = 0xE008U; -const char16 kWebDriverControlKey = 0xE009U; -const char16 kWebDriverAltKey = 0xE00AU; -const char16 kWebDriverCommandKey = 0xE03DU; +const base::char16 kWebDriverNullKey = 0xE000U; +const base::char16 kWebDriverShiftKey = 0xE008U; +const base::char16 kWebDriverControlKey = 0xE009U; +const base::char16 kWebDriverAltKey = 0xE00AU; +const base::char16 kWebDriverCommandKey = 0xE03DU; // Returns whether the given key code has a corresponding printable char. // Notice: The given key code should be a special WebDriver key code. @@ -107,7 +107,7 @@ bool IsSpecialKeyPrintable(ui::KeyboardCode key_code) { } // Returns whether the given key is a WebDriver key modifier. -bool IsModifierKey(char16 key) { +bool IsModifierKey(base::char16 key) { switch (key) { case kWebDriverShiftKey: case kWebDriverControlKey: @@ -122,7 +122,8 @@ bool IsModifierKey(char16 key) { // Gets the key code associated with |key|, if it is a special WebDriver key. // Returns whether |key| is a special WebDriver key. If true, |key_code| will // be set. -bool KeyCodeFromSpecialWebDriverKey(char16 key, ui::KeyboardCode* key_code) { +bool KeyCodeFromSpecialWebDriverKey(base::char16 key, + ui::KeyboardCode* key_code) { int index = static_cast<int>(key) - 0xE000U; bool is_special_key = index >= 0 && index < static_cast<int>(arraysize(kSpecialWebDriverKeys)); @@ -136,7 +137,7 @@ bool KeyCodeFromSpecialWebDriverKey(char16 key, ui::KeyboardCode* key_code) { // character, which is shorthand for the return key. Returns whether |key| is // a shorthand key. If true, |key_code| will be set and |client_should_skip| // will be set to whether the key should be skipped. -bool KeyCodeFromShorthandKey(char16 key_utf16, +bool KeyCodeFromShorthandKey(base::char16 key_utf16, ui::KeyboardCode* key_code, bool* client_should_skip) { base::string16 key_str_utf16; @@ -200,7 +201,7 @@ Status ConvertKeysToKeyEvents(const base::string16& client_keys, int sticky_modifiers = *modifiers; for (size_t i = 0; i < keys.size(); ++i) { - char16 key = keys[i]; + base::char16 key = keys[i]; if (key == kWebDriverNullKey) { // Release all modifier keys and clear |stick_modifiers|. diff --git a/chrome/test/chromedriver/key_converter_unittest.cc b/chrome/test/chromedriver/key_converter_unittest.cc index 21a3c5f..7cfcb52 100644 --- a/chrome/test/chromedriver/key_converter_unittest.cc +++ b/chrome/test/chromedriver/key_converter_unittest.cc @@ -136,7 +136,7 @@ TEST(KeyConverter, WebDriverSpecialChar) { CreateCharEvent(" ", " ", 0), CreateKeyUpEvent(ui::VKEY_SPACE, 0)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE00DU)); + keys.push_back(static_cast<base::char16>(0xE00DU)); CheckEventsReleaseModifiers(keys, event_array, arraysize(event_array)); } @@ -145,7 +145,7 @@ TEST(KeyConverter, WebDriverSpecialNonCharKey) { CreateKeyDownEvent(ui::VKEY_F1, 0), CreateKeyUpEvent(ui::VKEY_F1, 0)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE031U)); + keys.push_back(static_cast<base::char16>(0xE031U)); CheckEventsReleaseModifiers(keys, event_array, arraysize(event_array)); } @@ -210,7 +210,7 @@ TEST(KeyConverter, UppercaseCharUsesShiftOnlyIfNecessary) { CreateKeyUpEvent(ui::VKEY_C, kShiftKeyModifierMask), CreateKeyUpEvent(ui::VKEY_SHIFT, 0)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE008U)); + keys.push_back(static_cast<base::char16>(0xE008U)); keys.append(base::UTF8ToUTF16("aBc")); CheckEventsReleaseModifiers(keys, event_array, arraysize(event_array)); } @@ -226,14 +226,14 @@ TEST(KeyConverter, ToggleModifiers) { CreateKeyDownEvent(ui::VKEY_COMMAND, kMetaKeyModifierMask), CreateKeyUpEvent(ui::VKEY_COMMAND, 0)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE008U)); - keys.push_back(static_cast<char16>(0xE008U)); - keys.push_back(static_cast<char16>(0xE009U)); - keys.push_back(static_cast<char16>(0xE009U)); - keys.push_back(static_cast<char16>(0xE00AU)); - keys.push_back(static_cast<char16>(0xE00AU)); - keys.push_back(static_cast<char16>(0xE03DU)); - keys.push_back(static_cast<char16>(0xE03DU)); + keys.push_back(static_cast<base::char16>(0xE008U)); + keys.push_back(static_cast<base::char16>(0xE008U)); + keys.push_back(static_cast<base::char16>(0xE009U)); + keys.push_back(static_cast<base::char16>(0xE009U)); + keys.push_back(static_cast<base::char16>(0xE00AU)); + keys.push_back(static_cast<base::char16>(0xE00AU)); + keys.push_back(static_cast<base::char16>(0xE03DU)); + keys.push_back(static_cast<base::char16>(0xE03DU)); CheckEventsReleaseModifiers(keys, event_array, arraysize(event_array)); } @@ -387,10 +387,10 @@ TEST(KeyConverter, ModifiersState) { CreateKeyDownEvent(ui::VKEY_MENU, alt_key_modifier), CreateKeyDownEvent(ui::VKEY_COMMAND, meta_key_modifier)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE008U)); - keys.push_back(static_cast<char16>(0xE009U)); - keys.push_back(static_cast<char16>(0xE00AU)); - keys.push_back(static_cast<char16>(0xE03DU)); + keys.push_back(static_cast<base::char16>(0xE008U)); + keys.push_back(static_cast<base::char16>(0xE009U)); + keys.push_back(static_cast<base::char16>(0xE00AU)); + keys.push_back(static_cast<base::char16>(0xE03DU)); CheckEvents(keys, event_array, false /* release_modifiers */, arraysize(event_array), meta_key_modifier); @@ -404,8 +404,8 @@ TEST(KeyConverter, ReleaseModifiers) { CreateKeyUpEvent(ui::VKEY_SHIFT, 0), CreateKeyUpEvent(ui::VKEY_CONTROL, 0)}; base::string16 keys; - keys.push_back(static_cast<char16>(0xE008U)); - keys.push_back(static_cast<char16>(0xE009U)); + keys.push_back(static_cast<base::char16>(0xE008U)); + keys.push_back(static_cast<base::char16>(0xE009U)); CheckEvents(keys, event_array, true /* release_modifiers */, arraysize(event_array), 0); diff --git a/chrome/test/chromedriver/keycode_text_conversion.h b/chrome/test/chromedriver/keycode_text_conversion.h index 294a8b7..915674e 100644 --- a/chrome/test/chromedriver/keycode_text_conversion.h +++ b/chrome/test/chromedriver/keycode_text_conversion.h @@ -27,7 +27,7 @@ bool ConvertKeyCodeToText(ui::KeyboardCode key_code, // the character using the current keyboard layout. Returns true on success. // If an error occurs |error_msg| will be set to the error message, otherwise // it will be set to the empty string. -bool ConvertCharToKeyCode(char16 key, +bool ConvertCharToKeyCode(base::char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, std::string* error_msg); diff --git a/chrome/test/chromedriver/keycode_text_conversion_mac.mm b/chrome/test/chromedriver/keycode_text_conversion_mac.mm index 6d8a2c3..9854665 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_mac.mm +++ b/chrome/test/chromedriver/keycode_text_conversion_mac.mm @@ -74,7 +74,7 @@ bool ConvertKeyCodeToText( } bool ConvertCharToKeyCode( - char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, + base::char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, std::string* error_msg) { base::string16 key_string; key_string.push_back(key); diff --git a/chrome/test/chromedriver/keycode_text_conversion_unittest.cc b/chrome/test/chromedriver/keycode_text_conversion_unittest.cc index 5c95fa0..fc2a82b 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_unittest.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_unittest.cc @@ -14,7 +14,7 @@ namespace { -void CheckCharToKeyCode16(char16 character, ui::KeyboardCode key_code, +void CheckCharToKeyCode16(base::char16 character, ui::KeyboardCode key_code, int modifiers) { ui::KeyboardCode actual_key_code = ui::VKEY_UNKNOWN; int actual_modifiers = 0; @@ -42,7 +42,7 @@ void CheckCharToKeyCode(wchar_t character, ui::KeyboardCode key_code, void CheckCantConvertChar(wchar_t character) { std::wstring character_string; character_string.push_back(character); - char16 character_utf16 = base::WideToUTF16(character_string)[0]; + base::char16 character_utf16 = base::WideToUTF16(character_string)[0]; ui::KeyboardCode actual_key_code = ui::VKEY_UNKNOWN; int actual_modifiers = 0; std::string error_msg; diff --git a/chrome/test/chromedriver/keycode_text_conversion_win.cc b/chrome/test/chromedriver/keycode_text_conversion_win.cc index d65919d..802eb3c 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_win.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_win.cc @@ -35,7 +35,7 @@ bool ConvertKeyCodeToText( } bool ConvertCharToKeyCode( - char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, + base::char16 key, ui::KeyboardCode* key_code, int *necessary_modifiers, std::string* error_msg) { short vkey_and_modifiers = ::VkKeyScanW(key); bool translated = vkey_and_modifiers != -1 && diff --git a/chrome/test/chromedriver/keycode_text_conversion_x.cc b/chrome/test/chromedriver/keycode_text_conversion_x.cc index 0499203..d52bfb2 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_x.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_x.cc @@ -229,7 +229,7 @@ bool ConvertKeyCodeToText( } bool ConvertCharToKeyCode( - char16 key, + base::char16 key, ui::KeyboardCode* key_code, int* necessary_modifiers, std::string* error_msg) { diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc index 0779fb3..96b90d0 100644 --- a/chrome/utility/importer/ie_importer_win.cc +++ b/chrome/utility/importer/ie_importer_win.cc @@ -46,15 +46,15 @@ namespace { // Registry key paths from which we import IE settings. -const char16 kSearchScopePath[] = +const base::char16 kSearchScopePath[] = L"Software\\Microsoft\\Internet Explorer\\SearchScopes"; -const char16 kIEVersionKey[] = +const base::char16 kIEVersionKey[] = L"Software\\Microsoft\\Internet Explorer"; -const char16 kIEToolbarKey[] = +const base::char16 kIEToolbarKey[] = L"Software\\Microsoft\\Internet Explorer\\Toolbar"; // NTFS stream name of favicon image data. -const char16 kFaviconStreamName[] = L":favicon:$DATA"; +const base::char16 kFaviconStreamName[] = L":favicon:$DATA"; // A struct that hosts the information of AutoComplete data in PStore. struct AutoCompleteInfo { diff --git a/chrome_frame/simple_resource_loader.cc b/chrome_frame/simple_resource_loader.cc index b6e21e6..22024f3 100644 --- a/chrome_frame/simple_resource_loader.cc +++ b/chrome_frame/simple_resource_loader.cc @@ -248,7 +248,7 @@ std::wstring SimpleResourceLoader::GetLocalizedResource(int message_id) { // Data pack encodes strings as either UTF8 or UTF16. base::string16 msg; if (data_pack_->GetTextEncodingType() == ui::DataPack::UTF16) { - msg = base::string16(reinterpret_cast<const char16*>(data.data()), + msg = base::string16(reinterpret_cast<const base::char16*>(data.data()), data.length() / 2); } else if (data_pack_->GetTextEncodingType() == ui::DataPack::UTF8) { msg = base::UTF8ToUTF16(data); diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc index 7f3717e..f6b863e 100644 --- a/cloud_print/service/win/chrome_launcher.cc +++ b/cloud_print/service/win/chrome_launcher.cc @@ -32,7 +32,7 @@ namespace { const int kShutdownTimeoutMs = 30 * 1000; const int kUsageUpdateTimeoutMs = 6 * 3600 * 1000; // 6 hours. -static const char16 kAutoRunKeyPath[] = +static const base::char16 kAutoRunKeyPath[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run"; // Terminates any process. diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc index 242fa24..031ff6b 100644 --- a/components/autofill/core/browser/address.cc +++ b/components/autofill/core/browser/address.cc @@ -120,7 +120,7 @@ void Address::SetRawInfo(ServerFieldType type, const base::string16& value) { break; case ADDRESS_HOME_STREET_ADDRESS: - base::SplitString(value, char16('\n'), &street_address_); + base::SplitString(value, base::char16('\n'), &street_address_); break; default: @@ -164,7 +164,7 @@ bool Address::SetInfo(const AutofillType& type, // format, so the code would have to rely on iffy heuristics at best. // Instead, just give up when importing addresses like this. if (storable_type == ADDRESS_HOME_STREET_ADDRESS && !value.empty() && - value.find(char16('\n')) == base::string16::npos) { + value.find(base::char16('\n')) == base::string16::npos) { street_address_.clear(); return false; } diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc index 1a1ba6a..374255f 100644 --- a/components/autofill/core/browser/autofill_field.cc +++ b/components/autofill/core/browser/autofill_field.cc @@ -262,7 +262,7 @@ void FillSelectControl(const AutofillType& type, bool FillMonthControl(const base::string16& value, FormFieldData* field) { // Autofill formats a combined date as month/year. std::vector<base::string16> pieces; - base::SplitString(value, char16('/'), &pieces); + base::SplitString(value, base::char16('/'), &pieces); if (pieces.size() != 2) return false; @@ -290,7 +290,7 @@ void FillStreetAddress(const base::string16& value, } base::string16 one_line_value; - const char16 kNewline[] = { '\n', 0 }; + const base::char16 kNewline[] = { '\n', 0 }; const base::string16 separator = l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR); base::ReplaceChars(value, kNewline, separator, &one_line_value); diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc index a772832..16e9174 100644 --- a/components/autofill/core/browser/autofill_profile.cc +++ b/components/autofill/core/browser/autofill_profile.cc @@ -682,7 +682,7 @@ base::string16 AutofillProfile::ConstructInferredLabel( } // Flatten the label if need be. - const char16 kNewline[] = { '\n', 0 }; + const base::char16 kNewline[] = { '\n', 0 }; const base::string16 newline_separator = l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR); base::ReplaceChars(label, kNewline, newline_separator, &label); diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc index 6964aa4..e3e2b99 100644 --- a/components/autofill/core/browser/credit_card.cc +++ b/components/autofill/core/browser/credit_card.cc @@ -39,7 +39,7 @@ namespace autofill { namespace { -const char16 kCreditCardObfuscationSymbol = '*'; +const base::char16 kCreditCardObfuscationSymbol = '*'; // This is the maximum obfuscated symbols displayed. // It is introduced to avoid rare cases where the credit card number is diff --git a/components/autofill/core/browser/phone_number.cc b/components/autofill/core/browser/phone_number.cc index 28c8981..e997cc4 100644 --- a/components/autofill/core/browser/phone_number.cc +++ b/components/autofill/core/browser/phone_number.cc @@ -17,7 +17,7 @@ namespace autofill { namespace { -const char16 kPhoneNumberSeparators[] = { ' ', '.', '(', ')', '-', 0 }; +const base::char16 kPhoneNumberSeparators[] = { ' ', '.', '(', ')', '-', 0 }; void StripPunctuation(base::string16* number) { base::RemoveChars(*number, kPhoneNumberSeparators, number); diff --git a/components/autofill/core/browser/validation.cc b/components/autofill/core/browser/validation.cc index 4638c70..dc5ddd3 100644 --- a/components/autofill/core/browser/validation.cc +++ b/components/autofill/core/browser/validation.cc @@ -18,7 +18,7 @@ using base::StringPiece16; namespace { // The separator characters for SSNs. -const char16 kSSNSeparators[] = {' ', '-', 0}; +const base::char16 kSSNSeparators[] = {' ', '-', 0}; } // namespace diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc index 9503277..fb60cc9 100644 --- a/components/policy/core/common/policy_loader_win_unittest.cc +++ b/components/policy/core/common/policy_loader_win_unittest.cc @@ -603,12 +603,12 @@ void PRegTestHarness::AppendStringToPRegFile(const base::string16& path, const std::string& key, const std::string& value) { base::string16 string16_value(UTF8ToUTF16(value)); - std::vector<char16> data; + std::vector<base::char16> data; std::transform(string16_value.begin(), string16_value.end(), std::back_inserter(data), std::ptr_fun(base::ByteSwapToLE16)); data.push_back(base::ByteSwapToLE16(L'\0')); - AppendRecordToPRegFile(path, key, REG_SZ, data.size() * sizeof(char16), + AppendRecordToPRegFile(path, key, REG_SZ, data.size() * sizeof(base::char16), reinterpret_cast<uint8*>(vector_as_array(&data))); } @@ -693,7 +693,7 @@ class PolicyLoaderWinTest : public PolicyTestBase, protected: // The policy key this tests places data under. This must match the data // files in chrome/test/data/policy/gpo. - static const char16 kTestPolicyKey[]; + static const base::char16 kTestPolicyKey[]; PolicyLoaderWinTest() : gpo_list_(NULL), @@ -782,7 +782,7 @@ class PolicyLoaderWinTest : public PolicyTestBase, base::FilePath test_data_dir_; }; -const char16 PolicyLoaderWinTest::kTestPolicyKey[] = +const base::char16 PolicyLoaderWinTest::kTestPolicyKey[] = L"SOFTWARE\\Policies\\Chromium"; TEST_F(PolicyLoaderWinTest, HKLMOverHKCU) { diff --git a/components/policy/core/common/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc index ee3fd2d..6c6248c 100644 --- a/components/policy/core/common/preg_parser_win.cc +++ b/components/policy/core/common/preg_parser_win.cc @@ -33,12 +33,12 @@ const char kPRegFileHeader[8] = const int64 kMaxPRegFileSize = 1024 * 1024 * 16; // Constants for PReg file delimiters. -const char16 kDelimBracketOpen = L'['; -const char16 kDelimBracketClose = L']'; -const char16 kDelimSemicolon = L';'; +const base::char16 kDelimBracketOpen = L'['; +const base::char16 kDelimBracketClose = L']'; +const base::char16 kDelimSemicolon = L';'; // Registry path separator. -const char16 kRegistryPathSeparator[] = L"\\"; +const base::char16 kRegistryPathSeparator[] = L"\\"; // Magic strings for the PReg value field to trigger special actions. const char kActionTriggerPrefix[] = "**"; @@ -52,12 +52,12 @@ const char kActionTriggerSoft[] = "soft"; // Returns the character at |cursor| and increments it, unless the end is here // in which case -1 is returned. int NextChar(const uint8** cursor, const uint8* end) { - // Only read the character if a full char16 is available. - if (*cursor + sizeof(char16) > end) + // Only read the character if a full base::char16 is available. + if (*cursor + sizeof(base::char16) > end) return -1; int result = **cursor | (*(*cursor + 1) << 8); - *cursor += sizeof(char16); + *cursor += sizeof(base::char16); return result; } @@ -99,11 +99,12 @@ bool ReadFieldString(const uint8** cursor, } std::string DecodePRegStringValue(const std::vector<uint8>& data) { - size_t len = data.size() / sizeof(char16); + size_t len = data.size() / sizeof(base::char16); if (len <= 0) return std::string(); - const char16* chars = reinterpret_cast<const char16*>(vector_as_array(&data)); + const base::char16* chars = + reinterpret_cast<const base::char16*>(vector_as_array(&data)); base::string16 result; std::transform(chars, chars + len - 1, std::back_inserter(result), std::ptr_fun(base::ByteSwapToLE16)); diff --git a/components/sessions/serialized_navigation_entry.cc b/components/sessions/serialized_navigation_entry.cc index 061c422..a51580b 100644 --- a/components/sessions/serialized_navigation_entry.cc +++ b/components/sessions/serialized_navigation_entry.cc @@ -183,7 +183,7 @@ void WriteString16ToPickle(Pickle* pickle, int* bytes_written, int max_bytes, const base::string16& str) { - int num_bytes = str.size() * sizeof(char16); + int num_bytes = str.size() * sizeof(base::char16); if (*bytes_written + num_bytes < max_bytes) { *bytes_written += num_bytes; pickle->WriteString16(str); diff --git a/components/webdata/encryptor/encryptor_unittest.cc b/components/webdata/encryptor/encryptor_unittest.cc index b48792a..3084ab8 100644 --- a/components/webdata/encryptor/encryptor_unittest.cc +++ b/components/webdata/encryptor/encryptor_unittest.cc @@ -52,12 +52,12 @@ TEST_F(EncryptorTest, String16EncryptionDecryption) { EXPECT_EQ(plaintext, result); // Test Unicode. - char16 wchars[] = { 0xdbeb, 0xdf1b, 0x4e03, 0x6708, 0x8849, - 0x661f, 0x671f, 0x56db, 0x597c, 0x4e03, - 0x6708, 0x56db, 0x6708, 0xe407, 0xdbaf, - 0xdeb5, 0x4ec5, 0x544b, 0x661f, 0x671f, - 0x65e5, 0x661f, 0x671f, 0x4e94, 0xd8b1, - 0xdce1, 0x7052, 0x5095, 0x7c0b, 0xe586, 0}; + base::char16 wchars[] = { 0xdbeb, 0xdf1b, 0x4e03, 0x6708, 0x8849, + 0x661f, 0x671f, 0x56db, 0x597c, 0x4e03, + 0x6708, 0x56db, 0x6708, 0xe407, 0xdbaf, + 0xdeb5, 0x4ec5, 0x544b, 0x661f, 0x671f, + 0x65e5, 0x661f, 0x671f, 0x4e94, 0xd8b1, + 0xdce1, 0x7052, 0x5095, 0x7c0b, 0xe586, 0}; plaintext = wchars; utf8_plaintext = base::UTF16ToUTF8(plaintext); EXPECT_EQ(plaintext, base::UTF8ToUTF16(utf8_plaintext)); diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index 8b3098d..e6daa9f 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -34,7 +34,7 @@ const GUID GUID_IAccessibleContentDocument = { 0xa5d8e1f3, 0x3571, 0x4d8f, 0x95, 0x21, 0x07, 0xed, 0x28, 0xfb, 0x07, 0x2e}; -const char16 BrowserAccessibilityWin::kEmbeddedCharacter[] = L"\xfffc"; +const base::char16 BrowserAccessibilityWin::kEmbeddedCharacter[] = L"\xfffc"; // static LONG BrowserAccessibilityWin::next_unique_id_win_ = diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h index 69d6efb..c2a6b7a 100644 --- a/content/browser/accessibility/browser_accessibility_win.h +++ b/content/browser/accessibility/browser_accessibility_win.h @@ -82,7 +82,7 @@ BrowserAccessibilityWin // Represents a non-static text node in IAccessibleHypertext. This character // is embedded in the response to IAccessibleText::get_text, indicating the // position where a non-static text child object appears. - CONTENT_EXPORT static const char16 kEmbeddedCharacter[]; + CONTENT_EXPORT static const base::char16 kEmbeddedCharacter[]; // Mappings from roles and states to human readable strings. Initialize // with |InitializeStringMaps|. diff --git a/content/browser/dom_storage/dom_storage_database.cc b/content/browser/dom_storage/dom_storage_database.cc index 690d02a..155f1c6 100644 --- a/content/browser/dom_storage/dom_storage_database.cc +++ b/content/browser/dom_storage/dom_storage_database.cc @@ -107,7 +107,7 @@ bool DOMStorageDatabase::CommitChanges(bool clear_all_first, "INSERT INTO ItemTable VALUES (?,?)")); statement.BindString16(0, key); statement.BindBlob(1, value.string().data(), - value.string().length() * sizeof(char16)); + value.string().length() * sizeof(base::char16)); known_to_be_empty_ = false; did_insert = true; } diff --git a/content/browser/dom_storage/session_storage_database.cc b/content/browser/dom_storage/session_storage_database.cc index 8dc8b91..30d3d86 100644 --- a/content/browser/dom_storage/session_storage_database.cc +++ b/content/browser/dom_storage/session_storage_database.cc @@ -578,9 +578,9 @@ bool SessionStorageDatabase::ReadMap(const std::string& map_id, } else { // Convert the raw data stored in std::string (it->value()) to raw data // stored in base::string16. - size_t len = it->value().size() / sizeof(char16); - const char16* data_ptr = - reinterpret_cast<const char16*>(it->value().data()); + size_t len = it->value().size() / sizeof(base::char16); + const base::char16* data_ptr = + reinterpret_cast<const base::char16*>(it->value().data()); (*result)[key16] = base::NullableString16(base::string16(data_ptr, len), false); } diff --git a/content/browser/dom_storage/session_storage_database_unittest.cc b/content/browser/dom_storage/session_storage_database_unittest.cc index 414fbe6..71c8063 100644 --- a/content/browser/dom_storage/session_storage_database_unittest.cc +++ b/content/browser/dom_storage/session_storage_database_unittest.cc @@ -303,9 +303,10 @@ void SessionStorageDatabaseTest::DumpData() const { if (IsMapValueKey(it->key().ToString(), &dummy_map_id)) { // Convert the value back to base::string16. base::string16 value; - size_t len = it->value().size() / sizeof(char16); + size_t len = it->value().size() / sizeof(base::char16); value.resize(len); - value.assign(reinterpret_cast<const char16*>(it->value().data()), len); + value.assign( + reinterpret_cast<const base::char16*>(it->value().data()), len); LOG(WARNING) << it->key().ToString() << ": " << value; } else { LOG(WARNING) << it->key().ToString() << ": " << it->value().ToString(); @@ -699,7 +700,7 @@ TEST_F(SessionStorageDatabaseTest, WriteRawBytes) { unsigned char raw_data[10] = {255, 0, 0, 0, 1, 2, 3, 4, 5, 0}; DOMStorageValuesMap changes; base::string16 string_with_raw_data; - string_with_raw_data.assign(reinterpret_cast<char16*>(raw_data), 5); + string_with_raw_data.assign(reinterpret_cast<base::char16*>(raw_data), 5); changes[kKey1] = base::NullableString16(string_with_raw_data, false); EXPECT_TRUE(db_->CommitAreaChanges(kNamespace1, kOrigin1, false, changes)); CheckDatabaseConsistency(); diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc index 7a22662..5ab1f2a 100644 --- a/content/browser/download/drag_download_util.cc +++ b/content/browser/download/drag_download_util.cc @@ -27,7 +27,7 @@ bool ParseDownloadMetadata(const base::string16& metadata, base::string16* mime_type, base::FilePath* file_name, GURL* url) { - const char16 separator = L':'; + const base::char16 separator = L':'; size_t mime_type_end_pos = metadata.find(separator); if (mime_type_end_pos == base::string16::npos) diff --git a/content/browser/geolocation/wifi_data_provider_win.cc b/content/browser/geolocation/wifi_data_provider_win.cc index a4e6e74..d5149cc 100644 --- a/content/browser/geolocation/wifi_data_provider_win.cc +++ b/content/browser/geolocation/wifi_data_provider_win.cc @@ -617,7 +617,7 @@ bool GetSystemDirectory(base::string16* path) { if (buffer_size == 0) { return false; } - scoped_ptr<char16[]> buffer(new char16[buffer_size]); + scoped_ptr<base::char16[]> buffer(new base::char16[buffer_size]); // Return value excludes terminating NULL. int characters_written = ::GetSystemDirectory(buffer.get(), buffer_size); diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.cc b/content/browser/indexed_db/indexed_db_leveldb_coding.cc index 01c27d1..8a6be42 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding.cc @@ -263,10 +263,11 @@ void EncodeString(const base::string16& value, std::string* into) { // Backing store is UTF-16BE, convert from host endianness. size_t length = value.length(); size_t current = into->size(); - into->resize(into->size() + length * sizeof(char16)); + into->resize(into->size() + length * sizeof(base::char16)); - const char16* src = value.c_str(); - char16* dst = reinterpret_cast<char16*>(&*into->begin() + current); + const base::char16* src = value.c_str(); + base::char16* dst = + reinterpret_cast<base::char16*>(&*into->begin() + current); for (unsigned i = 0; i < length; ++i) *dst++ = htons(*src++); } @@ -428,16 +429,17 @@ bool DecodeString(StringPiece* slice, base::string16* value) { } // Backing store is UTF-16BE, convert to host endianness. - DCHECK(!(slice->size() % sizeof(char16))); - size_t length = slice->size() / sizeof(char16); + DCHECK(!(slice->size() % sizeof(base::char16))); + size_t length = slice->size() / sizeof(base::char16); base::string16 decoded; decoded.reserve(length); - const char16* encoded = reinterpret_cast<const char16*>(slice->begin()); + const base::char16* encoded = + reinterpret_cast<const base::char16*>(slice->begin()); for (unsigned i = 0; i < length; ++i) decoded.push_back(ntohs(*encoded++)); *value = decoded; - slice->remove_prefix(length * sizeof(char16)); + slice->remove_prefix(length * sizeof(base::char16)); return true; } @@ -448,7 +450,7 @@ bool DecodeStringWithLength(StringPiece* slice, base::string16* value) { int64 length = 0; if (!DecodeVarInt(slice, &length) || length < 0) return false; - size_t bytes = length * sizeof(char16); + size_t bytes = length * sizeof(base::char16); if (slice->size() < bytes) return false; @@ -628,9 +630,9 @@ bool ConsumeEncodedIDBKey(StringPiece* slice) { int64 length = 0; if (!DecodeVarInt(slice, &length) || length < 0) return false; - if (slice->size() < static_cast<size_t>(length) * sizeof(char16)) + if (slice->size() < static_cast<size_t>(length) * sizeof(base::char16)) return false; - slice->remove_prefix(length * sizeof(char16)); + slice->remove_prefix(length * sizeof(base::char16)); return true; } case kIndexedDBKeyDateTypeByte: @@ -690,19 +692,19 @@ int CompareEncodedStringsWithLength(StringPiece* slice1, *ok = false; return 0; } - DCHECK_GE(slice1->size(), len1 * sizeof(char16)); - DCHECK_GE(slice2->size(), len2 * sizeof(char16)); - if (slice1->size() < len1 * sizeof(char16) || - slice2->size() < len2 * sizeof(char16)) { + DCHECK_GE(slice1->size(), len1 * sizeof(base::char16)); + DCHECK_GE(slice2->size(), len2 * sizeof(base::char16)); + if (slice1->size() < len1 * sizeof(base::char16) || + slice2->size() < len2 * sizeof(base::char16)) { *ok = false; return 0; } // Extract the string data, and advance the passed slices. - StringPiece string1(slice1->begin(), len1 * sizeof(char16)); - StringPiece string2(slice2->begin(), len2 * sizeof(char16)); - slice1->remove_prefix(len1 * sizeof(char16)); - slice2->remove_prefix(len2 * sizeof(char16)); + StringPiece string1(slice1->begin(), len1 * sizeof(base::char16)); + StringPiece string2(slice2->begin(), len2 * sizeof(base::char16)); + slice1->remove_prefix(len1 * sizeof(base::char16)); + slice2->remove_prefix(len2 * sizeof(base::char16)); *ok = true; // Strings are UTF-16BE encoded, so a simple memcmp is sufficient. diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc index 97128ec..07bf2b1 100644 --- a/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc +++ b/content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc @@ -317,8 +317,8 @@ static std::string WrappedEncodeString(base::string16 value) { } TEST(IndexedDBLevelDBCodingTest, EncodeString) { - const char16 test_string_a[] = {'f', 'o', 'o', '\0'}; - const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; + const base::char16 test_string_a[] = {'f', 'o', 'o', '\0'}; + const base::char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; EXPECT_EQ(static_cast<size_t>(0), WrappedEncodeString(ASCIIToUTF16("")).size()); @@ -333,8 +333,8 @@ TEST(IndexedDBLevelDBCodingTest, EncodeString) { } TEST(IndexedDBLevelDBCodingTest, DecodeString) { - const char16 test_string_a[] = {'f', 'o', 'o', '\0'}; - const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; + const base::char16 test_string_a[] = {'f', 'o', 'o', '\0'}; + const base::char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; std::vector<base::string16> test_cases; test_cases.push_back(base::string16()); @@ -373,8 +373,8 @@ static std::string WrappedEncodeStringWithLength(base::string16 value) { } TEST(IndexedDBLevelDBCodingTest, EncodeStringWithLength) { - const char16 test_string_a[] = {'f', 'o', 'o', '\0'}; - const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; + const base::char16 test_string_a[] = {'f', 'o', 'o', '\0'}; + const base::char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; EXPECT_EQ(static_cast<size_t>(1), WrappedEncodeStringWithLength(base::string16()).size()); @@ -389,11 +389,11 @@ TEST(IndexedDBLevelDBCodingTest, EncodeStringWithLength) { } TEST(IndexedDBLevelDBCodingTest, DecodeStringWithLength) { - const char16 test_string_a[] = {'f', 'o', 'o', '\0'}; - const char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; + const base::char16 test_string_a[] = {'f', 'o', 'o', '\0'}; + const base::char16 test_string_b[] = {0xdead, 0xbeef, '\0'}; const int kLongStringLen = 1234; - char16 long_string[kLongStringLen + 1]; + base::char16 long_string[kLongStringLen + 1]; for (int i = 0; i < kLongStringLen; ++i) long_string[i] = i; long_string[kLongStringLen] = 0; @@ -445,12 +445,12 @@ static int CompareStrings(const std::string& p, const std::string& q) { } TEST(IndexedDBLevelDBCodingTest, CompareEncodedStringsWithLength) { - const char16 test_string_a[] = {0x1000, 0x1000, '\0'}; - const char16 test_string_b[] = {0x1000, 0x1000, 0x1000, '\0'}; - const char16 test_string_c[] = {0x1000, 0x1000, 0x1001, '\0'}; - const char16 test_string_d[] = {0x1001, 0x1000, 0x1000, '\0'}; - const char16 test_string_e[] = {0xd834, 0xdd1e, '\0'}; - const char16 test_string_f[] = {0xfffd, '\0'}; + const base::char16 test_string_a[] = {0x1000, 0x1000, '\0'}; + const base::char16 test_string_b[] = {0x1000, 0x1000, 0x1000, '\0'}; + const base::char16 test_string_c[] = {0x1000, 0x1000, 0x1001, '\0'}; + const base::char16 test_string_d[] = {0x1001, 0x1000, 0x1000, '\0'}; + const base::char16 test_string_e[] = {0xd834, 0xdd1e, '\0'}; + const base::char16 test_string_f[] = {0xfffd, '\0'}; std::vector<base::string16> test_cases; test_cases.push_back(ASCIIToUTF16("")); diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 0c14ea8..1d251a8 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -2258,7 +2258,7 @@ void RenderWidgetHostViewAura::InsertText(const base::string16& text) { has_composition_text_ = false; } -void RenderWidgetHostViewAura::InsertChar(char16 ch, int flags) { +void RenderWidgetHostViewAura::InsertChar(base::char16 ch, int flags) { if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { popup_child_host_view_->InsertChar(ch, flags); return; diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index ab8fcf1..1bff36e 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -260,7 +260,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura virtual void ConfirmCompositionText() OVERRIDE; virtual void ClearCompositionText() OVERRIDE; virtual void InsertText(const base::string16& text) OVERRIDE; - virtual void InsertChar(char16 ch, int flags) OVERRIDE; + virtual void InsertChar(base::char16 ch, int flags) OVERRIDE; virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE; virtual ui::TextInputType GetTextInputType() const OVERRIDE; virtual ui::TextInputMode GetTextInputMode() const OVERRIDE; diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index 7639af2..49c4dbd 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -1030,7 +1030,7 @@ void RenderWidgetHostViewWin::InsertText(const base::string16& text) { false); } -void RenderWidgetHostViewWin::InsertChar(char16 ch, int flags) { +void RenderWidgetHostViewWin::InsertChar(base::char16 ch, int flags) { if (!base::win::IsTSFAwareRequired()) { NOTREACHED(); return; diff --git a/content/browser/renderer_host/render_widget_host_view_win.h b/content/browser/renderer_host/render_widget_host_view_win.h index 4e8717a..69a6bc2 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.h +++ b/content/browser/renderer_host/render_widget_host_view_win.h @@ -271,7 +271,7 @@ class RenderWidgetHostViewWin virtual void ConfirmCompositionText() OVERRIDE; virtual void ClearCompositionText() OVERRIDE; virtual void InsertText(const base::string16& text) OVERRIDE; - virtual void InsertChar(char16 ch, int flags) OVERRIDE; + virtual void InsertChar(base::char16 ch, int flags) OVERRIDE; virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE; virtual ui::TextInputType GetTextInputType() const OVERRIDE; virtual ui::TextInputMode GetTextInputMode() const OVERRIDE; diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc index 0c54523..a4c996c 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc @@ -34,13 +34,13 @@ base::string16 WebUI::GetJavascriptCall( std::string json; for (size_t i = 0; i < arg_list.size(); ++i) { if (i > 0) - parameters += char16(','); + parameters += base::char16(','); base::JSONWriter::Write(arg_list[i], &json); parameters += base::UTF8ToUTF16(json); } return base::ASCIIToUTF16(function_name) + - char16('(') + parameters + char16(')') + char16(';'); + base::char16('(') + parameters + base::char16(')') + base::char16(';'); } WebUIImpl::WebUIImpl(WebContents* contents) diff --git a/content/common/android/address_parser.cc b/content/common/android/address_parser.cc index 15874fd3..cc47bef 100644 --- a/content/common/android/address_parser.cc +++ b/content/common/android/address_parser.cc @@ -32,7 +32,7 @@ const size_t kMaxAddressNameWordLength = 25; const size_t kMaxLocationNameDistance = 4; // Additional characters used as new line delimiters. -const char16 kNewlineDelimiters[] = { +const base::char16 kNewlineDelimiters[] = { '\n', ',', '*', diff --git a/content/common/android/address_parser_internal.cc b/content/common/android/address_parser_internal.cc index fe14d3b..b1a440d 100644 --- a/content/common/android/address_parser_internal.cc +++ b/content/common/android/address_parser_internal.cc @@ -20,14 +20,14 @@ const size_t kZipPlus4Digits = 9; // Maximum number of digits of a house number, including possible hyphens. const size_t kMaxHouseDigits = 5; -char16 SafePreviousChar(const base::string16::const_iterator& it, +base::char16 SafePreviousChar(const base::string16::const_iterator& it, const base::string16::const_iterator& begin) { if (it == begin) return ' '; return *(it - 1); } -char16 SafeNextChar(const base::string16::const_iterator& it, +base::char16 SafeNextChar(const base::string16::const_iterator& it, const base::string16::const_iterator& end) { if (it == end) return ' '; @@ -73,11 +73,11 @@ Word::Word(const base::string16::const_iterator& begin, DCHECK(begin <= end); } -bool HouseNumberParser::IsPreDelimiter(char16 character) { +bool HouseNumberParser::IsPreDelimiter(base::char16 character) { return character == ':' || IsPostDelimiter(character); } -bool HouseNumberParser::IsPostDelimiter(char16 character) { +bool HouseNumberParser::IsPostDelimiter(base::char16 character) { return IsWhitespace(character) || strchr(",\"'", character); } @@ -161,10 +161,10 @@ bool HouseNumberParser::Parse( // There should be more than 1 character because of result_chars. DCHECK_GT(result_chars_, 0U); DCHECK(it_ != begin_); - char16 previous = SafePreviousChar(it_, begin_); + base::char16 previous = SafePreviousChar(it_, begin_); if (IsAsciiDigit(previous)) { // Check cases like '12A'. - char16 next = SafeNextChar(it_, end_); + base::char16 next = SafeNextChar(it_, end_); if (IsPostDelimiter(next)) { AcceptChars(1); continue; @@ -172,9 +172,9 @@ bool HouseNumberParser::Parse( // Handle cases like 12a, 1st, 2nd, 3rd, 7th. if (IsAsciiAlpha(next)) { - char16 last_digit = previous; - char16 first_letter = base::ToLowerASCII(*it_); - char16 second_letter = base::ToLowerASCII(next); + base::char16 last_digit = previous; + base::char16 first_letter = base::ToLowerASCII(*it_); + base::char16 second_letter = base::ToLowerASCII(next); bool is_teen = SafePreviousChar(it_ - 1, begin_) == '1' && num_digits_ == 2; @@ -348,7 +348,7 @@ bool FindStateStartingInWord(WordList* words, return false; // No state names start with x, y, z. - char16 first_letter = base::ToLowerASCII(*first_word.begin); + base::char16 first_letter = base::ToLowerASCII(*first_word.begin); if (first_letter > 'w') return false; @@ -357,7 +357,7 @@ bool FindStateStartingInWord(WordList* words, // Look for two-letter state names. if (length == 2 && IsAsciiAlpha(*(first_word.begin + 1))) { - char16 second_letter = base::ToLowerASCII(*(first_word.begin + 1)); + base::char16 second_letter = base::ToLowerASCII(*(first_word.begin + 1)); DCHECK(second_letter >= 'a'); int second_index = second_letter - 'a'; @@ -596,7 +596,7 @@ bool IsValidLocationName(const Word& word) { return false; // No location names start with y, z. - char16 first_letter = base::ToLowerASCII(*word.begin); + base::char16 first_letter = base::ToLowerASCII(*word.begin); if (first_letter > 'x') return false; diff --git a/content/common/android/address_parser_internal.h b/content/common/android/address_parser_internal.h index 74af6c3..2c9d19c 100644 --- a/content/common/android/address_parser_internal.h +++ b/content/common/android/address_parser_internal.h @@ -37,8 +37,8 @@ class CONTENT_EXPORT HouseNumberParser { Word* word); private: - static inline bool IsPreDelimiter(char16 character); - static inline bool IsPostDelimiter(char16 character); + static inline bool IsPreDelimiter(base::char16 character); + static inline bool IsPostDelimiter(base::char16 character); inline void RestartOnNextDelimiter(); inline bool CheckFinished(Word* word) const; diff --git a/content/common/dom_storage/dom_storage_map.cc b/content/common/dom_storage/dom_storage_map.cc index 4fe2c3c..de33a52 100644 --- a/content/common/dom_storage/dom_storage_map.cc +++ b/content/common/dom_storage/dom_storage_map.cc @@ -11,7 +11,7 @@ namespace content { namespace { size_t size_of_item(const base::string16& key, const base::string16& value) { - return (key.length() + value.length()) * sizeof(char16); + return (key.length() + value.length()) * sizeof(base::char16); } size_t CountBytes(const DOMStorageValuesMap& values) { diff --git a/content/common/dom_storage/dom_storage_map_unittest.cc b/content/common/dom_storage/dom_storage_map_unittest.cc index 641b6b26..31283fd 100644 --- a/content/common/dom_storage/dom_storage_map_unittest.cc +++ b/content/common/dom_storage/dom_storage_map_unittest.cc @@ -13,14 +13,14 @@ namespace content { TEST(DOMStorageMapTest, DOMStorageMapBasics) { const base::string16 kKey(ASCIIToUTF16("key")); const base::string16 kValue(ASCIIToUTF16("value")); - const size_t kValueBytes = kValue.size() * sizeof(char16); + const size_t kValueBytes = kValue.size() * sizeof(base::char16); const size_t kItemBytes = - (kKey.size() + kValue.size()) * sizeof(char16); + (kKey.size() + kValue.size()) * sizeof(base::char16); const base::string16 kKey2(ASCIIToUTF16("key2")); - const size_t kKey2Bytes = kKey2.size() * sizeof(char16); + const size_t kKey2Bytes = kKey2.size() * sizeof(base::char16); const base::string16 kValue2(ASCIIToUTF16("value2")); const size_t kItem2Bytes = - (kKey2.size() + kValue2.size()) * sizeof(char16); + (kKey2.size() + kValue2.size()) * sizeof(base::char16); const size_t kQuota = 1024; // 1K quota for this test. scoped_refptr<DOMStorageMap> map(new DOMStorageMap(kQuota)); diff --git a/content/common/indexed_db/indexed_db_key_unittest.cc b/content/common/indexed_db/indexed_db_key_unittest.cc index ca52cc4..b7eb11d 100644 --- a/content/common/indexed_db/indexed_db_key_unittest.cc +++ b/content/common/indexed_db/indexed_db_key_unittest.cc @@ -32,9 +32,9 @@ TEST(IndexedDBKeyTest, KeySizeEstimates) { keys.push_back(IndexedDBKey(date, blink::WebIDBKeyTypeDate)); estimates.push_back(static_cast<size_t>(24)); // Overhead + sizeof(double). - const base::string16 string(1024, static_cast<char16>('X')); + const base::string16 string(1024, static_cast<base::char16>('X')); keys.push_back(IndexedDBKey(string)); - // Overhead + string length * sizeof(char16). + // Overhead + string length * sizeof(base::char16). estimates.push_back(static_cast<size_t>(2064)); const size_t array_size = 1024; diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc index 4fba507..1a7db619 100644 --- a/content/common/page_state_serialization.cc +++ b/content/common/page_state_serialization.cc @@ -311,8 +311,8 @@ void WriteString(const base::NullableString16& str, SerializeObject* obj) { if (str.is_null()) { obj->pickle.WriteInt(-1); } else { - const char16* data = str.string().data(); - size_t length_in_bytes = str.string().length() * sizeof(char16); + const base::char16* data = str.string().data(); + size_t length_in_bytes = str.string().length() * sizeof(base::char16); CHECK_LT(length_in_bytes, static_cast<size_t>(std::numeric_limits<int>::max())); @@ -323,7 +323,7 @@ void WriteString(const base::NullableString16& str, SerializeObject* obj) { // This reads a serialized NullableString16 from obj. If a string can't be // read, NULL is returned. -const char16* ReadStringNoCopy(SerializeObject* obj, int* num_chars) { +const base::char16* ReadStringNoCopy(SerializeObject* obj, int* num_chars) { int length_in_bytes; if (!obj->pickle.ReadInt(&obj->iter, &length_in_bytes)) { obj->parse_error = true; @@ -340,20 +340,20 @@ const char16* ReadStringNoCopy(SerializeObject* obj, int* num_chars) { } if (num_chars) - *num_chars = length_in_bytes / sizeof(char16); - return reinterpret_cast<const char16*>(data); + *num_chars = length_in_bytes / sizeof(base::char16); + return reinterpret_cast<const base::char16*>(data); } base::NullableString16 ReadString(SerializeObject* obj) { int num_chars; - const char16* chars = ReadStringNoCopy(obj, &num_chars); + const base::char16* chars = ReadStringNoCopy(obj, &num_chars); return chars ? base::NullableString16(base::string16(chars, num_chars), false) : base::NullableString16(); } void ConsumeString(SerializeObject* obj) { - const char16* unused ALLOW_UNUSED = ReadStringNoCopy(obj, NULL); + const base::char16* unused ALLOW_UNUSED = ReadStringNoCopy(obj, NULL); } template <typename T> diff --git a/content/common/plugin_constants_win.cc b/content/common/plugin_constants_win.cc index e87a50e..edaeffd 100644 --- a/content/common/plugin_constants_win.cc +++ b/content/common/plugin_constants_win.cc @@ -6,25 +6,26 @@ namespace content { -const char16 kNativeWindowClassName[] = L"NativeWindowClass"; -const char16 kWrapperNativeWindowClassName[] = L"WrapperNativeWindowClass"; -const char16 kPluginNameAtomProperty[] = L"PluginNameAtom"; -const char16 kPluginVersionAtomProperty[] = L"PluginVersionAtom"; -const char16 kDummyActivationWindowName[] = L"DummyWindowForActivation"; -const char16 kPaintMessageName[] = L"Chrome_CustomPaintil"; -const char16 kRegistryMozillaPlugins[] = L"SOFTWARE\\MozillaPlugins"; -const char16 kMozillaActiveXPlugin[] = L"npmozax.dll"; -const char16 kNewWMPPlugin[] = L"np-mswmp.dll"; -const char16 kOldWMPPlugin[] = L"npdsplay.dll"; -const char16 kYahooApplicationStatePlugin[] = L"npystate.dll"; -const char16 kWanWangProtocolHandlerPlugin[] = L"npww.dll"; -const char16 kFlashPlugin[] = L"npswf32.dll"; -const char16 kAcrobatReaderPlugin[] = L"nppdf32.dll"; -const char16 kRealPlayerPlugin[] = L"nppl3260.dll"; -const char16 kSilverlightPlugin[] = L"npctrl.dll"; -const char16 kJavaPlugin1[] = L"npjp2.dll"; -const char16 kJavaPlugin2[] = L"npdeploytk.dll"; +const base::char16 kNativeWindowClassName[] = L"NativeWindowClass"; +const base::char16 kWrapperNativeWindowClassName[] = + L"WrapperNativeWindowClass"; +const base::char16 kPluginNameAtomProperty[] = L"PluginNameAtom"; +const base::char16 kPluginVersionAtomProperty[] = L"PluginVersionAtom"; +const base::char16 kDummyActivationWindowName[] = L"DummyWindowForActivation"; +const base::char16 kPaintMessageName[] = L"Chrome_CustomPaintil"; +const base::char16 kRegistryMozillaPlugins[] = L"SOFTWARE\\MozillaPlugins"; +const base::char16 kMozillaActiveXPlugin[] = L"npmozax.dll"; +const base::char16 kNewWMPPlugin[] = L"np-mswmp.dll"; +const base::char16 kOldWMPPlugin[] = L"npdsplay.dll"; +const base::char16 kYahooApplicationStatePlugin[] = L"npystate.dll"; +const base::char16 kWanWangProtocolHandlerPlugin[] = L"npww.dll"; +const base::char16 kFlashPlugin[] = L"npswf32.dll"; +const base::char16 kAcrobatReaderPlugin[] = L"nppdf32.dll"; +const base::char16 kRealPlayerPlugin[] = L"nppl3260.dll"; +const base::char16 kSilverlightPlugin[] = L"npctrl.dll"; +const base::char16 kJavaPlugin1[] = L"npjp2.dll"; +const base::char16 kJavaPlugin2[] = L"npdeploytk.dll"; const char kGPUPluginMimeType[] = "application/vnd.google.chrome.gpu-plugin"; -const char16 kPluginDummyParentProperty[] = L"NPAPIPluginDummyParent"; +const base::char16 kPluginDummyParentProperty[] = L"NPAPIPluginDummyParent"; } // namespace content diff --git a/content/common/plugin_constants_win.h b/content/common/plugin_constants_win.h index 7d8d224..d796730 100644 --- a/content/common/plugin_constants_win.h +++ b/content/common/plugin_constants_win.h @@ -14,39 +14,39 @@ namespace content { // The window class name for a plugin window. -extern const char16 kNativeWindowClassName[]; +extern const base::char16 kNativeWindowClassName[]; // The name of the window class name for the wrapper HWND around the actual // plugin window that's used when running in multi-process mode. This window // is created on the browser UI thread. -extern const char16 kWrapperNativeWindowClassName[]; +extern const base::char16 kWrapperNativeWindowClassName[]; -extern const char16 kPluginNameAtomProperty[]; -extern const char16 kPluginVersionAtomProperty[]; -extern const char16 kDummyActivationWindowName[]; +extern const base::char16 kPluginNameAtomProperty[]; +extern const base::char16 kPluginVersionAtomProperty[]; +extern const base::char16 kDummyActivationWindowName[]; // The name of the custom window message that the browser uses to tell the // plugin process to paint a window. -extern const char16 kPaintMessageName[]; +extern const base::char16 kPaintMessageName[]; // The name of the registry key which NPAPI plugins update on installation. -extern const char16 kRegistryMozillaPlugins[]; - -extern const char16 kMozillaActiveXPlugin[]; -extern const char16 kNewWMPPlugin[]; -extern const char16 kOldWMPPlugin[]; -extern const char16 kYahooApplicationStatePlugin[]; -extern const char16 kWanWangProtocolHandlerPlugin[]; -extern const char16 kFlashPlugin[]; -extern const char16 kAcrobatReaderPlugin[]; -extern const char16 kRealPlayerPlugin[]; -extern const char16 kSilverlightPlugin[]; -extern const char16 kJavaPlugin1[]; -extern const char16 kJavaPlugin2[]; +extern const base::char16 kRegistryMozillaPlugins[]; + +extern const base::char16 kMozillaActiveXPlugin[]; +extern const base::char16 kNewWMPPlugin[]; +extern const base::char16 kOldWMPPlugin[]; +extern const base::char16 kYahooApplicationStatePlugin[]; +extern const base::char16 kWanWangProtocolHandlerPlugin[]; +extern const base::char16 kFlashPlugin[]; +extern const base::char16 kAcrobatReaderPlugin[]; +extern const base::char16 kRealPlayerPlugin[]; +extern const base::char16 kSilverlightPlugin[]; +extern const base::char16 kJavaPlugin1[]; +extern const base::char16 kJavaPlugin2[]; extern const char kGPUPluginMimeType[]; -extern const char16 kPluginDummyParentProperty[]; +extern const base::char16 kPluginDummyParentProperty[]; } // namespace content diff --git a/content/common/plugin_list_win.cc b/content/common/plugin_list_win.cc index 7d9706b..3afe1ab 100644 --- a/content/common/plugin_list_win.cc +++ b/content/common/plugin_list_win.cc @@ -25,23 +25,23 @@ namespace content { namespace { -const char16 kRegistryApps[] = +const base::char16 kRegistryApps[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"; -const char16 kRegistryFirefox[] = L"firefox.exe"; -const char16 kRegistryAcrobat[] = L"Acrobat.exe"; -const char16 kRegistryAcrobatReader[] = L"AcroRd32.exe"; -const char16 kRegistryWindowsMedia[] = L"wmplayer.exe"; -const char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe"; -const char16 kRegistryPath[] = L"Path"; -const char16 kRegistryFirefoxInstalled[] = +const base::char16 kRegistryFirefox[] = L"firefox.exe"; +const base::char16 kRegistryAcrobat[] = L"Acrobat.exe"; +const base::char16 kRegistryAcrobatReader[] = L"AcroRd32.exe"; +const base::char16 kRegistryWindowsMedia[] = L"wmplayer.exe"; +const base::char16 kRegistryQuickTime[] = L"QuickTimePlayer.exe"; +const base::char16 kRegistryPath[] = L"Path"; +const base::char16 kRegistryFirefoxInstalled[] = L"SOFTWARE\\Mozilla\\Mozilla Firefox"; -const char16 kRegistryJava[] = +const base::char16 kRegistryJava[] = L"Software\\JavaSoft\\Java Runtime Environment"; -const char16 kRegistryBrowserJavaVersion[] = L"BrowserJavaVersion"; -const char16 kRegistryCurrentJavaVersion[] = L"CurrentVersion"; -const char16 kRegistryJavaHome[] = L"JavaHome"; -const char16 kJavaDeploy1[] = L"npdeploytk.dll"; -const char16 kJavaDeploy2[] = L"npdeployjava1.dll"; +const base::char16 kRegistryBrowserJavaVersion[] = L"BrowserJavaVersion"; +const base::char16 kRegistryCurrentJavaVersion[] = L"CurrentVersion"; +const base::char16 kRegistryJavaHome[] = L"JavaHome"; +const base::char16 kJavaDeploy1[] = L"npdeploytk.dll"; +const base::char16 kJavaDeploy2[] = L"npdeployjava1.dll"; base::FilePath AppendPluginsDir(const base::FilePath& path) { return path.AppendASCII("plugins"); @@ -68,7 +68,7 @@ void GetExeDirectory(std::set<base::FilePath>* plugin_dirs) { } // Gets the installed path for a registered app. -bool GetInstalledPath(const char16* app, base::FilePath* out) { +bool GetInstalledPath(const base::char16* app, base::FilePath* out) { base::string16 reg_path(kRegistryApps); reg_path.append(L"\\"); reg_path.append(app); diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc index 7d916ac..6be38a2 100644 --- a/content/common/sandbox_win.cc +++ b/content/common/sandbox_win.cc @@ -220,7 +220,7 @@ void AddGenericDllEvictionPolicy(sandbox::TargetPolicy* policy) { } // Returns the object path prepended with the current logon session. -base::string16 PrependWindowsSessionPath(const char16* object) { +base::string16 PrependWindowsSessionPath(const base::char16* object) { // Cache this because it can't change after process creation. static uintptr_t s_session_id = 0; if (s_session_id == 0) { diff --git a/content/renderer/android/address_detector.cc b/content/renderer/android/address_detector.cc index 6ab267f..0a3d9e6 100644 --- a/content/renderer/android/address_detector.cc +++ b/content/renderer/android/address_detector.cc @@ -40,7 +40,7 @@ std::string AddressDetector::GetContentText(const base::string16& text) { // Get the address and replace unicode bullets with commas. base::string16 address_16 = CollapseWhitespace(text, false); std::replace(address_16.begin(), address_16.end(), - static_cast<char16>(0x2022), static_cast<char16>(',')); + static_cast<base::char16>(0x2022), static_cast<base::char16>(',')); return base::UTF16ToUTF8(address_16); } diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 35f3400..1361561 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc @@ -222,7 +222,7 @@ class RenderViewImplTest : public RenderViewTest { long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), flags); - output->assign(1, static_cast<char16>(c)); + output->assign(1, static_cast<base::char16>(c)); return 1; #elif defined(USE_OZONE) const int flags = ConvertMockKeyboardModifier(modifiers); @@ -255,7 +255,7 @@ class RenderViewImplTest : public RenderViewTest { long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), flags); - output->assign(1, static_cast<char16>(c)); + output->assign(1, static_cast<base::char16>(c)); return 1; #elif defined(TOOLKIT_GTK) // We ignore |layout|, which means we are only testing the layout of the @@ -288,7 +288,7 @@ class RenderViewImplTest : public RenderViewTest { gdk_event_free(events[i]); } - output->assign(1, static_cast<char16>(unicode_key)); + output->assign(1, static_cast<base::char16>(unicode_key)); return 1; #else NOTIMPLEMENTED(); diff --git a/content/shell/renderer/test_runner/WebTestProxy.cpp b/content/shell/renderer/test_runner/WebTestProxy.cpp index f6cec53..4b2215a 100644 --- a/content/shell/renderer/test_runner/WebTestProxy.cpp +++ b/content/shell/renderer/test_runner/WebTestProxy.cpp @@ -291,7 +291,7 @@ string dumpFrameScrollPosition(WebFrame* frame, bool recursive) } struct ToLower { - char16 operator()(char16 c) { return tolower(c); } + base::char16 operator()(base::char16 c) { return tolower(c); } }; // Returns True if item1 < item2. |