This commit is contained in:
Carsten "Tomcat" Book 2013-10-10 13:46:51 +02:00
Родитель 968fb0abf6 4a5c30eda0
Коммит b52f930802
162 изменённых файлов: 1178 добавлений и 8802 удалений

Просмотреть файл

@ -96,7 +96,6 @@ pref("browser.helperApps.deleteTempFileOnExit", false);
/* password manager */
pref("signon.rememberSignons", true);
pref("signon.expireMasterPassword", false);
pref("signon.SignonFileName", "signons.txt");
/* autocomplete */
pref("browser.formfill.enable", true);

Просмотреть файл

@ -383,7 +383,6 @@
@BINPATH@/components/HttpDataUsage.js
@BINPATH@/components/SiteSpecificUserAgent.js
@BINPATH@/components/SiteSpecificUserAgent.manifest
@BINPATH@/components/storage-Legacy.js
@BINPATH@/components/storage-mozStorage.js
@BINPATH@/components/crypto-SDR.js
@BINPATH@/components/jsconsole-clhandler.manifest

Просмотреть файл

@ -1341,6 +1341,8 @@
if (isRemote == aRemote)
return false;
let wasActive = document.activeElement == aBrowser;
// Unhook our progress listener.
let tab = this._getTabForBrowser(aBrowser);
let index = tab._tPos;
@ -1361,6 +1363,9 @@
else
tab.removeAttribute("remote");
if (wasActive)
aBrowser.focus();
return true;
]]>
</body>

Просмотреть файл

@ -20,6 +20,8 @@
#include "nsNetUtil.h"
#include "nsShellService.h"
#include "nsStringAPI.h"
#include "nsIDocShell.h"
#include "nsILoadContext.h"
#include <CoreFoundation/CoreFoundation.h>
#include <ApplicationServices/ApplicationServices.h>
@ -193,8 +195,15 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement,
wbp->SetPersistFlags(flags);
wbp->SetProgressListener(this);
nsCOMPtr<nsILoadContext> loadContext;
nsCOMPtr<nsISupports> container = content->OwnerDoc()->GetContainer();
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
if (docShell) {
loadContext = do_QueryInterface(docShell);
}
return wbp->SaveURI(imageURI, nullptr, docURI, nullptr, nullptr,
mBackgroundFile, content->OwnerDoc()->GetLoadContext());
mBackgroundFile, loadContext);
}
NS_IMETHODIMP

Просмотреть файл

