Skip to content

Commit

Permalink
Update some uses of char16 to use the base:: namespace.
Browse files Browse the repository at this point in the history
BUG=329295
TEST=no change
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/111373008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242507 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
avi@chromium.org committed Dec 25, 2013
1 parent 76d5aab commit c84c479
Show file tree
Hide file tree
Showing 50 changed files with 147 additions and 137 deletions.
2 changes: 1 addition & 1 deletion net/dns/dns_config_service_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool ParseDomainASCII(const base::string16& widestr, std::string* domain) {

// Otherwise try to convert it from IDN to punycode.
const int kInitialBufferSize = 256;
url_canon::RawCanonOutputT<char16, kInitialBufferSize> punycode;
url_canon::RawCanonOutputT<base::char16, kInitialBufferSize> punycode;
if (!url_canon::IDNToASCII(widestr.data(), widestr.length(), &punycode))
return false;

Expand Down
10 changes: 5 additions & 5 deletions net/http/http_auth_filter_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ enum RegistryHiveType {
namespace http_auth {

// The common path to all the registry keys containing domain zone information.
extern const char16 kRegistryInternetSettings[];
extern const char16 kSettingsMachineOnly[];
extern const char16* kRegistryEntries[3]; // L"http", L"https", and L"*"
extern const base::char16 kRegistryInternetSettings[];
extern const base::char16 kSettingsMachineOnly[];
extern const base::char16* kRegistryEntries[3]; // L"http", L"https", and L"*"

extern const char16* GetRegistryWhitelistKey();
extern const base::char16* GetRegistryWhitelistKey();
// Override the whitelist key. Passing in NULL restores the default value.
extern void SetRegistryWhitelistKey(const char16* new_whitelist_key);
extern void SetRegistryWhitelistKey(const base::char16* new_whitelist_key);
extern bool UseOnlyMachineSettings();

} // namespace http_auth
Expand Down
10 changes: 6 additions & 4 deletions net/http/http_auth_handler_ntlm_portable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ static void* WriteSecBuf(void* buf, uint16 length, uint32 offset) {
* to pass the same buffer as both input and output, which is a handy way to
* convert the unicode buffer to little-endian on big-endian platforms.
*/
static void* WriteUnicodeLE(void* buf, const char16* str, uint32 str_len) {
static void* WriteUnicodeLE(
void* buf, const base::char16* str, uint32 str_len) {
// Convert input string from BE to LE.
uint8* cursor = static_cast<uint8*>(buf);
const uint8* input = reinterpret_cast<const uint8*>(str);
Expand Down Expand Up @@ -480,7 +481,8 @@ static int GenerateType3Msg(const base::string16& domain,
ucs_domain_buf = domain;
domain_ptr = ucs_domain_buf.data();
domain_len = ucs_domain_buf.length() * 2;
WriteUnicodeLE(const_cast<void*>(domain_ptr), (const char16*) domain_ptr,
WriteUnicodeLE(const_cast<void*>(domain_ptr),
(const base::char16*) domain_ptr,
ucs_domain_buf.length());
#else
domain_ptr = domain.data();
Expand All @@ -500,7 +502,7 @@ static int GenerateType3Msg(const base::string16& domain,
ucs_user_buf = username;
user_ptr = ucs_user_buf.data();
user_len = ucs_user_buf.length() * 2;
WriteUnicodeLE(const_cast<void*>(user_ptr), (const char16*) user_ptr,
WriteUnicodeLE(const_cast<void*>(user_ptr), (const base::char16*) user_ptr,
ucs_user_buf.length());
#else
user_ptr = username.data();
Expand All @@ -521,7 +523,7 @@ static int GenerateType3Msg(const base::string16& domain,
host_ptr = ucs_host_buf.data();
host_len = ucs_host_buf.length() * 2;
#ifdef IS_BIG_ENDIAN
WriteUnicodeLE(const_cast<void*>(host_ptr), (const char16*) host_ptr,
WriteUnicodeLE(const_cast<void*>(host_ptr), (const base::char16*) host_ptr,
ucs_host_buf.length());
#endif
} else {
Expand Down
2 changes: 1 addition & 1 deletion net/proxy/proxy_resolver_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args,

// Otherwise try to convert it from IDN to punycode.
const int kInitialBufferSize = 256;
url_canon::RawCanonOutputT<char16, kInitialBufferSize> punycode_output;
url_canon::RawCanonOutputT<base::char16, kInitialBufferSize> punycode_output;
if (!url_canon::IDNToASCII(hostname_utf16.data(),
hostname_utf16.length(),
&punycode_output)) {
Expand Down
6 changes: 4 additions & 2 deletions ppapi/proxy/pdf_resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ void PDFResource::SearchString(const unsigned short* input_string,
PP_PrivateFindResult** results, int* count) {
if (locale_.empty())
locale_ = GetLocale();
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(term, -1, string, -1, locale_.c_str(),
Expand Down
2 changes: 1 addition & 1 deletion ppapi/shared_impl/ppb_gamepad_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct WebKitGamepad {
bool connected;

// Device identifier (based on manufacturer, model, etc.).
char16 id[kIdLengthCap];
base::char16 id[kIdLengthCap];

// Monotonically increasing value referring to when the data were last
// updated.
Expand Down
2 changes: 1 addition & 1 deletion remoting/host/verify_config_window_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool VerifyConfigWindowWin::VerifyHostSecretHash() {

// Get the PIN length.
int pin_length = pin_edit.GetWindowTextLength();
scoped_ptr<char16[]> pin(new char16[pin_length + 1]);
scoped_ptr<base::char16[]> pin(new base::char16[pin_length + 1]);

// Get the PIN making sure it is NULL terminated even if an error occurs.
int result = pin_edit.GetWindowText(pin.get(), pin_length + 1);
Expand Down
8 changes: 4 additions & 4 deletions remoting/host/win/launch_process_with_token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ bool SendCreateProcessRequest(
const base::FilePath::StringType& application_name,
const CommandLine::StringType& command_line,
DWORD creation_flags,
const char16* desktop_name) {
const base::char16* desktop_name) {
// |CreateProcessRequest| structure passes the same parameters to
// the execution server as CreateProcessAsUser() function does. Strings are
// stored as wide strings immediately after the structure. String pointers are
Expand Down Expand Up @@ -374,7 +374,7 @@ bool CreateRemoteSessionProcess(
const base::FilePath::StringType& application_name,
const CommandLine::StringType& command_line,
DWORD creation_flags,
const char16* desktop_name,
const base::char16* desktop_name,
PROCESS_INFORMATION* process_information_out)
{
DCHECK_LT(base::win::GetVersion(), base::win::VERSION_VISTA);
Expand Down Expand Up @@ -457,7 +457,7 @@ bool LaunchProcessWithToken(const base::FilePath& binary,
SECURITY_ATTRIBUTES* thread_attributes,
bool inherit_handles,
DWORD creation_flags,
const char16* desktop_name,
const base::char16* desktop_name,
ScopedHandle* process_out,
ScopedHandle* thread_out) {
base::FilePath::StringType application_name = binary.value();
Expand All @@ -466,7 +466,7 @@ bool LaunchProcessWithToken(const base::FilePath& binary,
memset(&startup_info, 0, sizeof(startup_info));
startup_info.cb = sizeof(startup_info);
if (desktop_name)
startup_info.lpDesktop = const_cast<char16*>(desktop_name);
startup_info.lpDesktop = const_cast<base::char16*>(desktop_name);

PROCESS_INFORMATION temp_process_info = {};
BOOL result = CreateProcessAsUser(user_token,
Expand Down
2 changes: 1 addition & 1 deletion remoting/host/win/launch_process_with_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool LaunchProcessWithToken(const base::FilePath& binary,
SECURITY_ATTRIBUTES* thread_attributes,
bool inherit_handles,
DWORD creation_flags,
const char16* desktop_name,
const base::char16* desktop_name,
base::win::ScopedHandle* process_out,
base::win::ScopedHandle* thread_out);

Expand Down
2 changes: 1 addition & 1 deletion remoting/host/win/security_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ScopedSd ConvertSddlToSd(const std::string& sddl) {

// Converts a SID into a text string.
std::string ConvertSidToString(SID* sid) {
char16* c_sid_string = NULL;
base::char16* c_sid_string = NULL;
if (!ConvertSidToStringSid(sid, &c_sid_string))
return std::string();

Expand Down
13 changes: 7 additions & 6 deletions sandbox/win/src/handle_closer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ SANDBOX_INTERCEPT HandleCloserInfo* g_handles_to_close;

HandleCloser::HandleCloser() {}

ResultCode HandleCloser::AddHandle(const char16* handle_type,
const char16* handle_name) {
ResultCode HandleCloser::AddHandle(const base::char16* handle_type,
const base::char16* handle_name) {
if (!handle_type)
return SBOX_ERROR_BAD_PARAMS;

Expand All @@ -61,10 +61,10 @@ size_t HandleCloser::GetBufferSize() {
for (HandleMap::iterator i = handles_to_close_.begin();
i != handles_to_close_.end(); ++i) {
size_t bytes_entry = offsetof(HandleListEntry, handle_type) +
(i->first.size() + 1) * sizeof(char16);
(i->first.size() + 1) * sizeof(base::char16);
for (HandleMap::mapped_type::iterator j = i->second.begin();
j != i->second.end(); ++j) {
bytes_entry += ((*j).size() + 1) * sizeof(char16);
bytes_entry += ((*j).size() + 1) * sizeof(base::char16);
}

// Round up to the nearest multiple of word size.
Expand Down Expand Up @@ -119,8 +119,9 @@ bool HandleCloser::SetupHandleList(void* buffer, size_t buffer_bytes) {
handle_info->record_bytes = buffer_bytes;
handle_info->num_handle_types = handles_to_close_.size();

char16* output = reinterpret_cast<char16*>(&handle_info->handle_entries[0]);
char16* end = reinterpret_cast<char16*>(
base::char16* output = reinterpret_cast<base::char16*>(
&handle_info->handle_entries[0]);
base::char16* end = reinterpret_cast<base::char16*>(
reinterpret_cast<char*>(buffer) + buffer_bytes);
for (HandleMap::iterator i = handles_to_close_.begin();
i != handles_to_close_.end(); ++i) {
Expand Down
5 changes: 3 additions & 2 deletions sandbox/win/src/handle_closer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct HandleListEntry {
size_t record_bytes; // Rounded to sizeof(size_t) bytes.
size_t offset_to_names; // Nul terminated strings of name_count names.
size_t name_count;
char16 handle_type[1];
base::char16 handle_type[1];
};

// Global parameters and a pointer to the list of entries.
Expand All @@ -47,7 +47,8 @@ class HandleCloser {
// Adds a handle that will be closed in the target process after lockdown.
// A NULL value for handle_name indicates all handles of the specified type.
// An empty string for handle_name indicates the handle is unnamed.
ResultCode AddHandle(const char16* handle_type, const char16* handle_name);
ResultCode AddHandle(const base::char16* handle_type,
const base::char16* handle_name);

// Serializes and copies the closer table into the target process.
bool InitializeTargetHandles(TargetProcess* target);
Expand Down
10 changes: 5 additions & 5 deletions sandbox/win/src/handle_closer_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ void HandleCloserAgent::InitializeHandlesToClose() {
HandleListEntry* entry = g_handles_to_close->handle_entries;
for (size_t i = 0; i < g_handles_to_close->num_handle_types; ++i) {
// Set the type name.
char16* input = entry->handle_type;
base::char16* input = entry->handle_type;
HandleMap::mapped_type& handle_names = handles_to_close_[input];
input = reinterpret_cast<char16*>(reinterpret_cast<char*>(entry)
input = reinterpret_cast<base::char16*>(reinterpret_cast<char*>(entry)
+ entry->offset_to_names);
// Grab all the handle names.
for (size_t j = 0; j < entry->name_count; ++j) {
Expand All @@ -65,9 +65,9 @@ void HandleCloserAgent::InitializeHandlesToClose() {
entry = reinterpret_cast<HandleListEntry*>(reinterpret_cast<char*>(entry)
+ entry->record_bytes);

DCHECK(reinterpret_cast<char16*>(entry) >= input);
DCHECK(reinterpret_cast<char16*>(entry) - input <
sizeof(size_t) / sizeof(char16));
DCHECK(reinterpret_cast<base::char16*>(entry) >= input);
DCHECK(reinterpret_cast<base::char16*>(entry) - input <
sizeof(size_t) / sizeof(base::char16));
}

// Clean up the memory we copied over.
Expand Down
32 changes: 16 additions & 16 deletions sandbox/win/src/handle_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ bool CompareHandleEntries(const SYSTEM_HANDLE_INFORMATION& a,

namespace sandbox {

const char16* HandleTable::kTypeProcess = L"Process";
const char16* HandleTable::kTypeThread = L"Thread";
const char16* HandleTable::kTypeFile = L"File";
const char16* HandleTable::kTypeDirectory = L"Directory";
const char16* HandleTable::kTypeKey = L"Key";
const char16* HandleTable::kTypeWindowStation = L"WindowStation";
const char16* HandleTable::kTypeDesktop = L"Desktop";
const char16* HandleTable::kTypeService = L"Service";
const char16* HandleTable::kTypeMutex = L"Mutex";
const char16* HandleTable::kTypeSemaphore = L"Semaphore";
const char16* HandleTable::kTypeEvent = L"Event";
const char16* HandleTable::kTypeTimer = L"Timer";
const char16* HandleTable::kTypeNamedPipe = L"NamedPipe";
const char16* HandleTable::kTypeJobObject = L"JobObject";
const char16* HandleTable::kTypeFileMap = L"FileMap";
const char16* HandleTable::kTypeAlpcPort = L"ALPC Port";
const base::char16* HandleTable::kTypeProcess = L"Process";
const base::char16* HandleTable::kTypeThread = L"Thread";
const base::char16* HandleTable::kTypeFile = L"File";
const base::char16* HandleTable::kTypeDirectory = L"Directory";
const base::char16* HandleTable::kTypeKey = L"Key";
const base::char16* HandleTable::kTypeWindowStation = L"WindowStation";
const base::char16* HandleTable::kTypeDesktop = L"Desktop";
const base::char16* HandleTable::kTypeService = L"Service";
const base::char16* HandleTable::kTypeMutex = L"Mutex";
const base::char16* HandleTable::kTypeSemaphore = L"Semaphore";
const base::char16* HandleTable::kTypeEvent = L"Event";
const base::char16* HandleTable::kTypeTimer = L"Timer";
const base::char16* HandleTable::kTypeNamedPipe = L"NamedPipe";
const base::char16* HandleTable::kTypeJobObject = L"JobObject";
const base::char16* HandleTable::kTypeFileMap = L"FileMap";
const base::char16* HandleTable::kTypeAlpcPort = L"ALPC Port";

HandleTable::HandleTable() {
static NtQuerySystemInformation QuerySystemInformation = NULL;
Expand Down
32 changes: 16 additions & 16 deletions sandbox/win/src/handle_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ namespace sandbox {
// for iterating through the table and retrieving handle info.
class HandleTable {
public:
static const char16* HandleTable::kTypeProcess;
static const char16* HandleTable::kTypeThread;
static const char16* HandleTable::kTypeFile;
static const char16* HandleTable::kTypeDirectory;
static const char16* HandleTable::kTypeKey;
static const char16* HandleTable::kTypeWindowStation;
static const char16* HandleTable::kTypeDesktop;
static const char16* HandleTable::kTypeService;
static const char16* HandleTable::kTypeMutex;
static const char16* HandleTable::kTypeSemaphore;
static const char16* HandleTable::kTypeEvent;
static const char16* HandleTable::kTypeTimer;
static const char16* HandleTable::kTypeNamedPipe;
static const char16* HandleTable::kTypeJobObject;
static const char16* HandleTable::kTypeFileMap;
static const char16* HandleTable::kTypeAlpcPort;
static const base::char16* HandleTable::kTypeProcess;
static const base::char16* HandleTable::kTypeThread;
static const base::char16* HandleTable::kTypeFile;
static const base::char16* HandleTable::kTypeDirectory;
static const base::char16* HandleTable::kTypeKey;
static const base::char16* HandleTable::kTypeWindowStation;
static const base::char16* HandleTable::kTypeDesktop;
static const base::char16* HandleTable::kTypeService;
static const base::char16* HandleTable::kTypeMutex;
static const base::char16* HandleTable::kTypeSemaphore;
static const base::char16* HandleTable::kTypeEvent;
static const base::char16* HandleTable::kTypeTimer;
static const base::char16* HandleTable::kTypeNamedPipe;
static const base::char16* HandleTable::kTypeJobObject;
static const base::char16* HandleTable::kTypeFileMap;
static const base::char16* HandleTable::kTypeAlpcPort;

class Iterator;

Expand Down
4 changes: 2 additions & 2 deletions sandbox/win/src/sandbox_policy_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ ResultCode PolicyBase::AddDllToUnload(const wchar_t* dll_name) {
return SBOX_ALL_OK;
}

ResultCode PolicyBase::AddKernelObjectToClose(const char16* handle_type,
const char16* handle_name) {
ResultCode PolicyBase::AddKernelObjectToClose(const base::char16* handle_type,
const base::char16* handle_name) {
return handle_closer_.AddHandle(handle_type, handle_name);
}

Expand Down
5 changes: 3 additions & 2 deletions sandbox/win/src/sandbox_policy_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class PolicyBase : public Dispatcher, public TargetPolicy {
virtual ResultCode AddRule(SubSystem subsystem, Semantics semantics,
const wchar_t* pattern) OVERRIDE;
virtual ResultCode AddDllToUnload(const wchar_t* dll_name);
virtual ResultCode AddKernelObjectToClose(const char16* handle_type,
const char16* handle_name) OVERRIDE;
virtual ResultCode AddKernelObjectToClose(
const base::char16* handle_type,
const base::char16* handle_name) OVERRIDE;

// Dispatcher:
virtual Dispatcher* OnMessageReady(IPCParams* ipc,
Expand Down
2 changes: 1 addition & 1 deletion tools/gdb/gdb_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def to_string(self):
return webkit.ustring_to_string(self.val['_M_dataplus']['_M_p'])
pp_set.add_printer(
'string16',
'^string16|std::basic_string<(unsigned short|char16|base::char16).*>$',
'^string16|std::basic_string<(unsigned short|base::char16).*>$',
String16Printer);


Expand Down
4 changes: 2 additions & 2 deletions ui/base/clipboard/clipboard_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void Clipboard::ReadText(ClipboardType type, base::string16* result) const {
if (!data)
return;

result->assign(static_cast<const char16*>(::GlobalLock(data)));
result->assign(static_cast<const base::char16*>(::GlobalLock(data)));
::GlobalUnlock(data);
}

Expand Down Expand Up @@ -632,7 +632,7 @@ void Clipboard::ReadBookmark(base::string16* title, std::string* url) const {
if (!data)
return;

base::string16 bookmark(static_cast<const char16*>(::GlobalLock(data)));
base::string16 bookmark(static_cast<const base::char16*>(::GlobalLock(data)));
::GlobalUnlock(data);

ParseBookmarkClipboardFormat(bookmark, title, url);
Expand Down
2 changes: 1 addition & 1 deletion ui/base/ime/chromeos/character_composer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ TEST_F(CharacterComposerTest, HexadecimalComposition) {
GDK_KEY_2, GDK_KEY_space, 0,
base::string16(1, 0x3042));
// MUSICAL KEYBOARD (U+1F3B9)
const char16 kMusicalKeyboard[] = {0xd83c, 0xdfb9};
const base::char16 kMusicalKeyboard[] = {0xd83c, 0xdfb9};
ExpectKeyFiltered(&character_composer, GDK_KEY_U,
EF_SHIFT_DOWN | EF_CONTROL_DOWN);
ExpectCharacterComposed(&character_composer, GDK_KEY_1, GDK_KEY_f, GDK_KEY_3,
Expand Down
2 changes: 1 addition & 1 deletion ui/base/ime/dummy_text_input_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void DummyTextInputClient::ClearCompositionText() {
void DummyTextInputClient::InsertText(const base::string16& text) {
}

void DummyTextInputClient::InsertChar(char16 ch, int flags) {
void DummyTextInputClient::InsertChar(base::char16 ch, int flags) {
}

gfx::NativeWindow DummyTextInputClient::GetAttachedWindow() const {
Expand Down
2 changes: 1 addition & 1 deletion ui/base/ime/dummy_text_input_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DummyTextInputClient : public TextInputClient {
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;
Expand Down
Loading

0 comments on commit c84c479

Please sign in to comment.