mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Backed out changeset a7040abce944 (bug 1008453) for w-p-t test failures on a CLOSED TREE
This commit is contained in:
parent
1ba509f16d
commit
d115280c5f
@ -48,7 +48,6 @@
|
||||
#include "mozilla/dom/Voicemail.h"
|
||||
#include "mozilla/dom/TVManager.h"
|
||||
#include "mozilla/dom/VRDevice.h"
|
||||
#include "mozilla/dom/workers/RuntimeService.h"
|
||||
#include "mozilla/Hal.h"
|
||||
#include "nsISiteSpecificUserAgent.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
@ -751,17 +750,6 @@ Navigator::JavaEnabled(ErrorResult& aRv)
|
||||
return mimeType && mimeType->GetEnabledPlugin();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
Navigator::HardwareConcurrency()
|
||||
{
|
||||
workers::RuntimeService* rts = workers::RuntimeService::GetOrCreateService();
|
||||
if (!rts) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return rts->ClampedHardwareConcurrency();
|
||||
}
|
||||
|
||||
void
|
||||
Navigator::RefreshMIMEArray()
|
||||
{
|
||||
|
@ -219,7 +219,6 @@ public:
|
||||
}
|
||||
PowerManager* GetMozPower(ErrorResult& aRv);
|
||||
bool JavaEnabled(ErrorResult& aRv);
|
||||
uint64_t HardwareConcurrency();
|
||||
bool TaintEnabled()
|
||||
{
|
||||
return false;
|
||||
|
@ -326,7 +326,6 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e1
|
||||
[test_innersize_scrollport.html]
|
||||
[test_messagemanager_targetchain.html]
|
||||
[test_named_frames.html]
|
||||
[test_navigator_hardwareConcurrency.html]
|
||||
[test_navigator_resolve_identity.html]
|
||||
[test_navigator_language.html]
|
||||
[test_noAudioNotification.html]
|
||||
|
@ -1,24 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Navigator.hardwareConcurrency</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
var x = navigator.hardwareConcurrency;
|
||||
is(typeof x, "number", "hardwareConcurrency should be a number.");
|
||||
ok(x > 0, "hardwareConcurrency should be greater than 0.");
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -12,7 +12,6 @@
|
||||
* http://www.w3.org/2012/sysapps/runtime/#extension-to-the-navigator-interface-1
|
||||
* https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
|
||||
* http://www.w3.org/TR/beacon/#sec-beacon-method
|
||||
* https://html.spec.whatwg.org/#navigatorconcurrenthardware
|
||||
*
|
||||
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
||||
* Opera Software ASA. You are granted a license to use, reproduce
|
||||
@ -30,7 +29,6 @@ Navigator implements NavigatorOnLine;
|
||||
Navigator implements NavigatorContentUtils;
|
||||
Navigator implements NavigatorStorageUtils;
|
||||
Navigator implements NavigatorFeatures;
|
||||
Navigator implements NavigatorConcurrentHardware;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorID {
|
||||
@ -478,8 +476,3 @@ partial interface Navigator {
|
||||
DOMRequest mozPay(any jwts);
|
||||
};
|
||||
#endif
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorConcurrentHardware {
|
||||
readonly attribute unsigned long long hardwareConcurrency;
|
||||
};
|
||||
|
@ -11,4 +11,3 @@ WorkerNavigator implements NavigatorID;
|
||||
WorkerNavigator implements NavigatorLanguage;
|
||||
WorkerNavigator implements NavigatorOnLine;
|
||||
WorkerNavigator implements NavigatorDataStore;
|
||||
WorkerNavigator implements NavigatorConcurrentHardware;
|
||||
|
@ -399,13 +399,4 @@ WorkerNavigator::GetUserAgent(nsString& aUserAgent, ErrorResult& aRv) const
|
||||
runnable->Dispatch(aRv);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
WorkerNavigator::HardwareConcurrency() const
|
||||
{
|
||||
RuntimeService* rts = RuntimeService::GetService();
|
||||
MOZ_ASSERT(rts);
|
||||
|
||||
return rts->ClampedHardwareConcurrency();
|
||||
}
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
@ -112,8 +112,6 @@ public:
|
||||
const nsAString& aName,
|
||||
const nsAString& aOwner,
|
||||
ErrorResult& aRv);
|
||||
|
||||
uint64_t HardwareConcurrency() const;
|
||||
};
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "GeckoProfiler.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/CycleCollectedJSRuntime.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
@ -69,7 +68,6 @@
|
||||
#include "WorkerRunnable.h"
|
||||
#include "WorkerScope.h"
|
||||
#include "WorkerThread.h"
|
||||
#include "prsystem.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -2451,28 +2449,6 @@ RuntimeService::SendOfflineStatusChangeEventToAllWorkers(bool aIsOffline)
|
||||
BROADCAST_ALL_WORKERS(OfflineStatusChangeEvent, aIsOffline);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
RuntimeService::ClampedHardwareConcurrency() const
|
||||
{
|
||||
// This needs to be atomic, because multiple workers, and even mainthread,
|
||||
// could race to initialize it at once.
|
||||
static Atomic<uint32_t> clampedHardwareConcurrency;
|
||||
|
||||
// No need to loop here: if compareExchange fails, that just means that some
|
||||
// other worker has initialized numberOfProcessors, so we're good to go.
|
||||
if (!clampedHardwareConcurrency) {
|
||||
int32_t numberOfProcessors = PR_GetNumberOfProcessors();
|
||||
if (numberOfProcessors <= 0) {
|
||||
numberOfProcessors = 1; // Must be one there somewhere
|
||||
}
|
||||
uint32_t clampedValue = std::min(uint32_t(numberOfProcessors),
|
||||
gMaxWorkersPerDomain);
|
||||
clampedHardwareConcurrency.compareExchange(0, clampedValue);
|
||||
}
|
||||
|
||||
return clampedHardwareConcurrency;
|
||||
}
|
||||
|
||||
// nsISupports
|
||||
NS_IMPL_ISUPPORTS(RuntimeService, nsIObserver)
|
||||
|
||||
|
@ -249,8 +249,6 @@ public:
|
||||
void
|
||||
SendOfflineStatusChangeEventToAllWorkers(bool aIsOffline);
|
||||
|
||||
uint32_t ClampedHardwareConcurrency() const;
|
||||
|
||||
private:
|
||||
RuntimeService();
|
||||
~RuntimeService();
|
||||
|
@ -21,7 +21,6 @@ EXPORTS.mozilla.dom += [
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.dom.workers += [
|
||||
'RuntimeService.h',
|
||||
'ServiceWorkerManager.h',
|
||||
'WorkerDebuggerManager.h',
|
||||
'Workers.h',
|
||||
|
@ -258,4 +258,3 @@ skip-if = (os == "win") || (os == "mac") || toolkit == 'android' #bug 798220
|
||||
[test_sharedWorker_ports.html]
|
||||
[test_sharedWorker_lifetime.html]
|
||||
[test_fileReader.html]
|
||||
[test_navigator_workers_hardwareConcurrency.html]
|
||||
|
@ -15,7 +15,6 @@ var supportedProps = [
|
||||
"onLine",
|
||||
"language",
|
||||
"languages",
|
||||
"hardwareConcurrency",
|
||||
];
|
||||
|
||||
self.onmessage = function(event) {
|
||||
|
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Navigator.hardwareConcurrency</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var script = "postMessage(navigator.hardwareConcurrency)";
|
||||
var url = URL.createObjectURL(new Blob([script]));
|
||||
var w = new Worker(url);
|
||||
w.onmessage = function(e) {
|
||||
var x = e.data;
|
||||
is(typeof x, "number", "hardwareConcurrency should be a number.");
|
||||
ok(x > 0, "hardwareConcurrency should be greater than 0.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user