Bug 1431797 Fix capitalization in mozilla files so the sandbox can compile on MinGW r?bobowen draft
authorTom Ritter <tom@mozilla.com>
Wed, 24 Jan 2018 14:27:21 -0600
changeset 724278 7407a6bba34f8fd3524a0fc0f6c47c5c81dfec91
parent 724277 886900e843da6a7ddc021d87a42acf2a6bb71261
child 747124 c50761f915f11c1d2aea0b2c8842f7a685b3a3f5
push id96718
push userbmo:tom@mozilla.com
push dateWed, 24 Jan 2018 20:35:53 +0000
reviewersbobowen
bugs1431797
milestone60.0a1
Bug 1431797 Fix capitalization in mozilla files so the sandbox can compile on MinGW r?bobowen This patch also adds the capitalization patch file to the chromium patches MozReview-Commit-ID: BzAkEtCKAi4
js/xpconnect/src/XPCShellImpl.cpp
security/sandbox/chromium-shim/patches/with_update/mingw_capitalization.patch
security/sandbox/chromium-shim/patches/with_update/patch_order.txt
toolkit/xre/nsAppRunner.cpp
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -39,17 +39,17 @@
 #ifdef ANDROID
 #include <android/log.h>
 #endif
 
 #ifdef XP_WIN
 #include "mozilla/widget/AudioSession.h"
 #include <windows.h>
 #if defined(MOZ_SANDBOX)
-#include "SandboxBroker.h"
+#include "sandboxBroker.h"
 #endif
 #endif
 
 #ifdef MOZ_CODE_COVERAGE
 #include "mozilla/CodeCoverageHandler.h"
 #endif
 
 // all this crap is needed to do the interactive shell stuff
