Merge from Chromium at DEPS revision r205460
This commit was generated by merge_to_master.py.
Change-Id: I4a744a5e426bd3bb378d887cfa56fe054742a540
diff --git a/sandbox/win/src/app_container.h b/sandbox/win/src/app_container.h
index 5ff0b9b..34b43e9 100644
--- a/sandbox/win/src/app_container.h
+++ b/sandbox/win/src/app_container.h
@@ -10,7 +10,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "sandbox/win/src/sandbox_types.h"
namespace base {
diff --git a/sandbox/win/src/app_container_test.cc b/sandbox/win/src/app_container_test.cc
index 0d4d177..3b33ca5 100644
--- a/sandbox/win/src/app_container_test.cc
+++ b/sandbox/win/src/app_container_test.cc
@@ -8,7 +8,7 @@
#include <atlbase.h>
#include <atlsecurity.h>
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
#include "sandbox/win/src/sync_policy_test.h"
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc
index a47bf65..39915a9 100644
--- a/sandbox/win/src/handle_closer.cc
+++ b/sandbox/win/src/handle_closer.cc
@@ -180,11 +180,12 @@
ResolveNTFunctionPtr("NtQueryObject", &QueryObject);
ULONG size = MAX_PATH;
- scoped_ptr<UNICODE_STRING> name;
+ scoped_ptr<UNICODE_STRING, base::FreeDeleter> name;
NTSTATUS result;
do {
- name.reset(reinterpret_cast<UNICODE_STRING*>(new BYTE[size]));
+ name.reset(static_cast<UNICODE_STRING*>(malloc(size)));
+ DCHECK(name.get());
result = QueryObject(handle, ObjectNameInformation, name.get(),
size, &size);
} while (result == STATUS_INFO_LENGTH_MISMATCH ||
diff --git a/sandbox/win/src/handle_closer.h b/sandbox/win/src/handle_closer.h
index b43e50f..a6f81d5 100644
--- a/sandbox/win/src/handle_closer.h
+++ b/sandbox/win/src/handle_closer.h
@@ -9,7 +9,7 @@
#include <set>
#include "base/basictypes.h"
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "sandbox/win/src/interception.h"
#include "sandbox/win/src/sandbox_types.h"
#include "sandbox/win/src/target_process.h"
diff --git a/sandbox/win/src/handle_closer_agent.h b/sandbox/win/src/handle_closer_agent.h
index 602f327..50ebf89 100644
--- a/sandbox/win/src/handle_closer_agent.h
+++ b/sandbox/win/src/handle_closer_agent.h
@@ -6,7 +6,7 @@
#define SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
#include "base/basictypes.h"
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "sandbox/win/src/handle_closer.h"
#include "sandbox/win/src/sandbox_types.h"
diff --git a/sandbox/win/src/handle_closer_test.cc b/sandbox/win/src/handle_closer_test.cc
index b35ff5e..ba0e33a 100644
--- a/sandbox/win/src/handle_closer_test.cc
+++ b/sandbox/win/src/handle_closer_test.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/stringprintf.h"
+#include "base/strings/stringprintf.h"
#include "base/win/scoped_handle.h"
#include "sandbox/win/src/handle_closer_agent.h"
#include "sandbox/win/src/sandbox.h"
diff --git a/sandbox/win/src/handle_policy_test.cc b/sandbox/win/src/handle_policy_test.cc
index 65efbc8..11e888a 100644
--- a/sandbox/win/src/handle_policy_test.cc
+++ b/sandbox/win/src/handle_policy_test.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/stringprintf.h"
+#include "base/strings/stringprintf.h"
#include "sandbox/win/src/handle_policy.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sandbox.h"
diff --git a/sandbox/win/src/handle_table.cc b/sandbox/win/src/handle_table.cc
index a497f74..7230dff 100644
--- a/sandbox/win/src/handle_table.cc
+++ b/sandbox/win/src/handle_table.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cstdlib>
+#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/win_utils.h"
@@ -120,9 +121,10 @@
case UPDATE_INFO_AND_NAME:
if (type_info_buffer_.size() && handle_name_.empty()) {
ULONG size = MAX_PATH;
- scoped_ptr<UNICODE_STRING> name;
+ scoped_ptr<UNICODE_STRING, base::FreeDeleter> name;
do {
- name.reset(reinterpret_cast<UNICODE_STRING*>(new BYTE[size]));
+ name.reset(static_cast<UNICODE_STRING*>(malloc(size)));
+ DCHECK(name.get());
result = QueryObject(reinterpret_cast<HANDLE>(
handle_entry_->Handle), ObjectNameInformation, name.get(),
size, &size);
diff --git a/sandbox/win/src/handle_table.h b/sandbox/win/src/handle_table.h
index acdc88d..21ff80f 100644
--- a/sandbox/win/src/handle_table.h
+++ b/sandbox/win/src/handle_table.h
@@ -9,7 +9,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "sandbox/win/src/nt_internals.h"
namespace sandbox {
diff --git a/sandbox/win/src/process_mitigations_test.cc b/sandbox/win/src/process_mitigations_test.cc
index 69b158d..f1274c5 100644
--- a/sandbox/win/src/process_mitigations_test.cc
+++ b/sandbox/win/src/process_mitigations_test.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/stringprintf.h"
+#include "base/strings/stringprintf.h"
#include "base/win/scoped_handle.h"
#include "base/win/windows_version.h"
diff --git a/sandbox/win/src/process_policy_test.cc b/sandbox/win/src/process_policy_test.cc
index 7e3d460..babe321 100644
--- a/sandbox/win/src/process_policy_test.cc
+++ b/sandbox/win/src/process_policy_test.cc
@@ -5,7 +5,7 @@
#include <memory>
#include <string>
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "base/strings/sys_string_conversions.h"
#include "base/win/scoped_handle.h"
#include "base/win/scoped_process_information.h"
diff --git a/sandbox/win/src/sandbox_nt_util.h b/sandbox/win/src/sandbox_nt_util.h
index 06538cd..40f261b 100644
--- a/sandbox/win/src/sandbox_nt_util.h
+++ b/sandbox/win/src/sandbox_nt_util.h
@@ -34,7 +34,7 @@
// returning a bool, while VERIFY_SUCCESS_NT expects an action returning
// NTSTATUS.
#ifndef NDEBUG
-#define DCHECK_NT(condition) { (condition) ? 0 : __debugbreak(); }
+#define DCHECK_NT(condition) { (condition) ? (void)0 : __debugbreak(); }
#define VERIFY(action) DCHECK_NT(action)
#define VERIFY_SUCCESS(action) DCHECK_NT(NT_SUCCESS(action))
#else
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h
index 0bb906e..d56501d 100644
--- a/sandbox/win/src/sandbox_policy_base.h
+++ b/sandbox/win/src/sandbox_policy_base.h
@@ -12,7 +12,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/string16.h"
+#include "base/strings/string16.h"
#include "sandbox/win/src/crosscall_server.h"
#include "sandbox/win/src/handle_closer.h"
#include "sandbox/win/src/ipc_tags.h"
diff --git a/sandbox/win/src/sidestep/preamble_patcher.h b/sandbox/win/src/sidestep/preamble_patcher.h
index 18cf7f8..3a0985c 100644
--- a/sandbox/win/src/sidestep/preamble_patcher.h
+++ b/sandbox/win/src/sidestep/preamble_patcher.h
@@ -7,6 +7,8 @@
#ifndef SANDBOX_SRC_SIDESTEP_PREAMBLE_PATCHER_H__
#define SANDBOX_SRC_SIDESTEP_PREAMBLE_PATCHER_H__
+#include <stddef.h>
+
namespace sidestep {
// Maximum size of the preamble stub. We overwrite at least the first 5