mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
120ac6d556
25 changed files with 193 additions and 112 deletions
20
Makefile.in
20
Makefile.in
|
|
@ -187,16 +187,7 @@ tup:
|
|||
@$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
|
||||
$(call BUILDSTATUS,TIER_FINISH tup)
|
||||
|
||||
# process_install_manifest needs to be invoked with --no-remove when building
|
||||
# js as standalone because automated builds are building nspr separately and
|
||||
# that would remove the resulting files.
|
||||
# Eventually, a standalone js build would just be able to build nspr itself,
|
||||
# removing the need for the former.
|
||||
ifdef JS_STANDALONE
|
||||
NO_REMOVE=1
|
||||
endif
|
||||
|
||||
.PHONY: $(addprefix install-,$(subst /,_,$(install_manifests)))
|
||||
.PHONY: $(addprefix install-,$(install_manifests))
|
||||
$(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
|
||||
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
|
||||
@# If we're using the hybrid FasterMake/RecursiveMake backend, we want
|
||||
|
|
@ -204,7 +195,7 @@ ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
|
|||
@# same directory, because that would blow up
|
||||
$(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
|
||||
endif
|
||||
$(addprefix $(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
|
||||
$(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
|
||||
|
||||
# Dummy wrapper rule to allow the faster backend to piggy back
|
||||
$(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
|
||||
|
|
@ -217,10 +208,9 @@ install-tests: install-test-files
|
|||
.PHONY: run-tests-deps
|
||||
run-tests-deps: $(install_manifest_depends)
|
||||
|
||||
# Force --no-remove, because $objdir/_tests is handled by multiple manifests.
|
||||
.PHONY: install-test-files
|
||||
install-test-files:
|
||||
$(call py_action,process_install_manifest,--no-remove _tests _build_manifests/install/_test_files)
|
||||
$(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
|
||||
|
||||
include $(topsrcdir)/build/moz-automation.mk
|
||||
|
||||
|
|
@ -240,13 +230,13 @@ ifndef NO_PROFILE_GUIDED_OPTIMIZE
|
|||
ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
|
||||
recurse_pre-export:: install-manifests
|
||||
binaries::
|
||||
@$(MAKE) install-manifests NO_REMOVE=1 install_manifests=dist/include
|
||||
@$(MAKE) install-manifests install_manifests=dist/include
|
||||
endif
|
||||
endif
|
||||
else # !MOZ_PROFILE_USE (normal build)
|
||||
recurse_pre-export:: install-manifests
|
||||
binaries::
|
||||
@$(MAKE) install-manifests NO_REMOVE=1 install_manifests=dist/include
|
||||
@$(MAKE) install-manifests install_manifests=dist/include
|
||||
endif
|
||||
|
||||
# For historical reasons that are unknown, $(DIST)/sdk is always blown away
|
||||
|
|
|
|||
|
|
@ -10,13 +10,12 @@
|
|||
# things happening at each step required other things happening in previous
|
||||
# steps without any documentation of those dependencies.
|
||||
#
|
||||
# This new build system tries to start afresh by establishing what files or
|
||||
# operations are needed for the build, and applying the necessary rules to
|
||||
# have those in place, relying on make dependencies to get them going.
|
||||
# This build system establishes what files or operations are needed for the
|
||||
# build, and applying the necessary rules to have those in place, relying on
|
||||
# make dependencies to get them going.
|
||||
#
|
||||
# As of writing, only building non-compiled parts of Firefox is supported
|
||||
# here (a few other things are also left out). This is a starting point, with
|
||||
# the intent to grow this build system to make it more complete.
|
||||
# Only non-compiled parts of the application and platform are built and
|
||||
# supported here (a few other things are also left out).
|
||||
#
|
||||
# This file contains rules and dependencies to get things working. The intent
|
||||
# is for a Makefile to define some dependencies and variables, and include
|
||||
|
|
@ -42,19 +41,11 @@ ifndef NO_XPIDL
|
|||
default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl
|
||||
endif
|
||||
|
||||
# Mac builds require to copy things in dist/bin/*.app
|
||||
# TODO: remove the MOZ_WIDGET_TOOLKIT and MOZ_BUILD_APP variables from
|
||||
# faster/Makefile and python/mozbuild/mozbuild/test/backend/test_build.py
|
||||
# when this is not required anymore.
|
||||
# We however don't need to do this when using the hybrid
|
||||
# FasterMake/RecursiveMake backend (FASTER_RECURSIVE_MAKE is set when
|
||||
# recursing from the RecursiveMake backend)
|
||||
ifndef FASTER_RECURSIVE_MAKE
|
||||
# Mac builds require copying files in dist/bin/*.app
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
default:
|
||||
$(MAKE) -C $(TOPOBJDIR)/$(MOZ_BUILD_APP)/app repackage
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: FORCE
|
||||
|
||||
|
|
@ -99,12 +90,9 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/
|
|||
# that are not supported by data in moz.build.
|
||||
|
||||
# The xpidl target in config/makefiles/xpidl requires the install manifest for
|
||||
# dist/idl to have been processed. When using the hybrid
|
||||
# FasterMake/RecursiveMake backend, this dependency is handled in the top-level
|
||||
# Makefile.
|
||||
ifndef FASTER_RECURSIVE_MAKE
|
||||
# dist/idl to have been processed.
|
||||
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl
|
||||
endif
|
||||
|
||||
# It also requires all the install manifests for dist/bin to have been processed
|
||||
# because it adds interfaces.manifest references with buildlist.py.
|
||||
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsHTMLTags.h"
|
||||
#include "jsapi.h"
|
||||
#include "ShadowRoot.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ install:: js-config.h
|
|||
#
|
||||
|
||||
install::
|
||||
$(call py_action,process_install_manifest,--no-remove --no-symlinks $(DESTDIR)$(includedir) $(DEPTH)/_build_manifests/install/dist_include)
|
||||
$(call py_action,process_install_manifest,--track install_dist_include.track --no-symlinks $(DESTDIR)$(includedir) $(DEPTH)/_build_manifests/install/dist_include)
|
||||
|
||||
#
|
||||
# END SpiderMonkey header installation
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@
|
|||
#ifndef V8_INFALLIBLEVECTOR_H_
|
||||
#define V8_INFALLIBLEVECTOR_H_
|
||||
|
||||
#include "ds/LifoAlloc.h"
|
||||
#include "mozilla/Vector.h"
|
||||
|
||||
namespace js {
|
||||
namespace irregexp {
|
||||
|
||||
|
|
@ -39,7 +42,7 @@ namespace irregexp {
|
|||
template<typename T, size_t N>
|
||||
class InfallibleVector
|
||||
{
|
||||
Vector<T, N, LifoAllocPolicy<Infallible>> vector_;
|
||||
mozilla::Vector<T, N, LifoAllocPolicy<Infallible>> vector_;
|
||||
|
||||
InfallibleVector(const InfallibleVector&) = delete;
|
||||
void operator=(const InfallibleVector&) = delete;
|
||||
|
|
@ -100,4 +103,4 @@ typedef InfallibleVector<int32_t, 10> IntegerVector;
|
|||
|
||||
} } // namespace js::irregexp
|
||||
|
||||
#endif // V8_INFALLIBLEVECTOR_H_
|
||||
#endif // V8_INFALLIBLEVECTOR_H_
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@
|
|||
|
||||
#include "irregexp/RegExpCharRanges.h"
|
||||
|
||||
#include "ds/LifoAlloc.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "unicode/uniset.h"
|
||||
#include "vm/Unicode.h"
|
||||
|
||||
// Generated table
|
||||
#include "irregexp/RegExpCharacters-inl.h"
|
||||
|
|
@ -447,7 +450,7 @@ bool IsExactPropertyValueAlias(const std::string& property_value_name, UProperty
|
|||
return false;
|
||||
}
|
||||
|
||||
bool LookupPropertyValueName(LifoAlloc* alloc,
|
||||
bool LookupPropertyValueName(js::LifoAlloc* alloc,
|
||||
UProperty property,
|
||||
const std::string& property_value_name, bool negate,
|
||||
CharacterRangeVector* ranges,
|
||||
|
|
@ -485,7 +488,7 @@ bool LookupPropertyValueName(LifoAlloc* alloc,
|
|||
return success;
|
||||
}
|
||||
|
||||
bool LookupSpecialPropertyValueName(LifoAlloc* alloc,
|
||||
bool LookupSpecialPropertyValueName(js::LifoAlloc* alloc,
|
||||
const std::string& name, bool negate,
|
||||
CharacterRangeVector* ranges,
|
||||
CharacterRangeVector* lead_ranges,
|
||||
|
|
@ -497,14 +500,14 @@ bool LookupSpecialPropertyValueName(LifoAlloc* alloc,
|
|||
// is the empty set.
|
||||
} else {
|
||||
CharacterRange::AddUnicodeRange(alloc, ranges, lead_ranges, trail_ranges, wide_ranges,
|
||||
0, unicode::NonBMPMax);
|
||||
0, js::unicode::NonBMPMax);
|
||||
}
|
||||
} else
|
||||
if (name == "ASCII") {
|
||||
if (negate) {
|
||||
// negative ASCII contains all planes
|
||||
CharacterRange::AddUnicodeRange(alloc, ranges, lead_ranges, trail_ranges, wide_ranges,
|
||||
0x80, unicode::NonBMPMax);
|
||||
0x80, js::unicode::NonBMPMax);
|
||||
} else {
|
||||
// positve ASCII is just low codepoints
|
||||
ranges->append(CharacterRange::Range(0x00, 0x7F));
|
||||
|
|
@ -748,12 +751,12 @@ CharacterRange::InsertRangeInCanonicalList(CharacterRangeVector& list,
|
|||
}
|
||||
|
||||
int
|
||||
irregexp::GetCaseIndependentLetters(char16_t character,
|
||||
bool ascii_subject,
|
||||
bool unicode,
|
||||
const char16_t* choices,
|
||||
size_t choices_length,
|
||||
char16_t* letters)
|
||||
js::irregexp::GetCaseIndependentLetters(char16_t character,
|
||||
bool ascii_subject,
|
||||
bool unicode,
|
||||
const char16_t* choices,
|
||||
size_t choices_length,
|
||||
char16_t* letters)
|
||||
{
|
||||
size_t count = 0;
|
||||
for (size_t i = 0; i < choices_length; i++) {
|
||||
|
|
@ -781,10 +784,10 @@ irregexp::GetCaseIndependentLetters(char16_t character,
|
|||
}
|
||||
|
||||
int
|
||||
irregexp::GetCaseIndependentLetters(char16_t character,
|
||||
bool ascii_subject,
|
||||
bool unicode,
|
||||
char16_t* letters)
|
||||
js::irregexp::GetCaseIndependentLetters(char16_t character,
|
||||
bool ascii_subject,
|
||||
bool unicode,
|
||||
char16_t* letters)
|
||||
{
|
||||
if (unicode) {
|
||||
const char16_t choices[] = {
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "ds/LifoAlloc.h"
|
||||
#include "irregexp/RegExpCharacters.h"
|
||||
#include "irregexp/InfallibleVector.h"
|
||||
#include "vm/Unicode.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
|
|
|
|||
|
|
@ -987,7 +987,7 @@ RegExpParser<CharT>::ParseClassEscape(char16_t* char_class, widechar *value,
|
|||
}
|
||||
return true;
|
||||
}
|
||||
MOZ_FALLTHROUGH
|
||||
MOZ_FALLTHROUGH;
|
||||
default:
|
||||
if (!ParseClassCharacterEscape(value))
|
||||
return false;
|
||||
|
|
@ -2069,8 +2069,8 @@ RegExpParser<CharT>::ParseDisjunction()
|
|||
// an identity escape for non-Unicode patterns without named
|
||||
// capture groups, and as the beginning of a named back-reference
|
||||
// in all other cases.
|
||||
Advance(2);
|
||||
if (unicode_ || HasNamedCaptures()) {
|
||||
Advance(2);
|
||||
if (!ParseNamedBackReference(builder, state)) {
|
||||
return ReportError(JSMSG_INVALID_IDENTITY_ESCAPE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1558,7 +1558,7 @@ ParseRegExpFlags(const CharT* chars, size_t length, RegExpFlag* flagsOut, char16
|
|||
return false;
|
||||
break;
|
||||
}
|
||||
MOZ_FALLTHROUGH
|
||||
MOZ_FALLTHROUGH;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9033,6 +9033,13 @@ nsFrame::CorrectStyleParentFrame(nsIFrame* aProspectiveParent,
|
|||
parent = sibling;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure ::first-letter inherits from ::first-line even when floated, see
|
||||
// Issue #2063 / Mozilla bug 13610.
|
||||
if (parent->GetType() == nsGkAtoms::lineFrame &&
|
||||
parent == parent->FirstInFlow()) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
nsIAtom* parentPseudo = parent->StyleContext()->GetPseudo();
|
||||
if (!parentPseudo ||
|
||||
|
|
|
|||
|
|
@ -580,9 +580,10 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||
nscoord availableISize = aReflowInput.AvailableISize();
|
||||
NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
|
||||
"should no longer use available widths");
|
||||
// Subtract off inline axis border+padding from availableISize
|
||||
// Subtract off inline axis border+padding from availableISize;
|
||||
// we don't subtract the end border+padding as we don't yet know whether
|
||||
// the end of the element will occur on the same line.
|
||||
availableISize -= startEdge;
|
||||
availableISize -= framePadding.IEnd(frameWM);
|
||||
lineLayout->BeginSpan(this, &aReflowInput, startEdge,
|
||||
startEdge + availableISize, &mBaseline);
|
||||
|
||||
|
|
|
|||
|
|
@ -1101,7 +1101,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
"The frame ctor should've dealt with this.");
|
||||
if (CanPlaceFrame(pfd, notSafeToBreak, continuingTextRun,
|
||||
savedOptionalBreakFrame != nullptr, reflowOutput,
|
||||
aReflowStatus, &optionalBreakAfterFits)) {
|
||||
aReflowStatus, &optionalBreakAfterFits,
|
||||
isText && availableSpaceOnLine < 0)) {
|
||||
if (!isEmpty) {
|
||||
psd->mHasNonemptyContent = true;
|
||||
mLineIsEmpty = false;
|
||||
|
|
@ -1259,6 +1260,10 @@ nsLineLayout::SyncAnnotationBounds(PerFrameData* aRubyFrame)
|
|||
* ReflowFrame above would have returned false, preventing this method
|
||||
* from being called. The logic in this method assumes that.
|
||||
*
|
||||
* We can always place an empty frame *unless* aAlreadyOverflowed is true,
|
||||
* in which case the line has already overflowed and we'd rather back up
|
||||
* to an earlier break (if available).
|
||||
*
|
||||
* Note that there is no check against the Y coordinate because we
|
||||
* assume that the caller will take care of that.
|
||||
*/
|
||||
|
|
@ -1269,7 +1274,8 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
|
|||
bool aCanRollBackBeforeFrame,
|
||||
ReflowOutput& aMetrics,
|
||||
nsReflowStatus& aStatus,
|
||||
bool* aOptionalBreakAfterFits)
|
||||
bool* aOptionalBreakAfterFits,
|
||||
bool aAlreadyOverflowed)
|
||||
{
|
||||
NS_PRECONDITION(pfd && pfd->mFrame, "bad args, null pointers for frame data");
|
||||
|
||||
|
|
@ -1340,8 +1346,11 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
|
|||
|
||||
// When it doesn't fit, check for a few special conditions where we
|
||||
// allow it to fit anyway.
|
||||
if (0 == startMargin + pfd->mBounds.ISize(lineWM) + endMargin) {
|
||||
// Empty frames always fit right where they are
|
||||
if (0 == startMargin + pfd->mBounds.ISize(lineWM) + endMargin &&
|
||||
!aAlreadyOverflowed) {
|
||||
// Empty frames always fit right where they are, unless we have text that
|
||||
// has already overflowed the line width, in which case we should try to
|
||||
// back up to an earlier break.
|
||||
#ifdef NOISY_CAN_PLACE_FRAME
|
||||
printf(" ==> empty frame fits\n");
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -677,7 +677,8 @@ protected:
|
|||
bool aCanRollBackBeforeFrame,
|
||||
ReflowOutput& aMetrics,
|
||||
nsReflowStatus& aStatus,
|
||||
bool* aOptionalBreakAfterFits);
|
||||
bool* aOptionalBreakAfterFits,
|
||||
bool aAlreadyOverflowed);
|
||||
|
||||
void PlaceFrame(PerFrameData* pfd,
|
||||
ReflowOutput& aMetrics);
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ pref("dom.enable_resource_timing", true);
|
|||
pref("dom.enable_user_timing", true);
|
||||
|
||||
// Whether performance.GetEntries* will contain an entry for the active document
|
||||
pref("dom.enable_performance_navigation_timing", true);
|
||||
pref("dom.enable_performance_navigation_timing", false);
|
||||
|
||||
// Enable printing performance marks/measures to log
|
||||
pref("dom.performance.enable_user_timing_logging", false);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ HTTP_ATOM(Service_Worker_Allowed, "Service-Worker-Allowed")
|
|||
HTTP_ATOM(Set_Cookie, "Set-Cookie")
|
||||
HTTP_ATOM(Set_Cookie2, "Set-Cookie2")
|
||||
HTTP_ATOM(Status_URI, "Status-URI")
|
||||
HTTP_ATOM(Strict_Transport_Security, "Strict-Transport-Security")
|
||||
HTTP_ATOM(TE, "TE")
|
||||
HTTP_ATOM(Title, "Title")
|
||||
HTTP_ATOM(Timeout, "Timeout")
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ nsHttpHeaderArray::SetHeader(nsHttpAtom header,
|
|||
return SetHeader_internal(header, headerName, value, variety);
|
||||
} else if (merge && !IsSingletonHeader(header)) {
|
||||
return MergeHeader(header, entry, value, variety);
|
||||
} else {
|
||||
} else if (!IsIgnoreMultipleHeader(header)) {
|
||||
// Replace the existing string with the new value
|
||||
if (entry->variety == eVarietyResponseNetOriginalAndResponse) {
|
||||
MOZ_ASSERT(variety == eVarietyResponse);
|
||||
|
|
@ -190,7 +190,7 @@ nsHttpHeaderArray::SetHeaderFromNet(nsHttpAtom header,
|
|||
eVarietyResponseNetOriginal);
|
||||
}
|
||||
return rv;
|
||||
} else {
|
||||
} else if (!IsIgnoreMultipleHeader(header)) {
|
||||
// Multiple instances of non-mergeable header received from network
|
||||
// - ignore if same value
|
||||
if (!entry->value.Equals(value)) {
|
||||
|
|
|
|||
|
|
@ -160,6 +160,8 @@ private:
|
|||
|
||||
// Header cannot be merged: only one value possible
|
||||
bool IsSingletonHeader(nsHttpAtom header);
|
||||
// Header cannot be merged, and subsequent values should be ignored
|
||||
bool IsIgnoreMultipleHeader(nsHttpAtom header);
|
||||
// For some headers we want to track empty values to prevent them being
|
||||
// combined with non-empty ones as a CRLF attack vector
|
||||
bool TrackEmptyHeader(nsHttpAtom header);
|
||||
|
|
@ -231,7 +233,22 @@ nsHttpHeaderArray::IsSingletonHeader(nsHttpAtom header)
|
|||
header == nsHttp::If_Unmodified_Since ||
|
||||
header == nsHttp::From ||
|
||||
header == nsHttp::Location ||
|
||||
header == nsHttp::Max_Forwards;
|
||||
header == nsHttp::Max_Forwards ||
|
||||
// Ignore-multiple-headers are singletons in the sense that they
|
||||
// shouldn't be merged.
|
||||
IsIgnoreMultipleHeader(header);
|
||||
}
|
||||
|
||||
// These are headers for which, in the presence of multiple values, we only
|
||||
// consider the first.
|
||||
inline bool nsHttpHeaderArray::IsIgnoreMultipleHeader(nsHttpAtom header)
|
||||
{
|
||||
// https://tools.ietf.org/html/rfc6797#section-8:
|
||||
//
|
||||
// If a UA receives more than one STS header field in an HTTP
|
||||
// response message over secure transport, then the UA MUST process
|
||||
// only the first such header field.
|
||||
return header == nsHttp::Strict_Transport_Security;
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
|
|
|||
29
netwerk/test/gtest/TestHeaders.cpp
Normal file
29
netwerk/test/gtest/TestHeaders.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
#include "nsHttpHeaderArray.h"
|
||||
|
||||
|
||||
TEST(TestHeaders, DuplicateHSTS) {
|
||||
// When the Strict-Transport-Security header is sent multiple times, its
|
||||
// effective value is the value of the first item. It is not coalesced like
|
||||
// other headers are.
|
||||
mozilla::net::nsHttpHeaderArray headers;
|
||||
nsresult rv = headers.SetHeaderFromNet(
|
||||
mozilla::net::nsHttp::Strict_Transport_Security, NS_LITERAL_CSTRING("max-age=360"), true
|
||||
);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
|
||||
nsAutoCString h;
|
||||
rv = headers.GetHeader(mozilla::net::nsHttp::Strict_Transport_Security, h);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
ASSERT_EQ(h.get(), "max-age=360");
|
||||
|
||||
rv = headers.SetHeaderFromNet(
|
||||
mozilla::net::nsHttp::Strict_Transport_Security, NS_LITERAL_CSTRING("max-age=720"), true
|
||||
);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
|
||||
rv = headers.GetHeader(mozilla::net::nsHttp::Strict_Transport_Security, h);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
ASSERT_EQ(h.get(), "max-age=360");
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
UNIFIED_SOURCES += [
|
||||
'TestBase64Stream.cpp',
|
||||
'TestHeaders.cpp',
|
||||
'TestProtocolProxyService.cpp',
|
||||
'TestStandardURL.cpp',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -29,33 +29,31 @@ COMPLETE = 'Elapsed: {elapsed:.2f}s; From {dest}: Kept {existing} existing; ' \
|
|||
'Removed {rm_files} files and {rm_dirs} directories.'
|
||||
|
||||
|
||||
def process_manifest(destdir, paths, track=None,
|
||||
remove_unaccounted=True,
|
||||
remove_all_directory_symlinks=True,
|
||||
remove_empty_directories=True,
|
||||
def process_manifest(destdir, paths, track,
|
||||
no_symlinks=False,
|
||||
defines={}):
|
||||
|
||||
if track:
|
||||
if os.path.exists(track):
|
||||
# We use the same format as install manifests for the tracking
|
||||
# data.
|
||||
manifest = InstallManifest(path=track)
|
||||
remove_unaccounted = FileRegistry()
|
||||
dummy_file = BaseFile()
|
||||
if os.path.exists(track):
|
||||
# We use the same format as install manifests for the tracking
|
||||
# data.
|
||||
manifest = InstallManifest(path=track)
|
||||
remove_unaccounted = FileRegistry()
|
||||
dummy_file = BaseFile()
|
||||
|
||||
finder = FileFinder(destdir, find_executables=False,
|
||||
find_dotfiles=True)
|
||||
for dest in manifest._dests:
|
||||
for p, f in finder.find(dest):
|
||||
remove_unaccounted.add(p, dummy_file)
|
||||
finder = FileFinder(destdir, find_executables=False,
|
||||
find_dotfiles=True)
|
||||
for dest in manifest._dests:
|
||||
for p, f in finder.find(dest):
|
||||
remove_unaccounted.add(p, dummy_file)
|
||||
|
||||
else:
|
||||
# If tracking is enabled and there is no file, we don't want to
|
||||
# be removing anything.
|
||||
remove_unaccounted=False
|
||||
remove_empty_directories=False
|
||||
remove_all_directory_symlinks=False
|
||||
remove_empty_directories=True
|
||||
remove_all_directory_symlinks=True
|
||||
else:
|
||||
# If tracking is enabled and there is no file, we don't want to
|
||||
# be removing anything.
|
||||
remove_unaccounted=False
|
||||
remove_empty_directories=False
|
||||
remove_all_directory_symlinks=False
|
||||
|
||||
manifest_cls = InstallManifestNoSymlinks if no_symlinks else InstallManifest
|
||||
manifest = manifest_cls()
|
||||
|
|
@ -70,7 +68,9 @@ def process_manifest(destdir, paths, track=None,
|
|||
remove_empty_directories=remove_empty_directories)
|
||||
|
||||
if track:
|
||||
manifest.write(path=track)
|
||||
# We should record files that we actually copied.
|
||||
# It is too late to expand wildcards when the track file is read.
|
||||
manifest.write(path=track, expand_pattern=True)
|
||||
|
||||
return result
|
||||
|
||||
|
|
@ -81,15 +81,9 @@ def main(argv):
|
|||
|
||||
parser.add_argument('destdir', help='Destination directory.')
|
||||
parser.add_argument('manifests', nargs='+', help='Path to manifest file(s).')
|
||||
parser.add_argument('--no-remove', action='store_true',
|
||||
help='Do not remove unaccounted files from destination.')
|
||||
parser.add_argument('--no-remove-all-directory-symlinks', action='store_true',
|
||||
help='Do not remove all directory symlinks from destination.')
|
||||
parser.add_argument('--no-remove-empty-directories', action='store_true',
|
||||
help='Do not remove empty directories from destination.')
|
||||
parser.add_argument('--no-symlinks', action='store_true',
|
||||
help='Do not install symbolic links. Always copy files')
|
||||
parser.add_argument('--track', metavar="PATH",
|
||||
parser.add_argument('--track', metavar="PATH", required=True,
|
||||
help='Use installed files tracking information from the given path.')
|
||||
parser.add_argument('-D', action=DefinesAction,
|
||||
dest='defines', metavar="VAR[=VAL]",
|
||||
|
|
@ -99,11 +93,11 @@ def main(argv):
|
|||
|
||||
start = time.time()
|
||||
|
||||
result = process_manifest(args.destdir, args.manifests,
|
||||
track=args.track, remove_unaccounted=not args.no_remove,
|
||||
remove_all_directory_symlinks=not args.no_remove_all_directory_symlinks,
|
||||
remove_empty_directories=not args.no_remove_empty_directories,
|
||||
result = process_manifest(
|
||||
args.destdir,
|
||||
args.manifests,
|
||||
no_symlinks=args.no_symlinks,
|
||||
track=args.track,
|
||||
defines=args.defines)
|
||||
|
||||
elapsed = time.time() - start
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class FasterMakeBackend(CommonBackend, PartialBackend):
|
|||
.add_pattern_symlink(
|
||||
prefix,
|
||||
f.full_path[len(prefix):],
|
||||
mozpath.join(path, f.target_basename))
|
||||
path)
|
||||
else:
|
||||
self._install_manifests[obj.install_target].add_symlink(
|
||||
f.full_path,
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ class InstallManifest(object):
|
|||
"""
|
||||
return json.loads(data)
|
||||
|
||||
def write(self, path=None, fileobj=None):
|
||||
def write(self, path=None, fileobj=None, expand_pattern=False):
|
||||
"""Serialize this manifest to a file or file object.
|
||||
|
||||
If path is specified, that file will be written to. If fileobj is specified,
|
||||
|
|
@ -242,10 +242,21 @@ class InstallManifest(object):
|
|||
for dest in sorted(self._dests):
|
||||
entry = self._dests[dest]
|
||||
|
||||
parts = ['%d' % entry[0], dest]
|
||||
parts.extend(entry[1:])
|
||||
fh.write('%s\n' % self.FIELD_SEPARATOR.join(
|
||||
p.encode('utf-8') for p in parts))
|
||||
if expand_pattern and entry[0] in (self.PATTERN_SYMLINK, self.PATTERN_COPY):
|
||||
type, base, pattern, dest = entry
|
||||
type = self.SYMLINK if type == self.PATTERN_SYMLINK else self.COPY
|
||||
finder = FileFinder(base)
|
||||
paths = [f[0] for f in finder.find(pattern)]
|
||||
for path in paths:
|
||||
source = mozpath.join(base, path)
|
||||
parts = ['%d' % type, mozpath.join(dest, path), source]
|
||||
fh.write('%s\n' % self.FIELD_SEPARATOR.join(
|
||||
p.encode('utf-8') for p in parts))
|
||||
else:
|
||||
parts = ['%d' % entry[0], dest]
|
||||
parts.extend(entry[1:])
|
||||
fh.write('%s\n' % self.FIELD_SEPARATOR.join(
|
||||
p.encode('utf-8') for p in parts))
|
||||
|
||||
def add_symlink(self, source, dest):
|
||||
"""Add a symlink to this manifest.
|
||||
|
|
@ -289,7 +300,7 @@ class InstallManifest(object):
|
|||
|
||||
<base>/foo/bar.h -> <dest>/foo/bar.h
|
||||
"""
|
||||
self._add_entry(mozpath.join(base, pattern, dest),
|
||||
self._add_entry(mozpath.join(dest, pattern),
|
||||
(self.PATTERN_SYMLINK, base, pattern, dest))
|
||||
|
||||
def add_pattern_copy(self, base, pattern, dest):
|
||||
|
|
@ -297,7 +308,7 @@ class InstallManifest(object):
|
|||
|
||||
See ``add_pattern_symlink()`` for usage.
|
||||
"""
|
||||
self._add_entry(mozpath.join(base, pattern, dest),
|
||||
self._add_entry(mozpath.join(dest, pattern),
|
||||
(self.PATTERN_COPY, base, pattern, dest))
|
||||
|
||||
def add_preprocess(self, source, dest, deps, marker='#', defines={},
|
||||
|
|
|
|||
|
|
@ -156,6 +156,29 @@ class TestInstallManifest(TestWithTmpDir):
|
|||
self.assertIn('s_dest2', m1)
|
||||
self.assertIn('c_dest2', m1)
|
||||
|
||||
def test_write_expand_pattern(self):
|
||||
source = self.tmppath('source')
|
||||
os.mkdir(source)
|
||||
os.mkdir('%s/base' % source)
|
||||
os.mkdir('%s/base/foo' % source)
|
||||
|
||||
with open('%s/base/foo/file1' % source, 'a'):
|
||||
pass
|
||||
|
||||
with open('%s/base/foo/file2' % source, 'a'):
|
||||
pass
|
||||
|
||||
m = InstallManifest()
|
||||
m.add_pattern_link('%s/base' % source, '**', 'dest')
|
||||
|
||||
track = self.tmppath('track')
|
||||
m.write(path=track, expand_pattern=True)
|
||||
|
||||
m = InstallManifest(path=track)
|
||||
self.assertEqual([dest for dest in m._dests],
|
||||
['dest/foo/file1', 'dest/foo/file2'])
|
||||
|
||||
|
||||
def test_copier_application(self):
|
||||
dest = self.tmppath('dest')
|
||||
os.mkdir(dest)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ using namespace mozilla;
|
|||
static bool
|
||||
ShouldHandleKeyEvent(nsIDOMEvent* aEvent) {
|
||||
bool handled, trusted = false;
|
||||
aEvent->GetPreventDefault(&handled);
|
||||
aEvent->GetDefaultPrevented(&handled);
|
||||
aEvent->GetIsTrusted(&trusted);
|
||||
|
||||
if (handled || !trusted) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
export::
|
||||
$(call py_action,process_install_manifest,$(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
|
||||
$(call py_action,process_install_manifest,--track install-xpidl.track $(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
|
||||
$(call SUBMAKE,xpidl,$(DEPTH)/config/makefiles/xpidl)
|
||||
|
||||
clean clobber realclean clobber_all distclean::
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue