mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Merge the last PGO-green inbound changeset to m-c.
This commit is contained in:
commit
36f3902ed9
@ -48,7 +48,7 @@ XPCOMUtils.defineLazyGetter(this, 'DebuggerServer', function() {
|
||||
// XXX never grant 'content-camera' to non-gaia apps
|
||||
function addPermissions(urls) {
|
||||
let permissions = [
|
||||
'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'pin-app',
|
||||
'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'pin-app',
|
||||
'websettings-read', 'websettings-readwrite',
|
||||
'content-camera', 'webcontacts-manage', 'wifi-manage', 'desktop-notification',
|
||||
'geolocation', 'device-storage'
|
||||
|
@ -1182,3 +1182,6 @@ pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false);
|
||||
// might keep around more than this, but we'll try to get down to this value).
|
||||
// (This is intentionally on the high side; see bug 746055.)
|
||||
pref("image.mem.max_decoded_image_kb", 256000);
|
||||
|
||||
// Example social provider
|
||||
pref("social.manifest.motown", "{\"origin\":\"https://motown-dev.mozillalabs.com\",\"name\":\"MoTown\",\"workerURL\":\"https://motown-dev.mozillalabs.com/social/worker.js\"}");
|
||||
|
@ -43,6 +43,7 @@ a {
|
||||
|
||||
#brandLogo {
|
||||
height: 154px;
|
||||
width: 154px;
|
||||
margin: 22px 0 31px;
|
||||
}
|
||||
|
||||
@ -64,6 +65,8 @@ a {
|
||||
|
||||
#searchEngineLogo {
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
#searchText {
|
||||
@ -82,7 +85,8 @@ body[dir=rtl] #searchText {
|
||||
border-radius: 0 2.5px 2.5px 0;
|
||||
}
|
||||
|
||||
#searchText:focus {
|
||||
#searchText:focus,
|
||||
#searchText[autofocus] {
|
||||
border-color: hsla(206,100%,60%,.6) hsla(206,76%,52%,.6) hsla(204,100%,40%,.6);
|
||||
}
|
||||
|
||||
@ -106,12 +110,14 @@ body[dir=rtl] #searchSubmit {
|
||||
}
|
||||
|
||||
#searchText:focus + #searchSubmit,
|
||||
#searchText + #searchSubmit:hover {
|
||||
#searchText + #searchSubmit:hover,
|
||||
#searchText[autofocus] + #searchSubmit {
|
||||
border-color: #59b5fc #45a3e7 #3294d5;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#searchText:focus + #searchSubmit {
|
||||
#searchText:focus + #searchSubmit,
|
||||
#searchText[autofocus] + #searchSubmit {
|
||||
background-image: -moz-linear-gradient(#4cb1ff, #1793e5);
|
||||
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
|
||||
0 0 0 1px hsla(0,0%,100%,.1) inset,
|
||||
@ -160,6 +166,12 @@ body[dir=rtl] #defaultSnippet2 {
|
||||
margin: 12px 0;
|
||||
color: #3c3c3c;
|
||||
font-size: 75%;
|
||||
/* 17px is approx. the default line-height as measured on Windows 7 Segoe UI.
|
||||
12px is 75% of approx. the default font-size as measured on Windows 7 Segoe UI.
|
||||
The 17/12 is here to convert em from units of font-size to units of
|
||||
line-height. The goal here is to initialize at the height of a
|
||||
three-line snippet to reduce visual moving/flickering. */
|
||||
min-height: -moz-calc(17/12 * 3em);
|
||||
}
|
||||
|
||||
#launcher {
|
||||
@ -256,8 +268,9 @@ body[narrow] #restorePreviousSession {
|
||||
|
||||
.launchButton::before {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-bottom: 6px;
|
||||
margin: 0 auto 6px;
|
||||
line-height: 0; /* remove extra vertical space due to non-zero font-size */
|
||||
}
|
||||
|
||||
|
@ -165,6 +165,15 @@ function setupSearchEngine()
|
||||
logoElt.alt = gSearchEngine.name;
|
||||
}
|
||||
|
||||
// The "autofocus" attribute doesn't focus the form element
|
||||
// immediately when the element is first drawn, so the
|
||||
// attribute is also used for styling when the page first loads.
|
||||
let searchText = document.getElementById("searchText");
|
||||
searchText.addEventListener("blur", function searchText_onBlur(e) {
|
||||
searchText.removeEventListener("blur", searchText_onBlur);
|
||||
e.target.removeAttribute("autofocus");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function loadSnippets()
|
||||
|
@ -25,9 +25,6 @@
|
||||
href="chrome://branding/content/icon16.png"/>
|
||||
<link rel="stylesheet" type="text/css" media="all"
|
||||
href="chrome://browser/content/abouthome/aboutHome.css"/>
|
||||
|
||||
<script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/abouthome/aboutHome.js"/>
|
||||
</head>
|
||||
|
||||
<body dir="&locale.dir;">
|
||||
@ -67,5 +64,8 @@
|
||||
</div>
|
||||
|
||||
<a id="aboutMozilla" href="http://www.mozilla.org/about/"/>
|
||||
|
||||
<script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/abouthome/aboutHome.js"/>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -354,18 +354,23 @@
|
||||
<label class="permissionLabel" id="permIndexedDBLabel"
|
||||
value="&permIndexedDB;" control="indexedDBRadioGroup"/>
|
||||
<hbox role="group" aria-labelledby="permIndexedDBLabel">
|
||||
<checkbox id="indexedDBDef" command="cmd_indexedDBDef" label="&permAskAlways;"/>
|
||||
<checkbox id="indexedDBDef" command="cmd_indexedDBDef" label="&permUseDefault;"/>
|
||||
<spacer flex="1"/>
|
||||
<vbox pack="center">
|
||||
<label id="indexedDBStatus" control="indexedDBClear"/>
|
||||
</vbox>
|
||||
<button id="indexedDBClear" label="&permClearStorage;"
|
||||
accesskey="&permClearStorage.accesskey;" onclick="onIndexedDBClear();"/>
|
||||
<radiogroup id="indexedDBRadioGroup" orient="horizontal">
|
||||
<radio id="indexedDB#1" command="cmd_indexedDBToggle" label="&permAllow;"/>
|
||||
<!-- Ask and Allow are purposefully reversed here! -->
|
||||
<radio id="indexedDB#1" command="cmd_indexedDBToggle" label="&permAskAlways;"/>
|
||||
<radio id="indexedDB#0" command="cmd_indexedDBToggle" label="&permAllow;"/>
|
||||
<radio id="indexedDB#2" command="cmd_indexedDBToggle" label="&permBlock;"/>
|
||||
</radiogroup>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<spacer flex="1"/>
|
||||
<vbox pack="center">
|
||||
<label id="indexedDBStatus" control="indexedDBClear" hidden="true"/>
|
||||
</vbox>
|
||||
<button id="indexedDBClear" label="&permClearStorage;" hidden="true"
|
||||
accesskey="&permClearStorage.accesskey;" onclick="onIndexedDBClear();"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<vbox class="permission" id="permPluginsRow">
|
||||
<label class="permissionLabel" id="permPluginsLabel"
|
||||
|
@ -51,7 +51,7 @@ var gPermObj = {
|
||||
},
|
||||
indexedDB: function getIndexedDBDefaultPermissions()
|
||||
{
|
||||
return BLOCK;
|
||||
return UNKNOWN;
|
||||
},
|
||||
plugins: function getPluginsDefaultPermissions()
|
||||
{
|
||||
@ -149,9 +149,6 @@ function onCheckboxClick(aPartId)
|
||||
var checkbox = document.getElementById(aPartId + "Def");
|
||||
if (checkbox.checked) {
|
||||
permissionManager.remove(gPermURI.host, aPartId);
|
||||
if (aPartId == "indexedDB") {
|
||||
permissionManager.remove(gPermURI.host, "indexedDB-unlimited");
|
||||
}
|
||||
command.setAttribute("disabled", "true");
|
||||
var perm = gPermObj[aPartId]();
|
||||
setRadioState(aPartId, perm);
|
||||
@ -171,7 +168,8 @@ function onRadioClick(aPartId)
|
||||
var id = radioGroup.selectedItem.id;
|
||||
var permission = id.split('#')[1];
|
||||
permissionManager.add(gPermURI, aPartId, permission);
|
||||
if (aPartId == "indexedDB" && permission == BLOCK) {
|
||||
if (aPartId == "indexedDB" &&
|
||||
(permission == ALLOW || permission == BLOCK)) {
|
||||
permissionManager.remove(gPermURI.host, "indexedDB-unlimited");
|
||||
}
|
||||
if (aPartId == "fullscreen" && permission == UNKNOWN) {
|
||||
@ -207,7 +205,6 @@ function onIndexedDBClear()
|
||||
|
||||
var permissionManager = Components.classes[PERMISSION_CONTRACTID]
|
||||
.getService(nsIPermissionManager);
|
||||
permissionManager.remove(gPermURI.host, "indexedDB");
|
||||
permissionManager.remove(gPermURI.host, "indexedDB-unlimited");
|
||||
initIndexedDBRow();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsIFile.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
|
||||
"@mozilla.org/browser/directory-provider;1"
|
||||
@ -16,7 +17,7 @@
|
||||
namespace mozilla {
|
||||
namespace browser {
|
||||
|
||||
class DirectoryProvider : public nsIDirectoryServiceProvider2
|
||||
class DirectoryProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -24,7 +25,7 @@ public:
|
||||
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
||||
|
||||
private:
|
||||
class AppendingEnumerator : public nsISimpleEnumerator
|
||||
class AppendingEnumerator MOZ_FINAL : public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -7,8 +7,10 @@
|
||||
#include "nsIContentSniffer.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
class nsFeedSniffer : public nsIContentSniffer, nsIStreamListener
|
||||
class nsFeedSniffer MOZ_FINAL : public nsIContentSniffer,
|
||||
nsIStreamListener
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -5,11 +5,12 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIPrivateBrowsingService.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
class nsIJSContextStack;
|
||||
|
||||
class nsPrivateBrowsingServiceWrapper : public nsIPrivateBrowsingService,
|
||||
public nsIObserver
|
||||
class nsPrivateBrowsingServiceWrapper MOZ_FINAL : public nsIPrivateBrowsingService,
|
||||
public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -17,7 +17,6 @@ var testGenerator = testSteps();
|
||||
|
||||
function runTest()
|
||||
{
|
||||
allowIndexedDB();
|
||||
allowUnlimitedQuota();
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
@ -27,7 +26,6 @@ function runTest()
|
||||
function finishTest()
|
||||
{
|
||||
resetUnlimitedQuota();
|
||||
resetIndexedDB();
|
||||
|
||||
SimpleTest.executeSoon(function() {
|
||||
testGenerator.close();
|
||||
@ -90,16 +88,6 @@ function removePermission(type, url)
|
||||
SpecialPowers.removePermission(type, url);
|
||||
}
|
||||
|
||||
function allowIndexedDB(url)
|
||||
{
|
||||
addPermission("indexedDB", true, url);
|
||||
}
|
||||
|
||||
function resetIndexedDB(url)
|
||||
{
|
||||
removePermission("indexedDB", url);
|
||||
}
|
||||
|
||||
function allowUnlimitedQuota(url)
|
||||
{
|
||||
addPermission("indexedDB-unlimited", true, url);
|
||||
|
@ -29,6 +29,14 @@
|
||||
#define TOPIC_PERMISSIONS_PROMPT "indexedDB-permissions-prompt"
|
||||
#define TOPIC_PERMISSIONS_RESPONSE "indexedDB-permissions-response"
|
||||
|
||||
// This is a little confusing, but our default behavior (UNKNOWN_ACTION) is to
|
||||
// allow access without a prompt. If the "indexedDB" permission is set to
|
||||
// ALLOW_ACTION then we will issue a prompt before allowing access. Otherwise
|
||||
// (DENY_ACTION) we deny access.
|
||||
#define PERMISSION_ALLOWED nsIPermissionManager::UNKNOWN_ACTION
|
||||
#define PERMISSION_DENIED nsIPermissionManager::DENY_ACTION
|
||||
#define PERMISSION_PROMPT nsIPermissionManager::ALLOW_ACTION
|
||||
|
||||
using namespace mozilla;
|
||||
USING_INDEXEDDB_NAMESPACE
|
||||
using namespace mozilla::services;
|
||||
@ -43,40 +51,41 @@ GetIndexedDBPermissions(const nsACString& aASCIIOrigin,
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
if (!Preferences::GetBool(PREF_INDEXEDDB_ENABLED)) {
|
||||
return nsIPermissionManager::DENY_ACTION;
|
||||
return PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
// No window here means chrome access
|
||||
// No window here means chrome access.
|
||||
if (!aWindow) {
|
||||
return nsIPermissionManager::ALLOW_ACTION;
|
||||
return PERMISSION_ALLOWED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIScriptObjectPrincipal> sop(do_QueryInterface(aWindow));
|
||||
NS_ENSURE_TRUE(sop, nsIPermissionManager::DENY_ACTION);
|
||||
|
||||
if (nsContentUtils::IsSystemPrincipal(sop->GetPrincipal())) {
|
||||
return nsIPermissionManager::ALLOW_ACTION;
|
||||
return PERMISSION_ALLOWED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(webNav);
|
||||
if (loadContext && loadContext->UsePrivateBrowsing()) {
|
||||
// TODO Support private browsing indexedDB?
|
||||
return nsIPermissionManager::DENY_ACTION;
|
||||
NS_WARNING("IndexedDB may not be used while in private browsing mode!");
|
||||
return PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(uri), aASCIIOrigin);
|
||||
NS_ENSURE_SUCCESS(rv, nsIPermissionManager::DENY_ACTION);
|
||||
NS_ENSURE_SUCCESS(rv, PERMISSION_DENIED);
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> permissionManager =
|
||||
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
|
||||
NS_ENSURE_TRUE(permissionManager, nsIPermissionManager::DENY_ACTION);
|
||||
NS_ENSURE_TRUE(permissionManager, PERMISSION_DENIED);
|
||||
|
||||
PRUint32 permission;
|
||||
rv = permissionManager->TestPermission(uri, PERMISSION_INDEXEDDB,
|
||||
&permission);
|
||||
NS_ENSURE_SUCCESS(rv, nsIPermissionManager::DENY_ACTION);
|
||||
NS_ENSURE_SUCCESS(rv, PERMISSION_DENIED);
|
||||
|
||||
return permission;
|
||||
}
|
||||
@ -102,23 +111,22 @@ CheckPermissionsHelper::Run()
|
||||
// process (if we are in the child process, we have already
|
||||
// set the permission when the prompt was shown in the parent, as
|
||||
// we cannot set the permission from the child).
|
||||
if (permission != nsIPermissionManager::UNKNOWN_ACTION &&
|
||||
XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||
if (permission != PERMISSION_PROMPT &&
|
||||
IndexedDatabaseManager::IsMainProcess()) {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), mASCIIOrigin);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> permissionManager =
|
||||
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
|
||||
NS_ENSURE_STATE(permissionManager);
|
||||
|
||||
|
||||
rv = permissionManager->Add(uri, PERMISSION_INDEXEDDB, permission,
|
||||
nsIPermissionManager::EXPIRE_NEVER, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
else if (permission == nsIPermissionManager::UNKNOWN_ACTION &&
|
||||
mPromptAllowed) {
|
||||
else if (permission == PERMISSION_PROMPT && mPromptAllowed) {
|
||||
nsCOMPtr<nsIObserverService> obs = GetObserverService();
|
||||
rv = obs->NotifyObservers(static_cast<nsIRunnable*>(this),
|
||||
TOPIC_PERMISSIONS_PROMPT, nsnull);
|
||||
@ -133,15 +141,15 @@ CheckPermissionsHelper::Run()
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
window.swap(mWindow);
|
||||
|
||||
if (permission == nsIPermissionManager::ALLOW_ACTION) {
|
||||
if (permission == PERMISSION_ALLOWED) {
|
||||
IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
|
||||
NS_ASSERTION(mgr, "This should never be null!");
|
||||
|
||||
return helper->Dispatch(mgr->IOThread());
|
||||
}
|
||||
|
||||
NS_ASSERTION(permission == nsIPermissionManager::UNKNOWN_ACTION ||
|
||||
permission == nsIPermissionManager::DENY_ACTION,
|
||||
NS_ASSERTION(permission == PERMISSION_PROMPT ||
|
||||
permission == PERMISSION_DENIED,
|
||||
"Unknown permission!");
|
||||
|
||||
helper->SetError(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
|
||||
@ -178,9 +186,27 @@ CheckPermissionsHelper::Observe(nsISupports* aSubject,
|
||||
mHasPrompted = true;
|
||||
|
||||
nsresult rv;
|
||||
mPromptResult = nsDependentString(aData).ToInteger(&rv);
|
||||
PRUint32 promptResult = nsDependentString(aData).ToInteger(&rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Have to convert the permission we got from the user to our weird reversed
|
||||
// permission type.
|
||||
switch (promptResult) {
|
||||
case nsIPermissionManager::ALLOW_ACTION:
|
||||
mPromptResult = PERMISSION_ALLOWED;
|
||||
break;
|
||||
case nsIPermissionManager::DENY_ACTION:
|
||||
mPromptResult = PERMISSION_DENIED;
|
||||
break;
|
||||
case nsIPermissionManager::UNKNOWN_ACTION:
|
||||
mPromptResult = PERMISSION_PROMPT;
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_NOTREACHED("Unknown permission type!");
|
||||
mPromptResult = PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
rv = NS_DispatchToCurrentThread(this);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -20,8 +20,8 @@ function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
// Avoids the prompt
|
||||
setPermission(testPageURL1, "indexedDB");
|
||||
setPermission(testPageURL2, "indexedDB");
|
||||
setPermission(testPageURL1, "indexedDB", "unknown");
|
||||
setPermission(testPageURL2, "indexedDB", "unknown");
|
||||
executeSoon(test1);
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ function test3()
|
||||
Components.classes["@mozilla.org/privatebrowsing;1"]
|
||||
.getService(Components.interfaces.nsIPrivateBrowsingService)
|
||||
.removeDataFromDomain(domains[1]);
|
||||
setPermission(testPageURL4, "indexedDB");
|
||||
setPermission(testPageURL4, "indexedDB", "unknown");
|
||||
executeSoon(test4);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,8 @@ const notificationID = "indexedDB-permissions-prompt";
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
removePermission(testPageURL, "indexedDB");
|
||||
// We want a prompt.
|
||||
setPermission(testPageURL, "indexedDB", "allow");
|
||||
executeSoon(test1);
|
||||
}
|
||||
|
||||
@ -27,7 +28,7 @@ function test1()
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
Components.interfaces.nsIPermissionManager.ALLOW_ACTION,
|
||||
Components.interfaces.nsIPermissionManager.UNKNOWN_ACTION,
|
||||
"Correct permission set");
|
||||
gBrowser.removeCurrentTab();
|
||||
executeSoon(test2);
|
||||
@ -63,7 +64,7 @@ function test2()
|
||||
"First database creation was successful");
|
||||
ok(!exception, "No exception");
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
Components.interfaces.nsIPermissionManager.ALLOW_ACTION,
|
||||
Components.interfaces.nsIPermissionManager.UNKNOWN_ACTION,
|
||||
"Correct permission set");
|
||||
gBrowser.removeCurrentTab();
|
||||
unregisterAllPopupEventHandlers();
|
||||
|
@ -10,7 +10,8 @@ const notificationID = "indexedDB-permissions-prompt";
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
removePermission(testPageURL, "indexedDB");
|
||||
// We want the prompt.
|
||||
setPermission(testPageURL, "indexedDB", "allow");
|
||||
executeSoon(test1);
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,6 @@ const notificationID = "indexedDB-permissions-prompt";
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
// Avoids the actual prompt
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
executeSoon(test1);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(10);
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
removePermission(testPageURL, "indexedDB-unlimited");
|
||||
Services.prefs.setIntPref("dom.indexedDB.warningQuota", 2);
|
||||
executeSoon(test1);
|
||||
@ -43,7 +42,7 @@ function test1()
|
||||
"Correct permission set");
|
||||
gBrowser.removeCurrentTab();
|
||||
unregisterAllPopupEventHandlers();
|
||||
executeSoon(test2);
|
||||
executeSoon(finish);
|
||||
});
|
||||
executeSoon(function() { dispatchEvent("indexedDB-done"); });
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(10);
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
removePermission(testPageURL, "indexedDB-unlimited");
|
||||
Services.prefs.setIntPref("dom.indexedDB.warningQuota", 2);
|
||||
executeSoon(test1);
|
||||
|
@ -12,7 +12,6 @@ function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(10);
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
removePermission(testPageURL, "indexedDB-unlimited");
|
||||
Services.prefs.setIntPref("dom.indexedDB.warningQuota", 2);
|
||||
executeSoon(test1);
|
||||
|
@ -12,7 +12,6 @@ function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(10);
|
||||
setPermission(testPageURL, "indexedDB");
|
||||
removePermission(testPageURL, "indexedDB-unlimited");
|
||||
Services.prefs.setIntPref("dom.indexedDB.warningQuota", 2);
|
||||
executeSoon(test1);
|
||||
|
@ -49,8 +49,6 @@
|
||||
};
|
||||
|
||||
function testSteps() {
|
||||
window.parent.SpecialPowers.addPermission("indexedDB", true, document);
|
||||
|
||||
let request = indexedDB.open(window.location.pathname, 1);
|
||||
request.onsuccess = unexpectedSuccessHandler;
|
||||
request.onerror = grabEventAndContinueHandler;
|
||||
|
@ -87,8 +87,6 @@
|
||||
}
|
||||
|
||||
function testSteps() {
|
||||
window.parent.SpecialPowers.addPermission("indexedDB", true, document);
|
||||
|
||||
let request = indexedDB.open(window.location.pathname, 1);
|
||||
request.onerror = errorHandler;
|
||||
request.onupgradeneeded = grabEventAndContinueHandler;
|
||||
|
@ -51,8 +51,6 @@
|
||||
};
|
||||
|
||||
function testSteps() {
|
||||
window.parent.SpecialPowers.addPermission("indexedDB", true, document);
|
||||
|
||||
// Test 1: Throwing an exception in an upgradeneeded handler should
|
||||
// abort the versionchange transaction and fire an error at the request.
|
||||
let request = indexedDB.open(window.location.pathname, 1);
|
||||
|
@ -102,15 +102,30 @@ function dispatchEvent(eventName)
|
||||
gBrowser.selectedBrowser.contentWindow.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function setPermission(url, permission)
|
||||
function setPermission(url, permission, value)
|
||||
{
|
||||
const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
|
||||
|
||||
switch (value) {
|
||||
case "allow":
|
||||
value = nsIPermissionManager.ALLOW_ACTION;
|
||||
break;
|
||||
case "deny":
|
||||
value = nsIPermissionManager.DENY_ACTION;
|
||||
break;
|
||||
case "unknown":
|
||||
value = nsIPermissionManager.UNKNOWN_ACTION;
|
||||
break;
|
||||
default:
|
||||
throw new Error("No idea what to set here!");
|
||||
}
|
||||
|
||||
let uri = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService)
|
||||
.newURI(url, null, null);
|
||||
Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Components.interfaces.nsIPermissionManager)
|
||||
.add(uri, permission,
|
||||
Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
|
||||
.add(uri, permission, value);
|
||||
}
|
||||
|
||||
function removePermission(url, permission)
|
||||
|
@ -53,7 +53,6 @@ if (!window.runTest) {
|
||||
{
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
allowIndexedDB();
|
||||
if (limitedQuota) {
|
||||
denyUnlimitedQuota();
|
||||
}
|
||||
@ -68,7 +67,6 @@ if (!window.runTest) {
|
||||
function finishTest()
|
||||
{
|
||||
resetUnlimitedQuota();
|
||||
resetIndexedDB();
|
||||
|
||||
SimpleTest.executeSoon(function() {
|
||||
testGenerator.close();
|
||||
@ -190,16 +188,6 @@ function setQuota(quota)
|
||||
SpecialPowers.setIntPref("dom.indexedDB.warningQuota", quota);
|
||||
}
|
||||
|
||||
function allowIndexedDB(url)
|
||||
{
|
||||
addPermission("indexedDB", true, url);
|
||||
}
|
||||
|
||||
function resetIndexedDB(url)
|
||||
{
|
||||
removePermission("indexedDB", url);
|
||||
}
|
||||
|
||||
function allowUnlimitedQuota(url)
|
||||
{
|
||||
addPermission("indexedDB-unlimited", true, url);
|
||||
|
@ -62,9 +62,6 @@
|
||||
|
||||
function runTest() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
SpecialPowers.addPermission("indexedDB", true, document);
|
||||
|
||||
window.addEventListener("message", messageListener, false);
|
||||
setiframe();
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#undef LOG
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "AutoMounterSetting" , ## args)
|
||||
@ -27,7 +28,7 @@
|
||||
namespace mozilla {
|
||||
namespace system {
|
||||
|
||||
class SettingsServiceCallback : public nsISettingsServiceCallback
|
||||
class SettingsServiceCallback MOZ_FINAL : public nsISettingsServiceCallback
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -21,6 +21,7 @@ SimpleTest.waitForExplicitFinish();
|
||||
// Observe app installation and confirm that the install origin didn't change.
|
||||
var observer = {
|
||||
observe: function observe(subject, topic, data) {
|
||||
Services.obs.removeObserver(observer, "webapps-sync-install");
|
||||
ok(JSON.parse(data).installOrigin == "http://www.example.com",
|
||||
"the install origin didn't change");
|
||||
tearDown();
|
||||
|
@ -1754,19 +1754,15 @@ nsHTMLEditor::RelativeFontChangeHelper(PRInt32 aSizeChange, nsINode* aNode)
|
||||
if (aNode->IsElement() && aNode->AsElement()->IsHTML(nsGkAtoms::font) &&
|
||||
aNode->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::size)) {
|
||||
// Cycle through children and adjust relative font size.
|
||||
for (nsIContent* child = aNode->GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
nsresult rv = RelativeFontChangeOnNode(aSizeChange, child);
|
||||
for (PRUint32 i = aNode->GetChildCount(); i--; ) {
|
||||
nsresult rv = RelativeFontChangeOnNode(aSizeChange, aNode->GetChildAt(i));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
||||
// Now cycle through the children.
|
||||
for (nsIContent* child = aNode->GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
nsresult rv = RelativeFontChangeHelper(aSizeChange, child);
|
||||
for (PRUint32 i = aNode->GetChildCount(); i--; ) {
|
||||
nsresult rv = RelativeFontChangeHelper(aSizeChange, aNode->GetChildAt(i));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
@ -1832,10 +1828,8 @@ nsHTMLEditor::RelativeFontChangeOnNode(PRInt32 aSizeChange, nsINode* aNode)
|
||||
// MOOSE: we should group the children together if possible
|
||||
// into a single "big" or "small". For the moment they are
|
||||
// each getting their own.
|
||||
for (nsIContent* child = aNode->GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
nsresult rv = RelativeFontChangeOnNode(aSizeChange, child);
|
||||
for (PRUint32 i = aNode->GetChildCount(); i--; ) {
|
||||
nsresult rv = RelativeFontChangeOnNode(aSizeChange, aNode->GetChildAt(i));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
@ -79,6 +79,7 @@ _TEST_FILES = \
|
||||
test_root_element_replacement.html \
|
||||
test_bug738366.html \
|
||||
test_bug757371.html \
|
||||
test_bug767684.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
|
15
editor/libeditor/html/tests/test_bug767684.html
Normal file
15
editor/libeditor/html/tests/test_bug767684.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=767684
|
||||
-->
|
||||
<title>Test for Bug 767684</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=767684">Mozilla Bug 767684</a>
|
||||
<div contenteditable>foo<b>bar</b>baz</div>
|
||||
<script>
|
||||
getSelection().selectAllChildren(document.querySelector("div"));
|
||||
document.execCommand("increaseFontSize");
|
||||
is(document.querySelector("div").innerHTML, "<big>foo<b>bar</b>baz</big>",
|
||||
"All selected text must be embiggened");
|
||||
</script>
|
@ -18,13 +18,14 @@
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIJSContextStack.h"
|
||||
#include "nspr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
extern PRLogModuleInfo *MCD;
|
||||
|
||||
// Security Manager for new XPCONNECT enabled JS Context
|
||||
// Right now it allows all access
|
||||
|
||||
class AutoConfigSecMan : public nsIXPCSecurityManager
|
||||
class AutoConfigSecMan MOZ_FINAL : public nsIXPCSecurityManager
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -272,7 +272,15 @@ $FRAGMENT_CALC_MASK<mask>$
|
||||
}
|
||||
@end
|
||||
|
||||
// Three textures, representing YCbCr planes of a video image
|
||||
// Three textures, representing YCbCr planes of a video image.
|
||||
//
|
||||
// Some older versions of the Tegra 2 android driver have a bug
|
||||
// where arithmetic ops on a texture read are just ignored. So,
|
||||
// if the below was |cb = texture2D(...).r - 0.5|, the "- 0.5" was
|
||||
// just being ignored/skipped. This, of course, lead to crappy
|
||||
// rendering -- see bug 765150. Doing them separately like below
|
||||
// makes it all OK. We don't know if this is special to constants,
|
||||
// special to 0.5, special to addition/subtraction, etc.
|
||||
@shader sYCbCrTextureLayer<mask:,Mask>FS
|
||||
$LAYER_FRAGMENT<mask>$
|
||||
#ifdef GL_ES
|
||||
@ -284,14 +292,19 @@ uniform sampler2D uCrTexture;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 yuv;
|
||||
vec4 color;
|
||||
yuv.r = texture2D(uCrTexture, vTexCoord).r - 0.5;
|
||||
yuv.g = texture2D(uYTexture, vTexCoord).r - 0.0625;
|
||||
yuv.b = texture2D(uCbTexture, vTexCoord).r - 0.5;
|
||||
color.r = yuv.g * 1.164 + yuv.r * 1.596;
|
||||
color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b;
|
||||
color.b = yuv.g * 1.164 + yuv.b * 2.018;
|
||||
|
||||
float y = texture2D(uYTexture, vTexCoord).r;
|
||||
float cb = texture2D(uCbTexture, vTexCoord).r;
|
||||
float cr = texture2D(uCrTexture, vTexCoord).r;
|
||||
|
||||
y = (y - 0.0625) * 1.164;
|
||||
cb = cb - 0.5;
|
||||
cr = cr - 0.5;
|
||||
|
||||
color.r = y + cr * 1.596;
|
||||
color.g = y - 0.813 * cr - 0.391 * cb;
|
||||
color.b = y + cb * 2.018;
|
||||
color.a = 1.0;
|
||||
$FRAGMENT_CALC_MASK<mask>$
|
||||
gl_FragColor = color * uLayerOpacity * mask;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsIFile.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
/**
|
||||
* The StartupCache is a persistent cache of simple key-value pairs,
|
||||
@ -88,7 +89,7 @@ struct CacheEntry
|
||||
|
||||
// We don't want to refcount StartupCache, and ObserverService wants to
|
||||
// refcount its listeners, so we'll let it refcount this instead.
|
||||
class StartupCacheListener : public nsIObserver
|
||||
class StartupCacheListener MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
@ -179,7 +180,7 @@ private:
|
||||
// references to the same object. We only support that if that object
|
||||
// is a singleton.
|
||||
#ifdef DEBUG
|
||||
class StartupCacheDebugOutputStream
|
||||
class StartupCacheDebugOutputStream MOZ_FINAL
|
||||
: public nsIObjectOutputStream
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -205,7 +206,7 @@ class StartupCacheDebugOutputStream
|
||||
{0xb5, 0x77, 0xf9, 0x23, 0x57, 0xed, 0xa8, 0x84}}
|
||||
// contract id: "@mozilla.org/startupcache/cache;1"
|
||||
|
||||
class StartupCacheWrapper
|
||||
class StartupCacheWrapper MOZ_FINAL
|
||||
: public nsIStartupCache
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
#include "nsIStreamLoader.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
class nsAlertsImageLoadListener : public nsIStreamLoaderObserver
|
||||
class nsAlertsImageLoadListener MOZ_FINAL : public nsIStreamLoaderObserver
|
||||
{
|
||||
public:
|
||||
nsAlertsImageLoadListener(const nsAString &aName,
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsPIPlacesDatabase.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "prinrval.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#define TOPIC_FRECENCY_UPDATED "places-frecency-updated"
|
||||
#define WAITFORTOPIC_TIMEOUT_SECONDS 5
|
||||
@ -95,7 +96,7 @@ void do_test_finished();
|
||||
/**
|
||||
* Spins current thread until a topic is received.
|
||||
*/
|
||||
class WaitForTopicSpinner : public nsIObserver
|
||||
class WaitForTopicSpinner MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -299,7 +300,7 @@ do_get_lastVisit(PRInt64 placeId, VisitRecord& result)
|
||||
static const char TOPIC_PROFILE_CHANGE[] = "profile-before-change";
|
||||
static const char TOPIC_PLACES_CONNECTION_CLOSED[] = "places-connection-closed";
|
||||
|
||||
class WaitForConnectionClosed : public nsIObserver
|
||||
class WaitForConnectionClosed MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
nsRefPtr<WaitForTopicSpinner> mSpinner;
|
||||
public:
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nsIBrowserHistory.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "mock_Link.h"
|
||||
using namespace mozilla::dom;
|
||||
@ -46,7 +47,7 @@ new_test_uri()
|
||||
return testURI.forget();
|
||||
}
|
||||
|
||||
class VisitURIObserver : public nsIObserver
|
||||
class VisitURIObserver MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -282,7 +283,7 @@ namespace test_observer_topic_dispatched_helpers {
|
||||
#define URI_VISITED "visited"
|
||||
#define URI_NOT_VISITED "not visited"
|
||||
#define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution"
|
||||
class statusObserver : public nsIObserver
|
||||
class statusObserver MOZ_FINAL : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -12,6 +12,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
EXTRA_JS_MODULES = \
|
||||
FrameWorker.jsm \
|
||||
SocialService.jsm \
|
||||
SocialProvider.jsm \
|
||||
$(NULL)
|
||||
|
||||
TEST_DIRS += \
|
||||
|
55
toolkit/components/social/SocialProvider.jsm
Normal file
55
toolkit/components/social/SocialProvider.jsm
Normal file
@ -0,0 +1,55 @@
|
||||
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FrameWorker.jsm");
|
||||
|
||||
const EXPORTED_SYMBOLS = ["SocialProvider"];
|
||||
|
||||
/**
|
||||
* The SocialProvider object represents a social provider, and allows
|
||||
* controlling its FrameWorker.
|
||||
*
|
||||
* @constructor
|
||||
* @param {jsobj} object representing the manifest file describing this provider
|
||||
*/
|
||||
function SocialProvider(input) {
|
||||
if (!input.name)
|
||||
throw new Error("SocialProvider must be passed a name");
|
||||
if (!input.workerURL)
|
||||
throw new Error("SocialProvider must be passed a workerURL");
|
||||
if (!input.origin)
|
||||
throw new Error("SocialProvider must be passed an origin");
|
||||
|
||||
this.name = input.name;
|
||||
this.workerURL = input.workerURL;
|
||||
this.origin = input.origin;
|
||||
}
|
||||
|
||||
SocialProvider.prototype = {
|
||||
/**
|
||||
* Terminate's the provider's FrameWorker, closing all of its ports.
|
||||
*/
|
||||
terminate: function shutdown() {
|
||||
try {
|
||||
getFrameWorkerHandle(this.workerURL, null).terminate();
|
||||
} catch (e) {
|
||||
Cu.reportError("SocialProvider termination failed: " + e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Instantiates a FrameWorker for the provider if one doesn't exist, and
|
||||
* returns a reference to a port to that FrameWorker.
|
||||
*
|
||||
* @param {DOMWindow} window (optional)
|
||||
*/
|
||||
getWorkerPort: function getWorkerPort(window) {
|
||||
return getFrameWorkerHandle(this.workerURL, window).port;
|
||||
}
|
||||
}
|
@ -5,34 +5,49 @@
|
||||
const EXPORTED_SYMBOLS = ["SocialService"];
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/SocialProvider.jsm");
|
||||
|
||||
const MANIFEST_PREFS = Services.prefs.getBranch("social.manifest.");
|
||||
|
||||
const SocialService = {
|
||||
let SocialServiceInternal = {};
|
||||
|
||||
_init: function _init() {
|
||||
let origins = MANIFEST_PREFS.getChildList("", {});
|
||||
this._providers = origins.reduce(function (memo, origin) {
|
||||
try {
|
||||
var manifest = JSON.parse(MANIFEST_PREFS.getCharPref(origin));
|
||||
}
|
||||
catch (err) {}
|
||||
XPCOMUtils.defineLazyGetter(SocialServiceInternal, "providers", function () {
|
||||
let providers = {};
|
||||
let prefs = MANIFEST_PREFS.getChildList("", {});
|
||||
prefs.forEach(function (pref) {
|
||||
try {
|
||||
var manifest = JSON.parse(MANIFEST_PREFS.getCharPref(pref));
|
||||
if (manifest && typeof(manifest) == "object") {
|
||||
memo[manifest.origin] = Object.create(manifest);
|
||||
let provider = new SocialProvider(manifest);
|
||||
providers[provider.origin] = provider;
|
||||
}
|
||||
return memo;
|
||||
}, {}, this);
|
||||
},
|
||||
} catch (err) {
|
||||
Cu.reportError("SocialService: failed to load provider: " + pref +
|
||||
", exception: " + err);
|
||||
}
|
||||
}, this);
|
||||
|
||||
return providers;
|
||||
});
|
||||
|
||||
const SocialService = {
|
||||
getProvider: function getProvider(origin, onDone) {
|
||||
schedule((function () {
|
||||
onDone(this._providers[origin] || null);
|
||||
onDone(SocialServiceInternal.providers[origin] || null);
|
||||
}).bind(this));
|
||||
},
|
||||
};
|
||||
|
||||
SocialService._init();
|
||||
// Returns an array of installed provider origins.
|
||||
getProviderList: function getProviderList(onDone) {
|
||||
let providers = [p for each (p in SocialServiceInternal.providers)];
|
||||
schedule((function () {
|
||||
onDone(providers);
|
||||
}).bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
function schedule(callback) {
|
||||
Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
|
@ -5,8 +5,9 @@
|
||||
function run_test() {
|
||||
let manifests = [0, 1, 2].map(function (i) {
|
||||
return {
|
||||
origin: "http://example" + i + ".com",
|
||||
name: "provider " + i,
|
||||
workerURL: "http://example" + i + ".com/worker.js",
|
||||
origin: "http://example" + i + ".com"
|
||||
};
|
||||
});
|
||||
manifests.forEach(function (manifest) {
|
||||
@ -26,8 +27,9 @@ function test(manifests, next) {
|
||||
let manifest = manifests[i];
|
||||
let provider = yield SocialService.getProvider(manifest.origin, next);
|
||||
do_check_neq(provider, null);
|
||||
do_check_eq(provider.origin, manifest.origin);
|
||||
do_check_eq(provider.name, manifest.name);
|
||||
do_check_eq(provider.workerURL, manifest.workerURL);
|
||||
do_check_eq(provider.origin, manifest.origin);
|
||||
}
|
||||
do_check_eq((yield SocialService.getProvider("bogus", next)), null);
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function run_test() {
|
||||
let manifests = [0, 1, 2].map(function (i) {
|
||||
return {
|
||||
name: "provider " + i,
|
||||
workerURL: "http://example" + i + ".com/worker.js",
|
||||
origin: "http://example" + i + ".com"
|
||||
};
|
||||
});
|
||||
manifests.forEach(function (manifest) {
|
||||
MANIFEST_PREFS.setCharPref(manifest.origin, JSON.stringify(manifest));
|
||||
});
|
||||
do_register_cleanup(function () MANIFEST_PREFS.deleteBranch(""));
|
||||
|
||||
Cu.import("resource://gre/modules/SocialService.jsm");
|
||||
|
||||
let runner = new AsyncRunner();
|
||||
runner.appendIterator(test(manifests, runner.next.bind(runner)));
|
||||
runner.next();
|
||||
}
|
||||
|
||||
function test(manifests, next) {
|
||||
let providers = yield SocialService.getProviderList(next);
|
||||
do_check_true(providers.length >= 3);
|
||||
for (let i = 0; i < manifests.length; i++) {
|
||||
do_check_neq(providers.map(function (p) p.origin).indexOf(manifests[i].origin), -1);
|
||||
do_check_neq(providers.map(function (p) p.workerURL).indexOf(manifests[i].workerURL), -1);
|
||||
do_check_neq(providers.map(function (p) p.name).indexOf(manifests[i].name), -1);
|
||||
}
|
||||
}
|
@ -3,3 +3,4 @@ head = head.js
|
||||
tail =
|
||||
|
||||
[test_getProvider.js]
|
||||
[test_getProviderList.js]
|
||||
|
@ -37,10 +37,11 @@
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
class nsToolkitProfile : public nsIToolkitProfile
|
||||
class nsToolkitProfile MOZ_FINAL : public nsIToolkitProfile
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -68,7 +69,7 @@ private:
|
||||
bool mForExternalApp;
|
||||
};
|
||||
|
||||
class nsToolkitProfileLock : public nsIProfileLock
|
||||
class nsToolkitProfileLock MOZ_FINAL : public nsIProfileLock
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -89,14 +90,14 @@ private:
|
||||
nsProfileLock mLock;
|
||||
};
|
||||
|
||||
class nsToolkitProfileFactory : public nsIFactory
|
||||
class nsToolkitProfileFactory MOZ_FINAL : public nsIFactory
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFACTORY
|
||||
};
|
||||
|
||||
class nsToolkitProfileService : public nsIToolkitProfileService
|
||||
class nsToolkitProfileService MOZ_FINAL : public nsIToolkitProfileService
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -142,7 +143,7 @@ private:
|
||||
|
||||
static nsToolkitProfileService *gService;
|
||||
|
||||
class ProfileEnumerator : public nsISimpleEnumerator
|
||||
class ProfileEnumerator MOZ_FINAL : public nsISimpleEnumerator
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
|
||||
#include "mozilla/Util.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "nsAppRunner.h"
|
||||
#include "mozilla/AppData.h"
|
||||
@ -1180,7 +1181,7 @@ ScopedXPCOMStartup::Initialize()
|
||||
* This is a little factory class that serves as a singleton-service-factory
|
||||
* for the nativeappsupport object.
|
||||
*/
|
||||
class nsSingletonFactory : public nsIFactory
|
||||
class nsSingletonFactory MOZ_FINAL : public nsIFactory
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "nsIThread.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#endif
|
||||
|
||||
class nsIFile;
|
||||
@ -59,7 +60,7 @@ NS_HIDDEN_(nsresult) ProcessUpdates(nsIFile *greDir, nsIFile *appDir,
|
||||
// updater application in the background for applying an update.
|
||||
// XXX ehsan this is living in this file in order to make use of the existing
|
||||
// stuff here, we might want to move it elsewhere in the future.
|
||||
class nsUpdateProcessor : public nsIUpdateProcessor
|
||||
class nsUpdateProcessor MOZ_FINAL : public nsIUpdateProcessor
|
||||
{
|
||||
public:
|
||||
nsUpdateProcessor();
|
||||
|
@ -792,7 +792,7 @@ nsXREDirProvider::DoStartup()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class ProfileChangeStatusImpl : public nsIProfileChangeStatus
|
||||
class ProfileChangeStatusImpl MOZ_FINAL : public nsIProfileChangeStatus
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -12,9 +12,10 @@
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
class nsXREDirProvider : public nsIDirectoryServiceProvider2,
|
||||
public nsIProfileStartup
|
||||
class nsXREDirProvider MOZ_FINAL : public nsIDirectoryServiceProvider2,
|
||||
public nsIProfileStartup
|
||||
{
|
||||
public:
|
||||
// we use a custom isupports implementation (no refcount)
|
||||
|
@ -305,6 +305,13 @@ public:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
{
|
||||
if (sample) {
|
||||
b.DefineProperty(sample, "time", entry.mTagFloat);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
case 'l':
|
||||
{
|
||||
@ -362,6 +369,7 @@ class TableTicker: public Sampler {
|
||||
const char** aFeatures, uint32_t aFeatureCount)
|
||||
: Sampler(aInterval, true)
|
||||
, mPrimaryThreadProfile(aEntrySize, aStack)
|
||||
, mStartTime(TimeStamp::Now())
|
||||
, mSaveRequested(false)
|
||||
{
|
||||
mUseStackWalk = hasFeature(aFeatures, aFeatureCount, "stackwalk");
|
||||
@ -401,6 +409,7 @@ private:
|
||||
private:
|
||||
// This represent the application's main thread (SAMPLER_INIT)
|
||||
ThreadProfile mPrimaryThreadProfile;
|
||||
TimeStamp mStartTime;
|
||||
bool mSaveRequested;
|
||||
bool mUseStackWalk;
|
||||
bool mJankOnly;
|
||||
@ -765,10 +774,15 @@ void TableTicker::Tick(TickSample* sample)
|
||||
if (recordSample)
|
||||
mPrimaryThreadProfile.flush();
|
||||
|
||||
if (!mJankOnly && !sLastTracerEvent.IsNull() && sample) {
|
||||
if (!sLastTracerEvent.IsNull() && sample) {
|
||||
TimeDuration delta = sample->timestamp - sLastTracerEvent;
|
||||
mPrimaryThreadProfile.addTag(ProfileEntry('r', delta.ToMilliseconds()));
|
||||
}
|
||||
|
||||
if (sample) {
|
||||
TimeDuration delta = sample->timestamp - mStartTime;
|
||||
mPrimaryThreadProfile.addTag(ProfileEntry('t', delta.ToMilliseconds()));
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, const ThreadProfile& profile)
|
||||
|
@ -42,6 +42,7 @@
|
||||
* this tag will describe the last 'c' tag.
|
||||
* 'r' - Responsiveness tag following an 's' tag. Gives an indication on how well the
|
||||
* application is responding to the event loop. Lower is better.
|
||||
* 't' - Elapse time since recording started.
|
||||
*
|
||||
* NOTE: File format is planned to be extended to include a dictionary to reduce size.
|
||||
*/
|
||||
|
@ -41,13 +41,6 @@ nsQueryInterfaceWithError::operator()( const nsIID& aIID, void** answer ) const
|
||||
return status;
|
||||
}
|
||||
|
||||
nsCOMPtr_base::~nsCOMPtr_base()
|
||||
{
|
||||
NSCAP_LOG_RELEASE(this, mRawPtr);
|
||||
if ( mRawPtr )
|
||||
NSCAP_RELEASE(this, mRawPtr);
|
||||
}
|
||||
|
||||
void
|
||||
nsCOMPtr_base::assign_with_AddRef( nsISupports* rawPtr )
|
||||
{
|
||||
|
@ -401,7 +401,12 @@ nsCOMPtr_base
|
||||
// nothing else to do here
|
||||
}
|
||||
|
||||
NS_COM_GLUE NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base();
|
||||
NS_COM_GLUE ~nsCOMPtr_base()
|
||||
{
|
||||
NSCAP_LOG_RELEASE(this, mRawPtr);
|
||||
if ( mRawPtr )
|
||||
NSCAP_RELEASE(this, mRawPtr);
|
||||
}
|
||||
|
||||
NS_COM_GLUE void NS_FASTCALL assign_with_AddRef( nsISupports* );
|
||||
NS_COM_GLUE void NS_FASTCALL assign_from_qi( const nsQueryInterface, const nsIID& );
|
||||
|
@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "nsISample.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
/**
|
||||
* SampleImpl is an implementation of the nsISample interface. In XPCOM,
|
||||
@ -28,7 +29,7 @@
|
||||
#define NS_SAMPLE_CONTRACTID "@mozilla.org/sample;1"
|
||||
|
||||
|
||||
class nsSampleImpl : public nsISample
|
||||
class nsSampleImpl MOZ_FINAL : public nsISample
|
||||
{
|
||||
public:
|
||||
nsSampleImpl();
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include <stdio.h>
|
||||
#include "nscore.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
class TestObjectBaseA {
|
||||
public:
|
||||
@ -53,7 +54,7 @@ class TestRefObjectBaseB {
|
||||
virtual nsrefcnt Release() = 0;
|
||||
};
|
||||
|
||||
class TestRefObject : public TestRefObjectBaseA, public TestRefObjectBaseB {
|
||||
class TestRefObject MOZ_FINAL : public TestRefObjectBaseA, public TestRefObjectBaseB {
|
||||
public:
|
||||
TestRefObject()
|
||||
: mRefCount(0)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "TestHarness.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
// {9e70a320-be02-11d1-8031-006008159b5a}
|
||||
#define NS_IFOO_IID \
|
||||
@ -23,7 +24,7 @@ public:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(IFoo, NS_IFOO_IID)
|
||||
|
||||
class Foo : public IFoo {
|
||||
class Foo MOZ_FINAL : public IFoo {
|
||||
public:
|
||||
|
||||
Foo(PRInt32 aID);
|
||||
@ -73,7 +74,7 @@ public:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(IBar, NS_IBAR_IID)
|
||||
|
||||
class Bar : public IBar {
|
||||
class Bar MOZ_FINAL : public IBar {
|
||||
public:
|
||||
|
||||
explicit Bar(nsCOMArray<IBar>& aArray);
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#define NS_ITESTSERVICE_IID \
|
||||
{0x127b5253, 0x37b1, 0x43c7, \
|
||||
@ -32,7 +33,8 @@ class NS_NO_VTABLE nsITestService : public nsISupports {
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsITestService, NS_ITESTSERVICE_IID)
|
||||
|
||||
class nsTestService : public nsITestService, public nsSupportsWeakReference
|
||||
class nsTestService MOZ_FINAL : public nsITestService,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@ -191,7 +192,7 @@ nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) {
|
||||
{ 0x6f7652e0, 0xee43, 0x11d1, \
|
||||
{ 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
|
||||
|
||||
class IFoo : public nsISupports
|
||||
class IFoo MOZ_FINAL : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@ -29,7 +30,9 @@ void printString(nsString &str) {
|
||||
printf("%s", NS_ConvertUTF16toUTF8(str).get());
|
||||
}
|
||||
|
||||
class TestObserver : public nsIObserver, public nsSupportsWeakReference {
|
||||
class TestObserver MOZ_FINAL : public nsIObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
TestObserver( const nsAString &name )
|
||||
: mName( name ) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "nsIPipe.h"
|
||||
#include "nsIMemory.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
/** NS_NewPipe2 reimplemented, because it's not exported by XPCOM */
|
||||
nsresult TP_NewPipe2(nsIAsyncInputStream** input,
|
||||
@ -41,7 +42,7 @@ nsresult TP_NewPipe2(nsIAsyncInputStream** input,
|
||||
* which <size>-byte locations in mMemory are empty and which are filled.
|
||||
* Pretty stupid, but enough to test bug 394692.
|
||||
*/
|
||||
class BackwardsAllocator : public nsIMemory
|
||||
class BackwardsAllocator MOZ_FINAL : public nsIMemory
|
||||
{
|
||||
public:
|
||||
BackwardsAllocator()
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
#include "prmon.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
using namespace mozilla;
|
||||
@ -83,7 +84,7 @@ private:
|
||||
ReentrantMonitor** mReentrantMonitorPtr;
|
||||
};
|
||||
|
||||
class Factory : public nsIFactory
|
||||
class Factory MOZ_FINAL : public nsIFactory
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -103,7 +104,7 @@ public:
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(Factory, nsIFactory)
|
||||
|
||||
class Component1 : public nsISupports
|
||||
class Component1 MOZ_FINAL : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -123,7 +124,7 @@ NS_INTERFACE_MAP_BEGIN(Component1)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
class Component2 : public nsISupports
|
||||
class Component2 MOZ_FINAL : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "prinrval.h"
|
||||
#include "prmon.h"
|
||||
#include "prthread.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
using namespace mozilla;
|
||||
@ -44,7 +45,7 @@ static bool gAllThreadsShutDown = false;
|
||||
PR_END_MACRO
|
||||
#endif
|
||||
|
||||
class Listener : public nsIThreadPoolListener
|
||||
class Listener MOZ_FINAL : public nsIThreadPoolListener
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prinrval.h"
|
||||
#include "prmon.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
using namespace mozilla;
|
||||
@ -68,7 +69,7 @@ private:
|
||||
ReentrantMonitor* mReentrantMonitor;
|
||||
};
|
||||
|
||||
class TimerCallback : public nsITimerCallback
|
||||
class TimerCallback MOZ_FINAL : public nsITimerCallback
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
Loading…
x
Reference in New Issue
Block a user