Bug 1462979 - Broker HttpEndRequestA for plugin process. r=jimm, a=RyanVM
☠☠ backed out by 728f6001d25c ☠ ☠
authorDavid Parks <dparks@mozilla.com>
Tue, 29 May 2018 12:27:23 -0700
changeset 473728 05f93f4378c67c9a3e608edf11c6ef6dde18e091
parent 473727 f5f970316cb959932af5ef2c7e99b0da98ead7b3
child 473729 8a24c581a1820b0619f34a5f2f6fd240d83cb3f5
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, RyanVM
bugs1462979
milestone61.0
Bug 1462979 - Broker HttpEndRequestA for plugin process. r=jimm, a=RyanVM Some file uploads fail (terminate early) without this function. Its omission from the original system was unintentional.
dom/plugins/ipc/FunctionBroker.cpp
dom/plugins/ipc/FunctionBrokerIPCUtils.h
--- a/dom/plugins/ipc/FunctionBroker.cpp
+++ b/dom/plugins/ipc/FunctionBroker.cpp
@@ -726,16 +726,39 @@ const LPINTERNET_BUFFERSA HSRExAReqInfo:
 // passes other values.
 // template<> template<>
 // struct HSRExAReqInfo::FixedValue<3> { static const DWORD value = 0; };
 
 template<> template<>
 struct HSRExAReqInfo::FixedValue<4> { static const DWORD_PTR value; };
 const DWORD_PTR HSRExAReqInfo::FixedValue<4>::value = 0;
 
+/* HttpEndRequestA */
+
+typedef SslFunctionBroker<ID_HttpEndRequestA,
+  decltype(HttpEndRequestA)> HttpEndRequestAFB;
+
+template<>
+ShouldHookFunc* const
+HttpEndRequestAFB::BaseType::mShouldHook = &CheckQuirks<QUIRK_FLASH_HOOK_SSL>;
+
+typedef RequestInfo<ID_HttpEndRequestA> HERAReqInfo;
+
+template<> template<>
+struct HERAReqInfo::FixedValue<1> { static const LPINTERNET_BUFFERSA value; };
+const LPINTERNET_BUFFERSA HERAReqInfo::FixedValue<1>::value = nullptr;
+
+template<> template<>
+struct HERAReqInfo::FixedValue<2> { static const DWORD value; };
+const DWORD HERAReqInfo::FixedValue<2>::value = 0;
+
+template<> template<>
+struct HERAReqInfo::FixedValue<3> { static const DWORD_PTR value; };
+const DWORD_PTR HERAReqInfo::FixedValue<3>::value = 0;
+
 /* InternetQueryOptionA */
 
 typedef FunctionBroker<ID_InternetQueryOptionA,
                        decltype(InternetQueryOptionA)> InternetQueryOptionAFB;
 
 template<>
 ShouldHookFunc* const
 InternetQueryOptionAFB::BaseType::mShouldHook = &CheckQuirks<QUIRK_FLASH_HOOK_SSL>;
@@ -1012,16 +1035,19 @@ AddBrokeredFunctionHooks(FunctionHookArr
     FUN_HOOK(new HttpQueryInfoAFB("wininet.dll", "HttpQueryInfoA",
                                   &HttpQueryInfoA));
   aHooks[ID_HttpSendRequestA] =
     FUN_HOOK(new HttpSendRequestAFB("wininet.dll", "HttpSendRequestA",
                                     &HttpSendRequestA));
   aHooks[ID_HttpSendRequestExA] =
     FUN_HOOK(new HttpSendRequestExAFB("wininet.dll", "HttpSendRequestExA",
                                       &HttpSendRequestExA));
+  aHooks[ID_HttpEndRequestA] =
+    FUN_HOOK(new HttpEndRequestAFB("wininet.dll", "HttpEndRequestA",
+      &HttpEndRequestA));
   aHooks[ID_InternetQueryOptionA] =
     FUN_HOOK(new InternetQueryOptionAFB("wininet.dll", "InternetQueryOptionA",
                                         &InternetQueryOptionA));
   aHooks[ID_InternetErrorDlg] =
     FUN_HOOK(new InternetErrorDlgFB("wininet.dll", "InternetErrorDlg",
                                     InternetErrorDlg));
   aHooks[ID_AcquireCredentialsHandleA] =
     FUN_HOOK(new AcquireCredentialsHandleAFB("sspicli.dll",
--- a/dom/plugins/ipc/FunctionBrokerIPCUtils.h
+++ b/dom/plugins/ipc/FunctionBrokerIPCUtils.h
@@ -35,16 +35,17 @@ enum FunctionHookId
   , ID_InternetReadFile
   , ID_InternetWriteFile
   , ID_InternetSetOptionA
   , ID_HttpAddRequestHeadersA
   , ID_HttpOpenRequestA
   , ID_HttpQueryInfoA
   , ID_HttpSendRequestA
   , ID_HttpSendRequestExA
+  , ID_HttpEndRequestA
   , ID_InternetQueryOptionA
   , ID_InternetErrorDlg
   , ID_AcquireCredentialsHandleA
   , ID_QueryCredentialsAttributesA
   , ID_FreeCredentialsHandle
   , ID_PrintDlgW
   , ID_FunctionHookCount
 #else // defined(XP_WIN)