@ -545,7 +545,7 @@ let gDevToolsBrowser = {
*/
_addToolToWindows: function DT_addToolToWindows(toolDefinition) {
// No menu item or global shortcut is required for options panel.
if (toolDefinition.id == "options") {
if (!toolDefinition.inMenu) {
return;
}
@ -561,7 +561,7 @@ let gDevToolsBrowser = {
let allDefs = gDevTools.getToolDefinitionArray();
let prevDef;
for (let def of allDefs) {
if (def.id == "options") {
if (!def.inMenu) {
continue;
}
if (def === toolDefinition) {
@ -630,7 +630,7 @@ let gDevToolsBrowser = {
let fragMenuItems = doc.createDocumentFragment();
for (let toolDefinition of gDevTools.getToolDefinitionArray()) {
if (toolDefinition.id == "options") {
if (!toolDefinition.inMenu) {
continue;
}

Просмотреть файл

@ -27,6 +27,7 @@ function testRegister(aToolbox)
gDevTools.registerTool({
id: "test-tool",
label: "Test Tool",
inMenu: true,
isTargetSupported: function() true,
build: function() {}
});

Просмотреть файл

@ -59,6 +59,7 @@ Tools.options = {
url: "chrome://browser/content/devtools/framework/toolbox-options.xul",
icon: "chrome://browser/skin/devtools/tool-options.png",
tooltip: l10n("optionsButton.tooltip", toolboxStrings),
inMenu: false,
isTargetSupported: function(target) {
return true;
},
@ -79,6 +80,7 @@ Tools.webConsole = {
label: l10n("ToolboxTabWebconsole.label", webConsoleStrings),
menuLabel: l10n("MenuWebconsole.label", webConsoleStrings),
tooltip: l10n("ToolboxWebconsole.tooltip", webConsoleStrings),
inMenu: true,
isTargetSupported: function(target) {
return true;
@ -99,6 +101,7 @@ Tools.inspector = {
url: "chrome://browser/content/devtools/inspector/inspector.xul",
label: l10n("inspector.label", inspectorStrings),
tooltip: l10n("inspector.tooltip", inspectorStrings),
inMenu: true,
preventClosingOnKey: true,
onkey: function(panel) {
@ -129,6 +132,7 @@ Tools.jsdebugger = {
url: "chrome://browser/content/devtools/debugger.xul",
label: l10n("ToolboxDebugger.label", debuggerStrings),
tooltip: l10n("ToolboxDebugger.tooltip", debuggerStrings),
inMenu: true,
isTargetSupported: function(target) {
return true;
@ -150,6 +154,7 @@ Tools.styleEditor = {
url: "chrome://browser/content/devtools/styleeditor.xul",
label: l10n("ToolboxStyleEditor.label", styleEditorStrings),
tooltip: l10n("ToolboxStyleEditor.tooltip2", styleEditorStrings),
inMenu: true,
isTargetSupported: function(target) {
return true;
@ -172,6 +177,7 @@ Tools.jsprofiler = {
url: "chrome://browser/content/devtools/profiler.xul",
label: l10n("profiler.label", profilerStrings),
tooltip: l10n("profiler.tooltip2", profilerStrings),
inMenu: true,
isTargetSupported: function (target) {
return true;
@ -194,6 +200,7 @@ Tools.netMonitor = {
url: "chrome://browser/content/devtools/netmonitor.xul",
label: l10n("netmonitor.label", netMonitorStrings),
tooltip: l10n("netmonitor.tooltip", netMonitorStrings),
inMenu: true,
isTargetSupported: function(target) {
return !target.isApp;
@ -213,6 +220,7 @@ Tools.scratchpad = {
url: "chrome://browser/content/devtools/scratchpad.xul",
label: l10n("scratchpad.label", scratchpadStrings),
tooltip: l10n("scratchpad.tooltip", scratchpadStrings),
inMenu: false,
isTargetSupported: function(target) {
return target.isRemote;

Просмотреть файл

@ -373,7 +373,6 @@
@BINPATH@/components/nsLoginInfo.js
@BINPATH@/components/nsLoginManager.js
@BINPATH@/components/nsLoginManagerPrompter.js
@BINPATH@/components/storage-Legacy.js
@BINPATH@/components/storage-mozStorage.js
@BINPATH@/components/crypto-SDR.js
@BINPATH@/components/jsconsole-clhandler.manifest

Просмотреть файл

@ -186,7 +186,6 @@ pref("browser.helperApps.deleteTempFileOnExit", false);
/* password manager */
pref("signon.rememberSignons", true);
pref("signon.SignonFileName", "signons.txt");
/* find helper */
pref("findhelper.autozoom", true);

Просмотреть файл

@ -0,0 +1,25 @@
# 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/.
JAVA_JAR_TARGETS += annotationProcessors
annotationProcessors_DEST := annotationProcessors.jar
annotationProcessors_JAVAFILES := \
AnnotationProcessor.java \
CodeGenerator.java \
MethodWithAnnotationInfo.java \
classloader/IterableJarLoadingURLClassLoader.java \
classloader/JarClassIterator.java \
utils/AlphabeticMethodComparator.java \
utils/GeneratableEntryPointIterator.java \
utils/Utils.java \
$(NULL)
include $(topsrcdir)/config/rules.mk
JAVA_CLASSPATH := $(ANDROID_SDK)/android.jar
# Include Android specific java flags, instead of what's in rules.mk.
include $(topsrcdir)/config/android-common.mk
libs:: annotationProcessors.jar

Просмотреть файл

@ -0,0 +1,5 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.

Просмотреть файл

@ -505,12 +505,12 @@ public class Utils {
* @param aClass Class to check for CharSequence-esqueness
* @return True if the given class implements CharSequence, false otherwise.
*/
public static boolean isCharSequence(Class aClass) {
public static boolean isCharSequence(Class<?> aClass) {
if (aClass.getCanonicalName().equals("java.lang.CharSequence")) {
return true;
}
Class[] interfaces = aClass.getInterfaces();
for (Class c : interfaces) {
Class<?>[] interfaces = aClass.getInterfaces();
for (Class<?> c : interfaces) {
if (c.getCanonicalName().equals("java.lang.CharSequence")) {
return true;
}

Просмотреть файл

@ -13,6 +13,7 @@ if CONFIG['OS_TARGET'] == 'Android' and not CONFIG['MOZ_ANDROID_LIBSTDCXX']:
DIRS += ['stlport']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['annotationProcessors']
TEST_DIRS += [
'mobile/sutagent/android',
'mobile/sutagent/android/watcher',

Просмотреть файл

@ -90,6 +90,40 @@ endif #} ANDROID_EXTRA_JARS
include $(topsrcdir)/config/android-common.mk
endif #} ANDROID_APK_NAME
ifdef JAVA_JAR_TARGETS #{
# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
# Intermediate class files are generated in jars/jarfile-classes.
# Arg 2: Java sources list. We use VPATH and $^ so sources can be
# relative to $(srcdir) or $(CURDIR).
# Arg 3: List of extra jars to link against. We do not use VPATH so
# jars must be relative to $(CURDIR).
# Arg 4: Additional JAVAC_FLAGS.
define java_jar_template
$(1): $(2) $(3)
$$(REPORT_BUILD)
@$$(NSINSTALL) -D $(1:.jar=)-classes
@$$(if $$(filter-out .,$$(@D)),$$(NSINSTALL) -D $$(@D))
$$(JAVAC) $$(JAVAC_FLAGS)\
$(4)\
-d $(1:.jar=)-classes\
$(if $(strip $(3)),-classpath $(subst $(NULL) ,:,$(strip $(3))))\
$$(filter %.java,$$^)
$$(JAR) cMf $$@ -C $(1:.jar=)-classes .
GARBAGE += $(1)
GARBAGE_DIRS += $(1:.jar=)-classes
endef
$(foreach jar,$(JAVA_JAR_TARGETS),\
$(if $($(jar)_DEST),,$(error Missing $(jar)_DEST))\
$(if $($(jar)_JAVAFILES),,$(error Missing $(jar)_JAVAFILES))\
$(eval $(call java_jar_template,$($(jar)_DEST),$($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),$($(jar)_EXTRA_JARS),$($(jar)_JAVAC_FLAGS)))\
)
endif #} JAVA_JAR_TARGETS
INCLUDED_JAVA_BUILD_MK := 1
endif #} INCLUDED_JAVA_BUILD_MK

Просмотреть файл

@ -1221,7 +1221,7 @@ endif
###############################################################################
# Java rules
###############################################################################
ifneq (,$(value JAVAFILES)$(value ANDROID_RESFILES))
ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS))
include $(topsrcdir)/config/makefiles/java-build.mk
endif

Просмотреть файл

@ -5,7 +5,6 @@
#ifndef nsIDocument_h___
#define nsIDocument_h___
#include "mozilla/Attributes.h"
#include "mozFlushType.h" // for enum
#include "nsAutoPtr.h" // for member
#include "nsCOMArray.h" // for member
@ -13,15 +12,10 @@
#include "nsCompatibility.h" // for member
#include "nsCOMPtr.h" // for member
#include "nsGkAtoms.h" // for static class members
#include "nsIChannel.h" // for member
#include "nsIDocumentEncoder.h" // for member (in nsCOMPtr)
#include "nsIDocumentObserver.h" // for typedef (nsUpdateType)
#include "nsIFrameRequestCallback.h" // for member (in nsCOMPtr)
#include "nsILoadContext.h" // for member (in nsCOMPtr)
#include "nsILoadGroup.h" // for member (in nsCOMPtr)
#include "nsINode.h" // for base class
#include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr)
#include "nsIStructuredCloneContainer.h" // for member (in nsCOMPtr)
#include "nsPIDOMWindow.h" // for use in inline functions
#include "nsPropertyTable.h" // for member
#include "nsTHashtable.h" // for member
@ -48,6 +42,7 @@ class nsIChannel;
class nsIContent;
class nsIContentSink;
class nsIDocShell;
class nsIDocumentEncoder;
class nsIDocumentObserver;
class nsIDOMDocument;
class nsIDOMDocumentFragment;
@ -59,12 +54,14 @@ class nsIDOMXPathExpression;
class nsIDOMXPathNSResolver;
class nsIHTMLCollection;
class nsILayoutHistoryState;
class nsILoadContext;
class nsIObjectLoadingContent;
class nsIObserver;
class nsIPresShell;
class nsIPrincipal;
class nsIRequest;
class nsIStreamListener;
class nsIStructuredCloneContainer;
class nsIStyleRule;
class nsIStyleSheet;
class nsIURI;
@ -1165,15 +1162,7 @@ public:
/**
* Get the container's load context for this document.
*/
nsILoadContext* GetLoadContext() const
{
nsCOMPtr<nsISupports> container = GetContainer();
if (container) {
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
return loadContext;
}
return nullptr;
}
nsILoadContext* GetLoadContext() const;
/**
* Set and get XML declaration. If aVersion is null there is no declaration.
@ -1481,15 +1470,9 @@ public:
mMayStartLayout = aMayStartLayout;
}
already_AddRefed<nsIDocumentEncoder> GetCachedEncoder()
{
return mCachedEncoder.forget();
}
already_AddRefed<nsIDocumentEncoder> GetCachedEncoder();
void SetCachedEncoder(already_AddRefed<nsIDocumentEncoder> aEncoder)
{
mCachedEncoder = aEncoder;
}
void SetCachedEncoder(already_AddRefed<nsIDocumentEncoder> aEncoder);
// In case of failure, the document really can't initialize the frame loader.
virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) = 0;
@ -1772,11 +1755,7 @@ public:
* Set the document's pending state object (as serialized using structured
* clone).
*/
void SetStateObject(nsIStructuredCloneContainer *scContainer)
{
mStateObjectContainer = scContainer;
mStateObjectCached = nullptr;
}
void SetStateObject(nsIStructuredCloneContainer *scContainer);
/**
* Returns Doc_Theme_None if there is no lightweight theme specified,
@ -2219,11 +2198,7 @@ protected:
return GetRootElement();
}
void SetContentTypeInternal(const nsACString& aType)
{
mCachedEncoder = nullptr;
mContentType = aType;
}
void SetContentTypeInternal(const nsACString& aType);
nsCString GetContentTypeInternal() const
{

Просмотреть файл

@ -18,6 +18,7 @@
#include "nsIAtom.h"
#include "nsIContentInlines.h"
#include "nsINodeInfo.h"
#include "nsIDocumentEncoder.h"
#include "nsIDocumentInlines.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"

Просмотреть файл

@ -93,6 +93,7 @@
#include "nsIContentViewer.h"
#include "nsIDocShell.h"
#include "nsIDocument.h"
#include "nsIDocumentEncoder.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsIDOMEvent.h"

Просмотреть файл

@ -213,6 +213,8 @@
#include "nsISecurityConsoleMessage.h"
#include "nsCharSeparatedTokenizer.h"
#include "mozilla/dom/XPathEvaluator.h"
#include "nsIDocumentEncoder.h"
#include "nsIStructuredCloneContainer.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -11375,6 +11377,43 @@ nsIDocument::XPathEvaluator()
return mXPathEvaluator;
}
already_AddRefed<nsIDocumentEncoder>
nsIDocument::GetCachedEncoder()
{
return mCachedEncoder.forget();
}
void
nsIDocument::SetCachedEncoder(already_AddRefed<nsIDocumentEncoder> aEncoder)
{
mCachedEncoder = aEncoder;
}
void
nsIDocument::SetContentTypeInternal(const nsACString& aType)
{
mCachedEncoder = nullptr;
mContentType = aType;
}
nsILoadContext*
nsIDocument::GetLoadContext() const
{
nsCOMPtr<nsISupports> container = GetContainer();
if (container) {
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
return loadContext;
}
return nullptr;
}
void
nsIDocument::SetStateObject(nsIStructuredCloneContainer *scContainer)
{
mStateObjectContainer = scContainer;
mStateObjectCached = nullptr;
}
bool
MarkDocumentTreeToBeInSyncOperation(nsIDocument* aDoc, void* aData)
{

Просмотреть файл

@ -998,8 +998,34 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream,
previousHandler = handler;
} while (1);
if (mBinding) {
while (true) {
XBLBindingSerializeDetails type;
rv = aStream->Read8(&type);
NS_ENSURE_SUCCESS(rv, rv);
if (type != XBLBinding_Serialize_Attribute) {
break;
}
int32_t attrNamespace;
rv = ReadNamespace(aStream, attrNamespace);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString attrName, attrValue;
rv = aStream->ReadString(attrName);
NS_ENSURE_SUCCESS(rv, rv);
rv = aStream->ReadString(attrValue);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAtom> atomName = do_GetAtom(attrName);
mBinding->SetAttr(attrNamespace, atomName, attrValue, false);
}
}
// Finally, read in the resources.
do {
while (true) {
XBLBindingSerializeDetails type;
rv = aStream->Read8(&type);
NS_ENSURE_SUCCESS(rv, rv);
@ -1016,7 +1042,7 @@ nsXBLPrototypeBinding::Read(nsIObjectInputStream* aStream,
AddResource(type == XBLBinding_Serialize_Stylesheet ? nsGkAtoms::stylesheet :
nsGkAtoms::image, src);
} while (1);
}
if (isFirstBinding) {
aDocInfo->SetFirstPrototypeBinding(this);
@ -1126,6 +1152,30 @@ nsXBLPrototypeBinding::Write(nsIObjectOutputStream* aStream)
aStream->Write8(XBLBinding_Serialize_NoMoreItems);
NS_ENSURE_SUCCESS(rv, rv);
if (mBinding) {
uint32_t attributes = mBinding->GetAttrCount();
nsAutoString attrValue;
for (uint32_t i = 0; i < attributes; ++i) {
const nsAttrName* attr = mBinding->GetAttrNameAt(i);
nsDependentAtomString attrName = attr->Atom();
mBinding->GetAttr(attr->NamespaceID(), attr->Atom(), attrValue);
rv = aStream->Write8(XBLBinding_Serialize_Attribute);
NS_ENSURE_SUCCESS(rv, rv);
rv = WriteNamespace(aStream, attr->NamespaceID());
NS_ENSURE_SUCCESS(rv, rv);
rv = aStream->WriteWStringZ(attrName.get());
NS_ENSURE_SUCCESS(rv, rv);
rv = aStream->WriteWStringZ(attrValue.get());
NS_ENSURE_SUCCESS(rv, rv);
}
}
aStream->Write8(XBLBinding_Serialize_NoMoreItems);
NS_ENSURE_SUCCESS(rv, rv);
// Write out the resources
if (mResources) {
rv = mResources->Write(aStream);

Просмотреть файл

@ -15,7 +15,7 @@ typedef uint8_t XBLBindingSerializeDetails;
// A version number to ensure we don't load cached data in a different
// file format.
#define XBLBinding_Serialize_Version 0x00000002
#define XBLBinding_Serialize_Version 0x00000003
// Set for the first binding in a document
#define XBLBinding_Serialize_IsFirstBinding 1
@ -45,6 +45,7 @@ typedef uint8_t XBLBindingSerializeDetails;
#define XBLBinding_Serialize_Handler 8
#define XBLBinding_Serialize_Image 9
#define XBLBinding_Serialize_Stylesheet 10
#define XBLBinding_Serialize_Attribute 0xA
#define XBLBinding_Serialize_Mask 0x0F
#define XBLBinding_Serialize_ReadOnly 0x80

Просмотреть файл

@ -20,14 +20,8 @@
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_1(URL, mWindow)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(URL, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(URL, Release)
URL::URL(nsPIDOMWindow* aWindow, nsIURI* aURI)
: mWindow(aWindow)
, mURI(aURI)
URL::URL(nsIURI* aURI)
: mURI(aURI)
{
}
@ -41,12 +35,6 @@ URL::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
URL::Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
URL& aBase, ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
if (!window) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
nsresult rv;
nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
@ -62,7 +50,7 @@ URL::Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
return nullptr;
}
nsRefPtr<URL> url = new URL(window, uri);
nsRefPtr<URL> url = new URL(uri);
return url.forget();
}
@ -70,12 +58,6 @@ URL::Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
URL::Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
const nsAString& aBase, ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
if (!window) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return nullptr;
}
nsresult rv;
nsCOMPtr<nsIIOService> ioService(do_GetService(NS_IOSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
@ -99,7 +81,7 @@ URL::Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
return nullptr;
}
nsRefPtr<URL> url = new URL(window, uri);
nsRefPtr<URL> url = new URL(uri);
return url.forget();
}
@ -110,7 +92,7 @@ URL::CreateObjectURL(const GlobalObject& aGlobal,
nsString& aResult,
ErrorResult& aError)
{
CreateObjectURLInternal(aGlobal.GetAsSupports(), aBlob,
CreateObjectURLInternal(aGlobal, aBlob,
NS_LITERAL_CSTRING(BLOBURI_SCHEME), aOptions, aResult,
aError);
}
@ -121,7 +103,7 @@ URL::CreateObjectURL(const GlobalObject& aGlobal, DOMMediaStream& aStream,
nsString& aResult,
ErrorResult& aError)
{
CreateObjectURLInternal(aGlobal.GetAsSupports(), &aStream,
CreateObjectURLInternal(aGlobal, &aStream,
NS_LITERAL_CSTRING(MEDIASTREAMURI_SCHEME), aOptions,
aResult, aError);
}
@ -132,65 +114,62 @@ URL::CreateObjectURL(const GlobalObject& aGlobal, MediaSource& aSource,
nsString& aResult,
ErrorResult& aError)
{
CreateObjectURLInternal(aGlobal.GetAsSupports(), &aSource,
CreateObjectURLInternal(aGlobal, &aSource,
NS_LITERAL_CSTRING(MEDIASOURCEURI_SCHEME), aOptions,
aResult, aError);
}
void
URL::CreateObjectURLInternal(nsISupports* aGlobal, nsISupports* aObject,
URL::CreateObjectURLInternal(const GlobalObject& aGlobal, nsISupports* aObject,
const nsACString& aScheme,
const objectURLOptions& aOptions,
nsString& aResult, ErrorResult& aError)
{
nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aGlobal);
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(w.get());
NS_PRECONDITION(!window || window->IsInnerWindow(),
"Should be inner window");
if (!window || !window->GetExtantDoc()) {
aError.Throw(NS_ERROR_INVALID_POINTER);
return;
}
nsIDocument* doc = window->GetExtantDoc();
nsCOMPtr<nsIPrincipal> principal = nsContentUtils::GetObjectPrincipal(aGlobal.Get());
nsCString url;
nsresult rv = nsHostObjectProtocolHandler::AddDataEntry(aScheme, aObject,
doc->NodePrincipal(), url);
principal, url);
if (NS_FAILED(rv)) {
aError.Throw(rv);
return;
}
doc->RegisterHostObjectUri(url);
nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aGlobal.GetAsSupports());
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(w.get());
if (window) {
NS_PRECONDITION(window->IsInnerWindow(), "Should be inner window");
if (!window->GetExtantDoc()) {
aError.Throw(NS_ERROR_INVALID_POINTER);
return;
}
nsIDocument* doc = window->GetExtantDoc();
if (doc) {
doc->RegisterHostObjectUri(url);
}
}
CopyASCIItoUTF16(url, aResult);
}
void
URL::RevokeObjectURL(const GlobalObject& aGlobal, const nsAString& aURL)
{
nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aGlobal.GetAsSupports());
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(w.get());
NS_PRECONDITION(!window || window->IsInnerWindow(),
"Should be inner window");
if (!window)
return;
nsIPrincipal* principal = nsContentUtils::GetObjectPrincipal(aGlobal.Get());
NS_LossyConvertUTF16toASCII asciiurl(aURL);
nsIPrincipal* winPrincipal = window->GetPrincipal();
if (!winPrincipal) {
return;
}
nsIPrincipal* principal =
nsIPrincipal* urlPrincipal =
nsHostObjectProtocolHandler::GetDataEntryPrincipal(asciiurl);
bool subsumes;
if (principal && winPrincipal &&
NS_SUCCEEDED(winPrincipal->Subsumes(principal, &subsumes)) &&
subsumes) {
if (window->GetExtantDoc()) {
if (urlPrincipal && principal->Subsumes(urlPrincipal)) {
nsCOMPtr<nsPIDOMWindow> w = do_QueryInterface(aGlobal.GetAsSupports());
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(w.get());
if (window && window->GetExtantDoc()) {
window->GetExtantDoc()->UnregisterHostObjectUri(asciiurl);
}
nsHostObjectProtocolHandler::RemoveDataEntry(asciiurl);

Просмотреть файл

@ -13,7 +13,6 @@
class nsIDOMBlob;
class nsISupports;
class nsIURI;
class nsPIDOMWindow;
namespace mozilla {
@ -33,15 +32,14 @@ class URLProxy;
class URL MOZ_FINAL
{
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(URL)
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(URL)
NS_INLINE_DECL_REFCOUNTING(URL)
URL(nsPIDOMWindow* aWindow, nsIURI* aURI);
URL(nsIURI* aURI);
// WebIDL methods
nsPIDOMWindow* GetParentObject() const
nsISupports* GetParentObject() const
{
return mWindow;
return nullptr;
}
JSObject*
@ -120,13 +118,13 @@ private:
return mURI;
}
static void CreateObjectURLInternal(nsISupports* aGlobal, nsISupports* aObject,
static void CreateObjectURLInternal(const GlobalObject& aGlobal,
nsISupports* aObject,
const nsACString& aScheme,
const objectURLOptions& aOptions,
nsString& aResult,
ErrorResult& aError);
nsRefPtr<nsPIDOMWindow> mWindow;
nsCOMPtr<nsIURI> mURI;
friend class mozilla::dom::workers::URLProxy;

Просмотреть файл

@ -148,6 +148,7 @@
#include "nsMenuPopupFrame.h"
#endif
#include "nsIDOMCustomEvent.h"
#include "nsIFrameRequestCallback.h"
#include "xpcprivate.h"
@ -12147,4 +12148,4 @@ nsGlobalWindow::DisableNetworkEvent(uint32_t aType)
#undef WINDOW_ONLY_EVENT
#undef BEFOREUNLOAD_EVENT
#undef ERROR_EVENT
#undef EVENT
#undef EVENT

Просмотреть файл

@ -1,5 +1,8 @@
[DEFAULT]
support-files =
file_url.jsm
[test_bug715041.xul]
[test_bug715041_removal.xul]
[test_domrequesthelper.xul]
[test_url.xul]

Просмотреть файл

@ -0,0 +1,18 @@
this.EXPORTED_SYMBOLS = ['checkFromJSM'];
this.checkFromJSM = function checkFromJSM(ok, is) {
Components.utils.importGlobalProperties(['URL']);
var url = new URL('http://www.example.com');
is(url.href, "http://www.example.com/", "JSM should have URL");
var url2 = new URL('/foobar', url);
is(url2.href, "http://www.example.com/foobar", "JSM should have URL - based on another URL");
var blob = new Blob(['a']);
var url = URL.createObjectURL(blob);
ok(url, "URL is created!");
URL.revokeObjectURL(url);
ok(true, "URL is revoked");
}

Просмотреть файл

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<window title="Test for URL API"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
</body>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
/** Test for URL API. **/
const Cu = Components.utils;
// Import our test JSM. We first strip the filename off
// the chrome url, then append the jsm filename.
var base = /.*\//.exec(window.location.href)[0];
Cu.import(base + "file_url.jsm");
checkFromJSM(ok, is);
]]></script>
</window>

Просмотреть файл

@ -67,6 +67,7 @@
#include "nsViewportInfo.h"
#include "JavaScriptChild.h"
#include "APZCCallbackHelper.h"
#include "nsILoadContext.h"
#define BROWSER_ELEMENT_CHILD_SCRIPT \
NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js")

Просмотреть файл

@ -38,6 +38,7 @@
#include "nsVersionComparator.h"
#include "mozilla/Preferences.h"
#include "mozilla/unused.h"
#include "nsILoadContext.h"
using namespace mozilla;

Просмотреть файл

@ -11,7 +11,9 @@
*/
interface CharacterData : Node {
[TreatNullAs=EmptyString,SetterThrows] attribute DOMString data;
[TreatNullAs=EmptyString, Pure, SetterThrows]
attribute DOMString data;
[Pure]
readonly attribute unsigned long length;
[Throws]
DOMString substringData(unsigned long offset, unsigned long count);

Просмотреть файл

@ -12,26 +12,34 @@
[Constructor(DOMString type, optional EventInit eventInitDict)]
interface Event {
[Pure]
readonly attribute DOMString type;
[Pure]
readonly attribute EventTarget? target;
[Pure]
readonly attribute EventTarget? currentTarget;
const unsigned short NONE = 0;
const unsigned short CAPTURING_PHASE = 1;
const unsigned short AT_TARGET = 2;
const unsigned short BUBBLING_PHASE = 3;
[Pure]
readonly attribute unsigned short eventPhase;
void stopPropagation();
void stopImmediatePropagation();
[Pure]
readonly attribute boolean bubbles;
[Pure]
readonly attribute boolean cancelable;
void preventDefault();
[Pure]
readonly attribute boolean defaultPrevented;
[Unforgeable]
[Unforgeable, Pure]
readonly attribute boolean isTrusted;
[Pure]
readonly attribute DOMTimeStamp timeStamp;
[Throws]

Просмотреть файл

@ -15,14 +15,21 @@ interface HTMLDocument : Document {
// DOM tree accessors
[Throws]
getter object (DOMString name);
[SetterThrows]
[Pure, SetterThrows]
attribute HTMLElement? body;
[Pure]
readonly attribute HTMLHeadElement? head;
[Pure]
readonly attribute HTMLCollection images;
[Pure]
readonly attribute HTMLCollection embeds;
[Pure]
readonly attribute HTMLCollection plugins;
[Pure]
readonly attribute HTMLCollection links;
[Pure]
readonly attribute HTMLCollection forms;
[Pure]
readonly attribute HTMLCollection scripts;
NodeList getElementsByName(DOMString elementName);
NodeList getItems(optional DOMString typeNames = ""); // microdata
@ -60,7 +67,9 @@ interface HTMLDocument : Document {
[TreatNullAs=EmptyString] attribute DOMString alinkColor;
[TreatNullAs=EmptyString] attribute DOMString bgColor;
[Pure]
readonly attribute HTMLCollection anchors;
[Pure]
readonly attribute HTMLCollection applets;
void clear();

Просмотреть файл

@ -335,7 +335,7 @@ public:
return;
}
mRetval = new URLProxy(new mozilla::dom::URL(nullptr, url));
mRetval = new URLProxy(new mozilla::dom::URL(url));
}
URLProxy*

Просмотреть файл

@ -106,8 +106,13 @@ protected:
return false;
}
JS::RootedString scriptURLStr(aCx, JS_ValueToString(aCx, aArgs[0]));
if (!scriptURLStr) {
return false;
}
nsDependentJSString scriptURL;
if (!scriptURL.init(aCx, aArgs[0])) {
if (!scriptURL.init(aCx, scriptURLStr)) {
return false;
}

Просмотреть файл

@ -17,6 +17,7 @@ support-files =
file_worker.js
jsm_url_worker.js
workersDisabled_worker.js
file_url.jsm
[test_bug883784.jsm]
[test_bug883784.xul]
@ -34,3 +35,4 @@ support-files =
[test_fileSlice.xul]
[test_fileSubWorker.xul]
[test_workersDisabled.xul]
[test_url.xul]

Просмотреть файл

@ -0,0 +1,23 @@
this.EXPORTED_SYMBOLS = ['checkFromJSM'];
this.checkFromJSM = function checkFromJSM(ok, is, finish) {
let worker = new ChromeWorker("jsm_url_worker.js");
worker.onmessage = function(event) {
if (event.data.type == 'finish') {
finish();
} else if (event.data.type == 'status') {
ok(event.data.status, event.data.msg);
}
}
var self = this;
worker.onerror = function(event) {
is(event.target, worker);
ok(false, "Worker had an error: " + event.data);
self.worker.terminate();
finish();
};
worker.postMessage(0);
}

Просмотреть файл

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<window title="DOM Worker Threads Test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="test();">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<script type="application/javascript" src="dom_worker_helper.js"/>
<script type="application/javascript">
<![CDATA[
function test()
{
waitForWorkerFinish();
Components.utils.import("chrome://mochitests/content/chrome/dom/workers/test/file_url.jsm");
checkFromJSM(ok, is, finish);
}
]]>
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<p id="display"></p>
<div id="content" style="display:none;"></div>
<pre id="test"></pre>
</body>
<label id="test-result"/>
</window>

Просмотреть файл

@ -35,6 +35,7 @@
#include "nsFocusManager.h"
#include "Layers.h"
#include "gfxContext.h"
#include "nsILoadContext.h"
// for painting the background window
#include "mozilla/LookAndFeel.h"

Просмотреть файл

@ -7,8 +7,8 @@
#define MOZILLA_GFX_BASERECT_H_
#include <cmath>
#include <mozilla/Assertions.h>
#include <algorithm>
#include "nsDebug.h"
namespace mozilla {
namespace gfx {
@ -277,21 +277,21 @@ struct BaseRect {
// Moves one edge of the rect without moving the opposite edge.
void SetLeftEdge(T aX) {
NS_ASSERTION(aX <= XMost(), "Bad rect edge");
MOZ_ASSERT(aX <= XMost());
width = XMost() - aX;
x = aX;
}
void SetRightEdge(T aXMost) {
NS_ASSERTION(aXMost >= x, "Bad rect edge");
MOZ_ASSERT(aXMost >= x);
width = aXMost - x;
}
void SetTopEdge(T aY) {
NS_ASSERTION(aY <= YMost(), "Bad rect edge");
MOZ_ASSERT(aY <= YMost());
height = YMost() - aY;
y = aY;
}
void SetBottomEdge(T aYMost) {
NS_ASSERTION(aYMost >= y, "Bad rect edge");
MOZ_ASSERT(aYMost >= y);
height = aYMost - y;
}

Просмотреть файл

@ -1270,7 +1270,9 @@ DrawTargetCG::Init(BackendType aType,
void
DrawTargetCG::Flush()
{
CGContextFlush(mCg);
if (GetContextType(mCg) == CG_CONTEXT_TYPE_IOSURFACE) {
CGContextFlush(mCg);
}
}
bool

Просмотреть файл

@ -87,8 +87,9 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mBuffer->Unlock();
if (bufferCreated) {
AddTextureClient(mBuffer);
if (bufferCreated && !AddTextureClient(mBuffer)) {
mBuffer = nullptr;
return;
}
if (surface) {

Просмотреть файл

@ -76,10 +76,10 @@ public:
virtual void Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) MOZ_OVERRIDE;
virtual void AddTextureClient(TextureClient* aTexture) MOZ_OVERRIDE
virtual bool AddTextureClient(TextureClient* aTexture) MOZ_OVERRIDE
{
MOZ_ASSERT((mTextureInfo.mTextureFlags & aTexture->GetFlags()) == mTextureInfo.mTextureFlags);
CompositableClient::AddTextureClient(aTexture);
return CompositableClient::AddTextureClient(aTexture);
}
virtual TemporaryRef<BufferTextureClient>

Просмотреть файл

@ -213,7 +213,7 @@ CompositableClient::CreateBufferTextureClient(gfx::SurfaceFormat aFormat)
return CreateBufferTextureClient(aFormat, TEXTURE_FLAGS_DEFAULT);
}
void
bool
CompositableClient::AddTextureClient(TextureClient* aClient)
{
++mNextTextureID;
@ -222,7 +222,7 @@ CompositableClient::AddTextureClient(TextureClient* aClient)
++mNextTextureID;
}
aClient->SetID(mNextTextureID);
mForwarder->AddTexture(this, aClient);
return mForwarder->AddTexture(this, aClient);
}
void

Просмотреть файл

@ -126,7 +126,7 @@ public:
/**
* Tells the Compositor to create a TextureHost for this TextureClient.
*/
virtual void AddTextureClient(TextureClient* aClient);
virtual bool AddTextureClient(TextureClient* aClient);
/**
* Tells the Compositor to delete the TextureHost corresponding to this

Просмотреть файл

@ -148,7 +148,10 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
RemoveTextureClient(mFrontBuffer);
}
mFrontBuffer = texture;
AddTextureClient(texture);
if (!AddTextureClient(texture)) {
mFrontBuffer = nullptr;
return false;
}
GetForwarder()->UpdatedTexture(this, texture, nullptr);
GetForwarder()->UseTexture(this, texture);
} else if (image->GetFormat() == PLANAR_YCBCR) {
@ -182,7 +185,10 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
mFrontBuffer->Unlock();
if (bufferCreated) {
AddTextureClient(mFrontBuffer);
if (!AddTextureClient(mFrontBuffer)) {
mFrontBuffer = nullptr;
return false;
}
}
if (status) {
@ -206,8 +212,11 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
RefPtr<SharedTextureClientOGL> buffer = new SharedTextureClientOGL(mTextureFlags);
buffer->InitWith(data->mHandle, size, data->mShareType, data->mInverted);
mFrontBuffer = buffer;
if (!AddTextureClient(mFrontBuffer)) {
mFrontBuffer = nullptr;
return false;
}
AddTextureClient(mFrontBuffer);
GetForwarder()->UseTexture(this, mFrontBuffer);
} else {
nsRefPtr<gfxASurface> surface = image->GetAsSurface();
@ -240,7 +249,10 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
mFrontBuffer->Unlock();
if (bufferCreated) {
AddTextureClient(mFrontBuffer);
if (!AddTextureClient(mFrontBuffer)) {
mFrontBuffer = nullptr;
return false;
}
}
if (status) {
@ -268,11 +280,11 @@ ImageClientBuffered::UpdateImage(ImageContainer* aContainer,
return ImageClientSingle::UpdateImage(aContainer, aContentFlags);
}
void
bool
ImageClientSingle::AddTextureClient(TextureClient* aTexture)
{
MOZ_ASSERT((mTextureFlags & aTexture->GetFlags()) == mTextureFlags);
CompositableClient::AddTextureClient(aTexture);
return CompositableClient::AddTextureClient(aTexture);
}
TemporaryRef<BufferTextureClient>

Просмотреть файл

@ -89,7 +89,7 @@ public:
virtual void OnDetach() MOZ_OVERRIDE;
virtual void AddTextureClient(TextureClient* aTexture) MOZ_OVERRIDE;
virtual bool AddTextureClient(TextureClient* aTexture) MOZ_OVERRIDE;
virtual TemporaryRef<BufferTextureClient>
CreateBufferTextureClient(gfx::SurfaceFormat aFormat, TextureFlags aFlags) MOZ_OVERRIDE;

Просмотреть файл

@ -153,7 +153,7 @@ public:
* Tell the compositor side to create a TextureHost that corresponds to
* aClient.
*/
virtual void AddTexture(CompositableClient* aCompositable,
virtual bool AddTexture(CompositableClient* aCompositable,
TextureClient* aClient) = 0;
/**

Просмотреть файл

@ -102,19 +102,20 @@ struct AutoEndTransaction {
CompositableTransaction* mTxn;
};
void
bool
ImageBridgeChild::AddTexture(CompositableClient* aCompositable,
TextureClient* aTexture)
{
SurfaceDescriptor descriptor;
if (!aTexture->ToSurfaceDescriptor(descriptor)) {
NS_WARNING("ImageBridge: Failed to serialize a TextureClient");
return;
return false;
}
mTxn->AddEdit(OpAddTexture(nullptr, aCompositable->GetIPDLActor(),
aTexture->GetID(),
descriptor,
aTexture->GetFlags()));
return true;
}
void

Просмотреть файл

@ -257,7 +257,7 @@ public:
/**
* See CompositableForwarder::AddTexture
*/
virtual void AddTexture(CompositableClient* aCompositable,
virtual bool AddTexture(CompositableClient* aCompositable,
TextureClient* aClient) MOZ_OVERRIDE;
/**

Просмотреть файл

@ -387,20 +387,21 @@ ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
mTxn->AddNoSwapPaint(OpUpdatePictureRect(nullptr, aCompositable->GetIPDLActor(), aRect));
}
void
bool
ShadowLayerForwarder::AddTexture(CompositableClient* aCompositable,
TextureClient* aTexture)
{
SurfaceDescriptor descriptor;
if (!aTexture->ToSurfaceDescriptor(descriptor)) {
NS_WARNING("Failed to serialize a TextureClient");
return;
return false;
}
MOZ_ASSERT(aTexture->GetFlags() != 0);
mTxn->AddEdit(OpAddTexture(nullptr, aCompositable->GetIPDLActor(),
aTexture->GetID(),
descriptor,
aTexture->GetFlags()));
return true;
}
void

Просмотреть файл

@ -306,7 +306,7 @@ public:
/**
* See CompositableForwarder::AddTexture
*/
virtual void AddTexture(CompositableClient* aCompositable,
virtual bool AddTexture(CompositableClient* aCompositable,
TextureClient* aClient) MOZ_OVERRIDE;
/**

Просмотреть файл

@ -55,6 +55,9 @@ SharedTextureClientOGL::InitWith(gl::SharedTextureHandle aHandle,
mSize = aSize;
mShareType = aShareType;
mInverted = aInverted;
if (mInverted) {
AddFlags(TEXTURE_NEEDS_Y_FLIP);
}
}
bool

Просмотреть файл

@ -31,6 +31,8 @@
using namespace mozilla;
using namespace mozilla::gfx;
UserDataKey gfxContext::sDontUseAsSourceKey;
/* This class lives on the stack and allows gfxContext users to easily, and
* performantly get a gfx::Pattern to use for drawing in their current context.
*/
@ -1614,8 +1616,9 @@ gfxContext::PushGroupAndCopyBackground(gfxContentType content)
gfxRect clipRect = GetRoundOutDeviceClipExtents(this);
clipExtents = IntRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
}
if (mDT->GetFormat() == FORMAT_B8G8R8X8 ||
mDT->GetOpaqueRect().Contains(clipExtents)) {
if ((mDT->GetFormat() == FORMAT_B8G8R8X8 ||
mDT->GetOpaqueRect().Contains(clipExtents)) &&
!mDT->GetUserData(&sDontUseAsSourceKey)) {
DrawTarget *oldDT = mDT;
RefPtr<SourceSurface> source = mDT->Snapshot();
Point oldDeviceOffset = CurrentState().deviceOffset;

Просмотреть файл

@ -708,6 +708,8 @@ public:
void CopyAsDataURL();
#endif
static mozilla::gfx::UserDataKey sDontUseAsSourceKey;
private:
friend class GeneralPattern;
friend struct GlyphBufferAzure;

Просмотреть файл

@ -90,6 +90,40 @@ endif #} ANDROID_EXTRA_JARS
include $(topsrcdir)/config/android-common.mk
endif #} ANDROID_APK_NAME
ifdef JAVA_JAR_TARGETS #{
# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
# Intermediate class files are generated in jars/jarfile-classes.
# Arg 2: Java sources list. We use VPATH and $^ so sources can be
# relative to $(srcdir) or $(CURDIR).
# Arg 3: List of extra jars to link against. We do not use VPATH so
# jars must be relative to $(CURDIR).
# Arg 4: Additional JAVAC_FLAGS.
define java_jar_template
$(1): $(2) $(3)
$$(REPORT_BUILD)
@$$(NSINSTALL) -D $(1:.jar=)-classes
@$$(if $$(filter-out .,$$(@D)),$$(NSINSTALL) -D $$(@D))
$$(JAVAC) $$(JAVAC_FLAGS)\
$(4)\
-d $(1:.jar=)-classes\
$(if $(strip $(3)),-classpath $(subst $(NULL) ,:,$(strip $(3))))\
$$(filter %.java,$$^)
$$(JAR) cMf $$@ -C $(1:.jar=)-classes .
GARBAGE += $(1)
GARBAGE_DIRS += $(1:.jar=)-classes
endef
$(foreach jar,$(JAVA_JAR_TARGETS),\
$(if $($(jar)_DEST),,$(error Missing $(jar)_DEST))\
$(if $($(jar)_JAVAFILES),,$(error Missing $(jar)_JAVAFILES))\
$(eval $(call java_jar_template,$($(jar)_DEST),$($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),$($(jar)_EXTRA_JARS),$($(jar)_JAVAC_FLAGS)))\
)
endif #} JAVA_JAR_TARGETS
INCLUDED_JAVA_BUILD_MK := 1
endif #} INCLUDED_JAVA_BUILD_MK

Просмотреть файл

@ -1221,7 +1221,7 @@ endif
###############################################################################
# Java rules
###############################################################################
ifneq (,$(value JAVAFILES)$(value ANDROID_RESFILES))
ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS))
include $(topsrcdir)/config/makefiles/java-build.mk
endif

Просмотреть файл

@ -33,6 +33,7 @@
#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#include "mozilla/dom/TextDecoderBinding.h"
#include "mozilla/dom/TextEncoderBinding.h"
#include "mozilla/dom/URLBinding.h"
using namespace mozilla;
using namespace JS;
@ -901,6 +902,8 @@ xpc::GlobalProperties::Parse(JSContext *cx, JS::HandleObject obj)
TextEncoder = true;
} else if (!strcmp(name.ptr(), "TextDecoder")) {
TextDecoder = true;
} else if (!strcmp(name.ptr(), "URL")) {
URL = true;
} else if (!strcmp(name.ptr(), "atob")) {
atob = true;
} else if (!strcmp(name.ptr(), "btoa")) {
@ -933,6 +936,10 @@ xpc::GlobalProperties::Define(JSContext *cx, JS::HandleObject obj)
!dom::TextDecoderBinding::GetConstructorObject(cx, obj))
return false;
if (URL &&
!dom::URLBinding::GetConstructorObject(cx, obj))
return false;
if (atob &&
!JS_DefineFunction(cx, obj, "atob", Atob, 1, 0))
return false;

Просмотреть файл

@ -3590,12 +3590,13 @@ struct GlobalProperties {
GlobalProperties() { mozilla::PodZero(this); }
bool Parse(JSContext *cx, JS::HandleObject obj);
bool Define(JSContext *cx, JS::HandleObject obj);
bool indexedDB;
bool XMLHttpRequest;
bool TextDecoder;
bool TextEncoder;
bool atob;
bool btoa;
bool indexedDB : 1;
bool XMLHttpRequest : 1;
bool TextDecoder : 1;
bool TextEncoder : 1;
bool URL : 1;
bool atob : 1;
bool btoa : 1;
};
// Infallible.

Просмотреть файл

@ -0,0 +1,10 @@
function run_test() {
var Cu = Components.utils;
var sb = new Cu.Sandbox('http://www.example.com',
{ wantGlobalProperties: ["URL"] });
sb.do_check_eq = do_check_eq;
Cu.evalInSandbox('do_check_eq(new URL("http://www.example.com").host, "www.example.com");',
sb);
Cu.importGlobalProperties(["URL"]);
do_check_eq(new URL("http://www.example.com").host, "www.example.com");
}

Просмотреть файл

@ -69,6 +69,7 @@ fail-if = os == "android"
[test_sandbox_metadata.js]
[test_exportFunction.js]
[test_textDecoder.js]
[test_url.js]
[test_sandbox_atob.js]
[test_watchdog_enable.js]
head = head_watchdog.js

Просмотреть файл

@ -47,6 +47,7 @@
#include "RestyleManager.h"
#include "Layers.h"
#include "imgIContainer.h"
#include "nsIFrameRequestCallback.h"
using namespace mozilla;
using namespace mozilla::widget;

Просмотреть файл

@ -1,9 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="position: sticky; right: 75px; padding-left: 84862313px;"></div>
</body>
</html>

Просмотреть файл

@ -502,4 +502,3 @@ load 885009-1.html
load 893523.html
test-pref(layout.css.sticky.enabled,true) load 914891.html
test-pref(layout.css.sticky.enabled,true) load 915475.xhtml
asserts(1-3) test-pref(layout.css.sticky.enabled,true) load 914919.html

Просмотреть файл

@ -592,9 +592,10 @@ inDOMUtils::GetCSSValuesForProperty(const nsAString& aProperty,
GetOtherValuesForProperty(propertyParserVariant, array);
}
}
// All CSS properties take initial and inherit.
// All CSS properties take initial, inherit and unset.
InsertNoDuplicates(array, NS_LITERAL_STRING("initial"));
InsertNoDuplicates(array, NS_LITERAL_STRING("inherit"));
InsertNoDuplicates(array, NS_LITERAL_STRING("unset"));
*aLength = array.Length();
PRUnichar** ret =

Просмотреть файл

@ -43,7 +43,7 @@ function do_test() {
// test a property with keywords and colors
var prop = "color";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
var expected = [ "initial", "inherit", "unset", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
"beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood",
"cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson",
"cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey",
@ -69,7 +69,7 @@ function do_test() {
// test a shorthand property
var prop = "background";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
var expected = [ "initial", "inherit", "unset", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
"beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue",
"chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue",
"darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta",
@ -96,7 +96,7 @@ function do_test() {
var prop = "border";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "-moz-calc", "initial", "-moz-use-text-color", "aliceblue",
var expected = [ "-moz-calc", "initial", "unset", "-moz-use-text-color", "aliceblue",
"antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet",
"brown", "burlywood", "cadetblue", "calc", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk",
"crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki",
@ -122,7 +122,7 @@ function do_test() {
// test keywords only
var prop = "border-top";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "thin", "medium", "thick", "none", "hidden", "dotted",
var expected = [ "initial", "inherit", "unset", "thin", "medium", "thick", "none", "hidden", "dotted",
"dashed", "solid", "double", "groove", "ridge", "inset", "outset", "-moz-use-text-color",
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black",
"blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse",
@ -149,13 +149,13 @@ function do_test() {
// tests no keywords or colors
var prop = "padding-bottom";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "calc", "-moz-calc" ];
var expected = [ "initial", "inherit", "unset", "calc", "-moz-calc" ];
ok(testValues(values, expected), "property padding-bottom's values.");
// test proprety
var prop = "display";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "none", "inline", "block", "inline-block", "list-item",
var expected = [ "initial", "inherit", "unset", "none", "inline", "block", "inline-block", "list-item",
"table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row",
"table-column-group", "table-column", "table-cell", "table-caption", "-moz-box", "-moz-inline-box",
"-moz-grid", "-moz-inline-grid", "-moz-grid-group", "-moz-grid-line", "-moz-stack", "-moz-inline-stack",
@ -165,25 +165,25 @@ function do_test() {
// test property
var prop = "float";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "none", "left", "right" ];
var expected = [ "initial", "inherit", "unset", "none", "left", "right" ];
ok(testValues(values, expected), "proprety float values");
// Test property with "auto"
var prop = "margin";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "-moz-calc", "initial", "auto", "calc", "inherit" ];
var expected = [ "-moz-calc", "initial", "unset", "auto", "calc", "inherit" ];
ok(testValues(values, expected), "property margin's values.");
// Test property with "normal"
var prop = "font-style";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "inherit", "italic", "normal", "oblique" ];
var expected = [ "initial", "inherit", "unset", "italic", "normal", "oblique" ];
ok(testValues(values, expected), "property font-style's values.");
// Test property with "cubic-bezier" and "step".
var prop = "-moz-transition";
var values = utils.getCSSValuesForProperty(prop);
var expected = [ "initial", "all", "cubic-bezier", "ease", "ease-in", "ease-in-out",
var expected = [ "initial", "all", "unset", "cubic-bezier", "ease", "ease-in", "ease-in-out",
"ease-out", "inherit", "linear", "none", "step-end", "step-start",
"steps" ];
ok(testValues(values, expected), "property -moz-transition's values.");

Просмотреть файл

@ -120,6 +120,7 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsIURIFixup.h"
#include "mozilla/dom/Element.h"
#include "nsContentList.h"
#include "nsIChannel.h"
using namespace mozilla;
using namespace mozilla::dom;

Просмотреть файл

@ -89,8 +89,12 @@
// Callers may also define CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
// to exclude properties that are not considered to be components of the 'all'
// shorthand property. Currently this is just 'direction', 'unicode-bidi' and
// a few internal properties.
// shorthand property. Currently this excludes 'direction' and 'unicode-bidi',
// as required by the CSS Cascading and Inheritance specification, and any
// internal properties that cannot be changed by using CSS syntax. For example,
// the internal '-moz-system-font' property is not excluded, as it is set by the
// 'font' shorthand, while '-x-lang' is excluded as there is no way to set this
// internal property from a style sheet.
// A caller who wants all the properties can define the |CSS_PROP|
// macro.
@ -348,7 +352,6 @@ CSS_PROP_TEXT(
nullptr,
offsetof(nsStyleText, mTabSize),
eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
-x-system-font,
@ -363,7 +366,6 @@ CSS_PROP_FONT(
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
CSS_PROP_SHORTHAND(
all,
all,

Просмотреть файл

@ -81,6 +81,7 @@ class Fake_MediaStream {
virtual nsresult Start() { return NS_OK; }
virtual nsresult Stop() { return NS_OK; }
virtual void StopStream() {}
virtual void Periodic() {}
@ -175,7 +176,7 @@ class Fake_SourceMediaStream : public Fake_MediaStream {
void RemoveDirectListener(Fake_MediaStreamListener* aListener) {}
//Don't pull anymore data,if mStop is true.
void StopStream() {
virtual void StopStream() {
mStop = true;
}
@ -264,7 +265,6 @@ class Fake_MediaStreamBase : public Fake_MediaStream {
virtual nsresult Start();
virtual nsresult Stop();
virtual int GetSegmentsAdded() {
return mPeriodic->GetTimesCalled();
}

Просмотреть файл

@ -1027,7 +1027,7 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer,
//Stops generating new audio data for transmission.
//Should be called before Cleanup of the peer connection.
void CloseSendStreams() {
static_cast<Fake_AudioStreamSource*>(
static_cast<Fake_MediaStream*>(
domMediaStream_->GetStream())->StopStream();
}

Просмотреть файл

@ -146,7 +146,6 @@ pref("browser.helperApps.deleteTempFileOnExit", false);
/* password manager */
pref("signon.rememberSignons", true);
pref("signon.expireMasterPassword", false);
pref("signon.SignonFileName", "signons.txt");
pref("signon.debug", false);
/* form helper (scroll to and optionally zoom into editable fields) */

Просмотреть файл

@ -172,7 +172,13 @@
</intent-filter>
</activity>
#include @OBJDIR@/WebAppManifestFragment.xml.in
<!-- Declare a predefined number of WebApp<num> activities. These are
used so that each web app can launch in its own process. Keep
this number in sync with the total number of web apps handled in
WebAppAllocator. -->
#define FRAGMENT WebAppManifestFragment.xml.frag
#include WebAppFragmentRepeater.inc
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
<activity-alias

Просмотреть файл

@ -1230,6 +1230,77 @@ ifdef MOZ_WEBRTC
ALL_JARS += jars/webrtc.jar
endif
JAVA_JAR_TARGETS += websockets
websockets_DEST := jars/websockets.jar
websockets_JAVAFILES := \
$(WEBSOCKETS_JAVA_FILES) \
$(NULL)
websockets_JAVAC_FLAGS := -Xlint:all,-serial
JAVA_JAR_TARGETS += gecko-browser
gecko-browser_DEST := jars/gecko-browser.jar
gecko-browser_JAVAFILES := \
$(FENNEC_JAVA_FILES) \
$(SYNC_JAVA_FILES) \
$(NULL)
gecko-browser_PP_JAVAFILES := \
$(FENNEC_PP_JAVA_FILES) \
$(FENNEC_PP_JAVA_VIEW_FILES) \
$(SYNC_PP_JAVA_FILES) \
R.java \
$(NULL)
gecko-browser_EXTRA_JARS := \
jars/gecko-mozglue.jar \
jars/gecko-util.jar \
jars/sync-thirdparty.jar \
jars/websockets.jar \
$(NULL)
gecko-browser_JAVAC_FLAGS := -Xlint:all,-deprecation,-fallthrough
JAVA_JAR_TARGETS += gecko-mozglue
gecko-mozglue_DEST := jars/gecko-mozglue.jar
gecko-mozglue_JAVAFILES := \
$(MOZGLUE_JAVA_FILES) \
$(NULL)
gecko-mozglue_PP_JAVAFILES := \
$(MOZGLUE_PP_JAVA_FILES) \
$(NULL)
gecko-mozglue_JAVAC_FLAGS := -Xlint:all
JAVA_JAR_TARGETS += gecko-util
gecko-util_DEST := jars/gecko-util.jar
gecko-util_JAVAFILES := \
$(UTIL_JAVA_FILES) \
$(UTIL_PP_JAVA_FILES) \
$(NULL)
gecko-util_EXTRA_JARS := \
jars/gecko-mozglue.jar \
$(NULL)
gecko-util_JAVAC_FLAGS := -Xlint:all,-deprecation
JAVA_JAR_TARGETS += sync-thirdparty
sync-thirdparty_DEST := jars/sync-thirdparty.jar
sync-thirdparty_JAVAFILES := \
$(SYNC_THIRDPARTY_JAVA_FILES) \
$(NULL)
sync-thirdparty_JAVAC_FLAGS := -Xlint:none
ifdef MOZ_WEBRTC
JAVA_JAR_TARGETS += webrtc
webrtc_DEST := jars/webrtc.jar
webrtc_JAVAFILES := \
$(WEBRTC_JAVA_FILES) \
$(NULL)
webrtc_EXTRA_JARS := \
jars/gecko-browser.jar \
jars/gecko-util.jar \
jars/gecko-mozglue.jar \
$(NULL)
webrtc_JAVAC_FLAGS := -Xlint:all,-deprecation,-cast
endif
include $(topsrcdir)/config/makefiles/java-build.mk
include $(topsrcdir)/config/rules.mk
# Override the Java settings with some specific android settings
@ -1242,49 +1313,7 @@ include $(topsrcdir)/config/android-common.mk
# indices.
classes.dex: $(ALL_JARS)
@echo "DX classes.dex"
$(DX) --dex --output=classes.dex jars $(ANDROID_COMPAT_LIB)
jars/gecko-browser.jar: jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar jars/websockets.jar $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
@echo "JAR gecko-browser.jar"
$(NSINSTALL) -D classes/gecko-browser
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes/gecko-browser -classpath "jars/gecko-mozglue.jar:jars/gecko-util.jar:jars/sync-thirdparty.jar:jars/websockets.jar" $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
$(JAR) cMf jars/gecko-browser.jar -C classes/gecko-browser .
jars/gecko-mozglue.jar: $(addprefix $(srcdir)/,$(MOZGLUE_JAVA_FILES)) $(MOZGLUE_PP_JAVA_FILES) jars
@echo "JAR gecko-mozglue.jar"
$(NSINSTALL) -D classes/gecko-mozglue
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all -d classes/gecko-mozglue $(addprefix $(srcdir)/,$(MOZGLUE_JAVA_FILES)) $(MOZGLUE_PP_JAVA_FILES)
$(JAR) cMf jars/gecko-mozglue.jar -C classes/gecko-mozglue .
jars/gecko-util.jar: jars/gecko-mozglue.jar $(addprefix $(srcdir)/,$(UTIL_JAVA_FILES)) jars
@echo "JAR gecko-util.jar"
$(NSINSTALL) -D classes/gecko-util
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation -d classes/gecko-util -classpath "jars/gecko-mozglue.jar" $(addprefix $(srcdir)/,$(UTIL_JAVA_FILES))
$(JAR) cMf jars/gecko-util.jar -C classes/gecko-util .
jars/sync-thirdparty.jar: $(addprefix $(srcdir)/,$(SYNC_THIRDPARTY_JAVA_FILES)) jars
@echo "JAR sync-thirdparty.jar"
$(NSINSTALL) -D classes/sync-thirdparty
$(JAVAC) $(JAVAC_FLAGS) -d classes/sync-thirdparty $(addprefix $(srcdir)/,$(SYNC_THIRDPARTY_JAVA_FILES))
$(JAR) cMf jars/sync-thirdparty.jar -C classes/sync-thirdparty .
jars/websockets.jar: $(addprefix $(srcdir)/, $(WEBSOCKETS_JAVA_FILES)) jars
@echo "JAR websockets.jar"
$(NSINSTALL) -D classes/websockets
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-serial -d classes/websockets $(addprefix $(srcdir)/,$(WEBSOCKETS_JAVA_FILES))
$(JAR) cMf jars/websockets.jar -C classes/websockets .
ifdef MOZ_WEBRTC
jars/webrtc.jar: $(addprefix $(srcdir)/, $(WEBRTC_JAVA_FILES)) jars jars/gecko-browser.jar jars/gecko-util.jar jars/gecko-mozglue.jar
@echo "JAR webrtc.jar"
$(NSINSTALL) -D classes/webrtc
$(JAVAC) $(JAVAC_FLAGS) -d classes/webrtc -classpath classes/gecko-browser:classes/gecko-util:classes/gecko-mozglue $(addprefix $(srcdir)/,$(WEBRTC_JAVA_FILES))
$(JAR) cMf jars/webrtc.jar -C classes/webrtc .
endif
jars:
@echo "MKDIR jars"
$(NSINSTALL) -D jars
$(DX) --dex --output=classes.dex $(ALL_JARS) $(ANDROID_COMPAT_LIB)
CLASSES_WITH_JNI= \
org.mozilla.gecko.GeckoAppShell \
@ -1306,20 +1335,11 @@ jni-stubs.inc: jars/gecko-browser.jar jars/gecko-mozglue.jar jars/gecko-util.jar
$(JAVAH) -o javah.out -bootclasspath $(JAVA_BOOTCLASSPATH) -classpath $(subst $(NULL) $(NULL),:,$^) $(CLASSES_WITH_JNI)
$(PYTHON) $(topsrcdir)/mobile/android/base/jni-generator.py javah.out $@
ANNOTATION_PROCESSOR_JAVA_FILES = \
build/annotationProcessors/AnnotationProcessor.java \
build/annotationProcessors/CodeGenerator.java \
build/annotationProcessors/MethodWithAnnotationInfo.java \
build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java \
build/annotationProcessors/classloader/JarClassIterator.java \
build/annotationProcessors/utils/AlphabeticMethodComparator.java \
build/annotationProcessors/utils/GeneratableEntryPointIterator.java \
build/annotationProcessors/utils/Utils.java \
$(NULL)
ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
GeneratedJNIWrappers.cpp: jars/gecko-browser.jar jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar
$(JAVAC) $(addprefix $(topsrcdir)/,$(ANNOTATION_PROCESSOR_JAVA_FILES)) -d $(CURDIR)
$(JAVA) -classpath $(JAVA_BOOTCLASSPATH):$(CURDIR) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $^
GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES)
GeneratedJNIWrappers.cpp: $(ALL_JARS)
$(JAVA) -classpath $(JAVA_BOOTCLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
PP_RES_XML= \
$(SYNC_PP_RES_XML) \
@ -1348,29 +1368,11 @@ android-preqs = \
$(call mkdir_deps,$(sort $(dir $(FENNEC_PP_JAVA_FILES)))) \
$(call mkdir_deps,$(sort $(dir $(SYNC_PP_JAVA_FILES)))) \
$(SERVICES_MANIFEST_FRAGMENTS) \
WebAppManifestFragment.xml.in \
WebAppsFragments.java \
$(NULL)
$(android-tgts): % : %.in $(android-preqs)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) -DOBJDIR="`pwd`" $(DEFINES) $(ACDEFINES) $< > $@
# Add a predefined number of WebApp<num> classes to the WebApps class.
# These are used so that each webapp can launch in its own process
# Keep this number in sync with the max web apps in WebAppAllocator.java
NUM_WEB_APPS=100
WebAppManifestFragment.xml.in: WebAppManifestFragment.xml.frag
@rm -f $@
@for n in `$(PYTHON) -c "for x in range($(NUM_WEB_APPS)): print x"`; do \
cat $< | sed s,@APPNUM@,$$n,g >> $@ ; \
done
WebAppsFragments.java: WebAppsFragment.java.frag
@rm -f $@
@for n in `$(PYTHON) -c "for x in range($(NUM_WEB_APPS)): print x"`; do \
cat $< | sed s,@APPNUM@,$$n,g >> $@ ; \
done
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
# Replace @VIEWTYPE@ with different View names.
$(FENNEC_PP_JAVA_VIEW_FILES): GeckoView.java.frag

Просмотреть файл

@ -0,0 +1,301 @@
#define APPNUM 0
#include @FRAGMENT@
#define APPNUM 1
#include @FRAGMENT@
#define APPNUM 2
#include @FRAGMENT@
#define APPNUM 3
#include @FRAGMENT@
#define APPNUM 4
#include @FRAGMENT@
#define APPNUM 5
#include @FRAGMENT@
#define APPNUM 6
#include @FRAGMENT@
#define APPNUM 7
#include @FRAGMENT@
#define APPNUM 8
#include @FRAGMENT@
#define APPNUM 9
#include @FRAGMENT@
#define APPNUM 10
#include @FRAGMENT@
#define APPNUM 11
#include @FRAGMENT@
#define APPNUM 12
#include @FRAGMENT@
#define APPNUM 13
#include @FRAGMENT@
#define APPNUM 14
#include @FRAGMENT@
#define APPNUM 15
#include @FRAGMENT@
#define APPNUM 16
#include @FRAGMENT@
#define APPNUM 17
#include @FRAGMENT@
#define APPNUM 18
#include @FRAGMENT@
#define APPNUM 19
#include @FRAGMENT@
#define APPNUM 20
#include @FRAGMENT@
#define APPNUM 21
#include @FRAGMENT@
#define APPNUM 22
#include @FRAGMENT@
#define APPNUM 23
#include @FRAGMENT@
#define APPNUM 24
#include @FRAGMENT@
#define APPNUM 25
#include @FRAGMENT@
#define APPNUM 26
#include @FRAGMENT@
#define APPNUM 27
#include @FRAGMENT@
#define APPNUM 28
#include @FRAGMENT@
#define APPNUM 29
#include @FRAGMENT@
#define APPNUM 30
#include @FRAGMENT@
#define APPNUM 31
#include @FRAGMENT@
#define APPNUM 32
#include @FRAGMENT@
#define APPNUM 33
#include @FRAGMENT@
#define APPNUM 34
#include @FRAGMENT@
#define APPNUM 35
#include @FRAGMENT@
#define APPNUM 36
#include @FRAGMENT@
#define APPNUM 37
#include @FRAGMENT@
#define APPNUM 38
#include @FRAGMENT@
#define APPNUM 39
#include @FRAGMENT@
#define APPNUM 40
#include @FRAGMENT@
#define APPNUM 41
#include @FRAGMENT@
#define APPNUM 42
#include @FRAGMENT@
#define APPNUM 43
#include @FRAGMENT@
#define APPNUM 44
#include @FRAGMENT@
#define APPNUM 45
#include @FRAGMENT@
#define APPNUM 46
#include @FRAGMENT@
#define APPNUM 47
#include @FRAGMENT@
#define APPNUM 48
#include @FRAGMENT@
#define APPNUM 49
#include @FRAGMENT@
#define APPNUM 50
#include @FRAGMENT@
#define APPNUM 51
#include @FRAGMENT@
#define APPNUM 52
#include @FRAGMENT@
#define APPNUM 53
#include @FRAGMENT@
#define APPNUM 54
#include @FRAGMENT@
#define APPNUM 55
#include @FRAGMENT@
#define APPNUM 56
#include @FRAGMENT@
#define APPNUM 57
#include @FRAGMENT@
#define APPNUM 58
#include @FRAGMENT@
#define APPNUM 59
#include @FRAGMENT@
#define APPNUM 60
#include @FRAGMENT@
#define APPNUM 61
#include @FRAGMENT@
#define APPNUM 62
#include @FRAGMENT@
#define APPNUM 63
#include @FRAGMENT@
#define APPNUM 64
#include @FRAGMENT@
#define APPNUM 65
#include @FRAGMENT@
#define APPNUM 66
#include @FRAGMENT@
#define APPNUM 67
#include @FRAGMENT@
#define APPNUM 68
#include @FRAGMENT@
#define APPNUM 69
#include @FRAGMENT@
#define APPNUM 70
#include @FRAGMENT@
#define APPNUM 71
#include @FRAGMENT@
#define APPNUM 72
#include @FRAGMENT@
#define APPNUM 73
#include @FRAGMENT@
#define APPNUM 74
#include @FRAGMENT@
#define APPNUM 75
#include @FRAGMENT@
#define APPNUM 76
#include @FRAGMENT@
#define APPNUM 77
#include @FRAGMENT@
#define APPNUM 78
#include @FRAGMENT@
#define APPNUM 79
#include @FRAGMENT@
#define APPNUM 80
#include @FRAGMENT@
#define APPNUM 81
#include @FRAGMENT@
#define APPNUM 82
#include @FRAGMENT@
#define APPNUM 83
#include @FRAGMENT@
#define APPNUM 84
#include @FRAGMENT@
#define APPNUM 85
#include @FRAGMENT@
#define APPNUM 86
#include @FRAGMENT@
#define APPNUM 87
#include @FRAGMENT@
#define APPNUM 88
#include @FRAGMENT@
#define APPNUM 89
#include @FRAGMENT@
#define APPNUM 90
#include @FRAGMENT@
#define APPNUM 91
#include @FRAGMENT@
#define APPNUM 92
#include @FRAGMENT@
#define APPNUM 93
#include @FRAGMENT@
#define APPNUM 94
#include @FRAGMENT@
#define APPNUM 95
#include @FRAGMENT@
#define APPNUM 96
#include @FRAGMENT@
#define APPNUM 97
#include @FRAGMENT@
#define APPNUM 98
#include @FRAGMENT@
#define APPNUM 99
#include @FRAGMENT@
#undef APPNUM
#undef FRAGMENT

Просмотреть файл

@ -6,8 +6,12 @@
#filter substitution
package @ANDROID_PACKAGE_NAME@;
/**
* Declare a predefined number of WebApp<num> classes to the WebApps class.
* These are used so that each web app can launch in its own process. Keep this
* number in sync with the number of web apps handled in WebAppAllocator.
*/
public final class WebApps {
#include @OBJDIR@/WebAppsFragments.java
#define FRAGMENT WebAppsFragment.java.frag
#include WebAppFragmentRepeater.inc
}

Просмотреть файл

@ -20,6 +20,7 @@ import android.support.v4.widget.CursorAdapter;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -98,6 +99,24 @@ class PinSiteDialog extends DialogFragment {
}
});
mSearch.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode != KeyEvent.KEYCODE_ENTER || mOnSiteSelectedListener == null) {
return false;
}
// If the user manually entered a search term or URL, wrap the value in
// a special URI until we can get a valid URL for this bookmark.
final String text = mSearch.getText().toString();
final String url = TopSitesPage.encodeUserEnteredUrl(text);
mOnSiteSelectedListener.onSiteSelected(url, text);
dismiss();
return true;
}
});
mList = (HomeListView) view.findViewById(R.id.list);
mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override

Просмотреть файл

@ -95,7 +95,9 @@ public class TopSitesGridView extends GridView {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
TopSitesGridItemView row = (TopSitesGridItemView) view;
String url = row.getUrl();
// Decode "user-entered" URLs before loading them.
String url = TopSitesPage.decodeUserEnteredUrl(row.getUrl());
// If the url is empty, the user can pin a site.
// If not, navigate to the page given by the url.

Просмотреть файл

@ -29,6 +29,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.LoaderManager;
@ -316,7 +317,8 @@ public class TopSitesPage extends HomeFragment {
if (item.getItemId() == R.id.top_sites_open_private_tab)
flags |= Tabs.LOADURL_PRIVATE;
Tabs.getInstance().loadUrl(info.url, flags);
// Decode "user-entered" URLs before loading them.
Tabs.getInstance().loadUrl(decodeUserEnteredUrl(info.url), flags);
Toast.makeText(activity, R.string.new_tab_opened, Toast.LENGTH_SHORT).show();
return true;
}
@ -372,6 +374,18 @@ public class TopSitesPage extends HomeFragment {
ThreadUtils.reduceGeckoPriority(PRIORITY_RESET_TIMEOUT);
}
static String encodeUserEnteredUrl(String url) {
return Uri.fromParts("user-entered", url, null).toString();
}
static String decodeUserEnteredUrl(String url) {
Uri uri = Uri.parse(url);
if ("user-entered".equals(uri.getScheme())) {
return uri.getSchemeSpecificPart();
}
return url;
}
/**
* Listener for pinning sites.
*/

Просмотреть файл

@ -29,7 +29,7 @@
android:textSelectHandleRight="@drawable/handle_end"
android:textCursorDrawable="@null"
android:inputType="textUri|textNoSuggestions"
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen"
android:singleLine="true"
android:gravity="center_vertical|left"/>

Просмотреть файл

@ -25,7 +25,7 @@ package:
$(MKDIR) -p bin gen libs/$(ABI_DIR) src
# Copy the JARs
cp ../base/jars/* libs/
cp ../base/jars/*.jar libs/
# Copy the SOs
cp $(DIST)/bin/libmozglue.so $(DIST)/bin/lib/libplugin-container.so libs/$(ABI_DIR)/

Просмотреть файл

@ -314,7 +314,6 @@
@BINPATH@/components/nsLoginManagerPrompter.js
@BINPATH@/components/SiteSpecificUserAgent.js
@BINPATH@/components/SiteSpecificUserAgent.manifest
@BINPATH@/components/storage-Legacy.js
@BINPATH@/components/storage-mozStorage.js
@BINPATH@/components/crypto-SDR.js
@BINPATH@/components/jsconsole-clhandler.manifest

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -3971,9 +3971,6 @@ pref("print.print_command", "lp -c -s ${MOZ_PRINTER_NAME:+-d\"$MOZ_PRINTER_NAME\
// Login Manager prefs
pref("signon.rememberSignons", true);
pref("signon.SignonFileName", "signons.txt"); // obsolete
pref("signon.SignonFileName2", "signons2.txt"); // obsolete
pref("signon.SignonFileName3", "signons3.txt"); // obsolete
pref("signon.autofillForms", true);
pref("signon.autologin.proxy", false);
pref("signon.debug", false);

Просмотреть файл

@ -122,13 +122,13 @@ nsHttpTransaction::nsHttpTransaction()
, mPassedRatePacing(false)
, mSynchronousRatePaceRequest(false)
{
LOG(("Creating nsHttpTransaction @%x\n", this));
LOG(("Creating nsHttpTransaction @%p\n", this));
gHttpHandler->GetMaxPipelineObjectSize(&mMaxPipelineObjectSize);
}
nsHttpTransaction::~nsHttpTransaction()
{
LOG(("Destroying nsHttpTransaction @%x\n", this));
LOG(("Destroying nsHttpTransaction @%p\n", this));
if (mTokenBucketCancel) {
mTokenBucketCancel->Cancel(NS_ERROR_ABORT);
@ -946,11 +946,11 @@ nsHttpTransaction::Restart()
// limit the number of restart attempts - bug 92224
if (++mRestartCount >= gHttpHandler->MaxRequestAttempts()) {
LOG(("reached max request attempts, failing transaction @%x\n", this));
LOG(("reached max request attempts, failing transaction @%p\n", this));
return NS_ERROR_NET_RESET;
}
LOG(("restarting transaction @%x\n", this));
LOG(("restarting transaction @%p\n", this));
// rewind streams in case we already wrote out the request
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mRequestStream);

Просмотреть файл

@ -471,7 +471,15 @@ nsHttpServer.prototype =
onStopListening: function(socket, status)
{
dumpn(">>> shutting down server on port " + socket.port);
for (var n in this._connections) {
if (!this._connections[n]._requestStarted) {
this._connections[n].close();
}
}
this._socketClosed = true;
if (this._hasOpenConnections()) {
dumpn("*** open connections!!!");
}
if (!this._hasOpenConnections())
{
dumpn("*** no open connections, notifying async from onStopListening");
@ -1166,14 +1174,25 @@ function Connection(input, output, server, port, outgoingPort, number)
*/
this.request = null;
/** State variables for debugging. */
this._closed = this._processed = false;
/** This allows a connection to disambiguate between a peer initiating a
* close and the socket being forced closed on shutdown.
*/
this._closed = false;
/** State variable for debugging. */
this._processed = false;
/** whether or not 1st line of request has been received */
this._requestStarted = false;
}
Connection.prototype =
{
/** Closes this connection's input/output streams. */
close: function()
{
if (this._closed)
return;
dumpn("*** closing connection " + this.number +
" on port " + this._outgoingPort);
@ -1231,6 +1250,11 @@ Connection.prototype =
return "<Connection(" + this.number +
(this.request ? ", " + this.request.path : "") +"): " +
(this._closed ? "closed" : "open") + ">";
},
requestStarted: function()
{
this._requestStarted = true;
}
};
@ -1417,6 +1441,7 @@ RequestReader.prototype =
{
this._parseRequestLine(line.value);
this._state = READER_IN_HEADERS;
this._connection.requestStarted();
return true;
}
catch (e)

Просмотреть файл

@ -145,14 +145,7 @@ LoginManagerCrypto_SDR.prototype = {
this._uiBusy = true;
try {
let plainOctet;
if (cipherText.charAt(0) == '~') {
// The old Wallet file format obscured entries by
// base64-encoding them. These entries are signaled by a
// leading '~' character.
plainOctet = atob(cipherText.substring(1));
} else {
plainOctet = this._decoderRing.decryptString(cipherText);
}
plainOctet = this._decoderRing.decryptString(cipherText);
plainText = this._utfConverter.ConvertToUnicode(plainOctet);
} catch (e) {
this.log("Failed to decrypt string: " + cipherText +

Просмотреть файл

@ -10,7 +10,6 @@ XPIDL_SOURCES += [
'nsILoginInfo.idl',
'nsILoginManager.idl',
'nsILoginManagerCrypto.idl',
'nsILoginManagerIEMigrationHelper.idl',
'nsILoginManagerPrompter.idl',
'nsILoginManagerStorage.idl',
'nsILoginMetaInfo.idl',
@ -24,7 +23,6 @@ EXTRA_COMPONENTS += [
'nsLoginManager.js',
'nsLoginManagerPrompter.js',
'passwordmgr.manifest',
'storage-Legacy.js',
]
EXTRA_PP_COMPONENTS += [

Просмотреть файл

@ -9,7 +9,7 @@
interface nsILoginManagerCrypto : nsISupports {
const unsigned long ENCTYPE_BASE64 = 0;
const unsigned long ENCTYPE_BASE64 = 0; // obsolete
const unsigned long ENCTYPE_SDR = 1;
/**

Просмотреть файл

@ -1,25 +0,0 @@
/* 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/. */
#include "nsISupports.idl"
interface nsILoginInfo;
[scriptable, uuid(8a59ea3d-b8d0-48af-a3e2-63e27a02cde7)]
interface nsILoginManagerIEMigrationHelper : nsISupports {
/**
* Takes a login provided from nsIEProfileMigrator, migrates it to the
* current login manager format, and adds it to the list of stored logins.
*
* @param aLogin
* The login to be migrated.
*
* Note: In some cases, multiple logins may be created from a single input
* when the format is ambigious.
*
*/
void migrateAndAddLogin(in nsILoginInfo aLogin);
};

Просмотреть файл

@ -9,7 +9,7 @@ interface nsIFile;
interface nsILoginInfo;
interface nsIPropertyBag;
[scriptable, uuid(d9fee9e2-c649-4c47-8c85-90fbbb5ccf67)]
[scriptable, uuid(fe0a4e80-d36f-43cc-a37b-4e1906e77257)]
/*
* NOTE: This interface is intended to be implemented by modules
@ -30,13 +30,11 @@ interface nsILoginManagerStorage : nsISupports {
* locations. This is primarily used to the unit tests and profile
* migration.
*
* @param aInputFile
* File to read for stored logins.
* @param aOutputFile
* If non-null, file to output logins to.
* @param aFile
* If non-null, file to use for login storage.
*
*/
void initWithFile(in nsIFile aInputFile, in nsIFile aOutputFile);
void initWithFile(in nsIFile aFile);
/**

Просмотреть файл

@ -15,12 +15,6 @@ nsLoginInfo.prototype = {
classID : Components.ID("{0f2f347c-1e4f-40cc-8efd-792dea70a85e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginInfo, Ci.nsILoginMetaInfo]),
// Allow storage-Legacy.js to get at the JS object so it can
// slap on a few extra properties for internal use.
get wrappedJSObject() {
return this;
},
//
// nsILoginInfo interfaces...
//

Просмотреть файл

@ -6,8 +6,6 @@ component {8aa66d77-1bbb-45a6-991e-b8f47751c291} nsLoginManagerPrompter.js
contract @mozilla.org/login-manager/prompter;1 {8aa66d77-1bbb-45a6-991e-b8f47751c291}
component {0f2f347c-1e4f-40cc-8efd-792dea70a85e} nsLoginInfo.js
contract @mozilla.org/login-manager/loginInfo;1 {0f2f347c-1e4f-40cc-8efd-792dea70a85e}
component {e09e4ca6-276b-4bb4-8b71-0635a3a2a007} storage-Legacy.js
contract @mozilla.org/login-manager/storage/legacy;1 {e09e4ca6-276b-4bb4-8b71-0635a3a2a007}
component {8c2023b9-175c-477e-9761-44ae7b549756} storage-mozStorage.js
contract @mozilla.org/login-manager/storage/mozStorage;1 {8c2023b9-175c-477e-9761-44ae7b549756}
component {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309} crypto-SDR.js

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -147,9 +147,7 @@ LoginManagerStorage_mozStorage.prototype = {
_prefBranch : null, // Preferences service
_signonsFile : null, // nsIFile for "signons.sqlite"
_importFile : null, // nsIFile for import from legacy
_debug : false, // mirrors signon.debug
_base64checked : false,
/*
@ -170,11 +168,8 @@ LoginManagerStorage_mozStorage.prototype = {
*
* Initialize the component, but override the default filename locations.
* This is primarily used to the unit tests and profile migration.
* aImportFile is legacy storage file, aDBFile is a sqlite/mozStorage file.
*/
initWithFile : function(aImportFile, aDBFile) {
if (aImportFile)
this._importFile = aImportFile;
initWithFile : function(aDBFile) {
if (aDBFile)
this._signonsFile = aDBFile;
@ -185,8 +180,6 @@ LoginManagerStorage_mozStorage.prototype = {
/*
* init
*
* Initialize this storage component; import from legacy files, if
* necessary. Most of the work is done in _deferredInit.
*/
init : function () {
this._dbStmts = {};
@ -197,6 +190,10 @@ LoginManagerStorage_mozStorage.prototype = {
let isFirstRun;
try {
// Force initialization of the crypto module.
// See bug 717490 comment 17.
this._crypto;
// If initWithFile is calling us, _signonsFile may already be set.
if (!this._signonsFile) {
// Initialize signons.sqlite
@ -208,13 +205,6 @@ LoginManagerStorage_mozStorage.prototype = {
// Initialize the database (create, migrate as necessary)
isFirstRun = this._dbInit();
// On first run we want to import the default legacy storage files.
// Otherwise if passed a file, import from that.
if (isFirstRun && !this._importFile)
this._importLegacySignons();
else if (this._importFile)
this._importLegacySignons(this._importFile);
this._initialized = true;
} catch (e) {
this.log("Initialization failed: " + e);
@ -231,28 +221,12 @@ LoginManagerStorage_mozStorage.prototype = {
*
*/
addLogin : function (login) {
this._addLogin(login, false);
},
/*
* _addLogin
*
* Private function wrapping core addLogin functionality.
*/
_addLogin : function (login, isEncrypted) {
let encUsername, encPassword;
// Throws if there are bogus values.
this._checkLoginValues(login);
// isEncrypted only set when importing from an legacy (signons3.txt)
// format, which only would have used SDR or BASE64 encoding. The
// latter of which is handled a little further down.
if (isEncrypted)
[encUsername, encPassword, encType] = [login.username, login.password, Ci.nsILoginManagerCrypto.ENCTYPE_SDR];
else
[encUsername, encPassword, encType] = this._encryptLogin(login);
[encUsername, encPassword, encType] = this._encryptLogin(login);
// Clone the login, so we don't modify the caller's object.
let loginClone = login.clone();
@ -266,11 +240,6 @@ LoginManagerStorage_mozStorage.prototype = {
loginClone.guid = this._uuidService.generateUUID().toString();
}
// If we're migrating legacy storage, check for base64 logins.
if (isEncrypted &&
(encUsername.charAt(0) == '~' || encPassword.charAt(0) == '~'))
encType = this._crypto.ENCTYPE_BASE64;
// Set timestamps
let currentTime = Date.now();
if (!loginClone.timeCreated)
@ -314,7 +283,7 @@ LoginManagerStorage_mozStorage.prototype = {
stmt = this._dbCreateStatement(query, params);
stmt.execute();
} catch (e) {
this.log("_addLogin failed: " + e.name + " : " + e.message);
this.log("addLogin failed: " + e.name + " : " + e.message);
throw "Couldn't write to database, login not added.";
} finally {
if (stmt) {
@ -323,8 +292,7 @@ LoginManagerStorage_mozStorage.prototype = {
}
// Send a notification that a login was added.
if (!isEncrypted)
this._sendNotification("addLogin", loginClone);
this._sendNotification("addLogin", loginClone);
},
@ -687,9 +655,6 @@ LoginManagerStorage_mozStorage.prototype = {
let stmt;
let transaction = new Transaction(this._dbConnection);
// Delete any old, unused files.
this._removeOldSignonsFiles();
// Disabled hosts kept, as one presumably doesn't want to erase those.
// TODO: Add these items to the deleted items table once we've sorted
// out the issues from bug 756701
@ -1063,76 +1028,6 @@ LoginManagerStorage_mozStorage.prototype = {
},
/*
* _importLegacySignons
*
* Imports a file that uses Legacy storage. Will use importFile if provided
* else it will attempt to initialize the Legacy storage normally.
*
*/
_importLegacySignons : function (importFile) {
this.log("Importing " + (importFile ? importFile.path : "legacy storage"));
let legacy = Cc["@mozilla.org/login-manager/storage/legacy;1"].
createInstance(Ci.nsILoginManagerStorage);
// Import all logins and disabled hosts
try {
if (importFile)
legacy.initWithFile(importFile, null);
else
legacy.init();
// Import logins and disabledHosts
let logins = legacy.getAllEncryptedLogins();
// Wrap in a transaction for better performance.
let transaction = new Transaction(this._dbConnection);
for each (let login in logins) {
try {
this._addLogin(login, true);
} catch (e) {
this.log("_importLegacySignons failed to add login: " + e);
}
}
let disabledHosts = legacy.getAllDisabledHosts();
for each (let hostname in disabledHosts)
this.setLoginSavingEnabled(hostname, false);
transaction.commit();
} catch (e) {
this.log("_importLegacySignons failed: " + e.name + " : " + e.message);
throw "Import failed";
}
},
/*
* _removeOldSignonsFiles
*
* Deletes any storage files that we're not using any more.
*/
_removeOldSignonsFiles : function () {
// We've used a number of prefs over time due to compatibility issues.
// We want to delete all files referenced in prefs, which are only for
// importing and clearing logins from storage-Legacy.js.
let filenamePrefs = ["SignonFileName3", "SignonFileName2", "SignonFileName"];
for each (let prefname in filenamePrefs) {
let filename = this._prefBranch.getCharPref(prefname);
let file = this._profileDir.clone();
file.append(filename);
if (file.exists()) {
this.log("Deleting old " + filename + " (" + prefname + ")");
try {
file.remove(false);
} catch (e) {
this.log("NOTICE: Couldn't delete " + filename + ": " + e);
}
}
}
},
/*
* _encryptLogin
*
@ -1144,9 +1039,6 @@ LoginManagerStorage_mozStorage.prototype = {
let encPassword = this._crypto.encrypt(login.password);
let encType = this._crypto.defaultEncType;
if (!this._base64checked)
this._reencryptBase64Logins();
return [encUsername, encPassword, encType];
},
@ -1181,82 +1073,10 @@ LoginManagerStorage_mozStorage.prototype = {
result.push(login);
}
if (!this._base64checked)
this._reencryptBase64Logins();
return result;
},
/*
* _reencryptBase64Logins
*
* Checks the signons DB for any logins using the old wallet-style base64
* obscuring of the username/password, instead of proper encryption. We're
* called once per session, after the user has successfully encrypted or
* decrypted some login (this helps ensure the user doesn't get mysterious
* prompts for a master password, when set).
*/
_reencryptBase64Logins : function () {
let base64Type = Ci.nsILoginManagerCrypto.ENCTYPE_BASE64;
this._base64checked = true;
// Ignore failures, will try again next session...
this.log("Reencrypting Base64 logins");
let transaction;
try {
let [logins, ids] = this._searchLogins({ encType: base64Type });
if (!logins.length)
return;
try {
logins = this._decryptLogins(logins);
} catch (e) {
// User might have canceled master password entry, just ignore.
return;
}
transaction = new Transaction(this._dbConnection);
let encUsername, encPassword, stmt;
for each (let login in logins) {
[encUsername, encPassword, encType] = this._encryptLogin(login);
let query =
"UPDATE moz_logins " +
"SET encryptedUsername = :encryptedUsername, " +
"encryptedPassword = :encryptedPassword, " +
"encType = :encType " +
"WHERE guid = :guid";
let params = {
encryptedUsername: encUsername,
encryptedPassword: encPassword,
encType: encType,
guid: login.guid
};
try {
stmt = this._dbCreateStatement(query, params);
stmt.execute();
} catch (e) {
// Ignore singular errors, continue trying to update others.
this.log("_reencryptBase64Logins caught error: " + e);
} finally {
if (stmt) {
stmt.reset();
}
}
}
} catch (e) {
this.log("_reencryptBase64Logins failed: " + e);
} finally {
if (transaction) {
transaction.commit();
}
}
},
//**************************************************************************//
// Database Creation & Access
@ -1287,8 +1107,7 @@ LoginManagerStorage_mozStorage.prototype = {
* _dbInit
*
* Attempts to initialize the database. This creates the file if it doesn't
* exist, performs any migrations, etc. When database is first created, we
* attempt to import legacy signons. Return if this is the first run.
* exist, performs any migrations, etc. Return if this is the first run.
*/
_dbInit : function () {
this.log("Initializing Database");
@ -1481,6 +1300,7 @@ LoginManagerStorage_mozStorage.prototype = {
stmt = this._dbCreateStatement(query);
while (stmt.executeStep()) {
let params = { id: stmt.row.id };
// We will tag base64 logins correctly, but no longer support their use.
if (stmt.row.encryptedUsername.charAt(0) == '~' ||
stmt.row.encryptedPassword.charAt(0) == '~')
params.encType = Ci.nsILoginManagerCrypto.ENCTYPE_BASE64;

Просмотреть файл

@ -1 +0,0 @@
#2c

Просмотреть файл

@ -1,3 +0,0 @@
#2d
http://www.nsa.gov
.

Просмотреть файл

@ -1,3 +0,0 @@
#2d
http://www.nsa.gov
.

Просмотреть файл

@ -1,2 +0,0 @@
#2d
.

Просмотреть файл

@ -1,9 +0,0 @@
#2d
.
http://dummyhost.mozilla.org
put_user_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECIfQXnNdOlcABBCrqWo0hzkpOPmpGiybiVkU
*put_pw_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECO2TxG6B5o66BBA1PUI/iSkl1G020imhKgEa
.

Просмотреть файл

@ -1,16 +0,0 @@
#2d
.
http://dummyhost.mozilla.org
put_user_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECCcwyTNPm0qJBBD10w5WFcQ7eMIMGSTujH3k
*put_pw_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECOqroi20oiqbBBC2UnpoZC9M/pkem9Csfzeg
.
http://dummyhost2.mozilla.org
put_user2_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKRdcGvGFLweBBBPN2MNaaw6NUUkkj0CebX+
*put_pw2_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECPFh9cwe24C1BBA3dcR+4B6G5kmb/oE+9zFT
http://cgi.site.com
.

Просмотреть файл

@ -1,14 +0,0 @@
#2d
.
http://dummyhost2.mozilla.org
put_user2_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECI/wcg7naww1BBD/ookfBmtc2MX0g8Xyr51f
*put_pw2_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECAoufABHZExXBBDEjlmK9AmpFcp8ODsdgofN
http://cgi.site.com
put_user3_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECK+7oqm6qJyjBBCu0Nxgl+ebE25bMcl4/RnT
*put_pw3_here
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECA//vIyOIl4oBBALsaRqgn86jFYdZioff78I
http://cgi.site.com
.

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше