summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-25 21:57:26 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-25 21:57:26 +0000
commitc84c479fdf0ff331f11e17a9753686d21d2ee16b (patch)
tree5fee05ec877add08bc6d60cc0975ad5f4aa4f254 /sandbox
parent76d5aab62bea96fdfc558cbecb52685ca1651870 (diff)
downloadchromium_src-c84c479fdf0ff331f11e17a9753686d21d2ee16b.zip
chromium_src-c84c479fdf0ff331f11e17a9753686d21d2ee16b.tar.gz
chromium_src-c84c479fdf0ff331f11e17a9753686d21d2ee16b.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/111373008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/win/src/handle_closer.cc13
-rw-r--r--sandbox/win/src/handle_closer.h5
-rw-r--r--sandbox/win/src/handle_closer_agent.cc10
-rw-r--r--sandbox/win/src/handle_table.cc32
-rw-r--r--sandbox/win/src/handle_table.h32
-rw-r--r--sandbox/win/src/sandbox_policy_base.cc4
-rw-r--r--sandbox/win/src/sandbox_policy_base.h5
7 files changed, 52 insertions, 49 deletions
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc
index 8ab9209..d250ec3 100644
--- a/sandbox/win/src/handle_closer.cc
+++ b/sandbox/win/src/handle_closer.cc
@@ -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;
@@ -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.
@@ -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) {
diff --git a/sandbox/win/src/handle_closer.h b/sandbox/win/src/handle_closer.h
index 8833b84..a5808d1 100644
--- a/sandbox/win/src/handle_closer.h
+++ b/sandbox/win/src/handle_closer.h
@@ -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.
@@ -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);
diff --git a/sandbox/win/src/handle_closer_agent.cc b/sandbox/win/src/handle_closer_agent.cc
index bc75e73..97dfb17 100644
--- a/sandbox/win/src/handle_closer_agent.cc
+++ b/sandbox/win/src/handle_closer_agent.cc
@@ -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) {
@@ -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.
diff --git a/sandbox/win/src/handle_table.cc b/sandbox/win/src/handle_table.cc
index deecfac..3b2febe 100644
--- a/sandbox/win/src/handle_table.cc
+++ b/sandbox/win/src/handle_table.cc
@@ -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;
diff --git a/sandbox/win/src/handle_table.h b/sandbox/win/src/handle_table.h
index e36bdb4..1b553fa 100644
--- a/sandbox/win/src/handle_table.h
+++ b/sandbox/win/src/handle_table.h
@@ -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;
diff --git a/sandbox/win/src/sandbox_policy_base.cc b/sandbox/win/src/sandbox_policy_base.cc
index 42006e6..758a8be 100644
--- a/sandbox/win/src/sandbox_policy_base.cc
+++ b/sandbox/win/src/sandbox_policy_base.cc
@@ -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);
}
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h
index 7969506..5c267a0 100644
--- a/sandbox/win/src/sandbox_policy_base.h
+++ b/sandbox/win/src/sandbox_policy_base.h
@@ -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,