new file mode 100644
--- /dev/null
+++ b/security/sandbox/chromium-shim/patches/with_update/mingw_capitalization.patch
@@ -0,0 +1,115 @@
+# HG changeset patch
+# User Tom Ritter <tom@mozilla.com>
+# Date 1516825559 21600
+#      Wed Jan 24 14:25:59 2018 -0600
+# Node ID 3fc024ee4ac9f68acf3ad27cfbfdf1527f20438b
+# Parent  bba456aaff2bebb7dc4b695cfb8cb5d492a7c402
+Bug 1431797 Correct the capitalization of headers inside the chromium code so MinGW can compile r?bobowen
+
+diff --git a/security/sandbox/chromium/base/rand_util_win.cc b/security/sandbox/chromium/base/rand_util_win.cc
+--- a/security/sandbox/chromium/base/rand_util_win.cc
++++ b/security/sandbox/chromium/base/rand_util_win.cc
+@@ -7,17 +7,17 @@
+ #include <windows.h>
+ #include <stddef.h>
+ #include <stdint.h>
+ 
+ // #define needed to link in RtlGenRandom(), a.k.a. SystemFunction036.  See the
+ // "Community Additions" comment on MSDN here:
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx
+ #define SystemFunction036 NTAPI SystemFunction036
+-#include <NTSecAPI.h>
++#include <ntsecapi.h>
+ #undef SystemFunction036
+ 
+ #include <algorithm>
+ #include <limits>
+ 
+ #include "base/logging.h"
+ 
+ namespace base {
+diff --git a/security/sandbox/chromium/base/win/pe_image.h b/security/sandbox/chromium/base/win/pe_image.h
+--- a/security/sandbox/chromium/base/win/pe_image.h
++++ b/security/sandbox/chromium/base/win/pe_image.h
+@@ -12,17 +12,17 @@
+ #define BASE_WIN_PE_IMAGE_H_
+ 
+ #include <windows.h>
+ 
+ #if defined(_WIN32_WINNT_WIN8)
+ // The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h.
+ #undef FACILITY_VISUALCPP
+ #endif
+-#include <DelayIMP.h>
++#include <delayimp.h>
+ 
+ namespace base {
+ namespace win {
+ 
+ // This class is a wrapper for the Portable Executable File Format (PE).
+ // Its main purpose is to provide an easy way to work with imports and exports
+ // from a file, mapped in memory as image.
+ class PEImage {
+diff --git a/security/sandbox/chromium/sandbox/win/src/acl.h b/security/sandbox/chromium/sandbox/win/src/acl.h
+--- a/security/sandbox/chromium/sandbox/win/src/acl.h
++++ b/security/sandbox/chromium/sandbox/win/src/acl.h
+@@ -1,16 +1,16 @@
+ // Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ 
+ #ifndef SANDBOX_SRC_ACL_H_
+ #define SANDBOX_SRC_ACL_H_
+ 
+-#include <AccCtrl.h>
++#include <accctrl.h>
+ #include <windows.h>
+ 
+ #include <memory>
+ 
+ #include "base/memory/free_deleter.h"
+ #include "sandbox/win/src/sid.h"
+ 
+ namespace sandbox {
+diff --git a/security/sandbox/chromium/sandbox/win/src/broker_services.cc b/security/sandbox/chromium/sandbox/win/src/broker_services.cc
+--- a/security/sandbox/chromium/sandbox/win/src/broker_services.cc
++++ b/security/sandbox/chromium/sandbox/win/src/broker_services.cc
+@@ -1,15 +1,15 @@
+ // Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ 
+ #include "sandbox/win/src/broker_services.h"
+ 
+-#include <AclAPI.h>
++#include <aclapi.h>
+ #include <stddef.h>
+ 
+ #include <utility>
+ 
+ #include "base/logging.h"
+ #include "base/macros.h"
+ #include "base/memory/ptr_util.h"
+ #include "base/threading/platform_thread.h"
+diff --git a/security/sandbox/chromium/sandbox/win/src/sandbox_rand.cc b/security/sandbox/chromium/sandbox/win/src/sandbox_rand.cc
+--- a/security/sandbox/chromium/sandbox/win/src/sandbox_rand.cc
++++ b/security/sandbox/chromium/sandbox/win/src/sandbox_rand.cc
+@@ -5,17 +5,17 @@
+ #include "sandbox/win/src/sandbox_rand.h"
+ 
+ #include <windows.h>
+ 
+ // #define needed to link in RtlGenRandom(), a.k.a. SystemFunction036.  See the
+ // "Community Additions" comment on MSDN here:
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx
+ #define SystemFunction036 NTAPI SystemFunction036
+-#include <NTSecAPI.h>
++#include <ntsecapi.h>
+ #undef SystemFunction036
+ 
+ namespace sandbox {
+ 
+ bool GetRandom(unsigned int* random_value) {
+   return RtlGenRandom(random_value, sizeof(unsigned int)) != FALSE;
+ }
+ 
old mode 100755
new mode 100644
--- a/security/sandbox/chromium-shim/patches/with_update/patch_order.txt
+++ b/security/sandbox/chromium-shim/patches/with_update/patch_order.txt
@@ -11,9 +11,10 @@ revert_c++14_index_sequence_usage.patch
 fix_Wcomma_warning_in_time_cc.patch
 allow_read_only_all_paths_rule.patch
 revert_TargetNtSetInformationThread_change.patch
 mingw_base_win_get_caller.patch
 mingw_duplicate_instatinations.patch
 mingw_msvc_requirement_error.patch
 mingw_copy_s.patch
 mingw_operator_new.patch
-mingw_cast_getprocaddress.patch
\ No newline at end of file
+mingw_cast_getprocaddress.patch
+mingw_capitalization.patch
\ No newline at end of file
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -217,18 +217,18 @@
 #ifdef MOZ_WIDGET_ANDROID
 #include "GeneratedJNIWrappers.h"
 #endif
 
 #if defined(MOZ_SANDBOX)
 #if defined(XP_LINUX) && !defined(ANDROID)
 #include "mozilla/SandboxInfo.h"
 #elif defined(XP_WIN)
-#include "SandboxBroker.h"
-#include "SandboxPermissions.h"
+#include "sandboxBroker.h"
+#include "sandboxPermissions.h"
 #endif
 #endif
 
 #ifdef MOZ_CODE_COVERAGE
 #include "mozilla/CodeCoverageHandler.h"
 #endif
 
 extern uint32_t gRestartMode;