summaryrefslogtreecommitdiffstats
path: root/dom/base
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base')
-rw-r--r--dom/base/nsIDocument.h44
-rw-r--r--dom/base/nsJSEnvironment.cpp109
-rw-r--r--dom/base/test/bug704320.sjs6
-rw-r--r--dom/base/test/referrerHelper.js3
4 files changed, 2 insertions, 160 deletions
diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h
index 1e0c9562e..7a73fae71 100644
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -18,11 +18,11 @@
#include "nsINode.h" // for base class
#include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr)
#include "nsIServiceManager.h"
+#include "nsIURI.h" // for use in inline functions
#include "nsIUUIDGenerator.h"
#include "nsPIDOMWindow.h" // for use in inline functions
#include "nsPropertyTable.h" // for member
-#include "nsDataHashtable.h" // for member
-#include "nsURIHashKey.h" // for member
+#include "nsTHashtable.h" // for member
#include "mozilla/net/ReferrerPolicy.h" // for member
#include "nsWeakReference.h"
#include "mozilla/UseCounter.h"
@@ -182,13 +182,6 @@ enum DocumentFlavor {
DocumentFlavorPlain, // Just a Document
};
-// Enum for HSTS priming states
-enum class HSTSPrimingState {
- eNO_HSTS_PRIMING = 0, // don't do HSTS Priming
- eHSTS_PRIMING_ALLOW = 1, // if HSTS priming fails, allow the load to proceed
- eHSTS_PRIMING_BLOCK = 2 // if HSTS priming fails, block the load
-};
-
// Document states
// RTL locale: specific to the XUL localedir attribute
@@ -406,34 +399,6 @@ public:
}
/**
- * Check to see if a subresource we want to load requires HSTS priming
- * to be done.
- */
- HSTSPrimingState GetHSTSPrimingStateForLocation(nsIURI* aContentLocation) const
- {
- HSTSPrimingState state;
- if (mHSTSPrimingURIList.Get(aContentLocation, &state)) {
- return state;
- }
- return HSTSPrimingState::eNO_HSTS_PRIMING;
- }
-
- /**
- * Add a subresource to the HSTS priming list. If this URI is
- * not in the HSTS cache, it will trigger an HSTS priming request
- * when we try to load it.
- */
- void AddHSTSPrimingLocation(nsIURI* aContentLocation, HSTSPrimingState aState)
- {
- mHSTSPrimingURIList.Put(aContentLocation, aState);
- }
-
- void ClearHSTSPrimingLocation(nsIURI* aContentLocation)
- {
- mHSTSPrimingURIList.Remove(aContentLocation);
- }
-
- /**
* Set the principal responsible for this document.
*/
virtual void SetPrincipal(nsIPrincipal *aPrincipal) = 0;
@@ -2987,11 +2952,6 @@ protected:
bool mUpgradeInsecureRequests;
bool mUpgradeInsecurePreloads;
- // if nsMixedContentBlocker requires sending an HSTS priming request,
- // temporarily store that in the document so that it can be propogated to the
- // LoadInfo and eventually the HTTP Channel
- nsDataHashtable<nsURIHashKey, HSTSPrimingState> mHSTSPrimingURIList;
-
mozilla::WeakPtr<nsDocShell> mDocumentContainer;
nsCString mCharacterSet;
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index 576f3052a..3be1a6d2f 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1006,110 +1006,6 @@ nsJSContext::AddSupportsPrimitiveTojsvals(nsISupports *aArg, JS::Value *aArgv)
return NS_OK;
}
-#ifdef MOZ_JPROF
-
-#include <signal.h>
-
-inline bool
-IsJProfAction(struct sigaction *action)
-{
- return (action->sa_sigaction &&
- (action->sa_flags & (SA_RESTART | SA_SIGINFO)) == (SA_RESTART | SA_SIGINFO));
-}
-
-void NS_JProfStartProfiling();
-void NS_JProfStopProfiling();
-void NS_JProfClearCircular();
-
-static bool
-JProfStartProfilingJS(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- NS_JProfStartProfiling();
- return true;
-}
-
-void NS_JProfStartProfiling()
-{
- // Figure out whether we're dealing with SIGPROF, SIGALRM, or
- // SIGPOLL profiling (SIGALRM for JP_REALTIME, SIGPOLL for
- // JP_RTC_HZ)
- struct sigaction action;
-
- // Must check ALRM before PROF since both are enabled for real-time
- sigaction(SIGALRM, nullptr, &action);
- //printf("SIGALRM: %p, flags = %x\n",action.sa_sigaction,action.sa_flags);
- if (IsJProfAction(&action)) {
- //printf("Beginning real-time jprof profiling.\n");
- raise(SIGALRM);
- return;
- }
-
- sigaction(SIGPROF, nullptr, &action);
- //printf("SIGPROF: %p, flags = %x\n",action.sa_sigaction,action.sa_flags);
- if (IsJProfAction(&action)) {
- //printf("Beginning process-time jprof profiling.\n");
- raise(SIGPROF);
- return;
- }
-
- sigaction(SIGPOLL, nullptr, &action);
- //printf("SIGPOLL: %p, flags = %x\n",action.sa_sigaction,action.sa_flags);
- if (IsJProfAction(&action)) {
- //printf("Beginning rtc-based jprof profiling.\n");
- raise(SIGPOLL);
- return;
- }
-
- printf("Could not start jprof-profiling since JPROF_FLAGS was not set.\n");
-}
-
-static bool
-JProfStopProfilingJS(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- NS_JProfStopProfiling();
- return true;
-}
-
-void
-NS_JProfStopProfiling()
-{
- raise(SIGUSR1);
- //printf("Stopped jprof profiling.\n");
-}
-
-static bool
-JProfClearCircularJS(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- NS_JProfClearCircular();
- return true;
-}
-
-void
-NS_JProfClearCircular()
-{
- raise(SIGUSR2);
- //printf("cleared jprof buffer\n");
-}
-
-static bool
-JProfSaveCircularJS(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- // Not ideal...
- NS_JProfStopProfiling();
- NS_JProfStartProfiling();
- return true;
-}
-
-static const JSFunctionSpec JProfFunctions[] = {
- JS_FS("JProfStartProfiling", JProfStartProfilingJS, 0, 0),
- JS_FS("JProfStopProfiling", JProfStopProfilingJS, 0, 0),
- JS_FS("JProfClearCircular", JProfClearCircularJS, 0, 0),
- JS_FS("JProfSaveCircular", JProfSaveCircularJS, 0, 0),
- JS_FS_END
-};
-
-#endif /* defined(MOZ_JPROF) */
-
nsresult
nsJSContext::InitClasses(JS::Handle<JSObject*> aGlobalObj)
{
@@ -1121,11 +1017,6 @@ nsJSContext::InitClasses(JS::Handle<JSObject*> aGlobalObj)
// Attempt to initialize profiling functions
::JS_DefineProfilingFunctions(cx, aGlobalObj);
-#ifdef MOZ_JPROF
- // Attempt to initialize JProf functions
- ::JS_DefineFunctions(cx, aGlobalObj, JProfFunctions);
-#endif
-
return NS_OK;
}
diff --git a/dom/base/test/bug704320.sjs b/dom/base/test/bug704320.sjs
index dff77f4b3..e0f549533 100644
--- a/dom/base/test/bug704320.sjs
+++ b/dom/base/test/bug704320.sjs
@@ -194,12 +194,6 @@ function createPolicyTest(policy, optionalEarlierPolicy) {
}
function handleRequest(request, response) {
- if (request.method == 'HEAD') {
- // respond to a HEAD request with a 418 so that we can easily distinguish
- // HSTS priming responses and ignore them
- response.setStatusLine('1.1', 418, "I'm a teapot");
- return;
- }
var sharedKey = 'bug704320.sjs';
var params = request.queryString.split('&');
var action = params[0].split('=')[1];
diff --git a/dom/base/test/referrerHelper.js b/dom/base/test/referrerHelper.js
index 207bf5f15..01a22829c 100644
--- a/dom/base/test/referrerHelper.js
+++ b/dom/base/test/referrerHelper.js
@@ -25,9 +25,6 @@ function doXHR(url, onSuccess, onFail) {
xhr.onload = function () {
if (xhr.status == 200) {
onSuccess(xhr);
- } else if (xhr.status == 418) {
- // Ignore HSTS priming responses
- return;
} else {
onFail(xhr);
}