Bug 1462979 - Broker HttpEndRequestA for plugin process. r=jimm, a=RyanVM
authorDavid Parks <dparks@mozilla.com>
Tue, 12 Jun 2018 16:40:56 -0700
changeset 471303 a7838c6579b6
parent 471302 a7315d0e1bd9
child 471304 4b525127bb53
push id9362
push userryanvm@gmail.com
push date2018-06-13 13:56 +0000
treeherdermozilla-beta@4b525127bb53 [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 ftrom 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 FunctionBroker<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)