From 73182c878727851dc967409d139faa10374536e0 Mon Sep 17 00:00:00 2001 From: Joel Maher Date: Tue, 16 Apr 2013 08:33:30 -0400 Subject: [PATCH 001/438] Bug 857252 - testing-modules-dir is not defined. r=gps --- testing/mochitest/runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index b4c99c23c9a5..8a55ed44d26c 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -358,7 +358,7 @@ See for details on the logg options.testingModulesDir = os.path.normpath(options.testingModulesDir) if not os.path.isabs(options.testingModulesDir): - options.testingModulesDir = os.path.abspath(testingModulesDir) + options.testingModulesDir = os.path.abspath(options.testingModulesDir) if not os.path.isdir(options.testingModulesDir): self.error('--testing-modules-dir not a directory: %s' % From 7a6ce42c2aea40a149f96c74f126e0df0d015756 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Tue, 16 Apr 2013 06:35:52 -0600 Subject: [PATCH 002/438] Bug 862228 - Move a RootedPropertyName to the proper place. --- js/src/frontend/Parser.cpp | 8 +++++--- js/src/jit-test/tests/basic/bug862228.js | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 js/src/jit-test/tests/basic/bug862228.js diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 88320dad663b..ecbe09be592e 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -2793,9 +2793,11 @@ Parser::checkDestructuring(BindData *data, * officially linked to its def or registered in lexdeps. Do * that now. */ - RootedPropertyName name(context, pn->pn_atom->asPropertyName()); - if (pair->pn_right == pair->pn_left && !noteNameUse(name, pn)) - return false; + if (pair->pn_right == pair->pn_left) { + RootedPropertyName name(context, pn->pn_atom->asPropertyName()); + if (!noteNameUse(name, pn)) + return false; + } ok = bindDestructuringLHS(pn); } if (!ok) diff --git a/js/src/jit-test/tests/basic/bug862228.js b/js/src/jit-test/tests/basic/bug862228.js new file mode 100644 index 000000000000..95ba66632c07 --- /dev/null +++ b/js/src/jit-test/tests/basic/bug862228.js @@ -0,0 +1,3 @@ +// |jit-test| error: ReferenceError + +({"":y=""}= From 5f0f14e3824d6b18c153c48874a579a9191e9334 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Tue, 16 Apr 2013 14:35:59 +0200 Subject: [PATCH 003/438] Bug 848935 - requestLongerTimeout for intermittent failure in browser_aboutHome.js --- browser/base/content/test/browser_aboutHome.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/base/content/test/browser_aboutHome.js b/browser/base/content/test/browser_aboutHome.js index 22345f0a2029..b2a4392a29a1 100644 --- a/browser/base/content/test/browser_aboutHome.js +++ b/browser/base/content/test/browser_aboutHome.js @@ -250,6 +250,7 @@ let gTests = [ function test() { waitForExplicitFinish(); + requestLongerTimeout(2); Task.spawn(function () { for (let test of gTests) { From 9b5c2c8642c2f63fc927087c4bf44eaa69acb345 Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Tue, 16 Apr 2013 08:46:03 -0400 Subject: [PATCH 004/438] Bug 843865 - Fix >> in code. r=bz --- netwerk/base/src/Dashboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/base/src/Dashboard.cpp b/netwerk/base/src/Dashboard.cpp index 994be332544f..b94d1900f9a2 100644 --- a/netwerk/base/src/Dashboard.cpp +++ b/netwerk/base/src/Dashboard.cpp @@ -393,7 +393,7 @@ Dashboard::GetDNSCacheEntries() Sequence &expiration = dict.mExpiration.Value(); Sequence &family = dict.mFamily.Value(); - Sequence> &hostaddr = dict.mHostaddr.Value(); + Sequence > &hostaddr = dict.mHostaddr.Value(); Sequence &hostname = dict.mHostname.Value(); uint32_t length = mDns.data.Length(); From 84a17b140eee5d40b93aa3fd1a661f2d34f53ef3 Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Mon, 15 Apr 2013 11:26:48 +0200 Subject: [PATCH 005/438] Bug 861790 - Fix unused function TypeIsFloatingPoint/TypeIsUnsigned in ObjectImpl.h. r=jwalden --HG-- extra : rebase_source : 0ee1b49909e370983cba448480fc28741a0879bd --- js/src/vm/ObjectImpl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index d683b4380ef6..0e757f3e08c0 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -560,11 +560,11 @@ struct uint8_clamped { }; /* Note that we can't use std::numeric_limits here due to uint8_clamped. */ -template static inline const bool TypeIsFloatingPoint() { return false; } +template inline const bool TypeIsFloatingPoint() { return false; } template<> inline const bool TypeIsFloatingPoint() { return true; } template<> inline const bool TypeIsFloatingPoint() { return true; } -template static inline const bool TypeIsUnsigned() { return false; } +template inline const bool TypeIsUnsigned() { return false; } template<> inline const bool TypeIsUnsigned() { return true; } template<> inline const bool TypeIsUnsigned() { return true; } template<> inline const bool TypeIsUnsigned() { return true; } From c2cef2b66749ab842ea4bae6c87e9409f59962ff Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 07:52:49 -0500 Subject: [PATCH 006/438] Bug 861181: Separate interface from implementation for nsColumnSetFrame. [r=roc] --- layout/generic/nsColumnSetFrame.cpp | 148 +---------------------- layout/generic/nsColumnSetFrame.h | 178 ++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 147 deletions(-) create mode 100644 layout/generic/nsColumnSetFrame.h diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 4a4294b033d2..cc5843fd5f79 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -5,157 +5,11 @@ /* rendering object for css3 multi-column layout */ -#include "nsContainerFrame.h" -#include "nsIContent.h" -#include "nsIFrame.h" -#include "nsISupports.h" -#include "nsIAtom.h" -#include "nsPresContext.h" -#include "nsHTMLParts.h" -#include "nsGkAtoms.h" -#include "nsStyleConsts.h" -#include "nsCOMPtr.h" -#include "nsLayoutUtils.h" -#include "nsDisplayList.h" -#include "nsCSSRendering.h" -#include +#include "nsColumnSetFrame.h" using namespace mozilla; using namespace mozilla::layout; -class nsColumnSetFrame : public nsContainerFrame { -public: - NS_DECL_FRAMEARENA_HELPERS - - nsColumnSetFrame(nsStyleContext* aContext); - - NS_IMETHOD SetInitialChildList(ChildListID aListID, - nsFrameList& aChildList); - - NS_IMETHOD Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus); - - NS_IMETHOD AppendFrames(ChildListID aListID, - nsFrameList& aFrameList); - NS_IMETHOD InsertFrames(ChildListID aListID, - nsIFrame* aPrevFrame, - nsFrameList& aFrameList); - NS_IMETHOD RemoveFrame(ChildListID aListID, - nsIFrame* aOldFrame); - - virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext); - virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext); - - virtual nsIFrame* GetContentInsertionFrame() { - nsIFrame* frame = GetFirstPrincipalChild(); - - // if no children return nullptr - if (!frame) - return nullptr; - - return frame->GetContentInsertionFrame(); - } - - virtual nsresult StealFrame(nsPresContext* aPresContext, - nsIFrame* aChild, - bool aForceNormal) - { // nsColumnSetFrame keeps overflow containers in main child list - return nsContainerFrame::StealFrame(aPresContext, aChild, true); - } - - virtual bool IsFrameOfType(uint32_t aFlags) const - { - return nsContainerFrame::IsFrameOfType(aFlags & - ~(nsIFrame::eCanContainOverflowContainers)); - } - - virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, - const nsDisplayListSet& aLists) MOZ_OVERRIDE; - - virtual nsIAtom* GetType() const; - - virtual void PaintColumnRule(nsRenderingContext* aCtx, - const nsRect& aDirtyRect, - const nsPoint& aPt); - -#ifdef DEBUG - NS_IMETHOD GetFrameName(nsAString& aResult) const { - return MakeFrameName(NS_LITERAL_STRING("ColumnSet"), aResult); - } -#endif - -protected: - nscoord mLastBalanceHeight; - nsReflowStatus mLastFrameStatus; - - /** - * These are the parameters that control the layout of columns. - */ - struct ReflowConfig { - int32_t mBalanceColCount; - nscoord mColWidth; - nscoord mExpectedWidthLeftOver; - nscoord mColGap; - nscoord mColMaxHeight; - bool mIsBalancing; - }; - - /** - * Some data that is better calculated during reflow - */ - struct ColumnBalanceData { - // The maximum "content height" of any column - nscoord mMaxHeight; - // The sum of the "content heights" for all columns - nscoord mSumHeight; - // The "content height" of the last column - nscoord mLastHeight; - // The maximum "content height" of all columns that overflowed - // their available height - nscoord mMaxOverflowingHeight; - // Whether or not we should revert back to 'auto' setting for column-fill. - // This happens if we overflow our columns such that we no longer have - // enough room to keep balancing. - bool mShouldRevertToAuto; - void Reset() { - mMaxHeight = mSumHeight = mLastHeight = mMaxOverflowingHeight = 0; - mShouldRevertToAuto = false; - } - }; - - /** - * Similar to nsBlockFrame::DrainOverflowLines. Locate any columns not - * handled by our prev-in-flow, and any columns sitting on our own - * overflow list, and put them in our primary child list for reflowing. - */ - void DrainOverflowColumns(); - - /** - * The basic reflow strategy is to call this function repeatedly to - * obtain specific parameters that determine the layout of the - * columns. This function will compute those parameters from the CSS - * style. This function will also be responsible for implementing - * the state machine that controls column balancing. - */ - ReflowConfig ChooseColumnStrategy(const nsHTMLReflowState& aReflowState, - bool aForceAuto); - - /** - * Reflow column children. Returns true iff the content that was reflowed - * fit into the mColMaxHeight. - */ - bool ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus, - const ReflowConfig& aConfig, - bool aLastColumnUnbounded, - nsCollapsingMargin* aCarriedOutBottomMargin, - ColumnBalanceData& aColData); -}; - /** * Tracking issues: * diff --git a/layout/generic/nsColumnSetFrame.h b/layout/generic/nsColumnSetFrame.h new file mode 100644 index 000000000000..25785a9db7ae --- /dev/null +++ b/layout/generic/nsColumnSetFrame.h @@ -0,0 +1,178 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +/* rendering object for css3 multi-column layout */ + +#include "nsContainerFrame.h" +#include "nsIContent.h" +#include "nsIFrame.h" +#include "nsISupports.h" +#include "nsIAtom.h" +#include "nsPresContext.h" +#include "nsHTMLParts.h" +#include "nsGkAtoms.h" +#include "nsStyleConsts.h" +#include "nsCOMPtr.h" +#include "nsLayoutUtils.h" +#include "nsDisplayList.h" +#include "nsCSSRendering.h" +#include + +class nsColumnSetFrame : public nsContainerFrame { +public: + NS_DECL_FRAMEARENA_HELPERS + + nsColumnSetFrame(nsStyleContext* aContext); + + NS_IMETHOD SetInitialChildList(ChildListID aListID, + nsFrameList& aChildList); + + NS_IMETHOD Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); + + NS_IMETHOD AppendFrames(ChildListID aListID, + nsFrameList& aFrameList); + NS_IMETHOD InsertFrames(ChildListID aListID, + nsIFrame* aPrevFrame, + nsFrameList& aFrameList); + NS_IMETHOD RemoveFrame(ChildListID aListID, + nsIFrame* aOldFrame); + + virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext); + virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext); + + virtual nsIFrame* GetContentInsertionFrame() { + nsIFrame* frame = GetFirstPrincipalChild(); + + // if no children return nullptr + if (!frame) + return nullptr; + + return frame->GetContentInsertionFrame(); + } + + virtual nsresult StealFrame(nsPresContext* aPresContext, + nsIFrame* aChild, + bool aForceNormal) + { // nsColumnSetFrame keeps overflow containers in main child list + return nsContainerFrame::StealFrame(aPresContext, aChild, true); + } + + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsContainerFrame::IsFrameOfType(aFlags & + ~(nsIFrame::eCanContainOverflowContainers)); + } + + virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) MOZ_OVERRIDE; + + virtual nsIAtom* GetType() const; + + virtual void PaintColumnRule(nsRenderingContext* aCtx, + const nsRect& aDirtyRect, + const nsPoint& aPt); + +#ifdef DEBUG + NS_IMETHOD GetFrameName(nsAString& aResult) const { + return MakeFrameName(NS_LITERAL_STRING("ColumnSet"), aResult); + } +#endif + +protected: + nscoord mLastBalanceHeight; + nsReflowStatus mLastFrameStatus; + + /** + * These are the parameters that control the layout of columns. + */ + struct ReflowConfig { + // The number of columns that we want to balance across. If we're not + // balancing, this will be set to INT32_MAX. + int32_t mBalanceColCount; + + // The width of each individual column. + nscoord mColWidth; + + // The amount of width that is expected to be left over after all the + // columns and column gaps are laid out. + nscoord mExpectedWidthLeftOver; + + // The width of each column gap. + nscoord mColGap; + + // The maximum height of any individual column during a reflow iteration. + // This parameter is set during each iteration of the binary search for + // the best column height. + nscoord mColMaxHeight; + + // A boolean controlling whether or not we are balancing. This should be + // equivalent to mBalanceColCount == INT32_MAX. + bool mIsBalancing; + + // The last known column height that was 'feasible'. A column height is + // feasible if all child content fits within the specified height. + nscoord mKnownFeasibleHeight; + + // The last known height that was 'infeasible'. A column height is + // infeasible if not all child content fits within the specified height. + nscoord mKnownInfeasibleHeight; + }; + + /** + * Some data that is better calculated during reflow + */ + struct ColumnBalanceData { + // The maximum "content height" of any column + nscoord mMaxHeight; + // The sum of the "content heights" for all columns + nscoord mSumHeight; + // The "content height" of the last column + nscoord mLastHeight; + // The maximum "content height" of all columns that overflowed + // their available height + nscoord mMaxOverflowingHeight; + // Whether or not we should revert back to 'auto' setting for column-fill. + // This happens if we overflow our columns such that we no longer have + // enough room to keep balancing. + bool mShouldRevertToAuto; + void Reset() { + mMaxHeight = mSumHeight = mLastHeight = mMaxOverflowingHeight = 0; + mShouldRevertToAuto = false; + } + }; + + /** + * Similar to nsBlockFrame::DrainOverflowLines. Locate any columns not + * handled by our prev-in-flow, and any columns sitting on our own + * overflow list, and put them in our primary child list for reflowing. + */ + void DrainOverflowColumns(); + + /** + * The basic reflow strategy is to call this function repeatedly to + * obtain specific parameters that determine the layout of the + * columns. This function will compute those parameters from the CSS + * style. This function will also be responsible for implementing + * the state machine that controls column balancing. + */ + ReflowConfig ChooseColumnStrategy(const nsHTMLReflowState& aReflowState, + bool aForceAuto); + + /** + * Reflow column children. Returns true iff the content that was reflowed + * fit into the mColMaxHeight. + */ + bool ReflowChildren(nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + const ReflowConfig& aConfig, + bool aLastColumnUnbounded, + nsCollapsingMargin* aCarriedOutBottomMargin, + ColumnBalanceData& aColData); +}; From 1c6de2e304f7b11b34fbbce38db61ce14db54098 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 07:52:51 -0500 Subject: [PATCH 007/438] Bug 861182: Pull knownFeasibleHeight and knownInfeasibleHeight into ReflowConfig so they can be used outside of nsColumnSetFrame::Reflow(). [r=roc] --- layout/generic/nsColumnSetFrame.cpp | 73 +++++++++++++++++------------ layout/generic/nsColumnSetFrame.h | 3 +- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index cc5843fd5f79..a0d95e6321f6 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -176,8 +176,14 @@ GetColumnGap(nsColumnSetFrame* aFrame, nsColumnSetFrame::ReflowConfig nsColumnSetFrame::ChooseColumnStrategy(const nsHTMLReflowState& aReflowState, - bool aForceAuto = false) + bool aForceAuto = false, + nscoord aFeasibleHeight = NS_INTRINSICSIZE, + nscoord aInfeasibleHeight = 0) + { + nscoord knownFeasibleHeight = aFeasibleHeight; + nscoord knownInfeasibleHeight = aInfeasibleHeight; + const nsStyleColumn* colStyle = StyleColumn(); nscoord availContentWidth = GetAvailableContentWidth(aReflowState); if (aReflowState.ComputedWidth() != NS_INTRINSICSIZE) { @@ -290,7 +296,8 @@ nsColumnSetFrame::ChooseColumnStrategy(const nsHTMLReflowState& aReflowState, numColumns, colWidth, expectedWidthLeftOver, colHeight, colGap); #endif ReflowConfig config = { numColumns, colWidth, expectedWidthLeftOver, colGap, - colHeight, isBalancing }; + colHeight, isBalancing, knownFeasibleHeight, + knownInfeasibleHeight }; return config; } @@ -808,91 +815,95 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, nscoord availableContentHeight = GetAvailableContentHeight(aReflowState); // Termination of the algorithm below is guaranteed because - // knownFeasibleHeight - knownInfeasibleHeight decreases in every - // iteration. - nscoord knownFeasibleHeight = NS_INTRINSICSIZE; - nscoord knownInfeasibleHeight = 0; + // config.mKnownFeasibleHeight - config.mKnownInfeasibleHeight decreases + // in every iteration. + // We set this flag when we detect that we may contain a frame // that can break anywhere (thus foiling the linear decrease-by-one // search) bool maybeContinuousBreakingDetected = false; while (!aPresContext->HasPendingInterrupt()) { - nscoord lastKnownFeasibleHeight = knownFeasibleHeight; + nscoord lastKnownFeasibleHeight = config.mKnownFeasibleHeight; // Record what we learned from the last reflow if (feasible) { // maxHeight is feasible. Also, mLastBalanceHeight is feasible. - knownFeasibleHeight = std::min(knownFeasibleHeight, colData.mMaxHeight); - knownFeasibleHeight = std::min(knownFeasibleHeight, mLastBalanceHeight); + config.mKnownFeasibleHeight = std::min(config.mKnownFeasibleHeight, + colData.mMaxHeight); + config.mKnownFeasibleHeight = std::min(config.mKnownFeasibleHeight, + mLastBalanceHeight); // Furthermore, no height less than the height of the last // column can ever be feasible. (We might be able to reduce the // height of a non-last column by moving content to a later column, // but we can't do that with the last column.) if (mFrames.GetLength() == config.mBalanceColCount) { - knownInfeasibleHeight = std::max(knownInfeasibleHeight, - colData.mLastHeight - 1); + config.mKnownInfeasibleHeight = + std::max(config.mKnownInfeasibleHeight, colData.mLastHeight - 1); } } else { - knownInfeasibleHeight = std::max(knownInfeasibleHeight, mLastBalanceHeight); + config.mKnownInfeasibleHeight = + std::max(config.mKnownInfeasibleHeight, mLastBalanceHeight); // If a column didn't fit in its available height, then its current // height must be the minimum height for unbreakable content in // the column, and therefore no smaller height can be feasible. - knownInfeasibleHeight = std::max(knownInfeasibleHeight, - colData.mMaxOverflowingHeight - 1); + config.mKnownInfeasibleHeight = + std::max(config.mKnownInfeasibleHeight, + colData.mMaxOverflowingHeight - 1); if (unboundedLastColumn) { // The last column is unbounded, so all content got reflowed, so the // mColMaxHeight is feasible. - knownFeasibleHeight = std::min(knownFeasibleHeight, - colData.mMaxHeight); + config.mKnownFeasibleHeight = std::min(config.mKnownFeasibleHeight, + colData.mMaxHeight); } } #ifdef DEBUG_roc printf("*** nsColumnSetFrame::Reflow balancing knownInfeasible=%d knownFeasible=%d\n", - knownInfeasibleHeight, knownFeasibleHeight); + config.mKnownInfeasibleHeight, config.mKnownFeasibleHeight); #endif - if (knownInfeasibleHeight >= knownFeasibleHeight - 1) { - // knownFeasibleHeight is where we want to be + if (config.mKnownInfeasibleHeight >= config.mKnownFeasibleHeight - 1) { + // config.mKnownFeasibleHeight is where we want to be break; } - if (knownInfeasibleHeight >= availableContentHeight) { + if (config.mKnownInfeasibleHeight >= availableContentHeight) { break; } - if (lastKnownFeasibleHeight - knownFeasibleHeight == 1) { + if (lastKnownFeasibleHeight - config.mKnownFeasibleHeight == 1) { // We decreased the feasible height by one twip only. This could // indicate that there is a continuously breakable child frame // that we are crawling through. maybeContinuousBreakingDetected = true; } - nscoord nextGuess = (knownFeasibleHeight + knownInfeasibleHeight)/2; + nscoord nextGuess = + (config.mKnownFeasibleHeight + config.mKnownInfeasibleHeight)/2; // The constant of 600 twips is arbitrary. It's about two line-heights. - if (knownFeasibleHeight - nextGuess < 600 && + if (config.mKnownFeasibleHeight - nextGuess < 600 && !maybeContinuousBreakingDetected) { // We're close to our target, so just try shrinking just the // minimum amount that will cause one of our columns to break // differently. - nextGuess = knownFeasibleHeight - 1; + nextGuess = config.mKnownFeasibleHeight - 1; } else if (unboundedLastColumn) { // Make a guess by dividing that into N columns. Add some slop // to try to make it on the feasible side. The constant of // 600 twips is arbitrary. It's about two line-heights. nextGuess = colData.mSumHeight/config.mBalanceColCount + 600; // Sanitize it - nextGuess = clamped(nextGuess, knownInfeasibleHeight + 1, - knownFeasibleHeight - 1); - } else if (knownFeasibleHeight == NS_INTRINSICSIZE) { + nextGuess = clamped(nextGuess, config.mKnownInfeasibleHeight + 1, + config.mKnownFeasibleHeight - 1); + } else if (config.mKnownFeasibleHeight == NS_INTRINSICSIZE) { // This can happen when we had a next-in-flow so we didn't // want to do an unbounded height measuring step. Let's just increase // from the infeasible height by some reasonable amount. - nextGuess = knownInfeasibleHeight*2 + 600; + nextGuess = config.mKnownInfeasibleHeight*2 + 600; } // Don't bother guessing more than our height constraint. nextGuess = std::min(availableContentHeight, nextGuess); @@ -914,13 +925,13 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, // We may need to reflow one more time at the feasible height to // get a valid layout. bool skip = false; - if (knownInfeasibleHeight >= availableContentHeight) { - config.mColMaxHeight = availableContentHeight; + if (config.mKnownInfeasibleHeight >= availableContentHeight) { + config.mColMaxHeight = availableContentHeight; if (mLastBalanceHeight == availableContentHeight) { skip = true; } } else { - config.mColMaxHeight = knownFeasibleHeight; + config.mColMaxHeight = config.mKnownFeasibleHeight; } if (!skip) { // If our height is unconstrained, make sure that the last column is diff --git a/layout/generic/nsColumnSetFrame.h b/layout/generic/nsColumnSetFrame.h index 25785a9db7ae..9c81517bcc57 100644 --- a/layout/generic/nsColumnSetFrame.h +++ b/layout/generic/nsColumnSetFrame.h @@ -162,7 +162,8 @@ protected: * the state machine that controls column balancing. */ ReflowConfig ChooseColumnStrategy(const nsHTMLReflowState& aReflowState, - bool aForceAuto); + bool aForceAuto, nscoord aFeasibleHeight, + nscoord aInfeasibleHeight); /** * Reflow column children. Returns true iff the content that was reflowed From d170276e6391d070dab470747eae610d244357be Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Tue, 16 Apr 2013 21:19:29 +0900 Subject: [PATCH 008/438] Bug 860180 - Prefer UTF-16BE/LE to UTF-16. r=hsivonen --- content/base/public/nsContentUtils.h | 2 +- content/base/src/nsContentUtils.cpp | 21 ++++--------------- content/base/src/nsScriptLoader.cpp | 4 ++-- dom/workers/FileReaderSync.cpp | 18 +++------------- .../src/base/nsUniversalDetector.cpp | 4 ++-- layout/style/Loader.cpp | 5 ++--- 6 files changed, 14 insertions(+), 40 deletions(-) diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index c9c75b9c70e3..9da9cc53d9c6 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -510,7 +510,7 @@ public: * @return boolean indicating whether a BOM was detected. */ static bool CheckForBOM(const unsigned char* aBuffer, uint32_t aLength, - nsACString& aCharset, bool *bigEndian = nullptr); + nsACString& aCharset); static nsresult GuessCharset(const char *aData, uint32_t aDataLen, nsACString &aCharset); diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 85749b985f5f..6bc0e3f6731b 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -3713,7 +3713,7 @@ nsContentUtils::ConvertStringFromCharset(const nsACString& aCharset, /* static */ bool nsContentUtils::CheckForBOM(const unsigned char* aBuffer, uint32_t aLength, - nsACString& aCharset, bool *bigEndian) + nsACString& aCharset) { bool found = true; aCharset.Truncate(); @@ -3725,15 +3725,11 @@ nsContentUtils::CheckForBOM(const unsigned char* aBuffer, uint32_t aLength, } else if (aLength >= 2 && aBuffer[0] == 0xFE && aBuffer[1] == 0xFF) { - aCharset = "UTF-16"; - if (bigEndian) - *bigEndian = true; + aCharset = "UTF-16BE"; } else if (aLength >= 2 && aBuffer[0] == 0xFF && aBuffer[1] == 0xFE) { - aCharset = "UTF-16"; - if (bigEndian) - *bigEndian = false; + aCharset = "UTF-16LE"; } else { found = false; } @@ -3791,16 +3787,7 @@ nsContentUtils::GuessCharset(const char *aData, uint32_t aDataLen, (aDataLen >= sizeof(sniffBuf) ? sizeof(sniffBuf) : aDataLen); memcpy(sniffBuf, aData, numRead); - bool bigEndian; - if (CheckForBOM(sniffBuf, numRead, aCharset, &bigEndian) && - aCharset.EqualsLiteral("UTF-16")) { - if (bigEndian) { - aCharset.AppendLiteral("BE"); - } - else { - aCharset.AppendLiteral("LE"); - } - } + CheckForBOM(sniffBuf, numRead, aCharset); } if (aCharset.IsEmpty()) { diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 65c236401c62..ac19a251bc9b 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -981,14 +981,14 @@ DetectByteOrderMark(const unsigned char* aBytes, int32_t aLen, nsCString& oChars if (0xFF == aBytes[1]) { // FE FF // UTF-16, big-endian - oCharset.Assign("UTF-16"); + oCharset.Assign("UTF-16BE"); } break; case 0xFF: if (0xFE == aBytes[1]) { // FF FE // UTF-16, little-endian - oCharset.Assign("UTF-16"); + oCharset.Assign("UTF-16LE"); } break; } diff --git a/dom/workers/FileReaderSync.cpp b/dom/workers/FileReaderSync.cpp index 715fa5cfc8bb..5e24ba4cf9fd 100644 --- a/dom/workers/FileReaderSync.cpp +++ b/dom/workers/FileReaderSync.cpp @@ -343,21 +343,9 @@ FileReaderSync::GuessCharset(nsIInputStream *aStream, nsACString &aCharset) sizeof(sniffBuf), &numRead); NS_ENSURE_SUCCESS(rv, rv); - if (numRead >= 4 && - sniffBuf[0] == 0x00 && - sniffBuf[1] == 0x00 && - sniffBuf[2] == 0xfe && - sniffBuf[3] == 0xff) { - mCharset = "UTF-32BE"; - } else if (numRead >= 4 && - sniffBuf[0] == 0xff && - sniffBuf[1] == 0xfe && - sniffBuf[2] == 0x00 && - sniffBuf[3] == 0x00) { - mCharset = "UTF-32LE"; - } else if (numRead >= 2 && - sniffBuf[0] == 0xfe && - sniffBuf[1] == 0xff) { + if (numRead >= 2 && + sniffBuf[0] == 0xfe && + sniffBuf[1] == 0xff) { mCharset = "UTF-16BE"; } else if (numRead >= 2 && sniffBuf[0] == 0xff && diff --git a/extensions/universalchardet/src/base/nsUniversalDetector.cpp b/extensions/universalchardet/src/base/nsUniversalDetector.cpp index 04b85f7c218a..a06c2270c29a 100644 --- a/extensions/universalchardet/src/base/nsUniversalDetector.cpp +++ b/extensions/universalchardet/src/base/nsUniversalDetector.cpp @@ -88,12 +88,12 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, uint32_t aLen) case '\xFE': if ('\xFF' == aBuf[1]) // FE FF UTF-16, big endian BOM - mDetectedCharset = "UTF-16"; + mDetectedCharset = "UTF-16BE"; break; case '\xFF': if ('\xFE' == aBuf[1]) // FF FE UTF-16, little endian BOM - mDetectedCharset = "UTF-16"; + mDetectedCharset = "UTF-16LE"; break; } // switch diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index cb9a11dc4278..a5b2ac857341 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -663,9 +663,8 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader, if (nsContentUtils::CheckForBOM((const unsigned char*)aSegment.BeginReading(), aSegment.Length(), aCharset)) { - // aCharset is now either "UTF-16" or "UTF-8". - // The UTF-16 decoder will re-sniff and swallow the BOM. - // The UTF-8 decoder will swallow the BOM. + // aCharset is now either "UTF-16BE", "UTF-16BE" or "UTF-8" + // which will swallow the BOM. mCharset.Assign(aCharset); #ifdef PR_LOGGING LOG((" Setting from BOM to: %s", PromiseFlatCString(aCharset).get())); From 031e42df2360e2f5b254e6d2e7749e5a74ff3285 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Tue, 16 Apr 2013 21:19:30 +0900 Subject: [PATCH 009/438] Bug 860180 - Regression tests. r=hsivonen --HG-- rename : parser/htmlparser/tests/mochitest/test_xml_mislabeled_nobom.html => parser/htmlparser/tests/mochitest/test_xml_mislabeled.html --- parser/htmlparser/tests/mochitest/Makefile.in | 2 +- .../tests/mochitest/test_xml_mislabeled.html | 62 +++++++++++++++++++ .../mochitest/test_xml_mislabeled_nobom.html | 44 ------------- 3 files changed, 63 insertions(+), 45 deletions(-) create mode 100644 parser/htmlparser/tests/mochitest/test_xml_mislabeled.html delete mode 100644 parser/htmlparser/tests/mochitest/test_xml_mislabeled_nobom.html diff --git a/parser/htmlparser/tests/mochitest/Makefile.in b/parser/htmlparser/tests/mochitest/Makefile.in index c0fb80e17b09..5e6d982fda71 100644 --- a/parser/htmlparser/tests/mochitest/Makefile.in +++ b/parser/htmlparser/tests/mochitest/Makefile.in @@ -81,7 +81,7 @@ MOCHITEST_FILES = parser_datreader.js \ file_bug716579-16.xhtml^headers^ \ test_bug717180.html \ file_bug717180.html \ - test_xml_mislabeled_nobom.html \ + test_xml_mislabeled.html \ $(NULL) # Test disabled on mobile. See bug 737020. diff --git a/parser/htmlparser/tests/mochitest/test_xml_mislabeled.html b/parser/htmlparser/tests/mochitest/test_xml_mislabeled.html new file mode 100644 index 000000000000..821edd42a772 --- /dev/null +++ b/parser/htmlparser/tests/mochitest/test_xml_mislabeled.html @@ -0,0 +1,62 @@ + +Test for mislabeled or unlabeled XML entities with U+xxD8 + + + + +
+ diff --git a/parser/htmlparser/tests/mochitest/test_xml_mislabeled_nobom.html b/parser/htmlparser/tests/mochitest/test_xml_mislabeled_nobom.html deleted file mode 100644 index 0849d22cac2c..000000000000 --- a/parser/htmlparser/tests/mochitest/test_xml_mislabeled_nobom.html +++ /dev/null @@ -1,44 +0,0 @@ - -Test for mislabeled XML entities - - - - -
- From 7f7df293ae003f27716e9f9bd48b4bf94e7064c8 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 15 Apr 2013 18:32:55 +0100 Subject: [PATCH 010/438] Bug 861281 - GC: Root the wrap object API r=terrence r=bholley --HG-- extra : rebase_source : 1d3ed88299ad8e9ad6812fb41aa48f03cc7aabae --- content/base/src/nsNodeUtils.cpp | 2 +- dom/bindings/BindingUtils.cpp | 4 +++- dom/bindings/BindingUtils.h | 2 +- js/src/jsapi-tests/testBug604087.cpp | 14 ++++------- js/src/jsapi.h | 9 +++---- js/src/jswrapper.cpp | 8 ++----- js/src/jswrapper.h | 4 ++-- js/xpconnect/wrappers/WrapperFactory.cpp | 30 +++++++++++++----------- js/xpconnect/wrappers/WrapperFactory.h | 14 +++++------ 9 files changed, 41 insertions(+), 46 deletions(-) diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp index 620be1b9c59f..3a1dbef635c0 100644 --- a/content/base/src/nsNodeUtils.cpp +++ b/content/base/src/nsNodeUtils.cpp @@ -400,7 +400,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, AutoJSContext cx; nsresult rv; - JSObject *wrapper; + JS::RootedObject wrapper(cx); bool isDOMBinding; if (aReparentScope && (wrapper = aNode->GetWrapper()) && !(isDOMBinding = IsDOMObject(wrapper))) { diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index db155f37b0db..85adf4ff3e3c 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -1438,8 +1438,10 @@ private: }; nsresult -ReparentWrapper(JSContext* aCx, JSObject* aObj) +ReparentWrapper(JSContext* aCx, JS::HandleObject aObjArg) { + // aObj is assigned to below, so needs to be re-rooted. + JS::RootedObject aObj(aCx, aObjArg); const DOMClass* domClass = GetDOMClass(aObj); JSObject* oldParent = JS_GetParent(aObj); diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 777aaa5626c9..724d29cb714e 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -1681,7 +1681,7 @@ struct JSBindingFinalized }; nsresult -ReparentWrapper(JSContext* aCx, JSObject* aObj); +ReparentWrapper(JSContext* aCx, JS::HandleObject aObj); /** * Used to implement the hasInstance hook of an interface object. diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index c3a907a20b91..100d432b3f7b 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -43,29 +43,23 @@ wrap(JSContext *cx, JS::HandleObject toWrap, JS::HandleObject target) } static JSObject * -SameCompartmentWrap(JSContext *cx, JSObject *objArg) +SameCompartmentWrap(JSContext *cx, JS::HandleObject obj) { - JS::RootedObject obj(cx, objArg); JS_GC(JS_GetRuntime(cx)); return obj; } static JSObject * -PreWrap(JSContext *cx, JSObject *scopeArg, JSObject *objArg, unsigned flags) +PreWrap(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj, unsigned flags) { - JS::RootedObject scope(cx, scopeArg); - JS::RootedObject obj(cx, objArg); JS_GC(JS_GetRuntime(cx)); return obj; } static JSObject * -Wrap(JSContext *cx, JSObject *existing, JSObject *objArg, - JSObject *protoArg, JSObject *parentArg, unsigned flags) +Wrap(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj, + JS::HandleObject proto, JS::HandleObject parent, unsigned flags) { - JS::RootedObject obj(cx, objArg); - JS::RootedObject proto(cx, protoArg); - JS::RootedObject parent(cx, parentArg); return js::Wrapper::New(cx, obj, proto, parent, &js::CrossCompartmentWrapper::singleton); } diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 846073b1386d..ecc48aa638b2 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -1161,8 +1161,8 @@ typedef JSBool * wrap a function. */ typedef JSObject * -(* JSWrapObjectCallback)(JSContext *cx, JSObject *existing, JSObject *obj, - JSObject *proto, JSObject *parent, +(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj, + JS::HandleObject proto, JS::HandleObject parent, unsigned flags); /* @@ -1171,7 +1171,8 @@ typedef JSObject * * or even finding a more suitable object for the new compartment. */ typedef JSObject * -(* JSPreWrapCallback)(JSContext *cx, JSObject *scope, JSObject *obj, unsigned flags); +(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj, + unsigned flags); /* * Callback used when wrapping determines that the underlying object is already @@ -1184,7 +1185,7 @@ typedef JSObject * * compartment wrapper that gets passed to wrap. */ typedef JSObject * -(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JSObject *obj); +(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj); typedef void (* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment); diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 3f21082891d9..49958bf7920b 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -132,14 +132,10 @@ Wrapper Wrapper::singletonWithPrototype((unsigned)0, true); /* Compartments. */ extern JSObject * -js::TransparentObjectWrapper(JSContext *cx, JSObject *existing, JSObject *objArg, - JSObject *wrappedProtoArg, JSObject *parentArg, +js::TransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj, + HandleObject wrappedProto, HandleObject parent, unsigned flags) { - RootedObject obj(cx, objArg); - RootedObject wrappedProto(cx, wrappedProtoArg); - RootedObject parent(cx, parentArg); - // Allow wrapping outer window proxies. JS_ASSERT(!obj->isWrapper() || obj->getClass()->ext.innerObject); return Wrapper::New(cx, obj, wrappedProto, parent, &CrossCompartmentWrapper::singleton); diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index 3e7985cb6b2a..520191eef739 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -205,8 +205,8 @@ class JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler }; extern JSObject * -TransparentObjectWrapper(JSContext *cx, JSObject *existing, JSObject *obj, - JSObject *wrappedProto, JSObject *parent, +TransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj, + HandleObject wrappedProto, HandleObject parent, unsigned flags); // Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by diff --git a/js/xpconnect/wrappers/WrapperFactory.cpp b/js/xpconnect/wrappers/WrapperFactory.cpp index 571c9a1d03b8..381f296d6341 100644 --- a/js/xpconnect/wrappers/WrapperFactory.cpp +++ b/js/xpconnect/wrappers/WrapperFactory.cpp @@ -125,7 +125,8 @@ WrapperFactory::DoubleWrap(JSContext *cx, HandleObject obj, unsigned flags) } JSObject * -WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *objArg, unsigned flags) +WrapperFactory::PrepareForWrapping(JSContext *cx, HandleObject scope, + HandleObject objArg, unsigned flags) { RootedObject obj(cx, objArg); // Outerize any raw inner objects at the entry point here, so that we don't @@ -167,6 +168,7 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj JSAutoCompartment ac(cx, obj); XPCCallContext ccx(JS_CALLER, cx, obj); + RootedObject wrapScope(cx, scope); { if (NATIVE_HAS_FLAG(&ccx, WantPreCreate)) { @@ -177,20 +179,19 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj // being accessed across compartments. We would really prefer to // replace the above code with a test that says "do you only have one // wrapper?" - RootedObject originalScope(cx, scope); nsresult rv = wn->GetScriptableInfo()->GetCallback()-> - PreCreate(wn->Native(), cx, scope, &scope); + PreCreate(wn->Native(), cx, scope, wrapScope.address()); NS_ENSURE_SUCCESS(rv, DoubleWrap(cx, obj, flags)); // If the handed back scope differs from the passed-in scope and is in // a separate compartment, then this object is explicitly requesting // that we don't create a second JS object for it: create a security // wrapper. - if (js::GetObjectCompartment(originalScope) != js::GetObjectCompartment(scope)) + if (js::GetObjectCompartment(scope) != js::GetObjectCompartment(wrapScope)) return DoubleWrap(cx, obj, flags); RootedObject currentScope(cx, JS_GetGlobalForObject(cx, obj)); - if (MOZ_UNLIKELY(scope != currentScope)) { + if (MOZ_UNLIKELY(wrapScope != currentScope)) { // The wrapper claims it wants to be in the new scope, but // currently has a reflection that lives in the old scope. This // can mean one of two things, both of which are rare: @@ -217,7 +218,7 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj // Check for case (2). if (probe != currentScope) { - MOZ_ASSERT(probe == scope); + MOZ_ASSERT(probe == wrapScope); return DoubleWrap(cx, obj, flags); } @@ -236,8 +237,8 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj // This doesn't actually pose a security issue, because we'll still compute // the correct (opaque) wrapper for the object below given the security // characteristics of the two compartments. - if (!AccessCheck::isChrome(js::GetObjectCompartment(scope)) && - AccessCheck::subsumesIgnoringDomain(js::GetObjectCompartment(scope), + if (!AccessCheck::isChrome(js::GetObjectCompartment(wrapScope)) && + AccessCheck::subsumesIgnoringDomain(js::GetObjectCompartment(wrapScope), js::GetObjectCompartment(obj))) { return DoubleWrap(cx, obj, flags); @@ -249,11 +250,11 @@ WrapperFactory::PrepareForWrapping(JSContext *cx, JSObject *scope, JSObject *obj // WrapNativeToJSVal. nsCOMPtr holder; - // This public WrapNativeToJSVal API enters the compartment of 'scope' + // This public WrapNativeToJSVal API enters the compartment of 'wrapScope' // so we don't have to. RootedValue v(cx); nsresult rv = - nsXPConnect::FastGetXPConnect()->WrapNativeToJSVal(cx, scope, wn->Native(), nullptr, + nsXPConnect::FastGetXPConnect()->WrapNativeToJSVal(cx, wrapScope, wn->Native(), nullptr, &NS_GET_IID(nsISupports), false, v.address(), getter_AddRefs(holder)); if (NS_SUCCEEDED(rv)) { @@ -344,8 +345,8 @@ SelectWrapper(bool securityWrapper, bool wantXrays, XrayType xrayType, } JSObject * -WrapperFactory::Rewrap(JSContext *cx, JSObject *existing, JSObject *obj, - JSObject *wrappedProto, JSObject *parent, +WrapperFactory::Rewrap(JSContext *cx, HandleObject existing, HandleObject obj, + HandleObject wrappedProto, HandleObject parent, unsigned flags) { MOZ_ASSERT(!IsWrapper(obj) || @@ -498,8 +499,9 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *existing, JSObject *obj, } JSObject * -WrapperFactory::WrapForSameCompartment(JSContext *cx, JSObject *obj) +WrapperFactory::WrapForSameCompartment(JSContext *cx, HandleObject objArg) { + RootedObject obj(cx, objArg); MOZ_ASSERT(js::IsObjectInContextCompartment(obj, cx)); // NB: The contract of WrapForSameCompartment says that |obj| may or may not @@ -511,7 +513,7 @@ WrapperFactory::WrapForSameCompartment(JSContext *cx, JSObject *obj) obj = JS_ObjectToOuterObject(cx, obj); NS_ENSURE_TRUE(obj, nullptr); - if (dom::GetSameCompartmentWrapperForDOMBinding(obj)) { + if (dom::GetSameCompartmentWrapperForDOMBinding(*obj.address())) { return obj; } diff --git a/js/xpconnect/wrappers/WrapperFactory.h b/js/xpconnect/wrappers/WrapperFactory.h index e17d98215ffe..c998a38b58c3 100644 --- a/js/xpconnect/wrappers/WrapperFactory.h +++ b/js/xpconnect/wrappers/WrapperFactory.h @@ -48,21 +48,21 @@ class WrapperFactory { // Prepare a given object for wrapping in a new compartment. static JSObject *PrepareForWrapping(JSContext *cx, - JSObject *scope, - JSObject *obj, + JS::HandleObject scope, + JS::HandleObject obj, unsigned flags); // Rewrap an object that is about to cross compartment boundaries. static JSObject *Rewrap(JSContext *cx, - JSObject *existing, - JSObject *obj, - JSObject *wrappedProto, - JSObject *parent, + JS::HandleObject existing, + JS::HandleObject obj, + JS::HandleObject wrappedProto, + JS::HandleObject parent, unsigned flags); // Wrap an object for same-compartment access. static JSObject *WrapForSameCompartment(JSContext *cx, - JSObject *obj); + JS::HandleObject obj); // Wrap wrapped object into a waiver wrapper and then re-wrap it. static bool WaiveXrayAndWrap(JSContext *cx, jsval *vp); From dfbe53629bdd568df3bd1d9fe287d08717c77e6a Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 9 Apr 2013 16:42:32 +0100 Subject: [PATCH 011/438] Bug 861912 - GC: Remove use of AUTO_MARK_JSVAL in XPConnect r=bholley --HG-- extra : rebase_source : 5d279fe19c5dfc5812eaa2a241945c58a29dbe9d --- js/xpconnect/src/XPCConvert.cpp | 28 ++++++++++------------ js/xpconnect/src/XPCWrappedJSClass.cpp | 14 +++-------- js/xpconnect/src/XPCWrappedNative.cpp | 5 +--- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 3 --- js/xpconnect/src/nsXPConnect.cpp | 1 - js/xpconnect/src/xpcprivate.h | 28 ---------------------- 6 files changed, 17 insertions(+), 62 deletions(-) diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index a201d126a3ec..2079193f75d7 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -29,6 +29,7 @@ using namespace xpc; using namespace mozilla; using namespace mozilla::dom; +using namespace JS; //#define STRICT_CHECK_OF_UNICODE #ifdef STRICT_CHECK_OF_UNICODE @@ -169,7 +170,7 @@ XPCConvert::NativeData2JS(XPCLazyCallContext& lccx, jsval* d, const void* s, nsID* iid2 = *((nsID**)s); if (!iid2) break; - JS::RootedObject scope(cx, lccx.GetScopeForNewJSObjects()); + RootedObject scope(cx, lccx.GetScopeForNewJSObjects()); JSObject* obj; if (!(obj = xpc_NewIDObject(cx, scope, *iid2))) return false; @@ -830,7 +831,7 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx, nsWrapperCache *cache = aHelper.GetWrapperCache(); bool tryConstructSlimWrapper = false; - JS::RootedObject flat(cx); + RootedObject flat(cx); if (cache) { flat = cache->GetWrapper(); if (cache->IsDOMBinding()) { @@ -1153,7 +1154,7 @@ public: private: JSContext * const mContext; - JS::AutoValueRooter tvr; + AutoValueRooter tvr; }; // static @@ -1411,29 +1412,26 @@ XPCConvert::NativeArray2JS(XPCLazyCallContext& lccx, // XXX add support to indicate *which* array element was not convertable - JSObject *array = JS_NewArrayObject(cx, count, nullptr); + RootedObject array(cx, JS_NewArrayObject(cx, count, nullptr)); if (!array) return false; - // root this early *d = OBJECT_TO_JSVAL(array); - AUTO_MARK_JSVAL(ccx, d); if (pErr) *pErr = NS_ERROR_XPC_BAD_CONVERT_NATIVE; uint32_t i; - jsval current = JSVAL_NULL; - AUTO_MARK_JSVAL(ccx, ¤t); + RootedValue current(cx, JSVAL_NULL); -#define POPULATE(_t) \ - PR_BEGIN_MACRO \ - for (i = 0; i < count; i++) { \ - if (!NativeData2JS(ccx, ¤t, ((_t*)*s)+i, type, iid, pErr) ||\ - !JS_SetElement(cx, array, i, ¤t)) \ - goto failure; \ - } \ +#define POPULATE(_t) \ + PR_BEGIN_MACRO \ + for (i = 0; i < count; i++) { \ + if (!NativeData2JS(ccx, current.address(), ((_t*)*s)+i, type, iid, pErr) || \ + !JS_SetElement(cx, array, i, current.address())) \ + goto failure; \ + } \ PR_END_MACRO // XXX check IsPtr - esp. to handle array of nsID (as opposed to nsID*) diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index d4a47e6cbe5f..def5886c3029 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -232,9 +232,6 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, if (!JS_GetPropertyById(cx, jsobj, funid, fun.address()) || JSVAL_IS_PRIMITIVE(fun)) return nullptr; - // protect fun so that we're sure it's alive when we call it - AUTO_MARK_JSVAL(cx, fun); - // Ensure that we are asking for a scriptable interface. // NB: It's important for security that this check is here rather // than later, since it prevents untrusted objects from implementing @@ -271,7 +268,6 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, "JS failed without setting an exception!"); RootedValue jsexception(cx, NullValue()); - AUTO_MARK_JSVAL(cx, jsexception.address()); if (JS_GetPendingException(cx, jsexception.address())) { nsresult rv; @@ -716,12 +712,9 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self, } // check if the JSObject claims to implement this interface - JSObject* jsobj = CallQueryInterfaceOnJSObject(ccx, self->GetJSObject(), - aIID); + RootedObject jsobj(ccx, CallQueryInterfaceOnJSObject(ccx, self->GetJSObject(), + aIID)); if (jsobj) { - // protect jsobj until it is actually attached - AUTO_MARK_JSVAL(ccx, OBJECT_TO_JSVAL(jsobj)); - // We can't use XPConvert::JSObject2NativeInterface() here // since that can find a XPCWrappedNative directly on the // proto chain, and we don't want that here. We need to find @@ -1291,8 +1284,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex, nsXPTType datum_type; uint32_t array_count; bool isArray = type.IsArray(); - RootedValue val(cx, JSVAL_NULL); - AUTO_MARK_JSVAL(ccx, val.address()); + RootedValue val(cx, NullValue()); bool isSizedString = isArray ? false : type.TagPart() == nsXPTType::T_PSTRING_SIZE_IS || diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index dc72f426a50f..b518645259f9 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -503,9 +503,7 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx, RootedObject parent(ccx, Scope->GetGlobalJSObject()); - jsval newParentVal = JSVAL_NULL; - XPCMarkableJSVal newParentVal_markable(&newParentVal); - AutoMarkingJSVal newParentVal_automarker(ccx, &newParentVal_markable); + RootedValue newParentVal(ccx, JSVAL_NULL); JSBool needsSOW = false; JSBool needsCOW = false; @@ -2441,7 +2439,6 @@ CallMethodHelper::GatherAndConvertResults() const nsXPTType& type = paramInfo.GetType(); nsXPTCVariant* dp = GetDispatchParam(i); RootedValue v(mCallContext, NullValue()); - AUTO_MARK_JSVAL(mCallContext, v.address()); uint32_t array_count = 0; nsXPTType datum_type; bool isArray = type.IsArray(); diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index de781293e608..457cf19de90c 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -424,9 +424,6 @@ DefinePropertyIfFound(XPCCallContext& ccx, if (!member->NewFunctionObject(ccx, iface, obj, funval.address())) return false; - // protect funobj until it is actually attached - AUTO_MARK_JSVAL(ccx, funval); - #ifdef off_DEBUG_jband { static int cloneCount = 0; diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index e8e9ee71e9b3..d0aec76d00c8 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -1593,7 +1593,6 @@ nsXPConnect::CreateSandbox(JSContext *cx, nsIPrincipal *principal, *_retval = nullptr; RootedValue rval(cx, JSVAL_VOID); - AUTO_MARK_JSVAL(ccx, rval.address()); SandboxOptions options(cx); nsresult rv = xpc_CreateSandboxObject(cx, rval.address(), principal, options); diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index bcc2d5532602..919f835904c1 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -3856,25 +3856,6 @@ private: MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; -/***************************************************************************/ -class XPCMarkableJSVal -{ -public: - XPCMarkableJSVal(jsval val) : mVal(val), mValPtr(&mVal) {} - XPCMarkableJSVal(jsval *pval) : mVal(JSVAL_VOID), mValPtr(pval) {} - ~XPCMarkableJSVal() {} - void Mark() {} - void TraceJS(JSTracer* trc) - { - JS_CallValueTracer(trc, *mValPtr, "XPCMarkableJSVal"); - } - void AutoTrace(JSTracer* trc) {} -private: - XPCMarkableJSVal(); // not implemented - jsval mVal; - jsval* mValPtr; -}; - /***************************************************************************/ // AutoMarkingPtr is the base class for the various AutoMarking pointer types // below. This system allows us to temporarily protect instances of our garbage @@ -3954,7 +3935,6 @@ typedef TypedAutoMarkingPtr AutoMarkingNativeSetPtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativePtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativeTearOffPtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativeProtoPtr; -typedef TypedAutoMarkingPtr AutoMarkingJSVal; typedef TypedAutoMarkingPtr AutoMarkingNativeScriptableInfoPtr; template @@ -4007,14 +3987,6 @@ class ArrayAutoMarkingPtr : public AutoMarkingPtr typedef ArrayAutoMarkingPtr AutoMarkingNativeInterfacePtrArrayPtr; -#define AUTO_MARK_JSVAL_HELPER2(tok, line) tok##line -#define AUTO_MARK_JSVAL_HELPER(tok, line) AUTO_MARK_JSVAL_HELPER2(tok, line) - -#define AUTO_MARK_JSVAL(cx, val) \ - XPCMarkableJSVal AUTO_MARK_JSVAL_HELPER(_val_,__LINE__)(val); \ - AutoMarkingJSVal AUTO_MARK_JSVAL_HELPER(_automarker_,__LINE__) \ - (cx, &AUTO_MARK_JSVAL_HELPER(_val_,__LINE__)) - /***************************************************************************/ // Allocates a string that grants all access ("AllAccess") From 7251a7a7f42d388e15d7239cf6481e60414dd5cb Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Tue, 16 Apr 2013 15:47:41 +0200 Subject: [PATCH 012/438] Bug 815905 - Dynamically open OpenSLES libary if available. r=jesup --- configure.in | 15 ----- .../android/audio_device_opensles_android.cc | 61 +++++++++++++++---- .../android/audio_device_opensles_android.h | 9 +++ 3 files changed, 59 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index da9746f4e9d9..965ae39e4545 100644 --- a/configure.in +++ b/configure.in @@ -5316,21 +5316,6 @@ if test -n "$MOZ_WEBRTC"; then MOZ_VP8_ENCODER=1 MOZ_VP8_ERROR_CONCEALMENT=1 - if test "$MOZ_WIDGET_TOOLKIT" != "gonk"; then - dnl OpenSLES is only available in Android 2.3 and later; we'll change this - dnl hard dependency to a dynamic load with graceful runtime failure before - dnl we make --enable-webrtc on by default in Android (bug 815905) - dnl - if test "$OS_TARGET" = "Android"; then - LDFLAGS="$LDFLAGS -lOpenSLES" - fi - case "$target" in - *-android*|*-linuxandroid*) - LDFLAGS="$LDFLAGS -lOpenSLES" - ;; - esac - fi - dnl enable once Signaling lands MOZ_WEBRTC_SIGNALING=1 AC_DEFINE(MOZ_WEBRTC_SIGNALING) diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc index e1f36846eb74..1b0e32f10399 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include "modules/audio_device/audio_device_utility.h" #include "system_wrappers/interface/event_wrapper.h" @@ -70,7 +71,8 @@ AudioDeviceAndroidOpenSLES::AudioDeviceAndroidOpenSLES(const WebRtc_Word32 id) speaker_sampling_rate_(N_PLAY_SAMPLES_PER_SEC * 1000), max_speaker_vol_(0), min_speaker_vol_(0), - loundspeaker_on_(false) { + loundspeaker_on_(false), + opensles_lib_(0) { WEBRTC_OPENSL_TRACE(kTraceMemory, kTraceAudioDevice, id, "%s created", __FUNCTION__); memset(rec_buf_, 0, sizeof(rec_buf_)); @@ -115,11 +117,46 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::Init() { if (is_initialized_) return 0; + /* Try to dynamically open the OpenSLES library */ + opensles_lib_ = dlopen("libOpenSLES.so", RTLD_LAZY); + if (!opensles_lib_) { + WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, + " failed to dlopen OpenSLES library"); + return -1; + } + + typedef SLresult (*slCreateEngine_t)(SLObjectItf *, + SLuint32, + const SLEngineOption *, + SLuint32, + const SLInterfaceID *, + const SLboolean *); + slCreateEngine_t f_slCreateEngine = + (slCreateEngine_t)dlsym(opensles_lib_, "slCreateEngine"); + SL_IID_ENGINE_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_ENGINE"); + SL_IID_BUFFERQUEUE_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_BUFFERQUEUE"); + SL_IID_ANDROIDCONFIGURATION_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_ANDROIDCONFIGURATION"); + SL_IID_PLAY_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_PLAY"); + SL_IID_ANDROIDSIMPLEBUFFERQUEUE_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_ANDROIDSIMPLEBUFFERQUEUE"); + SL_IID_RECORD_ = *(SLInterfaceID *)dlsym(opensles_lib_, "SL_IID_RECORD"); + + if (!f_slCreateEngine || + !SL_IID_ENGINE_ || + !SL_IID_BUFFERQUEUE_ || + !SL_IID_ANDROIDCONFIGURATION_ || + !SL_IID_PLAY_ || + !SL_IID_ANDROIDSIMPLEBUFFERQUEUE_ || + !SL_IID_RECORD_) { + WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, + " failed to find OpenSLES function"); + return -1; + } + SLEngineOption EngineOption[] = { { SL_ENGINEOPTION_THREADSAFE, static_cast(SL_BOOLEAN_TRUE) }, }; - WebRtc_Word32 res = slCreateEngine(&sles_engine_, 1, EngineOption, 0, - NULL, NULL); + WebRtc_Word32 res = f_slCreateEngine(&sles_engine_, 1, EngineOption, 0, + NULL, NULL); if (res != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, @@ -137,7 +174,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::Init() { if ((*sles_engine_)->GetInterface( sles_engine_, - SL_IID_ENGINE, + SL_IID_ENGINE_, &sles_engine_itf_) != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, " failed to get SL Engine interface"); @@ -190,6 +227,8 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::Terminate() { sles_engine_itf_ = NULL; } + dlclose(opensles_lib_); + is_initialized_ = false; return 0; } @@ -285,7 +324,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::SetSpeakerVolume( if (sles_engine_itf_ == NULL) { if ((*sles_engine_)->GetInterface( sles_engine_, - SL_IID_ENGINE, + SL_IID_ENGINE_, &sles_engine_itf_) != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, " failed to GetInterface SL Engine Interface"); @@ -726,7 +765,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitPlayout() { locator_outputmix.outputMix = sles_output_mixer_; SLInterfaceID ids[N_MAX_INTERFACES] = { - SL_IID_BUFFERQUEUE, SL_IID_ANDROIDCONFIGURATION }; + SL_IID_BUFFERQUEUE_, SL_IID_ANDROIDCONFIGURATION_ }; SLboolean req[N_MAX_INTERFACES] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE }; res = (*sles_engine_itf_)->CreateAudioPlayer(sles_engine_itf_, @@ -746,7 +785,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitPlayout() { return -1; } res = (*sles_player_)->GetInterface( - sles_player_, SL_IID_PLAY, + sles_player_, SL_IID_PLAY_, static_cast(&sles_player_itf_)); if (res != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, @@ -754,7 +793,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitPlayout() { return -1; } res = (*sles_player_)->GetInterface( - sles_player_, SL_IID_BUFFERQUEUE, + sles_player_, SL_IID_BUFFERQUEUE_, static_cast(&sles_player_sbq_itf_)); if (res != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, @@ -846,7 +885,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() { record_pcm_.endianness = SL_BYTEORDER_LITTLEENDIAN; const SLInterfaceID id[2] = { - SL_IID_ANDROIDSIMPLEBUFFERQUEUE, SL_IID_ANDROIDCONFIGURATION }; + SL_IID_ANDROIDSIMPLEBUFFERQUEUE_, SL_IID_ANDROIDCONFIGURATION_ }; const SLboolean req[2] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE }; WebRtc_Word32 res = -1; @@ -873,7 +912,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() { // Get the RECORD interface - it is an implicit interface res = (*sles_recorder_)->GetInterface( - sles_recorder_, SL_IID_RECORD, + sles_recorder_, SL_IID_RECORD_, static_cast(&sles_recorder_itf_)); if (res != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, @@ -884,7 +923,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() { // Get the simpleBufferQueue interface res = (*sles_recorder_)->GetInterface( sles_recorder_, - SL_IID_ANDROIDSIMPLEBUFFERQUEUE, + SL_IID_ANDROIDSIMPLEBUFFERQUEUE_, static_cast(&sles_recorder_sbq_itf_)); if (res != SL_RESULT_SUCCESS) { WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_, diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h index eb1603b6c0fb..cc53727411ab 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h @@ -310,6 +310,15 @@ class AudioDeviceAndroidOpenSLES: public AudioDeviceGeneric { std::queue play_queue_; WebRtc_Word8 play_buf_[N_PLAY_QUEUE_BUFFERS][ N_PLAY_CHANNELS * sizeof(int16_t) * PLAY_BUF_SIZE_IN_SAMPLES]; + + // dlopen for OpenSLES + void *opensles_lib_; + SLInterfaceID SL_IID_ENGINE_; + SLInterfaceID SL_IID_BUFFERQUEUE_; + SLInterfaceID SL_IID_ANDROIDCONFIGURATION_; + SLInterfaceID SL_IID_PLAY_; + SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE_; + SLInterfaceID SL_IID_RECORD_; }; } // namespace webrtc From 51b126dfa1f98838efd1f1fdfd6acbd7b70a5bfb Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Tue, 16 Apr 2013 15:47:41 +0200 Subject: [PATCH 013/438] Bug 815905 - Provide JNI as a fallback if OpenSLES opening fails. r=jesup --- .../android/audio_device_jni_android.h | 17 +++--- .../android/audio_device_opensles_android.h | 60 +++++++++---------- .../modules/audio_device/audio_device.gypi | 17 ++---- .../modules/audio_device/audio_device_impl.cc | 51 +++++++++------- 4 files changed, 71 insertions(+), 74 deletions(-) diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_jni_android.h b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_jni_android.h index b8186bea54e4..d7e713544612 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_jni_android.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_jni_android.h @@ -24,15 +24,6 @@ namespace webrtc { class EventWrapper; -const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default is 16 kHz -const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default is 16 kHz - -const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording -const WebRtc_UWord32 N_PLAY_CHANNELS = 1; // default is mono playout - -const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480; // Handle max 10 ms @ 48 kHz - - class ThreadWrapper; class AudioDeviceAndroidJni : public AudioDeviceGeneric { @@ -159,6 +150,14 @@ class AudioDeviceAndroidJni : public AudioDeviceGeneric { virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable); virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enable) const; + static const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default is 16 kHz + static const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default is 16 kHz + + static const WebRtc_UWord32 N_REC_CHANNELS = 1; // default is mono recording + static const WebRtc_UWord32 N_PLAY_CHANNELS = 1; // default is mono playout + + static const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480; // Handle max 10 ms @ 48 kHz + private: // Lock void Lock() { diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h index cc53727411ab..26f686b2f207 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h @@ -28,36 +28,6 @@ namespace webrtc { class EventWrapper; -const WebRtc_UWord32 N_MAX_INTERFACES = 3; -const WebRtc_UWord32 N_MAX_OUTPUT_DEVICES = 6; -const WebRtc_UWord32 N_MAX_INPUT_DEVICES = 3; - -const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default fs -const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default fs - -const WebRtc_UWord32 N_REC_CHANNELS = 1; -const WebRtc_UWord32 N_PLAY_CHANNELS = 1; - -const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480; -const WebRtc_UWord32 PLAY_BUF_SIZE_IN_SAMPLES = 480; - -const WebRtc_UWord32 REC_MAX_TEMP_BUF_SIZE_PER_10ms = - N_REC_CHANNELS * REC_BUF_SIZE_IN_SAMPLES * sizeof(int16_t); - -const WebRtc_UWord32 PLAY_MAX_TEMP_BUF_SIZE_PER_10ms = - N_PLAY_CHANNELS * PLAY_BUF_SIZE_IN_SAMPLES * sizeof(int16_t); - -// Number of the buffers in playout queue -const WebRtc_UWord16 N_PLAY_QUEUE_BUFFERS = 8; -// Number of buffers in recording queue -// TODO(xian): Reduce the numbers of buffers to improve the latency. -const WebRtc_UWord16 N_REC_QUEUE_BUFFERS = 16; -// Some values returned from getMinBufferSize -// (Nexus S playout 72ms, recording 64ms) -// (Galaxy, 167ms, 44ms) -// (Nexus 7, 72ms, 48ms) -// (Xoom 92ms, 40ms) - class ThreadWrapper; class AudioDeviceAndroidOpenSLES: public AudioDeviceGeneric { @@ -211,6 +181,36 @@ class AudioDeviceAndroidOpenSLES: public AudioDeviceGeneric { virtual WebRtc_Word32 SetLoudspeakerStatus(bool enable); virtual WebRtc_Word32 GetLoudspeakerStatus(bool& enable) const; // NOLINT + static const WebRtc_UWord32 N_MAX_INTERFACES = 3; + static const WebRtc_UWord32 N_MAX_OUTPUT_DEVICES = 6; + static const WebRtc_UWord32 N_MAX_INPUT_DEVICES = 3; + + static const WebRtc_UWord32 N_REC_SAMPLES_PER_SEC = 16000; // Default fs + static const WebRtc_UWord32 N_PLAY_SAMPLES_PER_SEC = 16000; // Default fs + + static const WebRtc_UWord32 N_REC_CHANNELS = 1; + static const WebRtc_UWord32 N_PLAY_CHANNELS = 1; + + static const WebRtc_UWord32 REC_BUF_SIZE_IN_SAMPLES = 480; + static const WebRtc_UWord32 PLAY_BUF_SIZE_IN_SAMPLES = 480; + + static const WebRtc_UWord32 REC_MAX_TEMP_BUF_SIZE_PER_10ms = + N_REC_CHANNELS * REC_BUF_SIZE_IN_SAMPLES * sizeof(int16_t); + + static const WebRtc_UWord32 PLAY_MAX_TEMP_BUF_SIZE_PER_10ms = + N_PLAY_CHANNELS * PLAY_BUF_SIZE_IN_SAMPLES * sizeof(int16_t); + + // Number of the buffers in playout queue + static const WebRtc_UWord16 N_PLAY_QUEUE_BUFFERS = 8; + // Number of buffers in recording queue + // TODO(xian): Reduce the numbers of buffers to improve the latency. + static const WebRtc_UWord16 N_REC_QUEUE_BUFFERS = 16; + // Some values returned from getMinBufferSize + // (Nexus S playout 72ms, recording 64ms) + // (Galaxy, 167ms, 44ms) + // (Nexus 7, 72ms, 48ms) + // (Xoom 92ms, 40ms) + private: // Lock void Lock() { diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi index 640f732c3066..5923da799cf9 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi @@ -110,6 +110,10 @@ 'win/audio_mixer_manager_win.h', 'android/audio_device_utility_android.cc', 'android/audio_device_utility_android.h', + 'android/audio_device_opensles_android.cc', + 'android/audio_device_opensles_android.h', + 'android/audio_device_jni_android.cc', + 'android/audio_device_jni_android.h', ], 'conditions': [ ['OS=="android"', { @@ -119,19 +123,6 @@ '-lOpenSLES', ], }, - 'conditions': [ - ['enable_android_opensl==1', { - 'sources': [ - 'android/audio_device_opensles_android.cc', - 'android/audio_device_opensles_android.h', - ], - }, { - 'sources': [ - 'android/audio_device_jni_android.cc', - 'android/audio_device_jni_android.h', - ], - }], - ], }], ['OS=="linux"', { 'defines': [ diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc index c7c87e66f3da..3f642bbaffba 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc @@ -24,8 +24,10 @@ #endif #elif defined(WEBRTC_ANDROID_OPENSLES) #include + #include #include "audio_device_utility_android.h" #include "audio_device_opensles_android.h" + #include "audio_device_jni_android.h" #elif defined(WEBRTC_ANDROID) #include #include "audio_device_utility_android.h" @@ -259,12 +261,18 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects() // Create the *Android OpenSLES* implementation of the Audio Device // #if defined(WEBRTC_ANDROID_OPENSLES) - if (audioLayer == kPlatformDefaultAudio) - { - // Create *Android OpenELSE Audio* implementation - ptrAudioDevice = new AudioDeviceAndroidOpenSLES(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Android OpenSLES Audio APIs will be utilized"); + // Check if the OpenSLES library is available before going further. + void* opensles_lib = dlopen("libOpenSLES.so", RTLD_LAZY); + if (opensles_lib) { + // That worked, close for now and proceed normally. + dlclose(opensles_lib); + if (audioLayer == kPlatformDefaultAudio) + { + // Create *Android OpenSLES Audio* implementation + ptrAudioDevice = new AudioDeviceAndroidOpenSLES(Id()); + WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, + "Android OpenSLES Audio APIs will be utilized"); + } } if (ptrAudioDevice != NULL) @@ -272,25 +280,24 @@ WebRtc_Word32 AudioDeviceModuleImpl::CreatePlatformSpecificObjects() // Create the Android implementation of the Device Utility. ptrAudioDeviceUtility = new AudioDeviceUtilityAndroid(Id()); } - // END #if defined(WEBRTC_ANDROID_OPENSLES) +#elif defined(WEBRTC_ANDROID_OPENSLES) or defined(WEBRTC_ANDROID) + // Fall back to this case if on Android 2.2/OpenSLES not available. + if (ptrAudioDevice == NULL) { + // Create the *Android Java* implementation of the Audio Device + if (audioLayer == kPlatformDefaultAudio) + { + // Create *Android JNI Audio* implementation + ptrAudioDevice = new AudioDeviceAndroidJni(Id()); + WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "Android JNI Audio APIs will be utilized"); + } - // Create the *Android Java* implementation of the Audio Device - // -#elif defined(WEBRTC_ANDROID) - if (audioLayer == kPlatformDefaultAudio) - { - // Create *Android JNI Audio* implementation - ptrAudioDevice = new AudioDeviceAndroidJni(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "Android JNI Audio APIs will be utilized"); + if (ptrAudioDevice != NULL) + { + // Create the Android implementation of the Device Utility. + ptrAudioDeviceUtility = new AudioDeviceUtilityAndroid(Id()); + } } - if (ptrAudioDevice != NULL) - { - // Create the Android implementation of the Device Utility. - ptrAudioDeviceUtility = new AudioDeviceUtilityAndroid(Id()); - } - // END #if defined(WEBRTC_ANDROID) - // Create the *Linux* implementation of the Audio Device // #elif defined(WEBRTC_LINUX) From 107dbb3b07dfb6598f9082e5e9b7e3dedc522243 Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Tue, 16 Apr 2013 15:47:41 +0200 Subject: [PATCH 014/438] Bug 861146 - Provide pthread_rwlock replacement for Android 2.2. r=jesup --- .../webrtc/trunk/webrtc/system_wrappers/source/rw_lock.cc | 7 ++++++- .../webrtc/system_wrappers/source/system_wrappers.gyp | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock.cc index 8b76eb86147d..d409e7476598 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock.cc @@ -15,6 +15,8 @@ #if defined(_WIN32) #include "webrtc/system_wrappers/source/rw_lock_generic.h" #include "webrtc/system_wrappers/source/rw_lock_win.h" +#elif defined(ANDROID) +#include "webrtc/system_wrappers/source/rw_lock_generic.h" #else #include "webrtc/system_wrappers/source/rw_lock_posix.h" #endif @@ -22,13 +24,16 @@ namespace webrtc { RWLockWrapper* RWLockWrapper::CreateRWLock() { -#ifdef _WIN32 +#if defined(_WIN32) // Native implementation is faster, so use that if available. RWLockWrapper* lock = RWLockWin::Create(); if (lock) { return lock; } return new RWLockGeneric(); +#elif defined(ANDROID) + // Android 2.2 and before do not have POSIX pthread rwlocks. + return new RWLockGeneric(); #else return RWLockPosix::Create(); #endif diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers.gyp b/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers.gyp index 0aff7dfb3364..23664d4f0249 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers.gyp +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers.gyp @@ -138,6 +138,11 @@ }], ['OS=="android" or moz_widget_toolkit_gonk==1', { 'dependencies': [ 'cpu_features_android', ], + 'sources!': [ + # Android doesn't have these in <=2.2 + 'rw_lock_posix.cc', + 'rw_lock_posix.h', + ], }], ['OS=="linux"', { 'link_settings': { From 9d6819b3922d45ccb77cacf1eb4ef335c2014085 Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Tue, 16 Apr 2013 15:47:41 +0200 Subject: [PATCH 015/438] Bug 861637 - Add workaround for missing clone function. r=blassey --- .../src/testing/gtest/include/gtest/internal/gtest-port.h | 6 +++--- .../trunk/testing/gtest/include/gtest/internal/gtest-port.h | 6 +++--- testing/gtest/gtest/include/gtest/internal/gtest-port.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h b/ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h index c3d34f6cf27d..a15f01f98d01 100644 --- a/ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h +++ b/ipc/chromium/src/testing/gtest/include/gtest/internal/gtest-port.h @@ -367,16 +367,16 @@ // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. +// Linux on the Itanium architecture, and x86 Android. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out. -#if GTEST_OS_LINUX && !defined(__ia64__) +#if GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) #define GTEST_HAS_CLONE 1 #else #define GTEST_HAS_CLONE 0 -#endif // GTEST_OS_LINUX && !defined(__ia64__) +#endif // GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) #endif // GTEST_HAS_CLONE diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h index e5a455186d36..2432fd624339 100644 --- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h +++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h @@ -572,16 +572,16 @@ using ::std::tuple_size; // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. +// Linux on the Itanium architecture, and x86 Android. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out. -# if GTEST_OS_LINUX && !defined(__ia64__) +# if GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) +# endif // GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) #endif // GTEST_HAS_CLONE diff --git a/testing/gtest/gtest/include/gtest/internal/gtest-port.h b/testing/gtest/gtest/include/gtest/internal/gtest-port.h index 157b47f86a39..ba39a9c19304 100644 --- a/testing/gtest/gtest/include/gtest/internal/gtest-port.h +++ b/testing/gtest/gtest/include/gtest/internal/gtest-port.h @@ -509,16 +509,16 @@ // Determines whether clone(2) is supported. // Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. +// Linux on the Itanium architecture, and x86 Android. // Also see http://linux.die.net/man/2/clone. #ifndef GTEST_HAS_CLONE // The user didn't tell us, so we need to figure it out. -# if GTEST_OS_LINUX && !defined(__ia64__) +# if GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) # define GTEST_HAS_CLONE 1 # else # define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) +# endif // GTEST_OS_LINUX && !defined(__ia64__) && !(defined(ANDROID) && defined(__i386__)) #endif // GTEST_HAS_CLONE From 2da9da464a6f676879f76593b24f66979d1f98a3 Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Tue, 16 Apr 2013 15:47:42 +0200 Subject: [PATCH 016/438] Bug 835716 - Enable building of WebRTC on Android by default. r=ted --- configure.in | 10 +--------- mobile/android/app/mobile.js | 4 ++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 965ae39e4545..af24709aeb45 100644 --- a/configure.in +++ b/configure.in @@ -5255,15 +5255,7 @@ dnl --enable-webrtc to override. Can disable for everything in dnl the master list above. if test -n "$MOZ_WEBRTC"; then case "$target" in - *-android*|*-linuxandroid*) - if test -n "$MOZ_B2G"; then - MOZ_WEBRTC=1 - else - dnl Make sure doesn't get matched by *-linux* - MOZ_WEBRTC= - fi - ;; - *-linux*|*-mingw*|*-darwin*) + *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*) dnl Leave enabled ;; *) diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 2ee9b0c7297c..4a9b191960e2 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -705,3 +705,7 @@ pref("browser.contentHandlers.types.3.type", "application/vnd.mozilla.maybe.feed // Enable Web Audio for Firefox for Android in Nightly and Aurora pref("media.webaudio.enabled", true); #endif + +// This needs more tests and stability fixes first, as well as UI. +pref("media.navigator.enabled", false); +pref("media.peerconnection.enabled", false); From 8b8c5084a549b5c56f480e7d06cd803792e9b3b7 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 16 Apr 2013 15:20:37 +0100 Subject: [PATCH 017/438] Bug 851782 - Dispatch an 'input' event when the 'type' of an is changed while a user is dragging its thumb. r=smaug --- content/html/content/src/HTMLInputElement.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/HTMLInputElement.cpp b/content/html/content/src/HTMLInputElement.cpp index 3cfc2e285ebd..70062b936465 100644 --- a/content/html/content/src/HTMLInputElement.cpp +++ b/content/html/content/src/HTMLInputElement.cpp @@ -7,6 +7,7 @@ #include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/HTMLInputElementBinding.h" +#include "nsAsyncDOMEvent.h" #include "nsAttrValueInlines.h" #include "nsIDOMHTMLInputElement.h" @@ -2715,6 +2716,7 @@ HTMLInputElement::CancelRangeThumbDrag(bool aIsForUserEvent) { MOZ_ASSERT(mIsDraggingRange); + mIsDraggingRange = false; if (nsIPresShell::GetCapturingContent() == this) { nsIPresShell::SetCapturingContent(nullptr, 0); // cancel capture } @@ -2731,8 +2733,10 @@ HTMLInputElement::CancelRangeThumbDrag(bool aIsForUserEvent) if (frame) { frame->UpdateForValueChange(); } + nsRefPtr event = + new nsAsyncDOMEvent(this, NS_LITERAL_STRING("input"), true, false); + event->RunDOMEventWhenSafe(); } - mIsDraggingRange = false; } void From c309d5712a84c8f516db60f00ac7400f1de5a568 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Tue, 16 Apr 2013 16:03:46 +0300 Subject: [PATCH 018/438] Bug 847596 - Paris binding for DeviceMotionEvent, r=peterv --HG-- extra : rebase_source : 7cbf9ac11b81506a2ffe0a5c3a34ecb78fe54f5b --- content/events/src/nsDOMDeviceMotionEvent.cpp | 31 +++++++++++-- content/events/src/nsDOMDeviceMotionEvent.h | 39 +++++++++++++++- content/events/test/test_bug662678.html | 45 ++++++++++++++----- dom/bindings/Bindings.conf | 6 +++ dom/webidl/DeviceMotionEvent.webidl | 26 +++++++++++ dom/webidl/WebIDL.mk | 1 + 6 files changed, 132 insertions(+), 16 deletions(-) create mode 100644 dom/webidl/DeviceMotionEvent.webidl diff --git a/content/events/src/nsDOMDeviceMotionEvent.cpp b/content/events/src/nsDOMDeviceMotionEvent.cpp index a2e8884fb690..4ab8645cd503 100644 --- a/content/events/src/nsDOMDeviceMotionEvent.cpp +++ b/content/events/src/nsDOMDeviceMotionEvent.cpp @@ -5,6 +5,9 @@ #include "nsDOMClassInfoID.h" #include "nsDOMDeviceMotionEvent.h" +using namespace mozilla; +using namespace mozilla::dom; + NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent) NS_IMPL_CYCLE_COLLECTION_UNLINK(mAcceleration) NS_IMPL_CYCLE_COLLECTION_UNLINK(mAccelerationIncludingGravity) @@ -46,12 +49,31 @@ nsDOMDeviceMotionEvent::InitDeviceMotionEvent(const nsAString & aEventTypeArg, return NS_OK; } +void +nsDOMDeviceMotionEvent::InitDeviceMotionEvent(const nsAString& aType, + bool aCanBubble, + bool aCancelable, + nsIDOMDeviceAcceleration* aAcceleration, + nsIDOMDeviceAcceleration* aAccelerationIncludingGravity, + nsIDOMDeviceRotationRate* aRotationRate, + double aInterval, + ErrorResult& aRv) +{ + aRv = InitDeviceMotionEvent(aType, + aCanBubble, + aCancelable, + aAcceleration, + aAccelerationIncludingGravity, + aRotationRate, + aInterval); +} + NS_IMETHODIMP nsDOMDeviceMotionEvent::GetAcceleration(nsIDOMDeviceAcceleration **aAcceleration) { NS_ENSURE_ARG_POINTER(aAcceleration); - NS_IF_ADDREF(*aAcceleration = mAcceleration); + NS_IF_ADDREF(*aAcceleration = GetAcceleration()); return NS_OK; } @@ -60,7 +82,8 @@ nsDOMDeviceMotionEvent::GetAccelerationIncludingGravity(nsIDOMDeviceAcceleration { NS_ENSURE_ARG_POINTER(aAccelerationIncludingGravity); - NS_IF_ADDREF(*aAccelerationIncludingGravity = mAccelerationIncludingGravity); + NS_IF_ADDREF(*aAccelerationIncludingGravity = + GetAccelerationIncludingGravity()); return NS_OK; } @@ -69,7 +92,7 @@ nsDOMDeviceMotionEvent::GetRotationRate(nsIDOMDeviceRotationRate **aRotationRate { NS_ENSURE_ARG_POINTER(aRotationRate); - NS_IF_ADDREF(*aRotationRate = mRotationRate); + NS_IF_ADDREF(*aRotationRate = GetRotationRate()); return NS_OK; } @@ -78,7 +101,7 @@ nsDOMDeviceMotionEvent::GetInterval(double *aInterval) { NS_ENSURE_ARG_POINTER(aInterval); - *aInterval = mInterval; + *aInterval = Interval(); return NS_OK; } diff --git a/content/events/src/nsDOMDeviceMotionEvent.h b/content/events/src/nsDOMDeviceMotionEvent.h index 7aa4667c3313..d68e04e22366 100644 --- a/content/events/src/nsDOMDeviceMotionEvent.h +++ b/content/events/src/nsDOMDeviceMotionEvent.h @@ -8,6 +8,7 @@ #include "nsIDOMDeviceMotionEvent.h" #include "nsDOMEvent.h" #include "mozilla/Attributes.h" +#include "mozilla/dom/DeviceMotionEventBinding.h" class nsDOMDeviceRotationRate MOZ_FINAL : public nsIDOMDeviceRotationRate { @@ -47,7 +48,9 @@ public: nsDOMDeviceMotionEvent(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, nsEvent* aEvent) : nsDOMEvent(aOwner, aPresContext, aEvent) - {} + { + SetIsDOMBinding(); + } NS_DECL_ISUPPORTS_INHERITED @@ -59,6 +62,40 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDeviceMotionEvent, nsDOMEvent) + virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) + { + return mozilla::dom::DeviceMotionEventBinding::Wrap(aCx, aScope, this); + } + + nsIDOMDeviceAcceleration* GetAcceleration() + { + return mAcceleration; + } + + nsIDOMDeviceAcceleration* GetAccelerationIncludingGravity() + { + return mAccelerationIncludingGravity; + } + + nsIDOMDeviceRotationRate* GetRotationRate() + { + return mRotationRate; + } + + double Interval() const + { + return mInterval; + } + + void InitDeviceMotionEvent(const nsAString& aType, + bool aCanBubble, + bool aCancelable, + nsIDOMDeviceAcceleration* aAcceleration, + nsIDOMDeviceAcceleration* aAccelerationIncludingGravity, + nsIDOMDeviceRotationRate* aRotationRate, + double aInterval, + mozilla::ErrorResult& aRv); + nsCOMPtr mAcceleration; nsCOMPtr mAccelerationIncludingGravity; nsCOMPtr mRotationRate; diff --git a/content/events/test/test_bug662678.html b/content/events/test/test_bug662678.html index dfcf5dcf8452..9784e4998005 100644 --- a/content/events/test/test_bug662678.html +++ b/content/events/test/test_bug662678.html @@ -24,16 +24,39 @@ var checkMotion = function(event) { window.removeEventListener("devicemotion", checkMotion, true); is(event.acceleration.x, 1.5); - is(event.acceleration.y, 1.5); - is(event.acceleration.z, 1.5); + is(event.acceleration.y, 2.5); + is(event.acceleration.z, 3.5); - is(event.accelerationIncludingGravity.x, 1.5); - is(event.accelerationIncludingGravity.y, 1.5); - is(event.accelerationIncludingGravity.z, 1.5); + is(event.accelerationIncludingGravity.x, 4.5); + is(event.accelerationIncludingGravity.y, 5.5); + is(event.accelerationIncludingGravity.z, 6.5); + + is(event.rotationRate.alpha, 7.5); + is(event.rotationRate.beta, 8.5); + is(event.rotationRate.gamma, 9.5); + + var e = document.createEvent("DeviceMotionEvent"); + e.initDeviceMotionEvent('devicemotion', true, true, + null, null, null, 0); + is(e.acceleration, null); + is(e.accelerationIncludingGravity, null); + is(e.rotationRate, null); + + e.initDeviceMotionEvent('devicemotion', true, true, + {}, {}, {}, 0); + + ok(isNaN(e.acceleration.x)); + ok(isNaN(e.acceleration.y)); + ok(isNaN(e.acceleration.z)); + + ok(isNaN(e.accelerationIncludingGravity.x)); + ok(isNaN(e.accelerationIncludingGravity.y)); + ok(isNaN(e.accelerationIncludingGravity.z)); + + ok(isNaN(e.rotationRate.alpha)); + ok(isNaN(e.rotationRate.beta)); + ok(isNaN(e.rotationRate.gamma)); - is(event.rotationRate.alpha, 1.5); - is(event.rotationRate.beta, 1.5); - is(event.rotationRate.gamma, 1.5); SimpleTest.finish(); }; @@ -44,9 +67,9 @@ ok(!!event, "Should have seen DeviceMotionEvent!"); event = document.createEvent("DeviceMotionEvent"); event.initDeviceMotionEvent('devicemotion', true, true, - {x:1.5,y:1.5,z:1.5}, - {x:1.5,y:1.5,z:1.5}, - {alpha:1.5,beta:1.5,gamma:1.5}, + {x:1.5,y:2.5,z:3.5}, + {x:4.5,y:5.5,z:6.5}, + {alpha:7.5,beta:8.5,gamma:9.5}, 0); window.dispatchEvent(event); diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 2d3081bb3bc2..a7b2ae1a6d2d 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -229,6 +229,10 @@ DOMInterfaces = { 'headerFile': 'mozilla/dom/DesktopNotification.h', }, +'DeviceMotionEvent': { + 'nativeType': 'nsDOMDeviceMotionEvent', +}, + 'Document': [ { 'nativeType': 'nsIDocument', @@ -1472,6 +1476,8 @@ addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h' addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h') addExternalIface('Counter') addExternalIface('CSSRule') +addExternalIface('DeviceAcceleration', headerFile='nsIDOMDeviceMotionEvent.h', notflattened=True) +addExternalIface('DeviceRotationRate', headerFile='nsIDOMDeviceMotionEvent.h', notflattened=True) addExternalIface('DOMError') addExternalIface('CSSRuleList') addExternalIface('DOMStringList') diff --git a/dom/webidl/DeviceMotionEvent.webidl b/dom/webidl/DeviceMotionEvent.webidl new file mode 100644 index 000000000000..a8bd4caf8aa5 --- /dev/null +++ b/dom/webidl/DeviceMotionEvent.webidl @@ -0,0 +1,26 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. + */ + +interface DeviceAcceleration; +interface DeviceRotationRate; + +interface DeviceMotionEvent : Event +{ + [Throws] + void initDeviceMotionEvent(DOMString type, + boolean canBubble, + boolean cancelable, + DeviceAcceleration? acceleration, + DeviceAcceleration? accelerationIncludingGravity, + DeviceRotationRate? rotationRate, + double interval); + + readonly attribute DeviceAcceleration? acceleration; + readonly attribute DeviceAcceleration? accelerationIncludingGravity; + readonly attribute DeviceRotationRate? rotationRate; + readonly attribute double interval; +}; + diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk index 785b44caf262..e3be80f1894f 100644 --- a/dom/webidl/WebIDL.mk +++ b/dom/webidl/WebIDL.mk @@ -46,6 +46,7 @@ webidl_files = \ CSSValueList.webidl \ DelayNode.webidl \ DesktopNotification.webidl \ + DeviceMotionEvent.webidl \ Document.webidl \ DocumentFragment.webidl \ DocumentType.webidl \ From f4e6aab5268c73f81a9e5e3175def3d908ad2133 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Fri, 29 Mar 2013 15:34:49 -0400 Subject: [PATCH 019/438] Bug 734691 - Add multi-thread support to profiler r=benwa --HG-- extra : rebase_source : 71db00ee222713fd60ba42be14226b52535a4f1e --- dom/workers/RuntimeService.cpp | 5 ++ ipc/chromium/src/base/thread.cc | 5 ++ tools/profiler/BreakpadSampler.cpp | 15 +++-- tools/profiler/GeckoProfiler.h | 3 + tools/profiler/GeckoProfilerFunc.h | 4 ++ tools/profiler/GeckoProfilerImpl.h | 13 ++++ tools/profiler/ProfileEntry.cpp | 10 ++- tools/profiler/ProfileEntry.h | 11 +++- tools/profiler/TableTicker.cpp | 54 ++++++++++------ tools/profiler/TableTicker.h | 62 ++++++++++++++++-- tools/profiler/platform-linux.cc | 100 +++++++++++++++++++++++------ tools/profiler/platform-macos.cc | 39 +++++++++-- tools/profiler/platform-win32.cc | 40 ++++++++++-- tools/profiler/platform.cpp | 31 ++++++++- tools/profiler/platform.h | 66 ++++++++++++++++++- 15 files changed, 395 insertions(+), 63 deletions(-) diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 070f739dce2d..fdfd21a2f0f2 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -42,6 +42,8 @@ #include "OSFileConstants.h" #include +#include "GeckoProfiler.h" + using namespace mozilla; using namespace mozilla::dom; @@ -515,6 +517,8 @@ public: return NS_ERROR_FAILURE; } + profiler_register_thread("WebWorker"); + { JSAutoRequest ar(cx); workerPrivate->DoRunLoop(cx); @@ -543,6 +547,7 @@ public: JS_DestroyRuntime(rt); workerPrivate->ScheduleDeletion(false); + profiler_unregister_thread(); return NS_OK; } }; diff --git a/ipc/chromium/src/base/thread.cc b/ipc/chromium/src/base/thread.cc index f447fbb201eb..31ec62832ec3 100644 --- a/ipc/chromium/src/base/thread.cc +++ b/ipc/chromium/src/base/thread.cc @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "base/thread_local.h" #include "base/waitable_event.h" +#include "GeckoProfiler.h" namespace base { @@ -136,6 +137,8 @@ void Thread::StopSoon() { } void Thread::ThreadMain() { + profiler_register_thread(name_.c_str()); + // The message loop for this thread. MessageLoop message_loop(startup_data_->options.message_loop_type); @@ -161,6 +164,8 @@ void Thread::ThreadMain() { // Assert that MessageLoop::Quit was called by ThreadQuitTask. DCHECK(GetThreadWasQuitProperly()); + profiler_unregister_thread(); + // We can't receive messages anymore. message_loop_ = NULL; thread_id_ = 0; diff --git a/tools/profiler/BreakpadSampler.cpp b/tools/profiler/BreakpadSampler.cpp index bc804e3627f5..d30a55b6ea2f 100644 --- a/tools/profiler/BreakpadSampler.cpp +++ b/tools/profiler/BreakpadSampler.cpp @@ -158,6 +158,13 @@ void genPseudoBacktraceEntries(/*MODIFIED*/UnwinderThreadBuffer* utb, // RUNS IN SIGHANDLER CONTEXT void BreakpadSampler::Tick(TickSample* sample) { + if (!sample->threadProfile) { + // Platform doesn't support multithread, so use the main thread profile we created + sample->threadProfile = GetPrimaryThreadProfile(); + } + + ThreadProfile& currThreadProfile = *sample->threadProfile; + /* Get hold of an empty inter-thread buffer into which to park the ProfileEntries for this sample. */ UnwinderThreadBuffer* utb = uwt__acquire_empty_buffer(); @@ -172,7 +179,7 @@ void BreakpadSampler::Tick(TickSample* sample) thread, and park them in |utb|. */ // Marker(s) come before the sample - PseudoStack* stack = mPrimaryThreadProfile.GetPseudoStack(); + PseudoStack* stack = currThreadProfile.GetPseudoStack(); for (int i = 0; stack->getMarker(i) != NULL; i++) { utb__addEntry( utb, ProfileEntry('m', stack->getMarker(i)) ); } @@ -186,7 +193,7 @@ void BreakpadSampler::Tick(TickSample* sample) // XXX: we also probably want to add an entry to the profile to help // distinguish which samples are part of the same event. That, or record // the event generation in each sample - mPrimaryThreadProfile.erase(); + currThreadProfile.erase(); } sLastSampledEventGeneration = sCurrentEventGeneration; @@ -293,9 +300,9 @@ void BreakpadSampler::Tick(TickSample* sample) # else # error "Unsupported platform" # endif - uwt__release_full_buffer(&mPrimaryThreadProfile, utb, ucV); + uwt__release_full_buffer(&currThreadProfile, utb, ucV); } else { - uwt__release_full_buffer(&mPrimaryThreadProfile, utb, NULL); + uwt__release_full_buffer(&currThreadProfile, utb, NULL); } } diff --git a/tools/profiler/GeckoProfiler.h b/tools/profiler/GeckoProfiler.h index 4c8e2b5452c8..9105f0470ecb 100644 --- a/tools/profiler/GeckoProfiler.h +++ b/tools/profiler/GeckoProfiler.h @@ -135,6 +135,9 @@ static inline void profiler_lock() {} // Re-enable the profiler and notify 'profiler-unlocked'. static inline void profiler_unlock() {} +static inline void profiler_register_thread(const char* name) {} +static inline void profiler_unregister_thread() {} + #else #include "GeckoProfilerImpl.h" diff --git a/tools/profiler/GeckoProfilerFunc.h b/tools/profiler/GeckoProfilerFunc.h index 2c26d8eb8a92..41134bfb5ce7 100644 --- a/tools/profiler/GeckoProfilerFunc.h +++ b/tools/profiler/GeckoProfilerFunc.h @@ -57,6 +57,10 @@ void mozilla_sampler_lock(); // Unlock the profiler, leaving it stopped and fires profiler-unlocked. void mozilla_sampler_unlock(); +// Register/unregister threads with the profiler +bool mozilla_sampler_register_thread(const char* name); +void mozilla_sampler_unregister_thread(); + /* Returns true if env var SPS_NEW is set to anything, else false. */ extern bool sps_version2(); diff --git a/tools/profiler/GeckoProfilerImpl.h b/tools/profiler/GeckoProfilerImpl.h index 917bd04173f7..65a60e2db615 100644 --- a/tools/profiler/GeckoProfilerImpl.h +++ b/tools/profiler/GeckoProfilerImpl.h @@ -140,6 +140,18 @@ void profiler_unlock() return mozilla_sampler_unlock(); } +static inline +void profiler_register_thread(const char* name) +{ + mozilla_sampler_register_thread(name); +} + +static inline +void profiler_unregister_thread() +{ + mozilla_sampler_unregister_thread(); +} + // we want the class and function name but can't easily get that using preprocessor macros // __func__ doesn't have the class name and __PRETTY_FUNCTION__ has the parameters @@ -154,6 +166,7 @@ void profiler_unlock() #define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, ...) MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, __LINE__, __VA_ARGS__) #define PROFILER_MAIN_THREAD_MARKER(info) MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla_sampler_add_marker(info) + /* FIXME/bug 789667: memory constraints wouldn't much of a problem for * this small a sample buffer size, except that serializing the * profile data is extremely, unnecessarily memory intensive. */ diff --git a/tools/profiler/ProfileEntry.cpp b/tools/profiler/ProfileEntry.cpp index d8c74b748217..4435ebf4e9a2 100644 --- a/tools/profiler/ProfileEntry.cpp +++ b/tools/profiler/ProfileEntry.cpp @@ -134,19 +134,23 @@ std::ostream& operator<<(std::ostream& stream, const ProfileEntry& entry) #define DYNAMIC_MAX_STRING 512 -ThreadProfile::ThreadProfile(int aEntrySize, PseudoStack *aStack) +ThreadProfile::ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aStack, int aThreadId, bool aIsMainThread) : mWritePos(0) , mLastFlushPos(0) , mReadPos(0) , mEntrySize(aEntrySize) , mPseudoStack(aStack) , mMutex("ThreadProfile::mMutex") + , mName(strdup(aName)) + , mThreadId(aThreadId) + , mIsMainThread(aIsMainThread) { mEntries = new ProfileEntry[mEntrySize]; } ThreadProfile::~ThreadProfile() { + free(mName); delete[] mEntries; } @@ -299,6 +303,10 @@ JSCustomObject* ThreadProfile::ToJSObject(JSContext *aCx) } void ThreadProfile::BuildJSObject(JSAObjectBuilder& b, JSCustomObject* profile) { + // Thread meta data + b.DefineProperty(profile, "name", mName); + b.DefineProperty(profile, "tid", mThreadId); + JSCustomArray *samples = b.CreateArray(); b.DefineProperty(profile, "samples", samples); diff --git a/tools/profiler/ProfileEntry.h b/tools/profiler/ProfileEntry.h index 897abb23c6ea..a5483b59f887 100644 --- a/tools/profiler/ProfileEntry.h +++ b/tools/profiler/ProfileEntry.h @@ -6,6 +6,7 @@ #ifndef MOZ_PROFILE_ENTRY_H #define MOZ_PROFILE_ENTRY_H +#include #include "GeckoProfilerImpl.h" #include "JSAObjectBuilder.h" #include "platform.h" @@ -56,7 +57,7 @@ typedef void (*IterateTagsCallback)(const ProfileEntry& entry, const char* tagSt class ThreadProfile { public: - ThreadProfile(int aEntrySize, PseudoStack *aStack); + ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aStack, int aThreadId, bool aIsMainThread); ~ThreadProfile(); void addTag(ProfileEntry aTag); void flush(); @@ -70,6 +71,11 @@ public: PseudoStack* GetPseudoStack(); mozilla::Mutex* GetMutex(); void BuildJSObject(JSAObjectBuilder& b, JSCustomObject* profile); + + bool IsMainThread() const { return mIsMainThread; } + const char* Name() const { return mName; } + int ThreadId() const { return mThreadId; } + private: // Circular buffer 'Keep One Slot Open' implementation // for simplicity @@ -80,6 +86,9 @@ private: int mEntrySize; PseudoStack* mPseudoStack; mozilla::Mutex mMutex; + char* mName; + int mThreadId; + bool mIsMainThread; }; std::ostream& operator<<(std::ostream& stream, const ThreadProfile& profile); diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index c31d9d94e4fa..14a3350b1318 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -173,16 +173,22 @@ void TableTicker::BuildJSObject(JSAObjectBuilder& b, JSCustomObject* profile) JSCustomArray *threads = b.CreateArray(); b.DefineProperty(profile, "threads", threads); - // For now we only have one thread SetPaused(true); - ThreadProfile* prof = GetPrimaryThreadProfile(); - prof->GetMutex()->Lock(); - JSCustomObject* threadSamples = b.CreateObject(); - prof->BuildJSObject(b, threadSamples); - b.ArrayPush(threads, threadSamples); - prof->GetMutex()->Unlock(); + + { + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + for (size_t i = 0; i < sRegisteredThreads->size(); i++) { + MutexAutoLock lock(*sRegisteredThreads->at(i)->Profile()->GetMutex()); + + JSCustomObject* threadSamples = b.CreateObject(); + sRegisteredThreads->at(i)->Profile()->BuildJSObject(b, threadSamples); + b.ArrayPush(threads, threadSamples); + } + } + SetPaused(false); -} +} // END SaveProfileTask et al //////////////////////////////////////////////////////////////////////// @@ -383,10 +389,17 @@ void doSampleStackTrace(PseudoStack *aStack, ThreadProfile &aProfile, TickSample void TableTicker::Tick(TickSample* sample) { + if (!sample->threadProfile) { + // Platform doesn't support multithread, so use the main thread profile we created + sample->threadProfile = GetPrimaryThreadProfile(); + } + + ThreadProfile& currThreadProfile = *sample->threadProfile; + // Marker(s) come before the sample - PseudoStack* stack = mPrimaryThreadProfile.GetPseudoStack(); + PseudoStack* stack = currThreadProfile.GetPseudoStack(); for (int i = 0; stack->getMarker(i) != NULL; i++) { - addDynamicTag(mPrimaryThreadProfile, 'm', stack->getMarker(i)); + addDynamicTag(currThreadProfile, 'm', stack->getMarker(i)); } stack->mQueueClearMarker = true; @@ -398,7 +411,7 @@ void TableTicker::Tick(TickSample* sample) // XXX: we also probably want to add an entry to the profile to help // distinguish which samples are part of the same event. That, or record // the event generation in each sample - mPrimaryThreadProfile.erase(); + currThreadProfile.erase(); } sLastSampledEventGeneration = sCurrentEventGeneration; @@ -414,29 +427,29 @@ void TableTicker::Tick(TickSample* sample) #if defined(USE_BACKTRACE) || defined(USE_NS_STACKWALK) if (mUseStackWalk) { - doNativeBacktrace(mPrimaryThreadProfile, sample); + doNativeBacktrace(currThreadProfile, sample); } else { - doSampleStackTrace(stack, mPrimaryThreadProfile, mAddLeafAddresses ? sample : nullptr); + doSampleStackTrace(stack, currThreadProfile, mAddLeafAddresses ? sample : nullptr); } #else - doSampleStackTrace(stack, mPrimaryThreadProfile, mAddLeafAddresses ? sample : nullptr); + doSampleStackTrace(stack, currThreadProfile, mAddLeafAddresses ? sample : nullptr); #endif if (recordSample) - mPrimaryThreadProfile.flush(); + currThreadProfile.flush(); - if (!sLastTracerEvent.IsNull() && sample) { + if (!sLastTracerEvent.IsNull() && sample && currThreadProfile.IsMainThread()) { TimeDuration delta = sample->timestamp - sLastTracerEvent; - mPrimaryThreadProfile.addTag(ProfileEntry('r', delta.ToMilliseconds())); + currThreadProfile.addTag(ProfileEntry('r', delta.ToMilliseconds())); } if (sample) { TimeDuration delta = sample->timestamp - mStartTime; - mPrimaryThreadProfile.addTag(ProfileEntry('t', delta.ToMilliseconds())); + currThreadProfile.addTag(ProfileEntry('t', delta.ToMilliseconds())); } if (sLastFrameNumber != sFrameNumber) { - mPrimaryThreadProfile.addTag(ProfileEntry('f', sFrameNumber)); + currThreadProfile.addTag(ProfileEntry('f', sFrameNumber)); sLastFrameNumber = sFrameNumber; } } @@ -460,7 +473,8 @@ void mozilla_sampler_print_location1() return; } - ThreadProfile threadProfile(1000, stack); + ThreadProfile threadProfile("Temp", PROFILE_DEFAULT_ENTRY, stack, + 0, false); doSampleStackTrace(stack, threadProfile, NULL); threadProfile.flush(); diff --git a/tools/profiler/TableTicker.h b/tools/profiler/TableTicker.h index 6b00d1e1c6d5..edb91195430d 100644 --- a/tools/profiler/TableTicker.h +++ b/tools/profiler/TableTicker.h @@ -5,6 +5,7 @@ #include "platform.h" #include "ProfileEntry.h" +#include "mozilla/Mutex.h" static bool hasFeature(const char** aFeatures, uint32_t aFeatureCount, const char* aFeature) { @@ -27,8 +28,8 @@ class TableTicker: public Sampler { public: TableTicker(int aInterval, int aEntrySize, PseudoStack *aStack, const char** aFeatures, uint32_t aFeatureCount) - : Sampler(aInterval, true) - , mPrimaryThreadProfile(aEntrySize, aStack) + : Sampler(aInterval, true, aEntrySize) + , mPrimaryThreadProfile(nullptr) , mStartTime(TimeStamp::Now()) , mSaveRequested(false) { @@ -38,10 +39,47 @@ class TableTicker: public Sampler { mJankOnly = hasFeature(aFeatures, aFeatureCount, "jank"); mProfileJS = hasFeature(aFeatures, aFeatureCount, "js"); mAddLeafAddresses = hasFeature(aFeatures, aFeatureCount, "leaf"); - mPrimaryThreadProfile.addTag(ProfileEntry('m', "Start")); + + { + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + // Create ThreadProfile for each registered thread + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + ThreadProfile* profile = new ThreadProfile(info->Name(), + aEntrySize, + info->Stack(), + info->ThreadId(), + info->IsMainThread()); + profile->addTag(ProfileEntry('m', "Start")); + + info->SetProfile(profile); + } + + SetActiveSampler(this); + } } - ~TableTicker() { if (IsActive()) Stop(); } + ~TableTicker() { + if (IsActive()) + Stop(); + + SetActiveSampler(nullptr); + + // Destroy ThreadProfile for all threads + { + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + ThreadProfile* profile = info->Profile(); + if (profile) { + delete profile; + info->SetProfile(nullptr); + } + } + } + } virtual void SampleStack(TickSample* sample) {} @@ -58,7 +96,19 @@ class TableTicker: public Sampler { ThreadProfile* GetPrimaryThreadProfile() { - return &mPrimaryThreadProfile; + if (!mPrimaryThreadProfile) { + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + if (info->IsMainThread()) { + mPrimaryThreadProfile = info->Profile(); + break; + } + } + } + + return mPrimaryThreadProfile; } void ToStreamAsJSON(std::ostream& stream); @@ -76,7 +126,7 @@ protected: void BuildJSObject(JSAObjectBuilder& b, JSCustomObject* profile); // This represent the application's main thread (SAMPLER_INIT) - ThreadProfile mPrimaryThreadProfile; + ThreadProfile* mPrimaryThreadProfile; TimeStamp mStartTime; bool mSaveRequested; bool mAddLeafAddresses; diff --git a/tools/profiler/platform-linux.cc b/tools/profiler/platform-linux.cc index 0cc1c058156a..0b5915e88327 100644 --- a/tools/profiler/platform-linux.cc +++ b/tools/profiler/platform-linux.cc @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef ANDROID #include #else @@ -60,9 +61,13 @@ #include #include "platform.h" #include "GeckoProfilerImpl.h" +#include "mozilla/Mutex.h" +#include "ProfileEntry.h" +#include "nsThreadUtils.h" #include #include +#include #define SIGNAL_SAVE_PROFILE SIGUSR2 @@ -75,15 +80,14 @@ pid_t gettid() } #endif -static Sampler* sActiveSampler = NULL; - - #ifdef ANDROID #include "android-signal-defs.h" #endif +static ThreadProfile* sCurrentThreadProfile = NULL; + static void ProfilerSaveSignalHandler(int signal, siginfo_t* info, void* context) { - sActiveSampler->RequestSave(); + Sampler::GetActiveSampler()->RequestSave(); } #ifdef ANDROID @@ -94,7 +98,7 @@ static void ProfilerSaveSignalHandler(int signal, siginfo_t* info, void* context #define V8_HOST_ARCH_X64 1 #endif static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { - if (!sActiveSampler) + if (!Sampler::GetActiveSampler()) return; TickSample sample_obj; @@ -103,7 +107,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { #ifdef ENABLE_SPS_LEAF_DATA // If profiling, we extract the current pc and sp. - if (sActiveSampler->IsProfiling()) { + if (Sampler::GetActiveSampler()->IsProfiling()) { // Extracting the sample from the context is extremely machine dependent. ucontext_t* ucontext = reinterpret_cast(context); mcontext_t& mcontext = ucontext->uc_mcontext; @@ -138,14 +142,17 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { #endif } #endif + sample->threadProfile = sCurrentThreadProfile; sample->timestamp = mozilla::TimeStamp::Now(); - sActiveSampler->Tick(sample); + Sampler::GetActiveSampler()->Tick(sample); + + sCurrentThreadProfile = NULL; } #ifndef XP_MACOSX -void tgkill(pid_t tgid, pid_t tid, int signalno) { - syscall(SYS_tgkill, tgid, tid, signalno); +int tgkill(pid_t tgid, pid_t tid, int signalno) { + return syscall(SYS_tgkill, tgid, tid, signalno); } #endif @@ -173,8 +180,33 @@ class Sampler::PlatformData : public Malloced { #ifdef XP_MACOSX pthread_kill(signal_receiver_, SIGPROF); #else - // Glibc doesn't provide a wrapper for tgkill(2). - tgkill(vm_tgid_, vm_tid_, SIGPROF); + + std::vector threads = GetRegisteredThreads(); + + for (uint32_t i = 0; i < threads.size(); i++) { + ThreadInfo* info = threads[i]; + + // We use sCurrentThreadProfile the ThreadProfile for the + // thread we're profiling to the signal handler + sCurrentThreadProfile = info->Profile(); + + int threadId = info->ThreadId(); + if (threadId == 0) { + threadId = vm_tid_; + } + + if (tgkill(vm_tgid_, threadId, SIGPROF) != 0) { + printf_stderr("profiler failed to signal tid=%d\n", threadId); +#ifdef DEBUG + abort(); +#endif + continue; + } + + // Wait for the signal handler to run before moving on to the next one + while (sCurrentThreadProfile) + sched_yield(); + } #endif } @@ -209,11 +241,12 @@ static void* SenderEntry(void* arg) { } -Sampler::Sampler(int interval, bool profiling) +Sampler::Sampler(int interval, bool profiling, int entrySize) : interval_(interval), profiling_(profiling), paused_(false), - active_(false) { + active_(false), + entrySize_(entrySize) { data_ = new PlatformData(this); } @@ -225,7 +258,6 @@ Sampler::~Sampler() { void Sampler::Start() { LOG("Sampler started"); - if (sActiveSampler != NULL) return; // Request profiling signals. LOG("Request signal"); @@ -259,9 +291,6 @@ void Sampler::Start() { data_->signal_sender_launched_ = true; } LOG("Profiler thread started"); - - // Set this sampler as the active sampler. - sActiveSampler = this; } @@ -281,9 +310,41 @@ void Sampler::Stop() { sigaction(SIGPROF, &data_->old_sigprof_signal_handler_, 0); data_->signal_handler_installed_ = false; } +} - // This sampler is no longer the active sampler. - sActiveSampler = NULL; +bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) +{ + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + ThreadInfo* info = new ThreadInfo(aName, gettid(), aIsMainThread, aPseudoStack); + + if (sActiveSampler) { + // We need to create the ThreadProfile now + info->SetProfile(new ThreadProfile(info->Name(), + sActiveSampler->EntrySize(), + info->Stack(), + info->ThreadId(), + aIsMainThread)); + } + + sRegisteredThreads->push_back(info); + return true; +} + +void Sampler::UnregisterCurrentThread() +{ + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + int id = gettid(); + + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + if (info->ThreadId() == id) { + delete info; + sRegisteredThreads->erase(sRegisteredThreads->begin() + i); + break; + } + } } #ifdef ANDROID @@ -307,3 +368,4 @@ void OS::RegisterStartHandler() } } #endif + diff --git a/tools/profiler/platform-macos.cc b/tools/profiler/platform-macos.cc index 99392cc7ed61..50945dc34fcd 100644 --- a/tools/profiler/platform-macos.cc +++ b/tools/profiler/platform-macos.cc @@ -28,6 +28,8 @@ #include #include +#include "nsThreadUtils.h" + #include "platform.h" #include "UnwinderThread2.h" /* uwt__register_thread_for_profiling */ @@ -199,8 +201,8 @@ class Sampler::PlatformData : public Malloced { class SamplerThread : public Thread { public: explicit SamplerThread(int interval) - : Thread("SamplerThread"), - interval_(interval) {} + : Thread("SamplerThread") + , interval_(interval) {} static void AddActiveSampler(Sampler* sampler) { ScopedLock lock(mutex_); @@ -279,6 +281,7 @@ class SamplerThread : public Thread { sample->sp = reinterpret_cast
(state.REGISTER_FIELD(sp)); sample->fp = reinterpret_cast
(state.REGISTER_FIELD(bp)); sample->timestamp = mozilla::TimeStamp::Now(); + sample->threadProfile = NULL; sampler->SampleStack(sample); sampler->Tick(sample); } @@ -302,12 +305,13 @@ Mutex* SamplerThread::mutex_ = OS::CreateMutex(); SamplerThread* SamplerThread::instance_ = NULL; -Sampler::Sampler(int interval, bool profiling) +Sampler::Sampler(int interval, bool profiling, int entrySize) : // isolate_(isolate), interval_(interval), profiling_(profiling), paused_(false), - active_(false) /*, + active_(false), + entrySize_(entrySize) /*, samples_taken_(0)*/ { data_ = new PlatformData; } @@ -337,3 +341,30 @@ Sampler::GetProfiledThread(Sampler::PlatformData* aData) { return aData->profiled_pthread(); } + +bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) +{ + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + if (!aIsMainThread) + return false; + + ThreadInfo* info = new ThreadInfo(aName, 0, true, aPseudoStack); + + if (sActiveSampler) { + // We need to create the ThreadProfile now + info->SetProfile(new ThreadProfile(info->Name(), + sActiveSampler->EntrySize(), + info->Stack(), + info->ThreadId(), + true)); + } + + sRegisteredThreads->push_back(info); + return true; +} + +void Sampler::UnregisterCurrentThread() +{ + // We only have the main thread currently and that will never be unregistered +} \ No newline at end of file diff --git a/tools/profiler/platform-win32.cc b/tools/profiler/platform-win32.cc index af68f4c52354..818b536b68f3 100644 --- a/tools/profiler/platform-win32.cc +++ b/tools/profiler/platform-win32.cc @@ -28,9 +28,10 @@ #include #include -#include "platform.h" #include +#include "platform.h" +#include "ProfileEntry.h" class Sampler::PlatformData : public Malloced { public: @@ -67,9 +68,9 @@ Sampler::GetThreadHandle(Sampler::PlatformData* aData) class SamplerThread : public Thread { public: SamplerThread(int interval, Sampler* sampler) - : Thread("SamplerThread"), - interval_(interval), - sampler_(sampler) {} + : Thread("SamplerThread") + , interval_(interval) + , sampler_(sampler) {} static void StartSampler(Sampler* sampler) { if (instance_ == NULL) { @@ -120,6 +121,7 @@ class SamplerThread : public Thread { // Grab the timestamp before pausing the thread, to avoid deadlocks. sample->timestamp = mozilla::TimeStamp::Now(); + sample->threadProfile = NULL; static const DWORD kSuspendFailed = static_cast(-1); if (SuspendThread(profiled_thread) == kSuspendFailed) @@ -155,11 +157,12 @@ class SamplerThread : public Thread { SamplerThread* SamplerThread::instance_ = NULL; -Sampler::Sampler(int interval, bool profiling) +Sampler::Sampler(int interval, bool profiling, int entrySize) : interval_(interval), profiling_(profiling), paused_(false), active_(false), + entrySize_(entrySize), data_(new PlatformData) { } @@ -238,3 +241,30 @@ void Thread::Join() { void OS::Sleep(int milliseconds) { ::Sleep(milliseconds); } + +bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) +{ + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + if (!aIsMainThread) + return false; + + ThreadInfo* info = new ThreadInfo(aName, 0, true, aPseudoStack); + + if (sActiveSampler) { + // We need to create the ThreadProfile now + info->SetProfile(new ThreadProfile(info->Name(), + sActiveSampler->EntrySize(), + info->Stack(), + info->ThreadId(), + true)); + } + + sRegisteredThreads->push_back(info); + return true; +} + +void Sampler::UnregisterCurrentThread() +{ + // We only have the main thread currently and that will never be unregistered +} \ No newline at end of file diff --git a/tools/profiler/platform.cpp b/tools/profiler/platform.cpp index 653b681dd17c..27bbeb6df5b0 100644 --- a/tools/profiler/platform.cpp +++ b/tools/profiler/platform.cpp @@ -18,6 +18,7 @@ #include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceDefs.h" #include "mozilla/Services.h" +#include "nsThreadUtils.h" mozilla::ThreadLocal tlsPseudoStack; mozilla::ThreadLocal tlsTicker; @@ -35,7 +36,7 @@ int sLastFrameNumber = 0; unsigned int sLastSampledEventGeneration = 0; /* a counter that's incremented everytime we get responsiveness event - * note: it might also be worth tracking everytime we go around + * note: it might also be worth trackplaing everytime we go around * the event loop */ unsigned int sCurrentEventGeneration = 0; /* we don't need to worry about overflow because we only treat the @@ -43,6 +44,18 @@ unsigned int sCurrentEventGeneration = 0; * a problem if 2^32 events happen between samples that we need * to know are associated with different events */ +std::vector* Sampler::sRegisteredThreads = new std::vector(); +mozilla::Mutex* Sampler::sRegisteredThreadsMutex = new mozilla::Mutex("sRegisteredThreads mutex"); + +Sampler* Sampler::sActiveSampler; + +ThreadInfo::~ThreadInfo() { + free(mName); + + if (mProfile) + delete mProfile; +} + bool sps_version2() { static int version = 0; // Raced on, potentially @@ -293,6 +306,8 @@ void mozilla_sampler_shutdown() uwt__deinit(); } + Sampler::FreeRegisteredThreads(); + profiler_stop(); // We can't delete the Stack because we can be between a // sampler call_enter/call_exit point. @@ -487,6 +502,20 @@ void mozilla_sampler_unlock() os->NotifyObservers(nullptr, "profiler-unlocked", nullptr); } +bool mozilla_sampler_register_thread(const char* aName) +{ + PseudoStack* stack = new PseudoStack(); + tlsPseudoStack.set(stack); + + return Sampler::RegisterCurrentThread(aName, stack, false); +} + +void mozilla_sampler_unregister_thread() +{ + Sampler::UnregisterCurrentThread(); +} + // END externally visible functions //////////////////////////////////////////////////////////////////////// + diff --git a/tools/profiler/platform.h b/tools/profiler/platform.h index 22bc75afbe87..8371927aa9d2 100644 --- a/tools/profiler/platform.h +++ b/tools/profiler/platform.h @@ -232,6 +232,9 @@ extern int sUnwindStackScan; /* max # of dubious frames allowed */ // (if used for profiling) the program counter and stack pointer for // the thread that created it. +class PseudoStack; +class ThreadProfile; + // TickSample captures the information collected for each sample. class TickSample { public: @@ -255,16 +258,44 @@ class TickSample { Address function; // The last called JS function. void* context; // The context from the signal handler, if available. On // Win32 this may contain the windows thread context. + ThreadProfile* threadProfile; static const int kMaxFramesCount = 64; - Address stack[kMaxFramesCount]; // Call stack. int frames_count; // Number of captured frames. mozilla::TimeStamp timestamp; }; +class ThreadInfo { + public: + ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread, PseudoStack* aPseudoStack) + : mName(strdup(aName)) + , mThreadId(aThreadId) + , mIsMainThread(aIsMainThread) + , mPseudoStack(aPseudoStack) + , mProfile(NULL) {} + + virtual ~ThreadInfo(); + + const char* Name() const { return mName; } + int ThreadId() const { return mThreadId; } + + bool IsMainThread() const { return mIsMainThread; } + PseudoStack* Stack() const { return mPseudoStack; } + + void SetProfile(ThreadProfile* aProfile) { mProfile = aProfile; } + ThreadProfile* Profile() const { return mProfile; } + + private: + char* mName; + int mThreadId; + const bool mIsMainThread; + PseudoStack* mPseudoStack; + ThreadProfile* mProfile; +}; + class Sampler { public: // Initialize sampler. - explicit Sampler(int interval, bool profiling); + explicit Sampler(int interval, bool profiling, int entrySize); virtual ~Sampler(); int interval() const { return interval_; } @@ -295,6 +326,8 @@ class Sampler { bool IsPaused() const { return paused_; } void SetPaused(bool value) { NoBarrier_Store(&paused_, value); } + int EntrySize() { return entrySize_; } + class PlatformData; PlatformData* platform_data() { return data_; } @@ -308,6 +341,34 @@ class Sampler { #ifdef XP_MACOSX static pthread_t GetProfiledThread(PlatformData*); #endif + + static std::vector GetRegisteredThreads() { + mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + + return *sRegisteredThreads; + } + + static bool RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread); + static void UnregisterCurrentThread(); + + // Should only be called on shutdown + static void FreeRegisteredThreads() { + while (sRegisteredThreads->size() > 0) { + sRegisteredThreads->pop_back(); + } + + delete sRegisteredThreadsMutex; + delete sRegisteredThreads; + } + + static Sampler* GetActiveSampler() { return sActiveSampler; } + static void SetActiveSampler(Sampler* sampler) { sActiveSampler = sampler; } + + protected: + static std::vector* sRegisteredThreads; + static mozilla::Mutex* sRegisteredThreadsMutex; + static Sampler* sActiveSampler; + private: void SetActive(bool value) { NoBarrier_Store(&active_, value); } @@ -315,6 +376,7 @@ class Sampler { const bool profiling_; Atomic32 paused_; Atomic32 active_; + const int entrySize_; PlatformData* data_; // Platform specific data. }; From df81c2521e4c9b3986e3c59bbd0cd45df298038c Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Wed, 3 Apr 2013 18:59:17 -0400 Subject: [PATCH 020/438] Bug 734691 - Port multi-thread support to win/mac. r=snorp,smaug --HG-- extra : rebase_source : 41af95bcc4b6044b7394538e2524528f67cbd1d5 --- dom/workers/RuntimeService.cpp | 16 ++- tools/profiler/GeckoProfiler.h | 4 + tools/profiler/GeckoProfilerImpl.h | 11 ++ tools/profiler/Makefile.in | 3 + tools/profiler/ProfileEntry.cpp | 6 +- tools/profiler/ProfileEntry.h | 7 +- tools/profiler/PseudoStack.h | 4 + tools/profiler/TableTicker.cpp | 15 +-- tools/profiler/TableTicker.h | 18 ++- tools/profiler/platform-linux.cc | 198 +++++++++++++++-------------- tools/profiler/platform-macos.cc | 121 +++++++++++------- tools/profiler/platform-win32.cc | 109 ++++++++++------ tools/profiler/platform.cpp | 73 ++++++++--- tools/profiler/platform.h | 124 ++++++++++-------- 14 files changed, 436 insertions(+), 273 deletions(-) diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index fdfd21a2f0f2..c5744cae3ea2 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -265,6 +265,10 @@ JSBool OperationCallback(JSContext* aCx) { WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx); + + // Now is a good time to turn on profiling if it's pending. + profiler_js_operation_callback(); + return worker->OperationCallback(aCx); } @@ -517,15 +521,19 @@ public: return NS_ERROR_FAILURE; } + JSRuntime* rt = JS_GetRuntime(cx); + profiler_register_thread("WebWorker"); +#ifdef MOZ_ENABLE_PROFILER_SPS + if (PseudoStack* stack = mozilla_get_pseudo_stack()) + stack->sampleRuntime(rt); +#endif { JSAutoRequest ar(cx); workerPrivate->DoRunLoop(cx); } - JSRuntime* rt = JS_GetRuntime(cx); - // XXX Bug 666963 - CTypes can create another JSContext for use with // closures, and then it holds that context in a reserved slot on the CType // prototype object. We have to destroy that context before we can destroy @@ -544,6 +552,10 @@ public: JS_DestroyContext(cx); } +#ifdef MOZ_ENABLE_PROFILER_SPS + if (PseudoStack* stack = mozilla_get_pseudo_stack()) + stack->sampleRuntime(nullptr); +#endif JS_DestroyRuntime(rt); workerPrivate->ScheduleDeletion(false); diff --git a/tools/profiler/GeckoProfiler.h b/tools/profiler/GeckoProfiler.h index 9105f0470ecb..9c2507a71dad 100644 --- a/tools/profiler/GeckoProfiler.h +++ b/tools/profiler/GeckoProfiler.h @@ -138,6 +138,10 @@ static inline void profiler_unlock() {} static inline void profiler_register_thread(const char* name) {} static inline void profiler_unregister_thread() {} +// Call by the JSRuntime's operation callback. This is used to enable +// profiling on auxilerary threads. +static inline void profiler_js_operation_callback() {} + #else #include "GeckoProfilerImpl.h" diff --git a/tools/profiler/GeckoProfilerImpl.h b/tools/profiler/GeckoProfilerImpl.h index 65a60e2db615..b5c20626c610 100644 --- a/tools/profiler/GeckoProfilerImpl.h +++ b/tools/profiler/GeckoProfilerImpl.h @@ -152,6 +152,17 @@ void profiler_unregister_thread() mozilla_sampler_unregister_thread(); } +static inline +void profiler_js_operation_callback() +{ + PseudoStack *stack = tlsPseudoStack.get(); + if (!stack) { + return; + } + + stack->jsOperationCallback(); +} + // we want the class and function name but can't easily get that using preprocessor macros // __func__ doesn't have the class name and __PRETTY_FUNCTION__ has the parameters diff --git a/tools/profiler/Makefile.in b/tools/profiler/Makefile.in index eb62fbd25143..98bcadcffde8 100644 --- a/tools/profiler/Makefile.in +++ b/tools/profiler/Makefile.in @@ -43,6 +43,9 @@ ifndef _MSC_VER FAIL_ON_WARNINGS = 1 endif # !_MSC_VER +# Uncomment for better debugging in opt builds +#MOZ_OPTIMIZE_FLAGS += -O0 -g + CPPSRCS = \ platform.cpp \ nsProfilerFactory.cpp \ diff --git a/tools/profiler/ProfileEntry.cpp b/tools/profiler/ProfileEntry.cpp index 4435ebf4e9a2..d3608cace5fc 100644 --- a/tools/profiler/ProfileEntry.cpp +++ b/tools/profiler/ProfileEntry.cpp @@ -134,7 +134,10 @@ std::ostream& operator<<(std::ostream& stream, const ProfileEntry& entry) #define DYNAMIC_MAX_STRING 512 -ThreadProfile::ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aStack, int aThreadId, bool aIsMainThread) +ThreadProfile::ThreadProfile(const char* aName, int aEntrySize, + PseudoStack *aStack, int aThreadId, + PlatformData* aPlatform, + bool aIsMainThread) : mWritePos(0) , mLastFlushPos(0) , mReadPos(0) @@ -144,6 +147,7 @@ ThreadProfile::ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aSt , mName(strdup(aName)) , mThreadId(aThreadId) , mIsMainThread(aIsMainThread) + , mPlatformData(aPlatform) { mEntries = new ProfileEntry[mEntrySize]; } diff --git a/tools/profiler/ProfileEntry.h b/tools/profiler/ProfileEntry.h index a5483b59f887..378dc42481c2 100644 --- a/tools/profiler/ProfileEntry.h +++ b/tools/profiler/ProfileEntry.h @@ -12,7 +12,6 @@ #include "platform.h" #include "mozilla/Mutex.h" -class ThreadProfile; class ThreadProfile; class ProfileEntry @@ -57,7 +56,9 @@ typedef void (*IterateTagsCallback)(const ProfileEntry& entry, const char* tagSt class ThreadProfile { public: - ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aStack, int aThreadId, bool aIsMainThread); + ThreadProfile(const char* aName, int aEntrySize, PseudoStack *aStack, + int aThreadId, PlatformData* aPlatformData, + bool aIsMainThread); ~ThreadProfile(); void addTag(ProfileEntry aTag); void flush(); @@ -76,6 +77,7 @@ public: const char* Name() const { return mName; } int ThreadId() const { return mThreadId; } + PlatformData* GetPlatformData() { return mPlatformData; } private: // Circular buffer 'Keep One Slot Open' implementation // for simplicity @@ -89,6 +91,7 @@ private: char* mName; int mThreadId; bool mIsMainThread; + PlatformData* mPlatformData; // Platform specific data. }; std::ostream& operator<<(std::ostream& stream, const ThreadProfile& profile); diff --git a/tools/profiler/PseudoStack.h b/tools/profiler/PseudoStack.h index 9079ffbfc3a8..b12bb226dae5 100644 --- a/tools/profiler/PseudoStack.h +++ b/tools/profiler/PseudoStack.h @@ -220,6 +220,10 @@ public: mStartJSSampling = true; } } + void jsOperationCallback() { + if (mStartJSSampling) + enableJSSampling(); + } void disableJSSampling() { mStartJSSampling = false; if (mRuntime) diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index 14a3350b1318..349f7e794338 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -179,6 +179,10 @@ void TableTicker::BuildJSObject(JSAObjectBuilder& b, JSCustomObject* profile) mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); for (size_t i = 0; i < sRegisteredThreads->size(); i++) { + // Thread not being profiled, skip it + if (!sRegisteredThreads->at(i)->Profile()) + continue; + MutexAutoLock lock(*sRegisteredThreads->at(i)->Profile()->GetMutex()); JSCustomObject* threadSamples = b.CreateObject(); @@ -291,7 +295,7 @@ void StackWalkCallback(void* aPC, void* aSP, void* aClosure) void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample) { #ifndef XP_MACOSX - uintptr_t thread = GetThreadHandle(platform_data()); + uintptr_t thread = GetThreadHandle(aSample->threadProfile->GetPlatformData()); MOZ_ASSERT(thread); #endif void* pc_array[1000]; @@ -308,7 +312,7 @@ void TableTicker::doNativeBacktrace(ThreadProfile &aProfile, TickSample* aSample uint32_t maxFrames = uint32_t(array.size - array.count); #ifdef XP_MACOSX - pthread_t pt = GetProfiledThread(platform_data()); + pthread_t pt = GetProfiledThread(aSample->threadProfile->GetPlatformData()); void *stackEnd = reinterpret_cast(-1); if (pt) stackEnd = static_cast(pthread_get_stackaddr_np(pt)); @@ -389,11 +393,6 @@ void doSampleStackTrace(PseudoStack *aStack, ThreadProfile &aProfile, TickSample void TableTicker::Tick(TickSample* sample) { - if (!sample->threadProfile) { - // Platform doesn't support multithread, so use the main thread profile we created - sample->threadProfile = GetPrimaryThreadProfile(); - } - ThreadProfile& currThreadProfile = *sample->threadProfile; // Marker(s) come before the sample @@ -474,7 +473,7 @@ void mozilla_sampler_print_location1() } ThreadProfile threadProfile("Temp", PROFILE_DEFAULT_ENTRY, stack, - 0, false); + 0, Sampler::AllocPlatformData(0), false); doSampleStackTrace(stack, threadProfile, NULL); threadProfile.flush(); diff --git a/tools/profiler/TableTicker.h b/tools/profiler/TableTicker.h index edb91195430d..1af75f19ef60 100644 --- a/tools/profiler/TableTicker.h +++ b/tools/profiler/TableTicker.h @@ -26,7 +26,7 @@ class BreakpadSampler; class TableTicker: public Sampler { public: - TableTicker(int aInterval, int aEntrySize, PseudoStack *aStack, + TableTicker(int aInterval, int aEntrySize, const char** aFeatures, uint32_t aFeatureCount) : Sampler(aInterval, true, aEntrySize) , mPrimaryThreadProfile(nullptr) @@ -38,6 +38,7 @@ class TableTicker: public Sampler { //XXX: It's probably worth splitting the jank profiler out from the regular profiler at some point mJankOnly = hasFeature(aFeatures, aFeatureCount, "jank"); mProfileJS = hasFeature(aFeatures, aFeatureCount, "js"); + mProfileThreads = hasFeature(aFeatures, aFeatureCount, "threads"); mAddLeafAddresses = hasFeature(aFeatures, aFeatureCount, "leaf"); { @@ -46,10 +47,15 @@ class TableTicker: public Sampler { // Create ThreadProfile for each registered thread for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { ThreadInfo* info = sRegisteredThreads->at(i); + + if (!info->IsMainThread() && !mProfileThreads) + continue; + ThreadProfile* profile = new ThreadProfile(info->Name(), aEntrySize, info->Stack(), info->ThreadId(), + info->GetPlatformData(), info->IsMainThread()); profile->addTag(ProfileEntry('m', "Start")); @@ -81,8 +87,6 @@ class TableTicker: public Sampler { } } - virtual void SampleStack(TickSample* sample) {} - // Called within a signal. This function must be reentrant virtual void Tick(TickSample* sample); @@ -115,7 +119,8 @@ class TableTicker: public Sampler { virtual JSObject *ToJSObject(JSContext *aCx); JSCustomObject *GetMetaJSCustomObject(JSAObjectBuilder& b); - const bool ProfileJS() { return mProfileJS; } + bool ProfileJS() const { return mProfileJS; } + bool ProfileThreads() const { return mProfileThreads; } virtual BreakpadSampler* AsBreakpadSampler() { return nullptr; } @@ -133,13 +138,14 @@ protected: bool mUseStackWalk; bool mJankOnly; bool mProfileJS; + bool mProfileThreads; }; class BreakpadSampler: public TableTicker { public: - BreakpadSampler(int aInterval, int aEntrySize, PseudoStack *aStack, + BreakpadSampler(int aInterval, int aEntrySize, const char** aFeatures, uint32_t aFeatureCount) - : TableTicker(aInterval, aEntrySize, aStack, aFeatures, aFeatureCount) + : TableTicker(aInterval, aEntrySize, aFeatures, aFeatureCount) {} // Called within a signal. This function must be reentrant diff --git a/tools/profiler/platform-linux.cc b/tools/profiler/platform-linux.cc index 0b5915e88327..68b127f3480e 100644 --- a/tools/profiler/platform-linux.cc +++ b/tools/profiler/platform-linux.cc @@ -64,6 +64,7 @@ #include "mozilla/Mutex.h" #include "ProfileEntry.h" #include "nsThreadUtils.h" +#include "TableTicker.h" #include #include @@ -84,6 +85,19 @@ pid_t gettid() #include "android-signal-defs.h" #endif +struct SamplerRegistry { + static void AddActiveSampler(Sampler *sampler) { + ASSERT(!SamplerRegistry::sampler); + SamplerRegistry::sampler = sampler; + } + static void RemoveActiveSampler(Sampler *sampler) { + SamplerRegistry::sampler = NULL; + } + static Sampler *sampler; +}; + +Sampler *SamplerRegistry::sampler = NULL; + static ThreadProfile* sCurrentThreadProfile = NULL; static void ProfilerSaveSignalHandler(int signal, siginfo_t* info, void* context) { @@ -150,93 +164,75 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { sCurrentThreadProfile = NULL; } -#ifndef XP_MACOSX int tgkill(pid_t tgid, pid_t tid, int signalno) { return syscall(SYS_tgkill, tgid, tid, signalno); } -#endif -class Sampler::PlatformData : public Malloced { +class PlatformData : public Malloced { public: - explicit PlatformData(Sampler* sampler) - : sampler_(sampler), - signal_handler_installed_(false), - vm_tgid_(getpid()), -#ifndef XP_MACOSX - vm_tid_(gettid()), -#endif - signal_sender_launched_(false) -#ifdef XP_MACOSX - , signal_receiver_(pthread_self()) -#endif + PlatformData() { } - - void SignalSender() { - while (sampler_->IsActive()) { - sampler_->HandleSaveRequest(); - - if (!sampler_->IsPaused()) { -#ifdef XP_MACOSX - pthread_kill(signal_receiver_, SIGPROF); -#else - - std::vector threads = GetRegisteredThreads(); - - for (uint32_t i = 0; i < threads.size(); i++) { - ThreadInfo* info = threads[i]; - - // We use sCurrentThreadProfile the ThreadProfile for the - // thread we're profiling to the signal handler - sCurrentThreadProfile = info->Profile(); - - int threadId = info->ThreadId(); - if (threadId == 0) { - threadId = vm_tid_; - } - - if (tgkill(vm_tgid_, threadId, SIGPROF) != 0) { - printf_stderr("profiler failed to signal tid=%d\n", threadId); -#ifdef DEBUG - abort(); -#endif - continue; - } - - // Wait for the signal handler to run before moving on to the next one - while (sCurrentThreadProfile) - sched_yield(); - } -#endif - } - - // Convert ms to us and subtract 100 us to compensate delays - // occuring during signal delivery. - // TODO measure and confirm this. - const useconds_t interval = sampler_->interval_ * 1000 - 100; - //int result = usleep(interval); - usleep(interval); - } - } - - Sampler* sampler_; - bool signal_handler_installed_; - struct sigaction old_sigprof_signal_handler_; - struct sigaction old_sigsave_signal_handler_; - pid_t vm_tgid_; - pid_t vm_tid_; - bool signal_sender_launched_; - pthread_t signal_sender_thread_; -#ifdef XP_MACOSX - pthread_t signal_receiver_; -#endif }; +/* static */ PlatformData* +Sampler::AllocPlatformData(int aThreadId) +{ + return new PlatformData; +} -static void* SenderEntry(void* arg) { - Sampler::PlatformData* data = - reinterpret_cast(arg); - data->SignalSender(); +/* static */ void +Sampler::FreePlatformData(PlatformData* aData) +{ + delete aData; +} + +static void* SignalSender(void* arg) { + int vm_tgid_ = getpid(); + + while (SamplerRegistry::sampler->IsActive()) { + SamplerRegistry::sampler->HandleSaveRequest(); + + if (!SamplerRegistry::sampler->IsPaused()) { + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + std::vector threads = + SamplerRegistry::sampler->GetRegisteredThreads(); + + for (uint32_t i = 0; i < threads.size(); i++) { + ThreadInfo* info = threads[i]; + + // This will be null if we're not interested in profiling this thread. + if (!info->Profile()) + continue; + + // We use sCurrentThreadProfile the ThreadProfile for the + // thread we're profiling to the signal handler + sCurrentThreadProfile = info->Profile(); + + int threadId = info->ThreadId(); + + if (tgkill(vm_tgid_, threadId, SIGPROF) != 0) { + printf_stderr("profiler failed to signal tid=%d\n", threadId); +#ifdef DEBUG + abort(); +#endif + continue; + } + + // Wait for the signal handler to run before moving on to the next one + while (sCurrentThreadProfile) + sched_yield(); + } + } + + // Convert ms to us and subtract 100 us to compensate delays + // occuring during signal delivery. + // TODO measure and confirm this. + const useconds_t interval = + SamplerRegistry::sampler->interval() * 1000 - 100; + //int result = usleep(interval); + usleep(interval); + } return 0; } @@ -247,25 +243,25 @@ Sampler::Sampler(int interval, bool profiling, int entrySize) paused_(false), active_(false), entrySize_(entrySize) { - data_ = new PlatformData(this); } Sampler::~Sampler() { - ASSERT(!data_->signal_sender_launched_); - delete data_; + ASSERT(!signal_sender_launched_); } void Sampler::Start() { LOG("Sampler started"); + SamplerRegistry::AddActiveSampler(this); + // Request profiling signals. LOG("Request signal"); struct sigaction sa; sa.sa_sigaction = ProfilerSignalHandler; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART | SA_SIGINFO; - if (sigaction(SIGPROF, &sa, &data_->old_sigprof_signal_handler_) != 0) { + if (sigaction(SIGPROF, &sa, &old_sigprof_signal_handler_) != 0) { LOG("Error installing signal"); return; } @@ -275,20 +271,20 @@ void Sampler::Start() { sa2.sa_sigaction = ProfilerSaveSignalHandler; sigemptyset(&sa2.sa_mask); sa2.sa_flags = SA_RESTART | SA_SIGINFO; - if (sigaction(SIGNAL_SAVE_PROFILE, &sa2, &data_->old_sigsave_signal_handler_) != 0) { + if (sigaction(SIGNAL_SAVE_PROFILE, &sa2, &old_sigsave_signal_handler_) != 0) { LOG("Error installing start signal"); return; } LOG("Signal installed"); - data_->signal_handler_installed_ = true; + signal_handler_installed_ = true; // Start a thread that sends SIGPROF signal to VM thread. // Sending the signal ourselves instead of relying on itimer provides // much better accuracy. SetActive(true); if (pthread_create( - &data_->signal_sender_thread_, NULL, SenderEntry, data_) == 0) { - data_->signal_sender_launched_ = true; + &signal_sender_thread_, NULL, SignalSender, NULL) == 0) { + signal_sender_launched_ = true; } LOG("Profiler thread started"); } @@ -299,32 +295,42 @@ void Sampler::Stop() { // Wait for signal sender termination (it will exit after setting // active_ to false). - if (data_->signal_sender_launched_) { - pthread_join(data_->signal_sender_thread_, NULL); - data_->signal_sender_launched_ = false; + if (signal_sender_launched_) { + pthread_join(signal_sender_thread_, NULL); + signal_sender_launched_ = false; } + SamplerRegistry::RemoveActiveSampler(this); + // Restore old signal handler - if (data_->signal_handler_installed_) { - sigaction(SIGNAL_SAVE_PROFILE, &data_->old_sigsave_signal_handler_, 0); - sigaction(SIGPROF, &data_->old_sigprof_signal_handler_, 0); - data_->signal_handler_installed_ = false; + if (signal_handler_installed_) { + sigaction(SIGNAL_SAVE_PROFILE, &old_sigsave_signal_handler_, 0); + sigaction(SIGPROF, &old_sigprof_signal_handler_, 0); + signal_handler_installed_ = false; } } bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) { - mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); - ThreadInfo* info = new ThreadInfo(aName, gettid(), aIsMainThread, aPseudoStack); + ThreadInfo* info = new ThreadInfo(aName, gettid(), + aIsMainThread, aPseudoStack); - if (sActiveSampler) { + bool profileThread = sActiveSampler && + (aIsMainThread || sActiveSampler->ProfileThreads()); + + if (profileThread) { // We need to create the ThreadProfile now info->SetProfile(new ThreadProfile(info->Name(), sActiveSampler->EntrySize(), info->Stack(), info->ThreadId(), + info->GetPlatformData(), aIsMainThread)); + if (sActiveSampler->ProfileJS()) { + info->Profile()->GetPseudoStack()->enableJSSampling(); + } } sRegisteredThreads->push_back(info); @@ -333,7 +339,7 @@ bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack void Sampler::UnregisterCurrentThread() { - mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); int id = gettid(); diff --git a/tools/profiler/platform-macos.cc b/tools/profiler/platform-macos.cc index 50945dc34fcd..ac338808da1a 100644 --- a/tools/profiler/platform-macos.cc +++ b/tools/profiler/platform-macos.cc @@ -31,6 +31,7 @@ #include "nsThreadUtils.h" #include "platform.h" +#include "TableTicker.h" #include "UnwinderThread2.h" /* uwt__register_thread_for_profiling */ // this port is based off of v8 svn revision 9837 @@ -91,21 +92,13 @@ void OS::Sleep(int milliseconds) { usleep(1000 * milliseconds); } -class Thread::PlatformData : public Malloced { - public: - PlatformData() : thread_(kNoThread) {} - pthread_t thread_; // Thread handle for pthread. -}; - Thread::Thread(const char* name) - : data_(new PlatformData), - stack_size_(0) { + : stack_size_(0) { set_name(name); } Thread::~Thread() { - delete data_; } @@ -141,9 +134,9 @@ static void* ThreadEntry(void* arg) { } // END temp hack for SPS v1-vs-v2 - thread->data()->thread_ = pthread_self(); + thread->thread_ = pthread_self(); SetThreadName(thread->name()); - ASSERT(thread->data()->thread_ != kNoThread); + ASSERT(thread->thread_ != kNoThread); thread->Run(); return NULL; } @@ -163,15 +156,15 @@ void Thread::Start() { pthread_attr_setstacksize(&attr, static_cast(stack_size_)); attr_ptr = &attr; } - pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); - ASSERT(data_->thread_ != kNoThread); + pthread_create(&thread_, attr_ptr, ThreadEntry, this); + ASSERT(thread_ != kNoThread); } void Thread::Join() { - pthread_join(data_->thread_, NULL); + pthread_join(thread_, NULL); } -class Sampler::PlatformData : public Malloced { +class PlatformData : public Malloced { public: PlatformData() : profiled_thread_(mach_thread_self()) { @@ -197,6 +190,17 @@ class Sampler::PlatformData : public Malloced { pthread_t profiled_pthread_; }; +/* static */ PlatformData* +Sampler::AllocPlatformData(int aThreadId) +{ + return new PlatformData; +} + +/* static */ void +Sampler::FreePlatformData(PlatformData* aData) +{ + delete aData; +} class SamplerThread : public Thread { public: @@ -205,7 +209,7 @@ class SamplerThread : public Thread { , interval_(interval) {} static void AddActiveSampler(Sampler* sampler) { - ScopedLock lock(mutex_); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); SamplerRegistry::AddActiveSampler(sampler); if (instance_ == NULL) { instance_ = new SamplerThread(sampler->interval()); @@ -216,37 +220,45 @@ class SamplerThread : public Thread { } static void RemoveActiveSampler(Sampler* sampler) { - ScopedLock lock(mutex_); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); instance_->Join(); //XXX: unlike v8 we need to remove the active sampler after doing the Join // because we drop the sampler immediately SamplerRegistry::RemoveActiveSampler(sampler); delete instance_; instance_ = NULL; - /* - if (SamplerRegistry::GetState() == SamplerRegistry::HAS_NO_SAMPLERS) { - RuntimeProfiler::StopRuntimeProfilerThreadBeforeShutdown(instance_); - delete instance_; - instance_ = NULL; - } - */ } // Implement Thread::Run(). virtual void Run() { while (SamplerRegistry::sampler->IsActive()) { - if (!SamplerRegistry::sampler->IsPaused()) - SampleContext(SamplerRegistry::sampler); + { + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + std::vector threads = + SamplerRegistry::sampler->GetRegisteredThreads(); + for (uint32_t i = 0; i < threads.size(); i++) { + ThreadInfo* info = threads[i]; + + // This will be null if we're not interested in profiling this thread. + if (!info->Profile()) + continue; + + ThreadProfile* thread_profile = info->Profile(); + + if (!SamplerRegistry::sampler->IsPaused()) + SampleContext(SamplerRegistry::sampler, thread_profile); + } + } OS::Sleep(interval_); } } - void SampleContext(Sampler* sampler) { - thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); + void SampleContext(Sampler* sampler, ThreadProfile* thread_profile) { + thread_act_t profiled_thread = + thread_profile->GetPlatformData()->profiled_thread(); + TickSample sample_obj; TickSample* sample = &sample_obj; - //TickSample* sample = CpuProfiler::TickSampleEvent(sampler->isolate()); - //if (sample == NULL) sample = &sample_obj; if (KERN_SUCCESS != thread_suspend(profiled_thread)) return; @@ -276,13 +288,11 @@ class SamplerThread : public Thread { flavor, reinterpret_cast(&state), &count) == KERN_SUCCESS) { - //sample->state = sampler->isolate()->current_vm_state(); sample->pc = reinterpret_cast
(state.REGISTER_FIELD(ip)); sample->sp = reinterpret_cast
(state.REGISTER_FIELD(sp)); sample->fp = reinterpret_cast
(state.REGISTER_FIELD(bp)); sample->timestamp = mozilla::TimeStamp::Now(); - sample->threadProfile = NULL; - sampler->SampleStack(sample); + sample->threadProfile = thread_profile; sampler->Tick(sample); } thread_resume(profiled_thread); @@ -300,11 +310,8 @@ class SamplerThread : public Thread { #undef REGISTER_FIELD - -Mutex* SamplerThread::mutex_ = OS::CreateMutex(); SamplerThread* SamplerThread::instance_ = NULL; - Sampler::Sampler(int interval, bool profiling, int entrySize) : // isolate_(isolate), interval_(interval), @@ -313,13 +320,11 @@ Sampler::Sampler(int interval, bool profiling, int entrySize) active_(false), entrySize_(entrySize) /*, samples_taken_(0)*/ { - data_ = new PlatformData; } Sampler::~Sampler() { ASSERT(!IsActive()); - delete data_; } @@ -337,27 +342,38 @@ void Sampler::Stop() { } pthread_t -Sampler::GetProfiledThread(Sampler::PlatformData* aData) +Sampler::GetProfiledThread(PlatformData* aData) { return aData->profiled_pthread(); } +#include +pid_t gettid() +{ + return (pid_t) syscall(SYS_thread_selfid); +} + bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) { - mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); - if (!aIsMainThread) - return false; + ThreadInfo* info = new ThreadInfo(aName, gettid(), + aIsMainThread, aPseudoStack); - ThreadInfo* info = new ThreadInfo(aName, 0, true, aPseudoStack); + bool profileThread = sActiveSampler && + (aIsMainThread || sActiveSampler->ProfileThreads()); - if (sActiveSampler) { + if (profileThread) { // We need to create the ThreadProfile now info->SetProfile(new ThreadProfile(info->Name(), sActiveSampler->EntrySize(), info->Stack(), info->ThreadId(), - true)); + info->GetPlatformData(), + aIsMainThread)); + if (sActiveSampler->ProfileJS()) { + info->Profile()->GetPseudoStack()->enableJSSampling(); + } } sRegisteredThreads->push_back(info); @@ -366,5 +382,16 @@ bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack void Sampler::UnregisterCurrentThread() { - // We only have the main thread currently and that will never be unregistered -} \ No newline at end of file + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + + int id = gettid(); + + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + if (info->ThreadId() == id) { + delete info; + sRegisteredThreads->erase(sRegisteredThreads->begin() + i); + break; + } + } +} diff --git a/tools/profiler/platform-win32.cc b/tools/profiler/platform-win32.cc index 818b536b68f3..c63fc32cccba 100644 --- a/tools/profiler/platform-win32.cc +++ b/tools/profiler/platform-win32.cc @@ -30,21 +30,21 @@ #include #include #include "platform.h" - +#include "TableTicker.h" #include "ProfileEntry.h" -class Sampler::PlatformData : public Malloced { +class PlatformData : public Malloced { public: // Get a handle to the calling thread. This is the thread that we are // going to profile. We need to make a copy of the handle because we are // going to use it in the sampler thread. Using GetThreadHandle() will // not work in this case. We're using OpenThread because DuplicateHandle // for some reason doesn't work in Chrome's sandbox. - PlatformData() : profiled_thread_(OpenThread(THREAD_GET_CONTEXT | + PlatformData(int aThreadId) : profiled_thread_(OpenThread(THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME | THREAD_QUERY_INFORMATION, false, - GetCurrentThreadId())) {} + aThreadId)) {} ~PlatformData() { if (profiled_thread_ != NULL) { @@ -59,8 +59,20 @@ class Sampler::PlatformData : public Malloced { HANDLE profiled_thread_; }; +/* static */ PlatformData* +Sampler::AllocPlatformData(int aThreadId) +{ + return new PlatformData(aThreadId); +} + +/* static */ void +Sampler::FreePlatformData(PlatformData* aData) +{ + delete aData; +} + uintptr_t -Sampler::GetThreadHandle(Sampler::PlatformData* aData) +Sampler::GetThreadHandle(PlatformData* aData) { return (uintptr_t) aData->profiled_thread(); } @@ -97,8 +109,24 @@ class SamplerThread : public Thread { ::timeBeginPeriod(interval_); while (sampler_->IsActive()) { - if (!sampler_->IsPaused()) - SampleContext(sampler_); + { + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + std::vector threads = + sampler_->GetRegisteredThreads(); + for (uint32_t i = 0; i < threads.size(); i++) { + ThreadInfo* info = threads[i]; + + // This will be null if we're not interested in profiling this thread. + if (!info->Profile()) + continue; + + ThreadProfile* thread_profile = info->Profile(); + + if (!sampler_->IsPaused()) { + SampleContext(sampler_, thread_profile); + } + } + } OS::Sleep(interval_); } @@ -107,8 +135,10 @@ class SamplerThread : public Thread { ::timeEndPeriod(interval_); } - void SampleContext(Sampler* sampler) { - HANDLE profiled_thread = sampler->platform_data()->profiled_thread(); + void SampleContext(Sampler* sampler, ThreadProfile* thread_profile) { + uintptr_t thread = Sampler::GetThreadHandle( + thread_profile->GetPlatformData()); + HANDLE profiled_thread = reinterpret_cast(thread); if (profiled_thread == NULL) return; @@ -121,7 +151,7 @@ class SamplerThread : public Thread { // Grab the timestamp before pausing the thread, to avoid deadlocks. sample->timestamp = mozilla::TimeStamp::Now(); - sample->threadProfile = NULL; + sample->threadProfile = thread_profile; static const DWORD kSuspendFailed = static_cast(-1); if (SuspendThread(profiled_thread) == kSuspendFailed) @@ -139,7 +169,6 @@ class SamplerThread : public Thread { sample->fp = reinterpret_cast
(context.Ebp); #endif sample->context = &context; - sampler->SampleStack(sample); sampler->Tick(sample); } ResumeThread(profiled_thread); @@ -162,13 +191,11 @@ Sampler::Sampler(int interval, bool profiling, int entrySize) profiling_(profiling), paused_(false), active_(false), - entrySize_(entrySize), - data_(new PlatformData) { + entrySize_(entrySize) { } Sampler::~Sampler() { ASSERT(!IsActive()); - delete data_; } void Sampler::Start() { @@ -192,18 +219,11 @@ static unsigned int __stdcall ThreadEntry(void* arg) { return 0; } -class Thread::PlatformData : public Malloced { - public: - explicit PlatformData(HANDLE thread) : thread_(thread) {} - HANDLE thread_; - unsigned thread_id_; -}; - // Initialize a Win32 thread object. The thread has an invalid thread // handle until it is started. Thread::Thread(const char* name) : stack_size_(0) { - data_ = new PlatformData(kNoThread); + thread_ = kNoThread; set_name(name); } @@ -214,27 +234,26 @@ void Thread::set_name(const char* name) { // Close our own handle for the thread. Thread::~Thread() { - if (data_->thread_ != kNoThread) CloseHandle(data_->thread_); - delete data_; + if (thread_ != kNoThread) CloseHandle(thread_); } // Create a new thread. It is important to use _beginthreadex() instead of // the Win32 function CreateThread(), because the CreateThread() does not // initialize thread specific structures in the C runtime library. void Thread::Start() { - data_->thread_ = reinterpret_cast( + thread_ = reinterpret_cast( _beginthreadex(NULL, static_cast(stack_size_), ThreadEntry, this, 0, - &data_->thread_id_)); + &thread_id_)); } // Wait for thread to terminate. void Thread::Join() { - if (data_->thread_id_ != GetCurrentThreadId()) { - WaitForSingleObject(data_->thread_, INFINITE); + if (thread_id_ != GetCurrentThreadId()) { + WaitForSingleObject(thread_, INFINITE); } } @@ -244,20 +263,25 @@ void OS::Sleep(int milliseconds) { bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread) { - mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); - if (!aIsMainThread) - return false; + ThreadInfo* info = new ThreadInfo(aName, GetCurrentThreadId(), + aIsMainThread, aPseudoStack); - ThreadInfo* info = new ThreadInfo(aName, 0, true, aPseudoStack); + bool profileThread = sActiveSampler && + (aIsMainThread || sActiveSampler->ProfileThreads()); - if (sActiveSampler) { + if (profileThread) { // We need to create the ThreadProfile now info->SetProfile(new ThreadProfile(info->Name(), sActiveSampler->EntrySize(), info->Stack(), - info->ThreadId(), - true)); + GetCurrentThreadId(), + info->GetPlatformData(), + aIsMainThread)); + if (sActiveSampler->ProfileJS()) { + info->Profile()->GetPseudoStack()->enableJSSampling(); + } } sRegisteredThreads->push_back(info); @@ -266,5 +290,16 @@ bool Sampler::RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack void Sampler::UnregisterCurrentThread() { - // We only have the main thread currently and that will never be unregistered -} \ No newline at end of file + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + + int id = GetCurrentThreadId(); + + for (uint32_t i = 0; i < sRegisteredThreads->size(); i++) { + ThreadInfo* info = sRegisteredThreads->at(i); + if (info->ThreadId() == id) { + delete info; + sRegisteredThreads->erase(sRegisteredThreads->begin() + i); + break; + } + } +} diff --git a/tools/profiler/platform.cpp b/tools/profiler/platform.cpp index 27bbeb6df5b0..80a317365be2 100644 --- a/tools/profiler/platform.cpp +++ b/tools/profiler/platform.cpp @@ -28,9 +28,10 @@ mozilla::ThreadLocal tlsTicker; // it as the flag itself. bool stack_key_initialized; -TimeStamp sLastTracerEvent; // is raced on -int sFrameNumber = 0; -int sLastFrameNumber = 0; +TimeStamp sLastTracerEvent; // is raced on +int sFrameNumber = 0; +int sLastFrameNumber = 0; +static bool sIsProfiling = false; // is raced on /* used to keep track of the last event that we sampled during */ unsigned int sLastSampledEventGeneration = 0; @@ -44,16 +45,33 @@ unsigned int sCurrentEventGeneration = 0; * a problem if 2^32 events happen between samples that we need * to know are associated with different events */ -std::vector* Sampler::sRegisteredThreads = new std::vector(); -mozilla::Mutex* Sampler::sRegisteredThreadsMutex = new mozilla::Mutex("sRegisteredThreads mutex"); +std::vector* Sampler::sRegisteredThreads = nullptr; +mozilla::Mutex* Sampler::sRegisteredThreadsMutex = nullptr; -Sampler* Sampler::sActiveSampler; +TableTicker* Sampler::sActiveSampler; + +void Sampler::Startup() { + sRegisteredThreads = new std::vector(); + sRegisteredThreadsMutex = new mozilla::Mutex("sRegisteredThreads mutex"); +} + +void Sampler::Shutdown() { + while (sRegisteredThreads->size() > 0) { + delete sRegisteredThreads->back(); + sRegisteredThreads->pop_back(); + } + + delete sRegisteredThreadsMutex; + delete sRegisteredThreads; +} ThreadInfo::~ThreadInfo() { free(mName); if (mProfile) delete mProfile; + + Sampler::FreePlatformData(mPlatformData); } bool sps_version2() @@ -235,9 +253,13 @@ void mozilla_sampler_init() } stack_key_initialized = true; + Sampler::Startup(); + PseudoStack *stack = new PseudoStack(); tlsPseudoStack.set(stack); + Sampler::RegisterCurrentThread("Gecko", stack, true); + if (sps_version2()) { // Read mode settings from MOZ_PROFILER_MODE and interval // settings from MOZ_PROFILER_INTERVAL and stack-scan threshhold @@ -306,9 +328,10 @@ void mozilla_sampler_shutdown() uwt__deinit(); } - Sampler::FreeRegisteredThreads(); - profiler_stop(); + + Sampler::Shutdown(); + // We can't delete the Stack because we can be between a // sampler call_enter/call_exit point. // TODO Need to find a safe time to delete Stack @@ -367,6 +390,7 @@ const char** mozilla_sampler_get_features() #endif "jank", "js", + "threads", NULL }; @@ -398,16 +422,29 @@ void mozilla_sampler_start(int aProfileEntries, int aInterval, if (sps_version2()) { t = new BreakpadSampler(aInterval ? aInterval : PROFILE_DEFAULT_INTERVAL, aProfileEntries ? aProfileEntries : PROFILE_DEFAULT_ENTRY, - stack, aFeatures, aFeatureCount); + aFeatures, aFeatureCount); } else { t = new TableTicker(aInterval ? aInterval : PROFILE_DEFAULT_INTERVAL, aProfileEntries ? aProfileEntries : PROFILE_DEFAULT_ENTRY, - stack, aFeatures, aFeatureCount); + aFeatures, aFeatureCount); } tlsTicker.set(t); t->Start(); - if (t->ProfileJS()) - stack->enableJSSampling(); + if (t->ProfileJS()) { + mozilla::MutexAutoLock lock(*Sampler::sRegisteredThreadsMutex); + std::vector threads = t->GetRegisteredThreads(); + + for (uint32_t i = 0; i < threads.size(); i++) { + ThreadInfo* info = threads[i]; + ThreadProfile* thread_profile = info->Profile(); + if (!thread_profile) { + continue; + } + thread_profile->GetPseudoStack()->enableJSSampling(); + } + } + + sIsProfiling = true; nsCOMPtr os = mozilla::services::GetObserverService(); if (os) @@ -435,6 +472,8 @@ void mozilla_sampler_stop() if (disableJS) stack->disableJSSampling(); + sIsProfiling = false; + nsCOMPtr os = mozilla::services::GetObserverService(); if (os) os->NotifyObservers(nullptr, "profiler-stopped", nullptr); @@ -442,15 +481,7 @@ void mozilla_sampler_stop() bool mozilla_sampler_is_active() { - if (!stack_key_initialized) - profiler_init(); - - TableTicker *t = tlsTicker.get(); - if (!t) { - return false; - } - - return t->IsActive(); + return sIsProfiling; } static double sResponsivenessTimes[100]; diff --git a/tools/profiler/platform.h b/tools/profiler/platform.h index 8371927aa9d2..f78c6911f9d4 100644 --- a/tools/profiler/platform.h +++ b/tools/profiler/platform.h @@ -35,14 +35,23 @@ #define __android_log_print(a, ...) #endif +#ifdef XP_UNIX +#include +#endif + #include "mozilla/StandardInteger.h" #include "mozilla/Util.h" #include "mozilla/unused.h" #include "mozilla/TimeStamp.h" +#include "mozilla/Mutex.h" #include "PlatformMacros.h" #include "v8-support.h" #include +#ifdef XP_WIN +#include +#endif + #define ASSERT(a) MOZ_ASSERT(a) #ifdef ANDROID @@ -183,14 +192,17 @@ class Thread { // prctl(). static const int kMaxThreadNameLength = 16; - class PlatformData; - PlatformData* data() { return data_; } +#ifdef XP_WIN + HANDLE thread_; + unsigned thread_id_; +#endif +#if defined(XP_MACOSX) + pthread_t thread_; +#endif private: void set_name(const char *name); - PlatformData* data_; - char name_[kMaxThreadNameLength]; int stack_size_; @@ -264,34 +276,9 @@ class TickSample { mozilla::TimeStamp timestamp; }; -class ThreadInfo { - public: - ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread, PseudoStack* aPseudoStack) - : mName(strdup(aName)) - , mThreadId(aThreadId) - , mIsMainThread(aIsMainThread) - , mPseudoStack(aPseudoStack) - , mProfile(NULL) {} - - virtual ~ThreadInfo(); - - const char* Name() const { return mName; } - int ThreadId() const { return mThreadId; } - - bool IsMainThread() const { return mIsMainThread; } - PseudoStack* Stack() const { return mPseudoStack; } - - void SetProfile(ThreadProfile* aProfile) { mProfile = aProfile; } - ThreadProfile* Profile() const { return mProfile; } - - private: - char* mName; - int mThreadId; - const bool mIsMainThread; - PseudoStack* mPseudoStack; - ThreadProfile* mProfile; -}; - +class ThreadInfo; +class PlatformData; +class TableTicker; class Sampler { public: // Initialize sampler. @@ -300,9 +287,6 @@ class Sampler { int interval() const { return interval_; } - // Performs stack sampling. - virtual void SampleStack(TickSample* sample) = 0; - // This method is called for each sampling period with the current // program counter. virtual void Tick(TickSample* sample) = 0; @@ -326,11 +310,14 @@ class Sampler { bool IsPaused() const { return paused_; } void SetPaused(bool value) { NoBarrier_Store(&paused_, value); } + virtual bool ProfileThreads() const = 0; + int EntrySize() { return entrySize_; } - class PlatformData; - - PlatformData* platform_data() { return data_; } + // We can't new/delete the type safely without defining it + // (-Wdelete-incomplete). Use these Alloc/Free functions instead. + static PlatformData* AllocPlatformData(int aThreadId); + static void FreePlatformData(PlatformData*); // If we move the backtracing code into the platform files we won't // need to have these hacks @@ -343,31 +330,23 @@ class Sampler { #endif static std::vector GetRegisteredThreads() { - mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex); - return *sRegisteredThreads; } static bool RegisterCurrentThread(const char* aName, PseudoStack* aPseudoStack, bool aIsMainThread); static void UnregisterCurrentThread(); + static void Startup(); // Should only be called on shutdown - static void FreeRegisteredThreads() { - while (sRegisteredThreads->size() > 0) { - sRegisteredThreads->pop_back(); - } + static void Shutdown(); - delete sRegisteredThreadsMutex; - delete sRegisteredThreads; - } - - static Sampler* GetActiveSampler() { return sActiveSampler; } - static void SetActiveSampler(Sampler* sampler) { sActiveSampler = sampler; } + static TableTicker* GetActiveSampler() { return sActiveSampler; } + static void SetActiveSampler(TableTicker* sampler) { sActiveSampler = sampler; } + static mozilla::Mutex* sRegisteredThreadsMutex; protected: static std::vector* sRegisteredThreads; - static mozilla::Mutex* sRegisteredThreadsMutex; - static Sampler* sActiveSampler; + static TableTicker* sActiveSampler; private: void SetActive(bool value) { NoBarrier_Store(&active_, value); } @@ -377,7 +356,46 @@ class Sampler { Atomic32 paused_; Atomic32 active_; const int entrySize_; - PlatformData* data_; // Platform specific data. + + // Refactor me! +#if defined(SPS_OS_linux) || defined(SPS_OS_android) + bool signal_handler_installed_; + struct sigaction old_sigprof_signal_handler_; + struct sigaction old_sigsave_signal_handler_; + bool signal_sender_launched_; + pthread_t signal_sender_thread_; +#endif +}; + +class ThreadInfo { + public: + ThreadInfo(const char* aName, int aThreadId, bool aIsMainThread, PseudoStack* aPseudoStack) + : mName(strdup(aName)) + , mThreadId(aThreadId) + , mIsMainThread(aIsMainThread) + , mPseudoStack(aPseudoStack) + , mPlatformData(Sampler::AllocPlatformData(aThreadId)) + , mProfile(NULL) {} + + virtual ~ThreadInfo(); + + const char* Name() const { return mName; } + int ThreadId() const { return mThreadId; } + + bool IsMainThread() const { return mIsMainThread; } + PseudoStack* Stack() const { return mPseudoStack; } + + void SetProfile(ThreadProfile* aProfile) { mProfile = aProfile; } + ThreadProfile* Profile() const { return mProfile; } + + PlatformData* GetPlatformData() const { return mPlatformData; } + private: + char* mName; + int mThreadId; + const bool mIsMainThread; + PseudoStack* mPseudoStack; + PlatformData* mPlatformData; + ThreadProfile* mProfile; }; #endif /* ndef TOOLS_PLATFORM_H_ */ From b7e1764ebe88215e7adb2873ef092374195da128 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 16 Apr 2013 08:23:18 +0200 Subject: [PATCH 021/438] Bug 861453 - Restore empty substs after bug 857557, but put them in a separate file, unlisted as a dependency for everything. r=gps --- build/macosx/universal/flight.mk | 1 + config/autoconf.mk.in | 1 + config/emptyvars.mk.in | 1 + config/moz.build | 1 + js/src/config/autoconf.mk.in | 1 + js/src/config/emptyvars.mk.in | 1 + js/src/configure.in | 2 +- python/mozbuild/mozbuild/backend/configenvironment.py | 6 +++++- .../mozbuild/test/backend/test_configenvironment.py | 9 ++++++--- 9 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 config/emptyvars.mk.in create mode 100644 js/src/config/emptyvars.mk.in diff --git a/build/macosx/universal/flight.mk b/build/macosx/universal/flight.mk index 675d9d36bed2..544382da7135 100644 --- a/build/macosx/universal/flight.mk +++ b/build/macosx/universal/flight.mk @@ -16,6 +16,7 @@ OBJDIR = $(OBJDIR_ARCH_1) endif topsrcdir = $(TOPSRCDIR) +DEPTH = $(OBJDIR) include $(OBJDIR)/config/autoconf.mk core_abspath = $(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 3a1f0d8f49e1..41f7854eeef7 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -1,2 +1,3 @@ +include $(DEPTH)/config/emptyvars.mk @ALLSUBSTS@ include $(topsrcdir)/config/baseconfig.mk diff --git a/config/emptyvars.mk.in b/config/emptyvars.mk.in new file mode 100644 index 000000000000..388cf2a35986 --- /dev/null +++ b/config/emptyvars.mk.in @@ -0,0 +1 @@ +@ALLEMPTYSUBSTS@ diff --git a/config/moz.build b/config/moz.build index 8c98eb6c345c..422455a99600 100644 --- a/config/moz.build +++ b/config/moz.build @@ -6,6 +6,7 @@ CONFIGURE_SUBST_FILES += [ 'autoconf.mk', + 'emptyvars.mk', 'doxygen.cfg', 'makefiles/test/Makefile', 'tests/makefiles/autodeps/Makefile', diff --git a/js/src/config/autoconf.mk.in b/js/src/config/autoconf.mk.in index 3a1f0d8f49e1..41f7854eeef7 100644 --- a/js/src/config/autoconf.mk.in +++ b/js/src/config/autoconf.mk.in @@ -1,2 +1,3 @@ +include $(DEPTH)/config/emptyvars.mk @ALLSUBSTS@ include $(topsrcdir)/config/baseconfig.mk diff --git a/js/src/config/emptyvars.mk.in b/js/src/config/emptyvars.mk.in new file mode 100644 index 000000000000..388cf2a35986 --- /dev/null +++ b/js/src/config/emptyvars.mk.in @@ -0,0 +1 @@ +@ALLEMPTYSUBSTS@ diff --git a/js/src/configure.in b/js/src/configure.in index 1e6636dc0fe5..3ec29c04489a 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -4384,7 +4384,7 @@ AC_SUBST(ac_configure_args) dnl Spit out some output dnl ======================================================== -AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk]) +AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk config/emptyvars.mk]) # Produce the js-config script at configure time; see the comments for # 'js-config' in Makefile.in. diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py index 89d8a5684296..dc63edcf4ea5 100644 --- a/python/mozbuild/mozbuild/backend/configenvironment.py +++ b/python/mozbuild/mozbuild/backend/configenvironment.py @@ -86,13 +86,15 @@ class ConfigEnvironment(object): - ALLDEFINES contains the defines in the form #define NAME VALUE, in sorted order, for use in config files, for an automatic listing of defines. - and another additional subst variable from all the other substs: + and two other additional subst variables from all the other substs: - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted order, for use in autoconf.mk. It includes ACDEFINES, but doesn't include ALLDEFINES. Only substs with a VALUE are included, such that the resulting file doesn't change when new empty substs are added. This results in less invalidation of build dependencies in the case of autoconf.mk.. + - ALLEMPTYSUBSTS contains the substs with an empty value, in the form + NAME =. ConfigEnvironment expects a "top_srcdir" subst to be set with the top source directory, in msys format on windows. It is used to derive a @@ -113,6 +115,8 @@ class ConfigEnvironment(object): shell_escape(self.defines[name])) for name in global_defines]) self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name, self.substs[name]) for name in self.substs if self.substs[name]])) + self.substs['ALLEMPTYSUBSTS'] = '\n'.join(sorted(['%s =' % name + for name in self.substs if not self.substs[name]])) self.substs['ALLDEFINES'] = '\n'.join(sorted(['#define %s %s' % (name, self.defines[name]) for name in global_defines])) diff --git a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py index a93ac9495cc7..dd202a3b2907 100644 --- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py +++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py @@ -22,14 +22,14 @@ class ConfigEnvironment(ConfigStatus.ConfigEnvironment): class TestEnvironment(unittest.TestCase): def test_auto_substs(self): - '''Test the automatically set values of ACDEFINES, ALLDEFINES - and ALLSUBSTS. + '''Test the automatically set values of ACDEFINES, ALLDEFINES, + ALLSUBSTS and ALLEMPTYSUBSTS. ''' env = ConfigEnvironment('.', '.', defines = [ ('foo', 'bar'), ('baz', 'qux 42'), ('abc', 'def'), ('extra', 'foobar') ], non_global_defines = ['extra', 'ignore'], - substs = [ ('FOO', 'bar'), ('ABC', 'def'), + substs = [ ('FOO', 'bar'), ('FOOBAR', ''), ('ABC', 'def'), ('bar', 'baz qux'), ('zzz', '"abc def"'), ('qux', '') ]) # non_global_defines should be filtered out in ACDEFINES and @@ -47,6 +47,9 @@ ACDEFINES = -Dfoo=bar -Dbaz=qux\ 42 -Dabc=def FOO = bar bar = baz qux zzz = "abc def"''') + # ALLEMPTYSUBSTS contains all substs with no value. + self.assertEqual(env.substs['ALLEMPTYSUBSTS'], '''FOOBAR = +qux =''') def test_config_file(self): '''Test the creation of config files. From b37125b286e2c6298d32616d20d2b5b27b4280dd Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Mon, 15 Apr 2013 15:41:55 -0700 Subject: [PATCH 022/438] Bug 851630: fix error in patch for bug 758288 that caused improper cancellation of key events in children of autocomplete textboxes, r=dao --HG-- extra : transplant_source : %D2XWZ%B0%21%E6%D5z%3F%26%9D%3E%DD7q%CE%B1%EFE --- toolkit/content/widgets/autocomplete.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index bf1028022f93..31dc01b5c25c 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -441,7 +441,7 @@ Date: Tue, 16 Apr 2013 08:25:29 -0700 Subject: [PATCH 023/438] Bug 862186: remove unused import from DebuggerUI.jsm, r=past --HG-- extra : transplant_source : %27%06U%D8%1C%10%FB%81%E5%00%EBi%2A%27%09%F0%0C%E6%D4%DB --- browser/devtools/debugger/DebuggerUI.jsm | 3 --- 1 file changed, 3 deletions(-) diff --git a/browser/devtools/debugger/DebuggerUI.jsm b/browser/devtools/debugger/DebuggerUI.jsm index 876bcaf90941..af26d1f95f2d 100644 --- a/browser/devtools/debugger/DebuggerUI.jsm +++ b/browser/devtools/debugger/DebuggerUI.jsm @@ -21,9 +21,6 @@ XPCOMUtils.defineLazyModuleGetter(this, XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, - "FileUtils", "resource://gre/modules/FileUtils.jsm"); - this.EXPORTED_SYMBOLS = ["DebuggerUI"]; /** From c1bc4b958c6bb48a1fc86e444c0f6b05aa131bcc Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Thu, 17 Nov 2011 13:41:04 -0800 Subject: [PATCH 024/438] Bug 703377: remove now-unused pref override functionality, r=dolske --HG-- extra : transplant_source : %C1%B65%07%B60XS%AB%DD%EF7Hx%A5%8Cz%11%04%97 --- .../dirprovider/DirectoryProvider.cpp | 10 ----- .../nsBrowserDirectoryServiceDefs.h | 24 ------------ .../dirprovider/tests/unit/test_keys.js | 11 +----- browser/components/nsBrowserContentHandler.js | 37 ------------------- browser/locales/Makefile.in | 11 ------ 5 files changed, 1 insertion(+), 92 deletions(-) delete mode 100644 browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp index 04e7a8e26ac2..92bc762d7418 100644 --- a/browser/components/dirprovider/DirectoryProvider.cpp +++ b/browser/components/dirprovider/DirectoryProvider.cpp @@ -12,7 +12,6 @@ #include "nsArrayEnumerator.h" #include "nsEnumeratorUtils.h" -#include "nsBrowserDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h" #include "nsDirectoryServiceDefs.h" #include "nsCategoryManagerUtils.h" @@ -58,15 +57,6 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult) } } } - else if (!strcmp(aKey, NS_APP_EXISTING_PREF_OVERRIDE)) { - rv = NS_GetSpecialDirectory(NS_APP_DEFAULTS_50_DIR, - getter_AddRefs(file)); - NS_ENSURE_SUCCESS(rv, rv); - - file->AppendNative(NS_LITERAL_CSTRING("existing-profile-defaults.js")); - file.swap(*aResult); - return NS_OK; - } else { return NS_ERROR_FAILURE; } diff --git a/browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h b/browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h deleted file mode 100644 index 9b89855ff60f..000000000000 --- a/browser/components/dirprovider/nsBrowserDirectoryServiceDefs.h +++ /dev/null @@ -1,24 +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/. */ - -#ifndef nsBrowserDirectoryServiceDefs_h___ -#define nsBrowserDirectoryServiceDefs_h___ - -//============================================================================= -// -// Defines property names for directories available from the browser-specific -// nsBrowserDirectoryProvider. -// -// System and XPCOM properties are defined in nsDirectoryServiceDefs.h. -// General application properties are defined in nsAppDirectoryServiceDefs.h. -// -//============================================================================= - -// ---------------------------------------------------------------------------- -// Files and directories that exist on a per-browser basis. -// ---------------------------------------------------------------------------- - -#define NS_APP_EXISTING_PREF_OVERRIDE "ExistingPrefOverride" - -#endif diff --git a/browser/components/dirprovider/tests/unit/test_keys.js b/browser/components/dirprovider/tests/unit/test_keys.js index 174ba59d3b6b..8f0773b27c68 100644 --- a/browser/components/dirprovider/tests/unit/test_keys.js +++ b/browser/components/dirprovider/tests/unit/test_keys.js @@ -10,17 +10,8 @@ function test_bookmarkhtml() { do_check_true(bmarks.equals(tbmarks)); } -function test_prefoverride() { - let dir = gDirSvc.get("DefRt", Ci.nsIFile); - dir.append("existing-profile-defaults.js"); - - let tdir = gDirSvc.get("ExistingPrefOverride", Ci.nsIFile); - do_check_true(dir.equals(tdir)); -} - function run_test() { - [test_bookmarkhtml, - test_prefoverride + [test_bookmarkhtml ].forEach(function(f) { do_test_pending(); print("Running test: " + f.name); diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index b489719cb356..f129168609b0 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -172,40 +172,6 @@ function getPostUpdateOverridePage(defaultOverridePage) { return update.getProperty("openURL") || defaultOverridePage; } -// Copies a pref override file into the user's profile pref-override folder, -// and then tells the pref service to reload its default prefs. -function copyPrefOverride() { - try { - var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"] - .getService(Components.interfaces.nsIProperties); - const NS_APP_EXISTING_PREF_OVERRIDE = "ExistingPrefOverride"; - var prefOverride = fileLocator.get(NS_APP_EXISTING_PREF_OVERRIDE, - Components.interfaces.nsIFile); - if (!prefOverride.exists()) - return; // nothing to do - - const NS_APP_PREFS_OVERRIDE_DIR = "PrefDOverride"; - var prefOverridesDir = fileLocator.get(NS_APP_PREFS_OVERRIDE_DIR, - Components.interfaces.nsIFile); - - // Check for any existing pref overrides, and remove them if present - var existingPrefOverridesFile = prefOverridesDir.clone(); - existingPrefOverridesFile.append(prefOverride.leafName); - if (existingPrefOverridesFile.exists()) - existingPrefOverridesFile.remove(false); - - prefOverride.copyTo(prefOverridesDir, null); - - // Now that we've installed the new-profile pref override file, - // re-read the default prefs. - var prefSvcObs = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIObserver); - prefSvcObs.observe(null, "reload-default-prefs", null); - } catch (ex) { - Components.utils.reportError(ex); - } -} - // Flag used to indicate that the arguments to openWindow can be passed directly. const NO_EXTERNAL_URIS = 1; @@ -600,9 +566,6 @@ nsBrowserContentHandler.prototype = { overridePage = Services.urlFormatter.formatURLPref("startup.homepage_welcome_url"); break; case OVERRIDE_NEW_MSTONE: - // Existing profile, new milestone build. - copyPrefOverride(); - // Check whether we have a session to restore. If we do, we assume // that this is an "update" session. var ss = Components.classes["@mozilla.org/browser/sessionstartup;1"] diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in index 4a71ea98ed2c..2353a1b96e02 100644 --- a/browser/locales/Makefile.in +++ b/browser/locales/Makefile.in @@ -99,17 +99,6 @@ $(STAGEDIST): $(DIST)/branding $(DIST)/branding: $(NSINSTALL) -D $@ -libs:: - @if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \ - $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \ - $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \ - fi -install:: - @if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \ - $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \ - $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(DESTDIR)$(mozappdir)/defaults/existing-profile-defaults.js; \ - fi - PROFILE_FILES = \ localstore.rdf \ mimeTypes.rdf \ From bb65618e53a56d196a5145387094c9d176efba6b Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Tue, 16 Apr 2013 08:27:42 -0700 Subject: [PATCH 025/438] bug 862152: remove obsolete xpcom/tests/utils code, r=bsmedberg --HG-- extra : transplant_source : ytT%C26%9B%27d%AB%A4%EA%5E%F3%21%7F%0AV%B9%86%00 --- xpcom/tests/utils/WhatError.cpp | 29 ------ xpcom/tests/utils/cp.js | 111 ----------------------- xpcom/tests/utils/dirs.js | 155 -------------------------------- xpcom/tests/utils/ls.js | 64 ------------- 4 files changed, 359 deletions(-) delete mode 100644 xpcom/tests/utils/WhatError.cpp delete mode 100644 xpcom/tests/utils/cp.js delete mode 100644 xpcom/tests/utils/dirs.js delete mode 100644 xpcom/tests/utils/ls.js diff --git a/xpcom/tests/utils/WhatError.cpp b/xpcom/tests/utils/WhatError.cpp deleted file mode 100644 index 8b9e9e159edc..000000000000 --- a/xpcom/tests/utils/WhatError.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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 "nsError.h" -#include -#include - -int -main(int argc, char **argv) -{ - int errorCode = 0; - char buffer[100]; - - if (argc != 2) - return -1; - - sscanf( argv[1], "0x%x", &errorCode); - sprintf(buffer, "%d", errorCode); - sscanf( buffer, "%d", &errorCode); - - printf( "Code: %d, Module: %d, Severity: %d\n", - NS_ERROR_GET_CODE(errorCode), - NS_ERROR_GET_MODULE(errorCode), - NS_ERROR_GET_SEVERITY(errorCode)); - - return 0; -} diff --git a/xpcom/tests/utils/cp.js b/xpcom/tests/utils/cp.js deleted file mode 100644 index a38c120b6ba4..000000000000 --- a/xpcom/tests/utils/cp.js +++ /dev/null @@ -1,111 +0,0 @@ -const nsILocalFile = Components.interfaces.nsILocalFile; -var prefix = ""; - -function rename(source, newName) -{ - try { - var sourceFile = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - sourceFile.initWithPath(source); - - } - catch (e) { - dump("Could not create nsILocalFile\n"); - } - - - try { - sourceFile.copyTo(null, newName); - } - catch (e) { - dump("error coping" + e + "\n"); - } -} - - -function cp(source, dest, followLinks, newName) -{ - try { - var sourceFile = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - sourceFile.initWithPath(source); - - var destFile = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - destFile.initWithPath(dest); - - } - catch (e) { - dump("Could not create nsILocalFile\n"); - } - - try { - - if (! destFile.isDirectory()) - { - dump("destination not a directory!\n"); - return; - } - } - catch (e) { - dump("error accessing dest"); - } - - try { - if (followLinks) - { - sourceFile.copyToFollowingLinks(destFile, newName); - } - else - { - sourceFile.copyTo(destFile, newName); - } - } - catch (e) { - dump("error coping" + e + "\n"); - } -} - - -function mv(source, dest, followLinks, newName) -{ - try { - var sourceFile = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - sourceFile.initWithPath(source); - - var destFile = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - destFile.initWithPath(dest); - - } - catch (e) { - dump("Could not create nsILocalFile\n"); - } - - try { - - if (! destFile.isDirectory()) - { - dump("destination not a directory!\n"); - return; - } - } - catch (e) { - dump("error accessing dest"); - } - - try { - if (followLinks) - { - sourceFile.moveToFollowingLinks(destFile, newName); - } - else - { - sourceFile.moveTo(destFile, newName); - } - } - catch (e) { - dump("error coping" + e + "\n"); - } -} diff --git a/xpcom/tests/utils/dirs.js b/xpcom/tests/utils/dirs.js deleted file mode 100644 index c3fc24791776..000000000000 --- a/xpcom/tests/utils/dirs.js +++ /dev/null @@ -1,155 +0,0 @@ -function dumpPathOfProperty(prop) -{ - dump(prop +' = '); - - try - { - var file = dsprops.get(prop, Components.interfaces.nsIFile); - dump(file.path + '\n'); - } - catch (ar) - { - dump('undefined or error \n'); - } -} - -var dscontractid = "@mozilla.org/file/directory_service;1"; // XXX old-style -var ds = Components.classes[dscontractid].getService(); -var dsprops = ds.QueryInterface(Components.interfaces.nsIProperties); - -dump("xpcom locations::\n"); -// XPCOM Locations: - dumpPathOfProperty ("xpcom.currentProcess"); - dumpPathOfProperty ("xpcom.currentProcess.componentRegistry"); - dumpPathOfProperty ("xpcom.currentProcess.componentDirectory"); - dumpPathOfProperty ("system.OS_DriveDirectory"); - dumpPathOfProperty ("system.OS_TemporaryDirectory"); - dumpPathOfProperty ("system.OS_CurrentProcessDirectory"); - dumpPathOfProperty ("system.OS_CurrentWorkingDirectory"); - -dump("Mac locations::\n"); -// Mac - dumpPathOfProperty ("system.SystemDirectory"); - dumpPathOfProperty ("system.DesktopDirectory"); - dumpPathOfProperty ("system.TrashDirectory"); - dumpPathOfProperty ("system.StartupDirectory"); - dumpPathOfProperty ("system.ShutdownDirectory"); - dumpPathOfProperty ("system.AppleMenuDirectory"); - dumpPathOfProperty ("system.ControlPanelDirectory"); - dumpPathOfProperty ("system.ExtensionDirectory"); - dumpPathOfProperty ("system.FontsDirectory"); - dumpPathOfProperty ("system.PreferencesDirectory"); - dumpPathOfProperty ("system.DocumentsDirectory"); - dumpPathOfProperty ("system.InternetSearchDirectory"); - -dump("PC locations::\n"); -// PC - dumpPathOfProperty ("system.SystemDirectory"); - dumpPathOfProperty ("system.WindowsDirectory"); - dumpPathOfProperty ("system.HomeDirectory"); - dumpPathOfProperty ("system.Desktop"); - dumpPathOfProperty ("system.Programs"); - dumpPathOfProperty ("system.Controls"); - dumpPathOfProperty ("system.Printers"); - dumpPathOfProperty ("system.Personal"); - dumpPathOfProperty ("system.Favorites"); - dumpPathOfProperty ("system.Startup"); - dumpPathOfProperty ("system.Recent"); - dumpPathOfProperty ("system.Sendto"); - dumpPathOfProperty ("system.Bitbucket"); - dumpPathOfProperty ("system.Startmenu"); - dumpPathOfProperty ("system.Desktopdirectory"); - dumpPathOfProperty ("system.Drives"); - dumpPathOfProperty ("system.Network"); - dumpPathOfProperty ("system.Nethood"); - dumpPathOfProperty ("system.Fonts"); - dumpPathOfProperty ("system.Templates"); - dumpPathOfProperty ("system.Common_Startmenu"); - dumpPathOfProperty ("system.Common_Programs"); - dumpPathOfProperty ("system.Common_Startup"); - dumpPathOfProperty ("system.Common_Desktopdirectory"); - dumpPathOfProperty ("system.Appdata"); - dumpPathOfProperty ("system.Printhood"); - -dump("Unix locations::\n"); -// Unix - - dumpPathOfProperty ("system.LocalDirectory"); - dumpPathOfProperty ("system.LibDirectory"); - dumpPathOfProperty ("system.HomeDirectory"); - -dump("Beos locations::\n"); -// Beos - - dumpPathOfProperty ("system.SettingsDirectory"); - dumpPathOfProperty ("system.HomeDirectory"); - dumpPathOfProperty ("system.DesktopDirectory"); - dumpPathOfProperty ("system.SystemDirectory"); - -dump("OS2 locations::\n"); -// OS2 - dumpPathOfProperty ("system.SystemDirectory"); - dumpPathOfProperty ("system.OS2Directory"); - dumpPathOfProperty ("system.DesktopDirectory"); - - -// XPFE locations: - - -// application Directories: - dumpPathOfProperty ("app.res.directory"); - dumpPathOfProperty ("app.defaults.directory"); - dumpPathOfProperty ("app.chrome.directory"); - dumpPathOfProperty ("app.chrome.user.directory"); - dumpPathOfProperty ("app.plugins.directory"); - -// application Files: - - dumpPathOfProperty ("app.registry.file.4"); - dumpPathOfProperty ("app.registry.file.5"); - dumpPathOfProperty ("app.local.store.file.5"); - dumpPathOfProperty ("app.history.file.5"); - dumpPathOfProperty ("app.user.panels.5"); - -// Preferences: - -// dumpPathOfProperty ("app.prefs.directory.3"); -// dumpPathOfProperty ("app.prefs.directory.4"); - dumpPathOfProperty ("app.prefs.directory.5"); - dumpPathOfProperty ("app.pref.default.directory.5"); - -// dumpPathOfProperty ("app.prefs.file.3"); -// dumpPathOfProperty ("app.prefs.file.4"); - dumpPathOfProperty ("app.prefs.file.5"); - -// Profile: - -// dumpPathOfProperty ("app.profile.user.directory.3"); -// dumpPathOfProperty ("app.profile.user.directory.4"); - dumpPathOfProperty ("app.profile.user.directory.5"); -// dumpPathOfProperty ("app.profile.default.user.directory.3"); -// dumpPathOfProperty ("app.profile.default.user.directory.4"); - dumpPathOfProperty ("app.profile.default.user.directory.5"); -// dumpPathOfProperty ("app.profile.defaults.directory.3"); -// dumpPathOfProperty ("app.profile.defaults.directory.4"); - dumpPathOfProperty ("app.profile.defaults.directory.5"); - - - -// Bookmarks: - -// dumpPathOfProperty ("app.bookmark.file.3"); -// dumpPathOfProperty ("app.bookmark.file.4"); - dumpPathOfProperty ("app.bookmark.file.5"); - -// Search - dumpPathOfProperty ("app.search.file.5"); - dumpPathOfProperty ("app.search.directory.5"); - - -// MailNews: - - dumpPathOfProperty ("app.mail.directory.5"); - dumpPathOfProperty ("app.mail.imap.directory.5"); - dumpPathOfProperty ("app.mail.news.directory.5"); - dumpPathOfProperty ("app.mail.messenger.cache.directory.5"); diff --git a/xpcom/tests/utils/ls.js b/xpcom/tests/utils/ls.js deleted file mode 100644 index 8ae62f06fef0..000000000000 --- a/xpcom/tests/utils/ls.js +++ /dev/null @@ -1,64 +0,0 @@ -const nsILocalFile = Components.interfaces.nsILocalFile; -var prefix = ""; - -function ls(path, recur) -{ - var file = Components.classes["@mozilla.org/file/local;1"]. - createInstance(nsILocalFile); - try { - file.initWithPath( path ); - - if (file.isDirectory() && arguments.length == 1) - ls_dir(file, recur); - else - ls_file(file, recur); - } - catch (e) { - dump("Error Returned " + e + "\n"); - } -} -function ls_file(file, recur) -{ - dump(prefix); - - try { - if (file.isDirectory()) { - dump("directory " + file.leafName + "\n"); - if(recur) - ls_dir(file, true); - return; - } - - dump(file.leafName + " " + file.fileSize); - if (file.isSymlink()) - dump(" -> " + file.target); - dump("\n"); - } - - catch (e) { - dump(file.leafName + " (error accessing)\n"); - } -} - -function ls_dir(file, recur) -{ - var leafName = file.leafName; - - var old = prefix; - prefix = prefix + " "; - - iter = file.directoryEntries; - dump(iter + "\n"); - - foreach_iter(iter, - function (file) { ls_file(file, recur); }); - prefix = old; -} - -function foreach_iter(iter, fun) -{ - while (iter.hasMoreElements()) { - var item = iter.getNext().QueryInterface(nsILocalFile); - fun(item); - } -} From 57ff08adeafdbd26535dfbafaa0d319d0c194742 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Tue, 16 Apr 2013 08:33:41 -0700 Subject: [PATCH 026/438] Bug 847211: When reparenting style contexts, skip flex-item style fixup if our element is the root of an anonymous subtree. r=bz --- layout/base/nsCSSFrameConstructor.cpp | 2 ++ layout/generic/crashtests/847211-1.html | 19 +++++++++++++++++++ layout/generic/crashtests/crashtests.list | 1 + layout/style/nsStyleSet.cpp | 8 ++++++++ 4 files changed, 30 insertions(+) create mode 100644 layout/generic/crashtests/847211-1.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index deab4aed4a7e..dda85e58a416 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -9892,6 +9892,8 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, NS_ABORT_IF_FALSE(!content->IsNodeOfType(nsINode::eCOMMENT) && !content->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION), "Why is someone creating garbage anonymous content"); + NS_ABORT_IF_FALSE(content->IsRootOfAnonymousSubtree(), + "Content should know it's an anonymous subtree"); nsRefPtr styleContext; TreeMatchContext::AutoFlexItemStyleFixupSkipper diff --git a/layout/generic/crashtests/847211-1.html b/layout/generic/crashtests/847211-1.html new file mode 100644 index 000000000000..83e7da0eb546 --- /dev/null +++ b/layout/generic/crashtests/847211-1.html @@ -0,0 +1,19 @@ + + + + + + + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 6f103bf6d249..642a81656bbe 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -454,6 +454,7 @@ test-pref(layout.css.flexbox.enabled,true) load 844529-1.html load 847130.xhtml load 847208.html asserts(4) load 847209.html # bug 847368 +test-pref(layout.css.flexbox.enabled,true) load 847211-1.html load 849603.html test-pref(layout.css.flexbox.enabled,true) load 851396-1.html test-pref(layout.css.flexbox.enabled,true) load 854263-1.html diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index 2bdc050167b1..0096750e4fee 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -1726,6 +1726,14 @@ nsStyleSet::ReparentStyleContext(nsStyleContext* aStyleContext, flags |= eDoAnimation; } + if (aElement && aElement->IsRootOfAnonymousSubtree()) { + // For anonymous subtree roots, don't tweak "display" value based on + // whether or not the parent is styled as a flex container. (If the parent + // has anonymous-subtree kids, then we know it's not actually going to get + // a flex container frame, anyway.) + flags |= eSkipFlexItemStyleFixup; + } + return GetContext(aNewParentContext, ruleNode, visitedRuleNode, pseudoTag, pseudoType, aElement, flags); From d73ecc7c2c7cc1f1377722f334f2e12903f6dc8f Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Tue, 16 Apr 2013 17:40:08 +0200 Subject: [PATCH 027/438] Bug 829419 - Don't allow processing pending events while shutting down cache IO thread, r=jduell --- netwerk/cache/Makefile.in | 1 + netwerk/cache/nsCacheService.cpp | 3 +- netwerk/cache/nsCacheUtils.cpp | 85 ++++++++++++++++++++++++++++++++ netwerk/cache/nsCacheUtils.h | 44 +++++++++++++++++ netwerk/cache/nsDeleteDir.cpp | 17 +------ 5 files changed, 134 insertions(+), 16 deletions(-) create mode 100644 netwerk/cache/nsCacheUtils.cpp create mode 100644 netwerk/cache/nsCacheUtils.h diff --git a/netwerk/cache/Makefile.in b/netwerk/cache/Makefile.in index f3d7dbd5e41c..b84ccb271bdb 100644 --- a/netwerk/cache/Makefile.in +++ b/netwerk/cache/Makefile.in @@ -28,6 +28,7 @@ CPPSRCS = \ nsCacheMetaData.cpp \ nsCacheService.cpp \ nsCacheSession.cpp \ + nsCacheUtils.cpp \ nsMemoryCacheDevice.cpp \ nsDiskCacheBinding.cpp \ nsDiskCacheBlockFile.cpp \ diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index a7ed007fcb8b..ea3151a22afa 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -20,6 +20,7 @@ #include "nsICacheVisitor.h" #include "nsDiskCacheDevice.h" #include "nsDiskCacheDeviceSQL.h" +#include "nsCacheUtils.h" #include "nsIObserverService.h" #include "nsIPrefService.h" @@ -1254,7 +1255,7 @@ nsCacheService::Shutdown() } if (cacheIOThread) - cacheIOThread->Shutdown(); + nsShutdownThread::BlockingShutdown(cacheIOThread); if (shouldSanitize) { nsresult rv = parentDir->AppendNative(NS_LITERAL_CSTRING("Cache")); diff --git a/netwerk/cache/nsCacheUtils.cpp b/netwerk/cache/nsCacheUtils.cpp new file mode 100644 index 000000000000..475cf712f32a --- /dev/null +++ b/netwerk/cache/nsCacheUtils.cpp @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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 "nsCache.h" +#include "nsCacheUtils.h" +#include "nsThreadUtils.h" + +using namespace mozilla; + +class nsDestroyThreadEvent : public nsRunnable { +public: + nsDestroyThreadEvent(nsIThread *thread) + : mThread(thread) + {} + NS_IMETHOD Run() + { + mThread->Shutdown(); + return NS_OK; + } +private: + nsCOMPtr mThread; +}; + +nsShutdownThread::nsShutdownThread(nsIThread *aThread) + : mLock("nsShutdownThread.mLock") + , mCondVar(mLock, "nsShutdownThread.mCondVar") + , mThread(aThread) +{ +} + +nsShutdownThread::~nsShutdownThread() +{ +} + +nsresult +nsShutdownThread::Shutdown(nsIThread *aThread) +{ + nsresult rv; + nsRefPtr ev = new nsDestroyThreadEvent(aThread); + rv = NS_DispatchToMainThread(ev); + if (NS_FAILED(rv)) { + NS_WARNING("Dispatching event in nsShutdownThread::Shutdown failed!"); + } + return rv; +} + +nsresult +nsShutdownThread::BlockingShutdown(nsIThread *aThread) +{ + nsresult rv; + + nsRefPtr st = new nsShutdownThread(aThread); + nsCOMPtr workerThread; + + rv = NS_NewNamedThread("thread shutdown", getter_AddRefs(workerThread)); + if (NS_FAILED(rv)) { + NS_WARNING("Can't create nsShutDownThread worker thread!"); + return rv; + } + + { + MutexAutoLock lock(st->mLock); + rv = aThread->Dispatch(st, NS_DISPATCH_NORMAL); + if (NS_FAILED(rv)) { + NS_WARNING( + "Dispatching event in nsShutdownThread::BlockingShutdown failed!"); + } else { + st->mCondVar.Wait(); + } + } + + return Shutdown(workerThread); +} + +NS_IMETHODIMP +nsShutdownThread::Run() +{ + MutexAutoLock lock(mLock); + mThread->Shutdown(); + mCondVar.Notify(); + return NS_OK; +} diff --git a/netwerk/cache/nsCacheUtils.h b/netwerk/cache/nsCacheUtils.h new file mode 100644 index 000000000000..611a41575e36 --- /dev/null +++ b/netwerk/cache/nsCacheUtils.h @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set sw=2 ts=8 et tw=80 : */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef _nsCacheUtils_h_ +#define _nsCacheUtils_h_ + +#include "nsThreadUtils.h" +#include "nsCOMPtr.h" +#include "mozilla/Mutex.h" +#include "mozilla/CondVar.h" + +class nsIThread; + +/** + * A class with utility methods for shutting down nsIThreads easily. + */ +class nsShutdownThread : public nsRunnable { +public: + nsShutdownThread(nsIThread *aThread); + ~nsShutdownThread(); + + NS_IMETHOD Run(); + +/** + * Shutdown ensures that aThread->Shutdown() is called on a main thread + */ + static nsresult Shutdown(nsIThread *aThread); + +/** + * BlockingShutdown ensures that by the time it returns, aThread->Shutdown() has + * been called and no pending events have been processed on the current thread. + */ + static nsresult BlockingShutdown(nsIThread *aThread); + +private: + mozilla::Mutex mLock; + mozilla::CondVar mCondVar; + nsCOMPtr mThread; +}; + +#endif diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp index 248cce07fc0b..fd66c0c0f23b 100644 --- a/netwerk/cache/nsDeleteDir.cpp +++ b/netwerk/cache/nsDeleteDir.cpp @@ -13,6 +13,7 @@ #include "nsAutoPtr.h" #include "nsThreadUtils.h" #include "nsISupportsPriority.h" +#include "nsCacheUtils.h" #include using namespace mozilla; @@ -28,20 +29,6 @@ public: } }; -class nsDestroyThreadEvent : public nsRunnable { -public: - nsDestroyThreadEvent(nsIThread *thread) - : mThread(thread) - {} - NS_IMETHOD Run() - { - mThread->Shutdown(); - return NS_OK; - } -private: - nsCOMPtr mThread; -}; - nsDeleteDir * nsDeleteDir::gInstance = nullptr; @@ -155,7 +142,7 @@ nsDeleteDir::DestroyThread() // more work to do, so don't delete thread. return; - NS_DispatchToMainThread(new nsDestroyThreadEvent(mThread)); + nsShutdownThread::Shutdown(mThread); mThread = nullptr; } From bcf6f3b22dc7c2ce0d4a18f659168a9e638a2b83 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 16 Apr 2013 11:51:49 -0400 Subject: [PATCH 028/438] Backed out changeset 76f7d7963692 (bug 861912) for debug mochitest b-c orange. --- js/xpconnect/src/XPCConvert.cpp | 28 ++++++++++++---------- js/xpconnect/src/XPCWrappedJSClass.cpp | 14 ++++++++--- js/xpconnect/src/XPCWrappedNative.cpp | 5 +++- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 3 +++ js/xpconnect/src/nsXPConnect.cpp | 1 + js/xpconnect/src/xpcprivate.h | 28 ++++++++++++++++++++++ 6 files changed, 62 insertions(+), 17 deletions(-) diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 2079193f75d7..a201d126a3ec 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -29,7 +29,6 @@ using namespace xpc; using namespace mozilla; using namespace mozilla::dom; -using namespace JS; //#define STRICT_CHECK_OF_UNICODE #ifdef STRICT_CHECK_OF_UNICODE @@ -170,7 +169,7 @@ XPCConvert::NativeData2JS(XPCLazyCallContext& lccx, jsval* d, const void* s, nsID* iid2 = *((nsID**)s); if (!iid2) break; - RootedObject scope(cx, lccx.GetScopeForNewJSObjects()); + JS::RootedObject scope(cx, lccx.GetScopeForNewJSObjects()); JSObject* obj; if (!(obj = xpc_NewIDObject(cx, scope, *iid2))) return false; @@ -831,7 +830,7 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx, nsWrapperCache *cache = aHelper.GetWrapperCache(); bool tryConstructSlimWrapper = false; - RootedObject flat(cx); + JS::RootedObject flat(cx); if (cache) { flat = cache->GetWrapper(); if (cache->IsDOMBinding()) { @@ -1154,7 +1153,7 @@ public: private: JSContext * const mContext; - AutoValueRooter tvr; + JS::AutoValueRooter tvr; }; // static @@ -1412,26 +1411,29 @@ XPCConvert::NativeArray2JS(XPCLazyCallContext& lccx, // XXX add support to indicate *which* array element was not convertable - RootedObject array(cx, JS_NewArrayObject(cx, count, nullptr)); + JSObject *array = JS_NewArrayObject(cx, count, nullptr); if (!array) return false; + // root this early *d = OBJECT_TO_JSVAL(array); + AUTO_MARK_JSVAL(ccx, d); if (pErr) *pErr = NS_ERROR_XPC_BAD_CONVERT_NATIVE; uint32_t i; - RootedValue current(cx, JSVAL_NULL); + jsval current = JSVAL_NULL; + AUTO_MARK_JSVAL(ccx, ¤t); -#define POPULATE(_t) \ - PR_BEGIN_MACRO \ - for (i = 0; i < count; i++) { \ - if (!NativeData2JS(ccx, current.address(), ((_t*)*s)+i, type, iid, pErr) || \ - !JS_SetElement(cx, array, i, current.address())) \ - goto failure; \ - } \ +#define POPULATE(_t) \ + PR_BEGIN_MACRO \ + for (i = 0; i < count; i++) { \ + if (!NativeData2JS(ccx, ¤t, ((_t*)*s)+i, type, iid, pErr) ||\ + !JS_SetElement(cx, array, i, ¤t)) \ + goto failure; \ + } \ PR_END_MACRO // XXX check IsPtr - esp. to handle array of nsID (as opposed to nsID*) diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index def5886c3029..d4a47e6cbe5f 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -232,6 +232,9 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, if (!JS_GetPropertyById(cx, jsobj, funid, fun.address()) || JSVAL_IS_PRIMITIVE(fun)) return nullptr; + // protect fun so that we're sure it's alive when we call it + AUTO_MARK_JSVAL(cx, fun); + // Ensure that we are asking for a scriptable interface. // NB: It's important for security that this check is here rather // than later, since it prevents untrusted objects from implementing @@ -268,6 +271,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx, "JS failed without setting an exception!"); RootedValue jsexception(cx, NullValue()); + AUTO_MARK_JSVAL(cx, jsexception.address()); if (JS_GetPendingException(cx, jsexception.address())) { nsresult rv; @@ -712,9 +716,12 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self, } // check if the JSObject claims to implement this interface - RootedObject jsobj(ccx, CallQueryInterfaceOnJSObject(ccx, self->GetJSObject(), - aIID)); + JSObject* jsobj = CallQueryInterfaceOnJSObject(ccx, self->GetJSObject(), + aIID); if (jsobj) { + // protect jsobj until it is actually attached + AUTO_MARK_JSVAL(ccx, OBJECT_TO_JSVAL(jsobj)); + // We can't use XPConvert::JSObject2NativeInterface() here // since that can find a XPCWrappedNative directly on the // proto chain, and we don't want that here. We need to find @@ -1284,7 +1291,8 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16_t methodIndex, nsXPTType datum_type; uint32_t array_count; bool isArray = type.IsArray(); - RootedValue val(cx, NullValue()); + RootedValue val(cx, JSVAL_NULL); + AUTO_MARK_JSVAL(ccx, val.address()); bool isSizedString = isArray ? false : type.TagPart() == nsXPTType::T_PSTRING_SIZE_IS || diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index b518645259f9..dc72f426a50f 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -503,7 +503,9 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx, RootedObject parent(ccx, Scope->GetGlobalJSObject()); - RootedValue newParentVal(ccx, JSVAL_NULL); + jsval newParentVal = JSVAL_NULL; + XPCMarkableJSVal newParentVal_markable(&newParentVal); + AutoMarkingJSVal newParentVal_automarker(ccx, &newParentVal_markable); JSBool needsSOW = false; JSBool needsCOW = false; @@ -2439,6 +2441,7 @@ CallMethodHelper::GatherAndConvertResults() const nsXPTType& type = paramInfo.GetType(); nsXPTCVariant* dp = GetDispatchParam(i); RootedValue v(mCallContext, NullValue()); + AUTO_MARK_JSVAL(mCallContext, v.address()); uint32_t array_count = 0; nsXPTType datum_type; bool isArray = type.IsArray(); diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 457cf19de90c..de781293e608 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -424,6 +424,9 @@ DefinePropertyIfFound(XPCCallContext& ccx, if (!member->NewFunctionObject(ccx, iface, obj, funval.address())) return false; + // protect funobj until it is actually attached + AUTO_MARK_JSVAL(ccx, funval); + #ifdef off_DEBUG_jband { static int cloneCount = 0; diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index d0aec76d00c8..e8e9ee71e9b3 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -1593,6 +1593,7 @@ nsXPConnect::CreateSandbox(JSContext *cx, nsIPrincipal *principal, *_retval = nullptr; RootedValue rval(cx, JSVAL_VOID); + AUTO_MARK_JSVAL(ccx, rval.address()); SandboxOptions options(cx); nsresult rv = xpc_CreateSandboxObject(cx, rval.address(), principal, options); diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 919f835904c1..bcc2d5532602 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -3856,6 +3856,25 @@ private: MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER }; +/***************************************************************************/ +class XPCMarkableJSVal +{ +public: + XPCMarkableJSVal(jsval val) : mVal(val), mValPtr(&mVal) {} + XPCMarkableJSVal(jsval *pval) : mVal(JSVAL_VOID), mValPtr(pval) {} + ~XPCMarkableJSVal() {} + void Mark() {} + void TraceJS(JSTracer* trc) + { + JS_CallValueTracer(trc, *mValPtr, "XPCMarkableJSVal"); + } + void AutoTrace(JSTracer* trc) {} +private: + XPCMarkableJSVal(); // not implemented + jsval mVal; + jsval* mValPtr; +}; + /***************************************************************************/ // AutoMarkingPtr is the base class for the various AutoMarking pointer types // below. This system allows us to temporarily protect instances of our garbage @@ -3935,6 +3954,7 @@ typedef TypedAutoMarkingPtr AutoMarkingNativeSetPtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativePtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativeTearOffPtr; typedef TypedAutoMarkingPtr AutoMarkingWrappedNativeProtoPtr; +typedef TypedAutoMarkingPtr AutoMarkingJSVal; typedef TypedAutoMarkingPtr AutoMarkingNativeScriptableInfoPtr; template @@ -3987,6 +4007,14 @@ class ArrayAutoMarkingPtr : public AutoMarkingPtr typedef ArrayAutoMarkingPtr AutoMarkingNativeInterfacePtrArrayPtr; +#define AUTO_MARK_JSVAL_HELPER2(tok, line) tok##line +#define AUTO_MARK_JSVAL_HELPER(tok, line) AUTO_MARK_JSVAL_HELPER2(tok, line) + +#define AUTO_MARK_JSVAL(cx, val) \ + XPCMarkableJSVal AUTO_MARK_JSVAL_HELPER(_val_,__LINE__)(val); \ + AutoMarkingJSVal AUTO_MARK_JSVAL_HELPER(_automarker_,__LINE__) \ + (cx, &AUTO_MARK_JSVAL_HELPER(_val_,__LINE__)) + /***************************************************************************/ // Allocates a string that grants all access ("AllAccess") From d293f8f75cb73b16b3647af8afe31654fe126ba4 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Tue, 16 Apr 2013 09:09:11 -0700 Subject: [PATCH 029/438] Bug 855276: Diagnostic patch. r=bent --- dom/indexedDB/TransactionThreadPool.cpp | 2 +- dom/indexedDB/TransactionThreadPool.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/indexedDB/TransactionThreadPool.cpp b/dom/indexedDB/TransactionThreadPool.cpp index ff599ef15456..2a331f2f4960 100644 --- a/dom/indexedDB/TransactionThreadPool.cpp +++ b/dom/indexedDB/TransactionThreadPool.cpp @@ -463,7 +463,7 @@ TransactionThreadPool::HasTransactionsForDatabase(IDBDatabase* aDatabase) } bool -TransactionThreadPool::MaybeFireCallback(DatabasesCompleteCallback& aCallback) +TransactionThreadPool::MaybeFireCallback(DatabasesCompleteCallback aCallback) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); diff --git a/dom/indexedDB/TransactionThreadPool.h b/dom/indexedDB/TransactionThreadPool.h index 82d1ad3ca90b..b8ea52a20bf8 100644 --- a/dom/indexedDB/TransactionThreadPool.h +++ b/dom/indexedDB/TransactionThreadPool.h @@ -173,7 +173,7 @@ protected: TransactionQueue& GetQueueForTransaction(IDBTransaction* aTransaction); - bool MaybeFireCallback(DatabasesCompleteCallback& aCallback); + bool MaybeFireCallback(DatabasesCompleteCallback aCallback); nsCOMPtr mThreadPool; From 828aa2ec132ca963c19baa98838f86c7a8e9e4de Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Tue, 16 Apr 2013 09:10:00 -0700 Subject: [PATCH 030/438] Bug 857669: Remove unused traversal method. r=mounir --- content/html/content/src/nsHTMLFormElement.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index c867111e0ed4..9938d7af3aef 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -2199,16 +2199,6 @@ nsFormControlList::FlushPendingNotifications() } } -static PLDHashOperator -ControlTraverser(const nsAString& key, nsISupports* control, void* userArg) -{ - nsCycleCollectionTraversalCallback *cb = - static_cast(userArg); - - cb->NoteXPCOMChild(control); - return PL_DHASH_NEXT; -} - NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFormControlList) tmp->Clear(); NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER From 8749ed336490f50453a20b94555e183095b98d65 Mon Sep 17 00:00:00 2001 From: Gabor Krizsanits Date: Tue, 16 Apr 2013 11:31:26 +0200 Subject: [PATCH 031/438] Bug 820170 - Wrapping nodes into documents compartment. r=bholley --- content/base/src/nsDocument.cpp | 7 ++++ content/xul/document/src/XULDocument.cpp | 29 +++++++++++++- dom/base/nsDOMClassInfo.cpp | 39 +++++-------------- .../tests/unit/test_allowedDomainsXHR.js | 39 ++++++++++++++----- 4 files changed, 73 insertions(+), 41 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3e96cb5af72e..0c196d84f3c5 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1852,6 +1852,13 @@ nsDocument::Init() mRadioGroups.Init(); mCustomPrototypes.Init(); + // If after creation the owner js global is not set for a document + // we use the default compartment for this document, instead of creating + // wrapper in some random compartment when the document is exposed to js + // via some events. + mScopeObject = do_GetWeakReference(xpc::GetNativeForGlobal(xpc::GetJunkScope())); + MOZ_ASSERT(mScopeObject); + // Force initialization. nsINode::nsSlots* slots = Slots(); diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp index 14dcfdc6ac0b..a53b32d84035 100644 --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -1517,6 +1517,29 @@ XULDocument::GetHeight(ErrorResult& aRv) return height; } +JSObject* +GetScopeObjectOfNode(nsIDOMNode* node) +{ + MOZ_ASSERT(node, "Must not be called with null.") + + // Window root occasionally keeps alive a node of a document whose + // window is already dead. If in this brief period someone calls + // GetPopupNode and we return that node, nsNodeSH::PreCreate will throw, + // because it will not know which scope this node belongs to. Returning + // an orphan node like that to JS would be a bug anyway, so to avoid + // this, let's do the same check as nsNodeSH::PreCreate does to + // determine the scope and if it fails let's just return null in + // XULDocument::GetPopupNode. + nsCOMPtr inode = do_QueryInterface(node); + MOZ_ASSERT(inode, "How can this happen?"); + + nsIDocument* doc = inode->OwnerDoc(); + MOZ_ASSERT(inode, "This should never happen."); + + nsIGlobalObject* global = doc->GetScopeObject(); + return global ? global->GetGlobalJSObject() : nullptr; +} + //---------------------------------------------------------------------- // // nsIDOMXULDocument interface @@ -1539,8 +1562,10 @@ XULDocument::GetPopupNode(nsIDOMNode** aNode) } } - if (node && nsContentUtils::CanCallerAccess(node)) - node.swap(*aNode); + if (node && nsContentUtils::CanCallerAccess(node) + && GetScopeObjectOfNode(node)) { + node.swap(*aNode); + } return NS_OK; } diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 3a7a3c3cf3fb..ee9dfc7fa9d0 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5550,18 +5550,6 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, // See http://bugzilla.mozilla.org/show_bug.cgi?id=227417 nsIDocument* doc = node->OwnerDoc(); - // If we have a document, make sure one of these is true - // (1) it has a script handling object, - // (2) has had one, or has been marked to have had one, - // (3) we are running a privileged script. - // Event handling is possible only if (1). If (2) event handling is prevented. - // If document has never had a script handling object, - // untrusted scripts (3) shouldn't touch it! - bool hasHadScriptHandlingObject = false; - NS_ENSURE_STATE(doc->GetScriptHandlingObject(hasHadScriptHandlingObject) || - hasHadScriptHandlingObject || - nsContentUtils::IsCallerChrome()); - nsINode *native_parent; bool nodeIsElement = node->IsElement(); @@ -5610,26 +5598,17 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, } } else { // We're called for a document object; set the parent to be the - // document's global object, if there is one + // document's global object - // Get the scope object from the document. - nsISupports *scope = doc->GetScopeObject(); + // Document should know its global but if the owner window of the + // document is already dead at this point, then just throw. + nsIGlobalObject* scope = doc->GetScopeObject(); + NS_ENSURE_TRUE(scope, NS_ERROR_UNEXPECTED); - if (scope) { - jsval v; - nsCOMPtr holder; - nsresult rv = WrapNative(cx, globalObj, scope, false, &v, - getter_AddRefs(holder)); - NS_ENSURE_SUCCESS(rv, rv); - - holder->GetJSObject(parentObj); - } - else { - // No global object reachable from this document, use the - // global object that was passed to this method. - - *parentObj = globalObj; - } + *parentObj = scope->GetGlobalJSObject(); + // Guarding against the case when the native global is still alive + // but the JS global is not. + NS_ENSURE_TRUE(*parentObj, NS_ERROR_UNEXPECTED); // No slim wrappers for a document's scope object. return node->ChromeOnlyAccess() ? diff --git a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js index 20e82224b766..183484737ab5 100644 --- a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js +++ b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js @@ -32,8 +32,17 @@ function checkResults(xhr) return true; } +var httpServersClosed = 0; +function finishIfDone() +{ + if (++httpServersClosed == 2) + do_test_finished(); +} + function run_test() { + do_test_pending(); + httpserver.registerPathHandler(testpath, serverHandler); httpserver.start(4444); @@ -45,14 +54,6 @@ function run_test() var res = cu.evalInSandbox('var sync = createXHR("4444/simple"); sync.send(null); sync', sb); checkResults(res); - // Test async XHR sending - var async = cu.evalInSandbox('var async = createXHR("4444/simple", true); async', sb); - async.addEventListener("readystatechange", function(event) { - if (checkResults(async)) - httpserver.stop(do_test_finished); - }, false); - async.send(null); - // negative test sync XHR sending (to ensure that the xhr do not have chrome caps, see bug 779821) try { cu.evalInSandbox('var createXHR = ' + createXHR.toString(), sb); @@ -61,8 +62,28 @@ function run_test() } catch (e) { do_check_true(true); } + + httpserver2.stop(finishIfDone); + + // Test async XHR sending + sb.finish = function(){ + httpserver.stop(finishIfDone); + } + + sb.checkResults = checkResults; - do_test_pending(); + sb.do_check_eq = do_check_eq; + + function changeListener(event) { + if (checkResults(async)) + finish(); + } + + var async = cu.evalInSandbox('var async = createXHR("4444/simple", true);' + + 'async.addEventListener("readystatechange", ' + + changeListener.toString() + ', false);' + + 'async', sb); + async.send(null); } function serverHandler(metadata, response) From e87cea32d3ccf48e3b5079505d93021d4f33bb8f Mon Sep 17 00:00:00 2001 From: Rodrigo Silveira Date: Sat, 13 Apr 2013 18:21:27 -0700 Subject: [PATCH 032/438] Bug 854077 - Use radio buttons for "Do Not Track" options and add a neutral option r=ally --HG-- rename : browser/metro/base/tests/mochitest/browser_sanitize_ui.js => browser/metro/base/tests/mochitest/browser_prefs_ui.js extra : rebase_source : 331345b81ff030f6cd6fa2f2e1bf20f276c82ce7 --- .../base/content/bindings/toggleswitch.xml | 4 +- browser/metro/base/content/browser.css | 6 ++- browser/metro/base/content/browser.xul | 11 +++- browser/metro/base/content/preferences.js | 6 +++ .../metro/base/tests/mochitest/Makefile.in | 2 +- ...ser_sanitize_ui.js => browser_prefs_ui.js} | 54 +++++++++++++++++-- .../locales/en-US/chrome/preferences.dtd | 10 ++-- browser/metro/theme/browser.css | 5 ++ 8 files changed, 84 insertions(+), 14 deletions(-) rename browser/metro/base/tests/mochitest/{browser_sanitize_ui.js => browser_prefs_ui.js} (61%) diff --git a/browser/metro/base/content/bindings/toggleswitch.xml b/browser/metro/base/content/bindings/toggleswitch.xml index 2bcdf4d506ed..48b503b2097a 100644 --- a/browser/metro/base/content/bindings/toggleswitch.xml +++ b/browser/metro/base/content/bindings/toggleswitch.xml @@ -20,8 +20,8 @@ - - + + diff --git a/browser/metro/base/content/browser.css b/browser/metro/base/content/browser.css index a30cbc4bddb4..e97123f2199c 100644 --- a/browser/metro/base/content/browser.css +++ b/browser/metro/base/content/browser.css @@ -118,10 +118,14 @@ placelabel { -moz-binding: url("chrome://browser/content/bindings/bindings.xml#place-label"); } -radio { +radio[type="toggle"] { -moz-binding: url("chrome://global/content/bindings/radio.xml#radio"); } +radiogroup { + -moz-binding: url("chrome://global/content/bindings/radio.xml#radiogroup"); +} + checkbox.toggleswitch { -moz-binding: url("chrome://browser/content/bindings/toggleswitch.xml#checkbox-toggleswitch"); } diff --git a/browser/metro/base/content/browser.xul b/browser/metro/base/content/browser.xul index 5bb1616c2d33..25fedd3611f9 100644 --- a/browser/metro/base/content/browser.xul +++ b/browser/metro/base/content/browser.xul @@ -461,8 +461,15 @@ - - + + &doNotTrack.desc; + + + + + + + diff --git a/browser/metro/base/content/preferences.js b/browser/metro/base/content/preferences.js index a6bd1b3d8da9..3b92112857ed 100644 --- a/browser/metro/base/content/preferences.js +++ b/browser/metro/base/content/preferences.js @@ -12,5 +12,11 @@ var PreferencesPanelView = { SanitizeUI.init(); } }, false); + }, + onDNTPreferenceChanged: function onDNTPreferenceChanged() { + let dntNoPref = document.getElementById("prefs-dnt-nopref"); + + // When "tell sites nothing about my preferences" is selected, disable do not track. + Services.prefs.setBoolPref("privacy.donottrackheader.enabled", !dntNoPref.selected); } }; diff --git a/browser/metro/base/tests/mochitest/Makefile.in b/browser/metro/base/tests/mochitest/Makefile.in index bc3ce41e58e1..852fa3f04f5e 100644 --- a/browser/metro/base/tests/mochitest/Makefile.in +++ b/browser/metro/base/tests/mochitest/Makefile.in @@ -29,7 +29,7 @@ BROWSER_TESTS = \ browser_context_menu_tests_02.html \ browser_context_menu_tests_03.html \ text-block.html \ - browser_sanitize_ui.js \ + browser_prefs_ui.js \ browser_topsites.js \ browser_tabs.js \ $(NULL) diff --git a/browser/metro/base/tests/mochitest/browser_sanitize_ui.js b/browser/metro/base/tests/mochitest/browser_prefs_ui.js similarity index 61% rename from browser/metro/base/tests/mochitest/browser_sanitize_ui.js rename to browser/metro/base/tests/mochitest/browser_prefs_ui.js index 374d9bb8fa14..97c1fea05338 100644 --- a/browser/metro/base/tests/mochitest/browser_sanitize_ui.js +++ b/browser/metro/base/tests/mochitest/browser_prefs_ui.js @@ -39,11 +39,8 @@ gTests.push({ // Show options flyout let promise = waitForEvent(Elements.prefsFlyout, "PopupChanged", 2000); Elements.prefsFlyout.show(); - yield promise; - ok(promise && !(promise instanceof Error), "Wait for PopupChanged"); - // Make sure it's opened yield waitForEvent(Elements.prefsFlyout, "transitionend", 1000); @@ -93,12 +90,59 @@ gTests.push({ }); // hide options flyout - promise = waitForEvent(Elements.prefsFlyout, "PopupChanged", 2000); + let promise = waitForEvent(Elements.prefsFlyout, "PopupChanged", 2000); Elements.prefsFlyout.hide(); + yield promise; + } +}); +function checkDNTPrefs(aExpectedEnabled, aExpectedValue) { + let currentEnabled = Services.prefs.getBoolPref("privacy.donottrackheader.enabled"); + let currentValue = Services.prefs.getIntPref("privacy.donottrackheader.value"); + + let enabledTestMsg = "testing privacy.donottrackheader.enabled, expected " + + aExpectedEnabled + " got " + currentEnabled; + + ok(aExpectedEnabled === currentEnabled, enabledTestMsg); + + let valueTestMsg = "testing privacy.donottrackheader.value, expected " + + aExpectedValue + " got " + currentValue; + + ok(aExpectedValue === currentValue, valueTestMsg); +} + +gTests.push({ + desc: "Test do not track settings", + run: function testDNT() { + let noTrack = document.getElementById("prefs-dnt-notrack"); + let noPref = document.getElementById("prefs-dnt-nopref"); + let okTrack = document.getElementById("prefs-dnt-oktrack"); + + // Show options flyout + let promise = waitForEvent(Elements.prefsFlyout, "PopupChanged", 2000); + Elements.prefsFlyout.show(); yield promise; - ok(promise && !(promise instanceof Error), "Wait for PopupChanged"); + noPref.click(); + // See https://mxr.mozilla.org/mozilla-central/source/modules/libpref/src/init/all.js?rev=0aab2bb76b45#755 + // -1 - tell sites nothing about preferences + yield waitForCondition(() => Services.prefs.getIntPref("privacy.donottrackheader.value") === -1); + checkDNTPrefs(false, -1); + + noTrack.click(); + // 1 - tell sites tracking is unacceptable + yield waitForCondition(() => Services.prefs.getIntPref("privacy.donottrackheader.value") === 1); + checkDNTPrefs(true, 1); + + okTrack.click(); + // 0 - tell sites tracking is acceptable + yield waitForCondition(() => Services.prefs.getIntPref("privacy.donottrackheader.value") === 0); + checkDNTPrefs(true, 0); + + // hide options flyout + let promise = waitForEvent(Elements.prefsFlyout, "PopupChanged", 2000); + Elements.prefsFlyout.hide(); + yield promise; } }); diff --git a/browser/metro/locales/en-US/chrome/preferences.dtd b/browser/metro/locales/en-US/chrome/preferences.dtd index c41c5f1fac8d..9449150ced9e 100644 --- a/browser/metro/locales/en-US/chrome/preferences.dtd +++ b/browser/metro/locales/en-US/chrome/preferences.dtd @@ -35,8 +35,12 @@ - - + + + + + - + + diff --git a/browser/metro/theme/browser.css b/browser/metro/theme/browser.css index 34fa534a9d26..5797334552b1 100644 --- a/browser/metro/theme/browser.css +++ b/browser/metro/theme/browser.css @@ -790,6 +790,11 @@ setting[type="directory"] > .preferences-alignment { -moz-box-align: center; } +/* Removes the left side title vbox on radio setting */ +setting[type="radio"] > vbox { + display: none; +} + #prefs-homepage-options, #prefs-homepage-popup { min-width: 200px; } From c16f555360c2696f9febc00c07077d78a65db15d Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 16 Apr 2013 19:07:38 +0200 Subject: [PATCH 033/438] Backout changeset baf184596a7b for build errors on a CLOSED TREE. --- content/base/src/nsDocument.cpp | 7 ---- content/xul/document/src/XULDocument.cpp | 29 +------------- dom/base/nsDOMClassInfo.cpp | 39 ++++++++++++++----- .../tests/unit/test_allowedDomainsXHR.js | 39 +++++-------------- 4 files changed, 41 insertions(+), 73 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 0c196d84f3c5..3e96cb5af72e 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1852,13 +1852,6 @@ nsDocument::Init() mRadioGroups.Init(); mCustomPrototypes.Init(); - // If after creation the owner js global is not set for a document - // we use the default compartment for this document, instead of creating - // wrapper in some random compartment when the document is exposed to js - // via some events. - mScopeObject = do_GetWeakReference(xpc::GetNativeForGlobal(xpc::GetJunkScope())); - MOZ_ASSERT(mScopeObject); - // Force initialization. nsINode::nsSlots* slots = Slots(); diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp index a53b32d84035..14dcfdc6ac0b 100644 --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -1517,29 +1517,6 @@ XULDocument::GetHeight(ErrorResult& aRv) return height; } -JSObject* -GetScopeObjectOfNode(nsIDOMNode* node) -{ - MOZ_ASSERT(node, "Must not be called with null.") - - // Window root occasionally keeps alive a node of a document whose - // window is already dead. If in this brief period someone calls - // GetPopupNode and we return that node, nsNodeSH::PreCreate will throw, - // because it will not know which scope this node belongs to. Returning - // an orphan node like that to JS would be a bug anyway, so to avoid - // this, let's do the same check as nsNodeSH::PreCreate does to - // determine the scope and if it fails let's just return null in - // XULDocument::GetPopupNode. - nsCOMPtr inode = do_QueryInterface(node); - MOZ_ASSERT(inode, "How can this happen?"); - - nsIDocument* doc = inode->OwnerDoc(); - MOZ_ASSERT(inode, "This should never happen."); - - nsIGlobalObject* global = doc->GetScopeObject(); - return global ? global->GetGlobalJSObject() : nullptr; -} - //---------------------------------------------------------------------- // // nsIDOMXULDocument interface @@ -1562,10 +1539,8 @@ XULDocument::GetPopupNode(nsIDOMNode** aNode) } } - if (node && nsContentUtils::CanCallerAccess(node) - && GetScopeObjectOfNode(node)) { - node.swap(*aNode); - } + if (node && nsContentUtils::CanCallerAccess(node)) + node.swap(*aNode); return NS_OK; } diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index ee9dfc7fa9d0..3a7a3c3cf3fb 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5550,6 +5550,18 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, // See http://bugzilla.mozilla.org/show_bug.cgi?id=227417 nsIDocument* doc = node->OwnerDoc(); + // If we have a document, make sure one of these is true + // (1) it has a script handling object, + // (2) has had one, or has been marked to have had one, + // (3) we are running a privileged script. + // Event handling is possible only if (1). If (2) event handling is prevented. + // If document has never had a script handling object, + // untrusted scripts (3) shouldn't touch it! + bool hasHadScriptHandlingObject = false; + NS_ENSURE_STATE(doc->GetScriptHandlingObject(hasHadScriptHandlingObject) || + hasHadScriptHandlingObject || + nsContentUtils::IsCallerChrome()); + nsINode *native_parent; bool nodeIsElement = node->IsElement(); @@ -5598,17 +5610,26 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, } } else { // We're called for a document object; set the parent to be the - // document's global object + // document's global object, if there is one - // Document should know its global but if the owner window of the - // document is already dead at this point, then just throw. - nsIGlobalObject* scope = doc->GetScopeObject(); - NS_ENSURE_TRUE(scope, NS_ERROR_UNEXPECTED); + // Get the scope object from the document. + nsISupports *scope = doc->GetScopeObject(); - *parentObj = scope->GetGlobalJSObject(); - // Guarding against the case when the native global is still alive - // but the JS global is not. - NS_ENSURE_TRUE(*parentObj, NS_ERROR_UNEXPECTED); + if (scope) { + jsval v; + nsCOMPtr holder; + nsresult rv = WrapNative(cx, globalObj, scope, false, &v, + getter_AddRefs(holder)); + NS_ENSURE_SUCCESS(rv, rv); + + holder->GetJSObject(parentObj); + } + else { + // No global object reachable from this document, use the + // global object that was passed to this method. + + *parentObj = globalObj; + } // No slim wrappers for a document's scope object. return node->ChromeOnlyAccess() ? diff --git a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js index 183484737ab5..20e82224b766 100644 --- a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js +++ b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js @@ -32,17 +32,8 @@ function checkResults(xhr) return true; } -var httpServersClosed = 0; -function finishIfDone() -{ - if (++httpServersClosed == 2) - do_test_finished(); -} - function run_test() { - do_test_pending(); - httpserver.registerPathHandler(testpath, serverHandler); httpserver.start(4444); @@ -54,6 +45,14 @@ function run_test() var res = cu.evalInSandbox('var sync = createXHR("4444/simple"); sync.send(null); sync', sb); checkResults(res); + // Test async XHR sending + var async = cu.evalInSandbox('var async = createXHR("4444/simple", true); async', sb); + async.addEventListener("readystatechange", function(event) { + if (checkResults(async)) + httpserver.stop(do_test_finished); + }, false); + async.send(null); + // negative test sync XHR sending (to ensure that the xhr do not have chrome caps, see bug 779821) try { cu.evalInSandbox('var createXHR = ' + createXHR.toString(), sb); @@ -62,28 +61,8 @@ function run_test() } catch (e) { do_check_true(true); } - - httpserver2.stop(finishIfDone); - - // Test async XHR sending - sb.finish = function(){ - httpserver.stop(finishIfDone); - } - - sb.checkResults = checkResults; - sb.do_check_eq = do_check_eq; - - function changeListener(event) { - if (checkResults(async)) - finish(); - } - - var async = cu.evalInSandbox('var async = createXHR("4444/simple", true);' + - 'async.addEventListener("readystatechange", ' + - changeListener.toString() + ', false);' + - 'async', sb); - async.send(null); + do_test_pending(); } function serverHandler(metadata, response) From e8487ad0c864f30225205d02d82c1349728f074a Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Tue, 31 Jul 2012 15:52:16 -0700 Subject: [PATCH 034/438] Bug 779336 - Replace DOMExpandoMap with a js::HashSet; r=bholley --HG-- extra : rebase_source : 125fbd75b5123c17cda64c9dfe7e09b36c03bb42 --- js/xpconnect/src/XPCWrappedNativeScope.cpp | 30 ++++++++-------------- js/xpconnect/src/xpcprivate.h | 18 +++++++------ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 9593accc82da..7a8c385fbf4c 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -390,14 +390,6 @@ WrappedNativeJSGCThingTracer(JSDHashTable *table, JSDHashEntryHdr *hdr, return JS_DHASH_NEXT; } -static PLDHashOperator -TraceDOMExpandos(nsPtrHashKey *expando, void *aClosure) -{ - JS_CallObjectTracer(static_cast(aClosure), expando->GetKey(), - "DOM expando object"); - return PL_DHASH_NEXT; -} - // static void XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt) @@ -410,8 +402,10 @@ XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntim // well as any DOM expando objects. for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) { cur->mWrappedNativeMap->Enumerate(WrappedNativeJSGCThingTracer, trc); - if (cur->mDOMExpandoMap) - cur->mDOMExpandoMap->EnumerateEntries(TraceDOMExpandos, trc); + if (cur->mDOMExpandoSet) { + for (DOMExpandoSet::Range r = cur->mDOMExpandoSet->all(); !r.empty(); r.popFront()) + JS_CallObjectTracer(trc, r.front(), "DOM expando object"); + } } } @@ -430,17 +424,13 @@ WrappedNativeSuspecter(JSDHashTable *table, JSDHashEntryHdr *hdr, return JS_DHASH_NEXT; } -static PLDHashOperator -SuspectDOMExpandos(nsPtrHashKey *key, void *arg) +static void +SuspectDOMExpandos(JSObject *obj, nsCycleCollectionTraversalCallback &cb) { - nsCycleCollectionTraversalCallback *cb = - static_cast(arg); - JSObject* obj = key->GetKey(); const dom::DOMClass* clasp = dom::GetDOMClass(obj); MOZ_ASSERT(clasp && clasp->mDOMObjectIsISupports); nsISupports* native = dom::UnwrapDOMObject(obj); - cb->NoteXPCOMRoot(native); - return PL_DHASH_NEXT; + cb.NoteXPCOMRoot(native); } // static @@ -452,8 +442,10 @@ XPCWrappedNativeScope::SuspectAllWrappers(XPCJSRuntime* rt, for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) { cur->mWrappedNativeMap->Enumerate(WrappedNativeSuspecter, &cb); - if (cur->mDOMExpandoMap) - cur->mDOMExpandoMap->EnumerateEntries(SuspectDOMExpandos, &cb); + if (cur->mDOMExpandoSet) { + for (DOMExpandoSet::Range r = cur->mDOMExpandoSet->all(); !r.empty(); r.popFront()) + SuspectDOMExpandos(r.front(), cb); + } } } diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index bcc2d5532602..d3db2c98abd4 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1678,18 +1678,20 @@ public: XPCContext *GetContext() { return mContext; } void ClearContext() { mContext = nullptr; } - typedef nsTHashtable > DOMExpandoMap; + typedef js::HashSet, + js::SystemAllocPolicy> DOMExpandoSet; bool RegisterDOMExpandoObject(JSObject *expando) { - if (!mDOMExpandoMap) { - mDOMExpandoMap = new DOMExpandoMap(); - mDOMExpandoMap->Init(8); + if (!mDOMExpandoSet) { + mDOMExpandoSet = new DOMExpandoSet(); + mDOMExpandoSet->init(8); } - return mDOMExpandoMap->PutEntry(expando, mozilla::fallible_t()); + return mDOMExpandoSet->put(expando); } void RemoveDOMExpandoObject(JSObject *expando) { - if (mDOMExpandoMap) - mDOMExpandoMap->RemoveEntry(expando); + if (mDOMExpandoSet) + mDOMExpandoSet->remove(expando); } // Gets the appropriate scope object for XBL in this scope. The context @@ -1737,7 +1739,7 @@ private: XPCContext* mContext; - nsAutoPtr mDOMExpandoMap; + nsAutoPtr mDOMExpandoSet; bool mIsXBLScope; From 68e139c5497d57c358bb09a15af6f722d1a89e61 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Mon, 15 Apr 2013 15:34:27 -0700 Subject: [PATCH 035/438] Bug 859586 - Remove {Start,End,Fail}DocumentLoad notifications (r=felipe) --- browser/base/content/browser.js | 39 +++++++-------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index be1abad75379..a1c4fdf9b670 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3745,6 +3745,7 @@ var XULBrowserWindow = { aMaxTotalProgress); }, + // This function fires only for the currently selected tab. onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) { const nsIWebProgressListener = Ci.nsIWebProgressListener; const nsIChannel = Ci.nsIChannel; @@ -3752,8 +3753,13 @@ var XULBrowserWindow = { if (aStateFlags & nsIWebProgressListener.STATE_START && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { - if (aRequest && aWebProgress.DOMWindow == content) - this.startDocumentLoad(aRequest); + if (aRequest && aWebProgress.DOMWindow == content) { + // clear out feed data + gBrowser.selectedBrowser.feeds = null; + + // clear out search-engine data + gBrowser.selectedBrowser.engines = null; + } this.isBusy = true; @@ -3770,11 +3776,6 @@ var XULBrowserWindow = { } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP) { - if (aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK && - aWebProgress.DOMWindow == content && - aRequest) - this.endDocumentLoad(aRequest, aStatus); - // This (thanks to the filter) is a network stop or the last // request stop outside of loading the document, stop throbbers // and progress bars and such @@ -4073,30 +4074,6 @@ var XULBrowserWindow = { if (loadingDone) return; this.onStatusChange(gBrowser.webProgress, null, 0, aMessage); - }, - - startDocumentLoad: function XWB_startDocumentLoad(aRequest) { - // clear out feed data - gBrowser.selectedBrowser.feeds = null; - - // clear out search-engine data - gBrowser.selectedBrowser.engines = null; - - var uri = aRequest.QueryInterface(Ci.nsIChannel).URI; - try { - Services.obs.notifyObservers(content, "StartDocumentLoad", uri.spec); - } catch (e) { - } - }, - - endDocumentLoad: function XWB_endDocumentLoad(aRequest, aStatus) { - var urlStr = aRequest.QueryInterface(Ci.nsIChannel).originalURI.spec; - - var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad"; - try { - Services.obs.notifyObservers(content, notification, urlStr); - } catch (e) { - } } }; From b27a45bc2873f1540f4e866bc2a7e6a2a3f5577b Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Wed, 27 Feb 2013 10:30:19 -0800 Subject: [PATCH 036/438] Bug 813418 - Centralize certificate validation (Part 1, tests). r=bsmith --HG-- extra : rebase_source : a9d66d37da35b315097af6e20177188a3ef52ce0 --- build/pgo/certs/cert8.db | Bin 65536 -> 65536 bytes build/pgo/certs/evintermediate.ca | 34 ++++++++++ build/pgo/certs/evroot.ca | 32 +++++++++ build/pgo/certs/key3.db | Bin 69632 -> 98304 bytes build/pgo/server-locations.txt | 2 + .../manager/ssl/src/nsIdentityChecking.cpp | 21 +++++- .../ssl/tests/mochitest/bugs/Makefile.in | 2 + .../mochitest/bugs/test_ev_validation.html | 52 +++++++++++++++ .../bugs/test_ev_validation_child.html | 62 ++++++++++++++++++ testing/mochitest/Makefile.in | 2 + testing/mochitest/intermediate-ev-tester.crl | Bin 0 -> 541 bytes testing/mochitest/root-ev-tester.crl | Bin 0 -> 557 bytes 12 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 build/pgo/certs/evintermediate.ca create mode 100644 build/pgo/certs/evroot.ca create mode 100644 security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html create mode 100644 security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html create mode 100644 testing/mochitest/intermediate-ev-tester.crl create mode 100644 testing/mochitest/root-ev-tester.crl diff --git a/build/pgo/certs/cert8.db b/build/pgo/certs/cert8.db index 3123b417b151a77a7ededbd77dc6e9a7c6fae898..aa38b3b0d57ae2c303d6873e659ee0f288853e3e 100644 GIT binary patch literal 65536 zcmeI52|QF?|G@7oc8aXYG6{)rXNF;rB}+0V+rvHr7mL9@~CJ3T_5Apg-1S_a)F{lht2pGm(i zxF8?^2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@ z00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve z0)PM@@Sh@}0)5bXtM^Rrh@Ow$kZzmqeqFNeDec4B;o7UUqp3kuJE{>iP{UorL}Qjl z59KkXkg|pHMSYvPBY6S&94VW$ndCugA=VPpi5^5UQH-ds>ZlT|oITf0e!0A_+%!2~ zIXT%lSy{;h$szCo1ONd*01yBK00BS%5C8-K0YCr{00aO5KmZT`1ONd*01yBK00BS% z5C8-K0YKn4B7j6P=j7x>qOP-jf~LZeY#-oA{KHHf7K6oNa4;V`mtxExF(3Fa7&bNt zj(9}mfw|amEAi}t*p(~3CO8GLh6Y3tSP0$2A;`Db)6c_~#_%AlV$cJKv*4L%KDVIw zV$Wa(lSv~e6O3089O?Fc&IDh&k1qi^SQ4Ir7UB^UT0wX4^Je%45sW>Y86I@HH^al3 zC=bh`yK#b&$dMMvF-Rss0lA8|pO0^Vr?;<5&>ZwMg0KKuZjK-~-Cr3!x3U9`I2TqN zZ3Y)cMAE^9=FOz}(meFh63CfU=z%nMFD6~Z!P6a<66GV3VG>b|sG&}Usn()=Bs57H zNx~5~zczc48I1773Gy*KeCgiqbVmlwmrnjqv^f$ZGxkNIQKQN0Zl1o+h*i=!@udBP^bI223{`ioTzSUXxX_l0|SKK!bx>9wL zu=A{zx;-auFkaq0pN(5VR4lCLxL)(TpqF7h)8wdEALT|+3=_jNK1n|ap2^@6GvzEZ zc3GF*A3N3cRrlF-ns?pq2c=A58$9YP*WOwmUfUt6$luoBqAk{+aJ=B5Y~hv9M78#S z0tYM(17QwCVrmc~7hp+5#3ZNSMesslHfb>aEnT_jpj|-Opw{lo+IyxWMa0kov+xK) zB*C*$sCJiDyOmdRXQk!B8|T?Q--qtDdcQxSJv-v*@6e+nxuE0K^JJXlO-V2>N=6XR z2IDZ8A((=ur17e-GOUz2Cv$d;oQtoomzJvPnEt5h?dj>OJkp!#-YO2>Ojr*+j)2#M zDX3Lm32g|A+nBv zc(y31s|P97AK8Kpzd3kV#;86|CNOPgV_9z+?EBJq@8tkx@w}wuKSJP3`O}SB?=&^* z`siG==Cy1s@SyJ?P~A=K-=ERF+Grdt!%#mL^gK1;nYj>m$d%hp3oph5zFOe^`tvqw z^5M73?mE^N)W39ysh)btrCphL;#@ypq*P#2oj-JXqiAFP+3%Lv47 z*kiw*?mt$mK#1=D4U|16^5Y>*aKzoeq0z-)5kv}+QElqiQEg;cBFe%t=pG)y8Oyvq zofu3yVSyjRk?u%X>gCIDX9UxH8J-?QX_gv6Ml=ybwizD&G$zAw>^L-Dt&bG=_l7bo zdQVv=hJK%hB0tPxh1bXHvy&iBIFeljF=<3b%o)sg{r(?0lz%f{G>IfN$~W_6I0;AG z`y0akpD^J@EIgc`5F+ru5cj`lx&6wDxsNDt~m$ref@U!#wYki8!bu?8U&_=2iEcwD@`|_M$%q%L~E^TP=HAR_3tdm!n#r!d+;=UdMbyV}p+~9`v1%?Oh~jis^WGU% z8+`dRg$HWRmMhMjPin}JC3f9UoS#S*`*KL3bi|6mvcr*BEX#~XhGHxXAvQDDx|lyO zG5zx~7(5<_W!E2LEO^>MB_+=rMo{OA~r+Bh6Y0=MyprqFL> z;~?XuAWB3I&kJ*ZwM1|jm%L*V&oX2JK5^^>rJXb&UW}P}<>#@Ggw5k4$uEo>F`_cu=mmSPn zxjOGvM(#0EQgy-gol9uPQW|g0%Pumyp})rGzGrmZ?C`X6j+LsP0?I`<_gALco}IQX zvW&}qRtou_#!BF zHIx^-B`1yYnp>Zgpqj-iW-GXMC=6Q>$fDVFlNqWWS)iYs7w#^VtCWX8LDu^zOk1?=MEy` zk*T6sY(xZf&|&F}#4n8|_g)ckH9Pel?IT|;b8}4wt64Z*H#Ya_mPT|csOl;wpi6Kc&xzcAfP$~Q=t}QBz`J3{j=_-5n-=Ym=d}X~(Ym`9#V1gc zq38a`E(!A9_pI?+Df+mUpv5subd)H~!*PTugh6lKkMGuS#}$I09~}pYBb|7{Lvero zPNEM9ihsR0_D7W&uBj*lc{zI$eCXc(bZ>$K-P@Pp#Be}nt02f7`Nc-q^)EgoP5h9h z0LvqTA@cYnZ9#YU^7N*82N4XvU58-c=j-B$P9x%A5uy-0ZMZPcn280nwaEE@yc0V? z^@p2>{9Gm7$ARWWr}_HQ9Nb7qYavKLENt=QHcXs2!UrcfH6S2B#h&J!DHDoiG7l3+4fouzrkCdUXMujFvEJlu$A zqoD5^`BTkP`|7ZqegXttvMVo;NtyOQVUy{V?Dz&hSD}0r8?VFbTM`<3BsFiI-Ogak zuaojC+QaSjs&M*=>Zk9T*julv8sAqja^7!|RCnSw%yHraff~D9 zXPbTwzX)IcG-%eex#nawrBpeZV*Ns$3mE*RT#@?&=eeUM(mYG1Rn?u{#9=shMKo^d zlCvi~EW$!12G036`Zs2Y6dUxkeq0>*$v&`hMrBI+0M;fkuBhDlCHsm8F;gRNynX!c zf>W^m^|#^n0)vI6dzaqQ^XlBNui~}dbq9gfFYZR?tyIHz$;8|m5NmmqF9%8PN?S9< zPtZet$AhMNfxK(Ih1PLn1(yh6Si&%g-SLMVh{)s z9;3Y>Xa)p@BX5}|(Dyi)K$Lb#>HgprS^@NOFSa{IsLyg<#CB1K&#a_JxaF&F$LZ?kyEO zB;}e^RLahO?^>$DTG$pQTghmx#GDOHd~<}+T;Vi3W2Iq=ZSnl#?Uw^M-p$PvI^qD? zX1sS5>F1=JJy9cj&9~0V^hUUX#vfA3MrqcXo>X17_4LEHQ-=PqTNv7Z)Uu>?m9hPe zWp|}EV+)6$iuvIw-%U=BfAxhL4FX$Sy{k1;!zvFwcU-<3GiZ|7aXC{_z;BbkgV9rl zOL}IMOSN8{XDt4R-Us4Q;^nYGKPxVTLIeCM`Qi&%!gx_4K%2=$CvSn7# z{p`5h5Pxf59-AFUwr=z2*5r^^nRQvH`QUE;@T#_h$KO2aIAbE=A2>ZH-s<_9Mc=G9 z#8#L9H7XXO6YRr|Il<@vfjP$#hO>w;%$!IVWQYVLYzbATq|v&^J42JWB8iFlJgsI zS1ty47q5J_>Ggw%k7c>41E=ko(!43kars2?Phn!09JFRBhj)}=uTG@Tt;!YUpBeU5 zq;C?!B|g)Y*hySxcY^(VOO`;-b*s~T7hI%rYLCC`H03PhdU3;)7gMqD7C&9tr1N@C z*5I+*_9d=Z<2|IRz2d~s?nUAAtjW!HBsKDwWxk2{4R5xcd43~V?$i=)Yif%^p<__b z?X1H5-mLT?<+44@B|!mErb$ld{TRL-s8IX`%BX}OQ`En{rPwj2M#beG`pki)K>~<9 zVTXuI%|zldiNgs?A!)+uBoYjhk^iXJjZIFfVe>QbZR=3T#jH=acMc-% zVah>o-Pg{`wB5WPbBYY!eRM@hm9|32BIKC0>>9p}6>QHp>q_ms+92+kG;2Z4k*H3o z{rQF;Hev&U>Z^qE*p?-1%*~9u^_p=-B*Tf3ajddu#gn@GQa*VHnT4X2*o&v8nBBd$ zWK(aSZbGq2=dhMTUXR05k&cYa`*FhT$SXK32KvqvL=|0O^FDv~DARL?wKuF<@Xa?=Z?pwzO%2i9GrIuc^UAXA=v#myc8m-AD2CA}~1j-7!v~H{T73Q6flq(B9 zww=NAUSi!e_8raV2LAjUFnFzF^@(QD`jCPA7U9$`gASiu(xsxk{F)!O6k&w&@ek_C z(=!Ug#jHF9jvu~>8sEO7X1xOqmF!6rDo%C?qM+XHuo@AOt6{}A2U)G4MkFIE0#pJ$ zl$BiqX|DDzbY~JRm`r1`vRngcOfN^K7yD?*(e(xH!wVl&JiVQvQ446a82Wq!K^o{( z%-^~oGN&Uoda@s06ZiK{jH(Lc73<%DfE}$6t98hn6SRu%?Ss7ef(THTUZ@_wUbOCF zU0IzW?F-sRw1c(RXs1!PP@SpoHS;M4DH|zkDG$`$)h)>{NqbaMR8A=yD#t1upUpnI zU7k(8T#ik?W0soi;7l_aj+v`x(#1=WXJGIF1ONd*01yBK00BS%5C8-K0YCr{00aO5 zKmZT`1ONd*01yBK00BS%5C8=JO#;Yk@DXR}3r5(N<=C0S|TNGkR*H|#w3&`?~jZO-j1`570f!%Gk%F^iG4Bc@{4hoE}4EUz_a4sT@FOvn!!xQz1%^)MseTK{Q~t%$lOMX)YMDZ-(o^`n2S%V)PiICR?{ zMuwDsRcJTKuoMH|Xc~zAv#t8r{G{bO`$}go-CMDzG<55{Ijt32pYlrjnjQ`*=j*D# zC)}eSaj~)BT^VzzHIIgWpt+XNnV-J>j~AN+`GwYNNT{uGXWCQ06dg(qKmF-#Y!39n@1)mE?OOxsJ=Sg3bpje){`NEQ=P`k)f{RYz$T9&Py z(;MEemwOma_eY(^(RCx=JkNgzZ)TQz53lEKG;Cq?0Fe`3&NFGieUhqf2Xl zpC(VP4>@Y_u>SA|Aa2Ck*@tYL!xj&oC0OIt&woqKe&_rAk8C@-#;ysqz9&&xOm5F% z|7n<^k!67Yb7hUL9sGGkCsUnI?j1rGHS42)|6ASmBd@iQ2P!gAjRdP{lF@a|$O9Fb zh^%vFCI7L#1~L499*XLuR{s)pytfDlPTO*0^A(q;ErBX+q<&z3TI) zQ(V_+zj+*%_wlBdsZ6xIvDwt-{Q>pNb(hQAbP|GR@HOsJ8dB%J<6v$lVqk1?Yz5rp{Tdgu964;{68$;I;s<~jpx1XEx zh3nm&E4$X7;^kk9W$!fN71_V+(>~nxtR!arCgomv+nVC4$gMVudE$fzBkLVSU-qrI z%F}Rs@WY=84dw~lud^-hJL|N3eTrI(kh1y9K^&Y~Q!;T=bdC<~eS1Z8nYIm2pX_UR z1G*A?7Tyo`+3%6f{BI52KN4>w;L=|Rm!OQ+Pa2QJeuHH)37Jwc5r@FdhsM7jR*QE z5?7sNO0KMu$8;05y0c%@GdXQoSJryq1%n;Z4b#>GswO^>bwZ~h1S)FYvi zMgk=vV*<;$9@lnXfdo^CRH8bGqE12wgt5tq9GQRW zdeM}oVL$%o_X!kz9OO9&!eRN-0s}GTGsSZ{cf`$ z?@-7x&2*|FzEkIT$eZ$@b@iI5Iqn&_X!S0G5nYCzi+B_%AR8LvQBnXOiJgHYL?g#~ zYex#8F@cEVrbJj-q;XjyK7RH@m47YzE&pH3lO`xXoIk$2q&I!NA5swqCWG$bi@G+9 zyF6<*5+GrM-O|7C9Ep@=RsUC|gnZ}@1l|+gm$Eu9%`BrIk&)4$fbH|qd#uY6u zf<$;=czbz!1_q659d7{HffZB}^<#Gf

}-#DC2qjn9%ro9ChFN^$g2Co=;A z+`QMj_>(kg<4a9POELZF$`mHeaon!&Iw9(>v?xI0xUloeB+beJTV~FSlO2rqdWqDX zm7EU!BomQdHy5^@CwHg|4$5(CSyf?xrdNey&>TC*(8h4^$KkwxPdzo5)Sv$ryvBgT)dru`5i~R2+C>lv5c_#j6Gi z*kjDP37%UAoK;d{w)nO#UlPD8jQ^7MJZ5vq;H7%PK3D1Yygqqu0@X}2y4c~c9%4B5 zR_`O&0)y#0)f{MgjPG{dY|5%zqd`TGTR)kubE6T4h6BYwkOu@!ZWVC9k|)%bLHwD2 zE_B$h0KauBWmY7OIY_rk8kqoNh5VSD39uho(JbfJ;m{c*HBGfKku-*r@J|AS{M0UZ z!(M0=Rb4m5zcInuK$Rv@(w*#e{e%9RB(0pBp^xJAv%lhncT;FjOwO%ah|ZuF3zlr-dt*Vn8(g+jmfEu zx}{;gp&Pf}{OmDf>4$vn>$`Yjgy`od+@wN}owfKx-kUhn;ag4x%zr|qod zUY*3hzdwQYF8xt$&&|i#J)Y}*Pn$2l(~@6$O}b=fr5ic^(V2vywW8^#w5gVs3XS`m z&Zf_$6p>t=-1X92t6jq@5?sO_z1-JohayyJ=Uv_keMFf;-V(=G4$=N*_x-D3nI1Bm;!FV^|&&f|B+#Bq*~`BlAs4)0x+-D|Mg zujY%Avy9C)ZHPYg#4pUNH_)Z)nCg}5br<+#LZe>HzZDeUy=E61mi#c5lVj`oO$UX~ zA2C%>5PZ9e@+65(Ca)Ru*+R!LuDUCWX z`iwk={Yx0vzvZCJ5>zx)00o&+gUM*1R957GugSmX_WV=fEfT_C?8$l-FvDr1)n-ju znNDp6RpW9>+S&o~v-M4c0i|s`c+!m)IBMV9;04=08NNSJb>VKvGM~1-evbG}B0iWM zgV#m5m7;tirne_1#?7tbIdno{_8YAw+_<8Os1r`n`8?hGYBN(#F7@xd(oHD9o5y9R zyxROWF7C*7X=U%>kVFT@tJMg}QAh0`d5-_UvPrB=yBxG1lYDymYKOTUGJ7vA@S7Lv z^|B!^1S`F&onPnnnmCs#8=s1~*-J}zMV3pOFLgin5 zd8;)4SsTlf5f*)7JLPX^t`;r0!N5K=a9feS>4D+RsDbE|Sy|7+T9i8n)41-6Z@pml zKEk7fjdQfVEXQ(WBI$44{$UXoKmreaA8P=OP&TRI25^&Vpdq8eq)zp*BB_lF=I{lH zdjvj!03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mA zfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@ P00;mAfB+!yza{X0cco0F delta 60 zcmV-C0K@-)fCPYm1duxcAhA5eKLIF{0YFg%>MlSpvvEKj9kYNy%@MOeZ@>@%7?S~j SF$8BWoi4G_XD+jyu47SUvlVIp diff --git a/build/pgo/certs/evintermediate.ca b/build/pgo/certs/evintermediate.ca new file mode 100644 index 000000000000..17a048ad86c3 --- /dev/null +++ b/build/pgo/certs/evintermediate.ca @@ -0,0 +1,34 @@ +-----BEGIN CERTIFICATE----- +MIIF9zCCBN+gAwIBAgIBAzANBgkqhkiG9w0BAQUFADCB4TELMAkGA1UEBhMCVVMx +CzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MSMwIQYDVQQKExpN +b3ppbGxhIC0gRVYgZGVidWcgdGVzdCBDQTEdMBsGA1UECxMUU2VjdXJpdHkgRW5n +aW5lZXJpbmcxJjAkBgNVBAMTHUVWIFRlc3RpbmcgKHVudHJ1c3R3b3J0aHkpIENB +MRMwEQYDVQQpEwpldi10ZXN0LWNhMSwwKgYJKoZIhvcNAQkBFh1jaGFybGF0YW5A +dGVzdGluZy5leGFtcGxlLmNvbTAeFw0xMzAyMTQxNzU5MDlaFw0yMzAyMTIxNzU5 +MDlaMIHRMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50 +YWluIFZpZXcxIzAhBgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0w +GwYDVQQLExRTZWN1cml0eSBFbmdpbmVlcmluZzEWMBQGA1UEAxMNaW50ZXJtZWRp +YXRlMzETMBEGA1UEKRMKZXYtdGVzdC1jYTEsMCoGCSqGSIb3DQEJARYdY2hhcmxh +dGFuQHRlc3RpbmcuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDAfzrlJdawr7v8m7lslODk5FTqCiBO7tPxnWhAOEL5g05knLTZTc5J +3ywmGoW6ae6RwPlWuqRuFd2Ea+yCawyjkUoLOpFH/xziDzvaS6LXNdJoxQqWk/LX +8YYQVFfmxh8E11fz74IoCzX++mY1byaNONf3bLU2HU8vnVvENr1gy9Bzpm8wUuKm +HkBYuG0SVzaeym2H/mo5PJICPVhPa+YxfEVS8EIFCigXGH7xrz/bPXnpfgsSJTnN +4amBNkORfjf7H9x6IWkJGEkIvkVoYKT4iQ9q6/C4YDjWa9p5lA4F/qxnJefezH/I +6hcqEODSaDsY+I6vsN8ks8r8MTTnd7BjAgMBAAGjggHGMIIBwjAdBgNVHQ4EFgQU +fluXMAT0ZS21pV13vv46m8k7nRkwggEYBgNVHSMEggEPMIIBC4AUyJg651hwk+3B +V0rQvQZv9n2bWPahgeekgeQwgeExCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEW +MBQGA1UEBxMNTW91bnRhaW4gVmlldzEjMCEGA1UEChMaTW96aWxsYSAtIEVWIGRl +YnVnIHRlc3QgQ0ExHTAbBgNVBAsTFFNlY3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYD +VQQDEx1FViBUZXN0aW5nICh1bnRydXN0d29ydGh5KSBDQTETMBEGA1UEKRMKZXYt +dGVzdC1jYTEsMCoGCSqGSIb3DQEJARYdY2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBs +ZS5jb22CCQCvxT0iZiZJMjAMBgNVHRMEBTADAQH/MDYGA1UdHwQvMC0wK6ApoCeG +JWh0dHA6Ly9leGFtcGxlLmNvbS9yb290LWV2LXRlc3Rlci5jcmwwPwYDVR0gBDgw +NjA0BgRVHSAAMCwwKgYIKwYBBQUHAgEWHmh0dHA6Ly9teXRlc3Rkb21haW4ubG9j +YWwvY3BzOzANBgkqhkiG9w0BAQUFAAOCAQEAC4grNTV5K8yqiAJ/0f6oIkTMqyJ4 +lyHXvvKXMHTpRZ7Jdy0aq5KTSHswx64ZRN7V2ds+czzDWgxX3rBuZZAgOW1JYva3 +Ps3XRYUiaTW8eeaWjuVRFAp7ytRmSsOGeOtHbez8jDmTqPRQ1mTMsMzpY4bFD8do +5y0xsbz4DYIeeNnX9+XGB5u2ml8t5L8Cj65wwMAx9HlsjTrfQTMIwpwbNle6GuZ3 +9FzmE2piAND73yCgU5W66K2lZg8N6vHBq0UhPDCF72y8MlHxQOpTr3/jIGr4X7k9 +uyYq0Pw5Y/LKyGbyW5iMFdLzabm1ua8IWAf7DSFMH6L3WlK8mngCfJ1icQ== +-----END CERTIFICATE----- diff --git a/build/pgo/certs/evroot.ca b/build/pgo/certs/evroot.ca new file mode 100644 index 000000000000..df220e446c44 --- /dev/null +++ b/build/pgo/certs/evroot.ca @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFljCCBH6gAwIBAgIJAK/FPSJmJkkyMA0GCSqGSIb3DQEBBQUAMIHhMQswCQYD +VQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxIzAh +BgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0wGwYDVQQLExRTZWN1 +cml0eSBFbmdpbmVlcmluZzEmMCQGA1UEAxMdRVYgVGVzdGluZyAodW50cnVzdHdv +cnRoeSkgQ0ExEzARBgNVBCkTCmV2LXRlc3QtY2ExLDAqBgkqhkiG9w0BCQEWHWNo +YXJsYXRhbkB0ZXN0aW5nLmV4YW1wbGUuY29tMB4XDTEzMDIxNDE3NDkwMFoXDTIz +MDIxMjE3NDkwMFowgeExCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UE +BxMNTW91bnRhaW4gVmlldzEjMCEGA1UEChMaTW96aWxsYSAtIEVWIGRlYnVnIHRl +c3QgQ0ExHTAbBgNVBAsTFFNlY3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYDVQQDEx1F +ViBUZXN0aW5nICh1bnRydXN0d29ydGh5KSBDQTETMBEGA1UEKRMKZXYtdGVzdC1j +YTEsMCoGCSqGSIb3DQEJARYdY2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBsZS5jb20w +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCk+k5mvnrxhVdVnhaxCeDG +ZC5kcC8951K3xTkh2JMtUpSQL2IoGLOZOWTNY+2wGNyHbdJjKDv1d0bzZfz3yDkB +AbY6OcxS4WkwccKsyIzkdacpYWhi7kEFevm9p7TI8jdrpKmItrlqfZKfteh+K+DF +XZF7xp6zpoUis6dykmk5v8RivpCZl7HIlsOW0wSqCocXWH/WWFgAQyozjW8MgGOL +/eV2aLsx+yg7it9GMMtyidggwvlYM7O8vY0gJqQKXntbHq1zV7jIJ3bXzJceur+G +Ce4HvsRHAQUSl6jUfm00aKkqS+1t3svZURIKM6qWAuIKMGcspv+L8lyn1KImG8M5 +AgMBAAGjggFNMIIBSTAdBgNVHQ4EFgQUyJg651hwk+3BV0rQvQZv9n2bWPYwggEY +BgNVHSMEggEPMIIBC4AUyJg651hwk+3BV0rQvQZv9n2bWPahgeekgeQwgeExCzAJ +BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEj +MCEGA1UEChMaTW96aWxsYSAtIEVWIGRlYnVnIHRlc3QgQ0ExHTAbBgNVBAsTFFNl +Y3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYDVQQDEx1FViBUZXN0aW5nICh1bnRydXN0 +d29ydGh5KSBDQTETMBEGA1UEKRMKZXYtdGVzdC1jYTEsMCoGCSqGSIb3DQEJARYd +Y2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBsZS5jb22CCQCvxT0iZiZJMjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAcKVLC9MbdSZjzkVBseCm6t49aIIBm +xQrsTNV2Gnp5eIXBfUhNAfD0zbBcKHK9AfHmNT8ZK6iABjiOrnn6yQNufW5MMdNx ++/4FtTmdlBPLpyuBY7re+XbIaPxr/jB9jJ1pmh52xH3wMkO7ATDQ2fqFnODFrUKS +UpXzuydPnsCdu32KPSnewIrkDB10Sah7vw3uwASO2GWqaFtUDFWGpt6rYQTcOF8g +7a6Zj0johBMQFHE3HDRebWxiOf21ppN/tvv0gtGiA0ZIXBezeLaJ+Hob1xTbi4sw +sGYDKHPCrLuTZWXmkv0rAIkLLK4VHbsA5xYPQNJJsTpX3u0Z0vZxJd9/ +-----END CERTIFICATE----- diff --git a/build/pgo/certs/key3.db b/build/pgo/certs/key3.db index f4edf2e72fbfede0ad14ff150df337352a729964..a99595c52a9f799b96b1a081e885916aa8e90237 100644 GIT binary patch delta 3400 zcmZvfcQ_ji*Ty3u#NJeFo|=8c3W8QBYF2DjYR@Q7hZ@mX39UA2uhy(qsTre)*_cJ` z5vyvHhPG&FpAcW)?|Z-N`rhw-|G4k#oa>zX-}AdpY%ybOEcl6>03!eZVEZku-(vo) zfAoK*=|LHo(o^ygS z+>f9{BX2l}Xf*ZPY8U=tflyFsn1KlEzeHD<|p8H^aLR4$+Jzqn-#WME*7XB;$W zYqavHelg4avi7fM<%7c870jC#QeeI-2jr`wHc(h?pY-7Bx4N*scNfuYIvhb<-vyk> z_0Ksq*XDL7uC;D(r5m&=iKam=^Ez)$DG)wY`44%rJ}F1-h`;Mw>F8Kt{d|I1mx@V(BzzN{b^gOo{PB5K z!OZV9oHr&y7*wbcZQaXktufogTWmu{qdzu)v)m>ewcX7qS#AHN2xPR9bB*Rw?eKe< z-lCPzv)92otHJ?BnxD}*@nt`{v8J$-#5NpqnqSL@`FW7lc2?1k5sQ7kX6o2LOm*a6 zdCyt=62mcTn~jGTC4c;Gf#O4vz?|Cu!*q+ko)7O_>&p0VMFO(*q>_S*@zkB zwPQ@DT75Mg#W8#^UI!wt%e8rX8OVZzuBL4)s?hq8sITmwKe2`8Kh5%T0PElN;Kt*{ zAX-Yn(XY%L*KKcD=zp8}x^yz1X8l2j%SNLC( zy6ZV@L>?ZbBb6&Mm?RaGt#QzD$B)svwt~U}^U?3V7rb{%ZESVKF2XA($9uN5*t!Io zenN+qP#?a5o+|sHe2bO#CNNLcn!*{7Zfs!ZW9Lx=X95-?U3$ z85e`c?`&~4stP)GUf8EH^M=cJB}Y^@kHeo}nF0p=IDH)?D|YJ2Bag?c7{3p@ssGBd zKO}59nGz-OBZv7?-WVk5%`vVbIoA0kX(P)Bi&&ZJ9P#sdla!Am=X#_)$lfDelcUzV zta>6erRDG#hG;=0nT69D^>vj*cJWM8J*U_|P6ebJ5I?Q$i;QGFCR9Sg4VE@mB*d}Q z>&A6wZHJhucEX%Zp{C(Ec#wzg*N^wBeoY|Eq;cnsEx8s;?v0>5hPpoJ5u%_Rb45yL znyfS4C^tc*u}QUE;IHftyCUxsBGWH*aHza^?Y0A9`}i2+8m5@0XFW-{)PffAV#KAZ zH6QkZbv5;u`<@xF@%ylaq^d@m&)>sJVP3jLXXQN(*ne18%p;-YW?pP+J2v_E#t90@ zz4!3E3x9vFD@O?{{1ozIW;pjoBRlsEAb9UGyI_e8tq7D_nvNbxyl`;-dVec9{-LWC zTZ#ZZe#A#;=g@AHZL*er{FE?>BCzg0ccS>~ErS3IzfV7~1||2%2vO59w6{!d}#jRq4p(NIwRgeq742kHN#KoBeNHwj=FHHXJz7uif}jUvH~Y@-Oa$JkBH!1br3xnm~%jF!P{gS%*DyrGk3pLF^fgHGIZ>jUtbk)5Rs<`mnIC}~q5G^2gKtcSZi zfQBx4S+cKYoVWELfe;6SAW^i-^N%V0%GUZ{!om7vvWN)rPOp>1P4<@bDb(p?iA3xX zljOwK*-|CJHIFi_=XRj==UDF;9{Q$?9UBCVV%$7Ptii7b`Whm?KH$!$M;&lr-(+fch%^7q26aK!JU-6vX zCVi@H`MHNiyjIJ1Bq@!~3CQ{rgl`ePJFu`L@ zPJM`c*FIZ$4|}un)5+O#2cCfEqlYj?_Ti^r{h`)x_>>#N!rPA;wANThbdA=K(nA=Y z-DV{eSTlet96!wKJY2o8_|XBlf$g5sr_F8L+YSJVDqZD~qhtUv@e^c_HsF4RLjHEA zbgUj~Kl%&MxdMAtWaJfcK#5@XlC*JHCo6S<#ZpudCdh(s`aq|E2&HdkzpsZG`CUlZ zFH$9R`zJ9|yxyt-Pn_wvFOkq>MOZ-$6)9_&m;P2(AAyUnLcj|K4X9Xl-4)v+l9@g} zQRdf?q@uOtYZKlR$Q5PkxCz;}NhKMR))$I9<_#$ceWpwf&ueI~lllJsS`zBgtFT>W z+iZlnrS+n%(ap1MT%ZCMiHC}V*v@@>MIx}z4quAN(kaVFkjIFlPjC0!t?`7Z&xrH} z1)sE*lbhnC$21(Q6tQgGW@CLw4hDyUZjlkRdMyQQ)u98coKdoes9qm-mV~4{FJpLi zzjRp0$?#%Taz#!4{ifPREkmrQPmE3Grh2316xH6ys;SK}FjcxOb5$*AvbqrO-xo!C zVG(8*ktdtZ8RlEK@^jWZl}W>RgKLU1Mk_!xFzBGXaPBj*GbTDy4&bCuC1HN7|YXkI~-t7|I zks4I6vpW(%^p6ZB#=W-mM`B>;s zS1g{lU7~k?!qR(_>dA7G9hT`2jrdl3fMOPm#BBG7R2$({mW7WVqi#$mbgqsyC2 zI{nJG@A9dPB&*-c=G0!`hlM7G&e89)dXvODS&3yWizv*BLEh z?c2+d5joh1LAF+Nc}@RER>pasl@Pa-=aG66EUi`% zWj=-boLG0s(6<}=4FgPRycUR_PqTVcfoQcwo;I`S7A;dEz2;C_!_6cb0>2$hr1U>| zmvm6PX&%&k-BQ+N=x{7^S?IQp`OR!4RkCtmB;4K96yVVb(|=?nRG;D5g*-R#5c|9pLjJd)Gw#K>7F=)VBB9696w delta 138 zcmZo@U~5>wGC^IGnSp_U3yArFm>q~&fLLdujWi?c#EUr_kJ#vMW;FQEzxlsCqkFrNt j7^RsP6*z3V;LN<)dGlVINeV(h#Xf8x#hWX?wMzm3!qz60 diff --git a/build/pgo/server-locations.txt b/build/pgo/server-locations.txt index dbc0cf4af3f2..98c7d3f34d3e 100644 --- a/build/pgo/server-locations.txt +++ b/build/pgo/server-locations.txt @@ -101,6 +101,8 @@ https://mismatch.expired.example.com:443 privileged,cert=expired https://mismatch.untrusted.example.com:443 privileged,cert=untrusted https://untrusted-expired.example.com:443 privileged,cert=untrustedandexpired https://mismatch.untrusted-expired.example.com:443 privileged,cert=untrustedandexpired +https://ev-valid.example.com:443 privileged,cert=evvalid +https://ev-invalid.example.com:443 priviliged,cert=evinvalid # This is here so that we don't load the default live bookmark over # the network in every test suite. diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index da1304d13e53..b9c5ca90a9c3 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -109,6 +109,21 @@ static struct nsMyTrustedEVInfo myTrustedEVInfos[] = { * In other words, if you add another list, that uses the same dotted_oid * as an existing entry, then please use the same oid_name. */ + { + // This is the testing EV signature. + // C=US, ST=CA, L=Mountain View, O=Mozilla - EV debug test CA, OU=Security Engineering, CN=EV Testing (untrustworthy) CA/name=ev-test-ca/emailAddress=charlatan@testing.example.com + "1.3.6.1.4.1.13769.666.666.666.1.500.9.1", + "DEBUGtesting EV OID", + SEC_OID_UNKNOWN, + "AD:FE:0E:44:16:45:B0:17:46:8B:76:01:74:B7:FF:64:5A:EC:35:91", + "MIHhMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWlu" + "IFZpZXcxIzAhBgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0wGwYD" + "VQQLExRTZWN1cml0eSBFbmdpbmVlcmluZzEmMCQGA1UEAxMdRVYgVGVzdGluZyAo" + "dW50cnVzdHdvcnRoeSkgQ0ExEzARBgNVBCkTCmV2LXRlc3QtY2ExLDAqBgkqhkiG" + "9w0BCQEWHWNoYXJsYXRhbkB0ZXN0aW5nLmV4YW1wbGUuY29t", + "AK/FPSJmJkky", + nullptr + }, { // CN=WellsSecure Public Root Certificate Authority,OU=Wells Fargo Bank NA,O=Wells Fargo WellsSecure,C=US "2.16.840.1.114171.500.9", @@ -1061,7 +1076,11 @@ nsNSSComponent::IdentityInfoInit() ias.serialNumber.type = siUnsignedInteger; entry.cert = CERT_FindCertByIssuerAndSN(nullptr, &ias); - NS_ASSERTION(entry.cert, "Could not find EV root in NSS storage"); + + // The debug CA info is at position 0, and is NOT on the NSS root db + if (iEV != 0) { + NS_ASSERTION(entry.cert, "Could not find EV root in NSS storage"); + } SECITEM_FreeItem(&ias.derIssuer, false); SECITEM_FreeItem(&ias.serialNumber, false); diff --git a/security/manager/ssl/tests/mochitest/bugs/Makefile.in b/security/manager/ssl/tests/mochitest/bugs/Makefile.in index 8981ea47a8d9..f61c25dcc82b 100644 --- a/security/manager/ssl/tests/mochitest/bugs/Makefile.in +++ b/security/manager/ssl/tests/mochitest/bugs/Makefile.in @@ -15,6 +15,8 @@ MOCHITEST_FILES = \ test_bug480509.html \ test_bug483440.html \ test_bug484111.html \ + test_ev_validation.html \ + test_ev_validation_child.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html new file mode 100644 index 000000000000..1e1812758519 --- /dev/null +++ b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html @@ -0,0 +1,52 @@ + + + + + + Test for Bug 813418 + + + + + +Mozilla Bug 813418 +

+ +
+
+
+ + diff --git a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html new file mode 100644 index 000000000000..0faa27a015cc --- /dev/null +++ b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html @@ -0,0 +1,62 @@ + + + + + + + + +

Security_state_child

+ + + diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index 4f8240cc21cb..98ed5ee90d16 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -61,6 +61,8 @@ _SERV_FILES = \ plain-loop.html \ android.json \ b2g.json \ + root-ev-tester.crl \ + intermediate-ev-tester.crl \ $(NULL) ifeq ($(MOZ_BUILD_APP),mobile/android) diff --git a/testing/mochitest/intermediate-ev-tester.crl b/testing/mochitest/intermediate-ev-tester.crl new file mode 100644 index 0000000000000000000000000000000000000000..3d94e958fd77301027d4b0122c9213400f8704b6 GIT binary patch literal 541 zcmXqLVv;myVq`SnW#iOp^Jx3d%gD&e%3#oV(U9AKlZ`o)g-w_#G#JL=5N2|AG!!!s z0m-ln^ZMqO=9MI7<|%|_rj{Ej8z_RrxrC*B^Q$s*auOAE6{7L5jGAMS@e4ON%l~DivJw(lhf?Q;Rb5(qU#Z3-e~?m82Hsrlw>jmZTaR3L6N5 zv}p=+rIzV}%+gIxG}JNBf;*d&QA{>DBe5tau_Q6i0i*(GoL*{0Vs1fBs$Oz_t~jru zv4N4HiJ^tDrKv%bIIj_iYXs$@1pqTJOc?yFKNoS^MFz8ox4U+%5f=A*l_93ASa{BV z(e=k05@w&e-Yk{CRGa9v`6uJ|hV@IHntt$N5&CG@wymc)$won8`tHeH>6VN+{05wN z&n}RxulnkFc2|vB`i}1}6fYm#WqwJc<6T(JZIKfvRv4BhwSISgYgN+FK1pBu*qZRh z%GFC}ER|iu_;gj&l!NcD{PcZq=TaEPv&+bkY4-hMsS7GP=Qq8Ldm`Z_Jl$XU(N@@aWr}ViC;$m*nPie literal 0 HcmV?d00001 diff --git a/testing/mochitest/root-ev-tester.crl b/testing/mochitest/root-ev-tester.crl new file mode 100644 index 0000000000000000000000000000000000000000..4d0dee3a0e42bdd95c5df0476b04731a0e115e8d GIT binary patch literal 557 zcmXqLV$w8dViYvsW#iOp^Jx3d%gD&e%3#p=(2(1JlZ`o)g-w_#G#JL=5N2|AG!!!s z0m-ln^ZMqO=9MI7<|%|_rj{Ej8z_RrxrC*B^Q$s*auOAE6{7L5jGAMS@e4ON%l~DivJw(lhf?Q;Rb5(hb!NR6x?q!m>b}AwWGqK?Mzl!r08%JW8C`2*fpla?t{WxrvdHA@0bGzWj$X9A?&k zaq?fdfHT>u;QSANel`7Uzpc3rUXS+Iv?;w0>=IdeabuFf?D_tD+RmYM3s{$2nLB^a zO-YBED5u=u=*MrY7gdQy9u$7Dx<2f{%!HgM-+*n$@ZoU0EOg Date: Sat, 27 Oct 2012 00:11:35 -0700 Subject: [PATCH 037/438] Bug 813418 - Centralize certificate validation (Part 2 centralize verfification) r=bsmith --HG-- rename : security/manager/ssl/src/nsCERTValInParamWrapper.cpp => security/manager/ssl/src/CertVerifier.cpp extra : rebase_source : 36e8fc83be5c0ec3d83791f04505f47ab972e2cb --- security/manager/ssl/src/CertVerifier.cpp | 416 ++++++++++++++++++ security/manager/ssl/src/CertVerifier.h | 65 +++ security/manager/ssl/src/CryptoUtil.h | 13 + security/manager/ssl/src/Makefile.in | 2 +- .../ssl/src/SSLServerCertVerification.cpp | 168 +++---- .../ssl/src/nsCERTValInParamWrapper.cpp | 126 ------ .../manager/ssl/src/nsCERTValInParamWrapper.h | 71 --- security/manager/ssl/src/nsCMS.cpp | 46 +- .../manager/ssl/src/nsIdentityChecking.cpp | 116 ++--- security/manager/ssl/src/nsNSSCertificate.cpp | 50 +-- security/manager/ssl/src/nsNSSCertificate.h | 4 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 114 ++--- security/manager/ssl/src/nsNSSComponent.cpp | 56 +-- security/manager/ssl/src/nsNSSComponent.h | 24 +- .../manager/ssl/src/nsUsageArrayHelper.cpp | 71 ++- security/manager/ssl/src/nsUsageArrayHelper.h | 8 +- 16 files changed, 727 insertions(+), 623 deletions(-) create mode 100644 security/manager/ssl/src/CertVerifier.cpp create mode 100644 security/manager/ssl/src/CertVerifier.h create mode 100644 security/manager/ssl/src/CryptoUtil.h delete mode 100644 security/manager/ssl/src/nsCERTValInParamWrapper.cpp delete mode 100644 security/manager/ssl/src/nsCERTValInParamWrapper.h diff --git a/security/manager/ssl/src/CertVerifier.cpp b/security/manager/ssl/src/CertVerifier.cpp new file mode 100644 index 000000000000..6b021a8e01d7 --- /dev/null +++ b/security/manager/ssl/src/CertVerifier.cpp @@ -0,0 +1,416 @@ +/* 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 "CertVerifier.h" +#include "nsNSSComponent.h" +#include "cert.h" +#include "secerr.h" + + +#ifdef PR_LOGGING +extern PRLogModuleInfo* gPIPNSSLog; +#endif + +namespace mozilla { namespace psm { + +extern SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag); +extern CERTCertList* getRootsForOid(SECOidTag oid_tag); + +const CertVerifier::Flags CertVerifier::FLAG_LOCAL_ONLY = 1; + +CertVerifier::CertVerifier(missing_cert_download_config mcdc, + crl_download_config cdc, + ocsp_download_config odc, + ocsp_strict_config osc, + any_revo_fresh_config arfc, + const char *firstNetworkRevocationMethod) + : mMissingCertDownloadEnabled(mcdc == missing_cert_download_on) + , mCRLDownloadEnabled(cdc == crl_download_allowed) + , mOCSPDownloadEnabled(odc == ocsp_on) + , mOCSPStrict(osc == ocsp_strict) + , mRequireRevocationInfo(arfc == any_revo_strict) + , mCRLFirst(firstNetworkRevocationMethod != nullptr && + !strcmp("crl", firstNetworkRevocationMethod)) +{ + MOZ_COUNT_CTOR(CertVerifier); +} + +CertVerifier::~CertVerifier() +{ + MOZ_COUNT_DTOR(CertVerifier); +} + + +static SECStatus +ClassicVerifyCert(CERTCertificate * cert, + const SECCertificateUsage usage, + const PRTime time, + nsIInterfaceRequestor * pinArg, + /*optional out*/ CERTCertList **validationChain, + /*optional out*/ CERTVerifyLog *verifyLog) +{ + SECStatus rv; + SECCertUsage enumUsage; + if (validationChain) { + switch(usage){ + case certificateUsageSSLClient: + enumUsage = certUsageSSLClient; + break; + case certificateUsageSSLServer: + enumUsage = certUsageSSLServer; + break; + case certificateUsageSSLServerWithStepUp: + enumUsage = certUsageSSLServerWithStepUp; + break; + case certificateUsageSSLCA: + enumUsage = certUsageSSLCA; + break; + case certificateUsageEmailSigner: + enumUsage = certUsageEmailSigner; + break; + case certificateUsageEmailRecipient: + enumUsage = certUsageEmailRecipient; + break; + case certificateUsageObjectSigner: + enumUsage = certUsageObjectSigner; + break; + case certificateUsageUserCertImport: + enumUsage = certUsageUserCertImport; + break; + case certificateUsageVerifyCA: + enumUsage = certUsageVerifyCA; + break; + case certificateUsageProtectedObjectSigner: + enumUsage = certUsageProtectedObjectSigner; + break; + case certificateUsageStatusResponder: + enumUsage = certUsageStatusResponder; + break; + case certificateUsageAnyCA: + enumUsage = certUsageAnyCA; + break; + default: + return SECFailure; + } + } + if (usage == certificateUsageSSLServer) { + /* SSL server cert verification has always used CERT_VerifyCert, so we + * continue to use it for SSL cert verification to minimize the risk of + * there being any differnce in results between CERT_VerifyCert and + * CERT_VerifyCertificate. + */ + rv = CERT_VerifyCert(CERT_GetDefaultCertDB(), cert, true, + certUsageSSLServer, time, pinArg, verifyLog); + } else { + rv = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), cert, true, + usage, time, pinArg, + verifyLog, nullptr); + } + if (rv == SECSuccess && validationChain) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: getting chain in 'classic' \n")); + *validationChain = CERT_GetCertChainFromCert(cert, time, enumUsage); + if (!*validationChain) { + rv = SECFailure; + } + } + return rv; +} + +SECStatus +CertVerifier::VerifyCert(CERTCertificate * cert, + const SECCertificateUsage usage, + const PRTime time, + nsIInterfaceRequestor * pinArg, + const Flags flags, + /*optional out*/ CERTCertList **validationChain, + /*optional out*/ SECOidTag *evOidPolicy, + /*optional out*/ CERTVerifyLog *verifyLog) +{ + if (!cert) { + PORT_SetError(SEC_ERROR_INVALID_ARGS); + return SECFailure; + } + if (validationChain) { + *validationChain = nullptr; + } + if (evOidPolicy) { + *evOidPolicy = SEC_OID_UNKNOWN; + } + + ScopedCERTCertList trustAnchors; + SECStatus rv; + SECOidTag evPolicy = SEC_OID_UNKNOWN; + + // Do EV checking only for sslserver usage + if (usage == certificateUsageSSLServer) { + SECStatus srv = getFirstEVPolicy(cert, evPolicy); + if (srv == SECSuccess) { + if (evPolicy != SEC_OID_UNKNOWN) { + trustAnchors = getRootsForOid(evPolicy); + } + if (!trustAnchors) { + return SECFailure; + } + } else { + // Do not setup EV verification params + evPolicy = SEC_OID_UNKNOWN; + } + } + + MOZ_ASSERT_IF(evPolicy != SEC_OID_UNKNOWN, trustAnchors); + + size_t i = 0; + size_t validationChainLocation = 0; + size_t validationTrustAnchorLocation = 0; + CERTValOutParam cvout[4]; + if (verifyLog) { + cvout[i].type = cert_po_errorLog; + cvout[i].value.pointer.log = verifyLog; + ++i; + } + if (validationChain) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: setting up validation chain outparam.\n")); + validationChainLocation = i; + cvout[i].type = cert_po_certList; + cvout[i].value.pointer.cert = nullptr; + ++i; + validationTrustAnchorLocation = i; + cvout[i].type = cert_po_trustAnchor; + cvout[i].value.pointer.chain = nullptr; + ++i; + } + cvout[i].type = cert_po_end; + + CERTRevocationFlags rev; + + CERTRevocationMethodIndex revPreferredMethods[2]; + rev.leafTests.preferred_methods = + rev.chainTests.preferred_methods = revPreferredMethods; + + uint64_t revFlagsPerMethod[2]; + rev.leafTests.cert_rev_flags_per_method = + rev.chainTests.cert_rev_flags_per_method = revFlagsPerMethod; + rev.leafTests.number_of_preferred_methods = + rev.chainTests.number_of_preferred_methods = 1; + + rev.leafTests.number_of_defined_methods = + rev.chainTests.number_of_defined_methods = cert_revocation_method_ocsp + 1; + + const bool localOnly = flags & FLAG_LOCAL_ONLY; + CERTValInParam cvin[6]; + + // Parameters for both EV and DV validation + cvin[0].type = cert_pi_useAIACertFetch; + cvin[0].value.scalar.b = mMissingCertDownloadEnabled && !localOnly; + cvin[1].type = cert_pi_revocationFlags; + cvin[1].value.pointer.revocation = &rev; + cvin[2].type = cert_pi_date; + cvin[2].value.scalar.time = time; + i = 3; + const size_t evParamLocation = i; + + // Declare dv variables here so that we can use they dont cross the goto line! + // after classic is gone, we can move the declaration below (and remove the + // goto) + bool strictRevocation; + + if (evPolicy != SEC_OID_UNKNOWN) { + // EV setup! + // This flags are not quite correct, but it is what we have now, so keeping + // them identical for bug landing purposes. Should be fixed later! + uint64_t revMethodFlags = + CERT_REV_M_TEST_USING_THIS_METHOD + | (mOCSPDownloadEnabled ? CERT_REV_M_ALLOW_NETWORK_FETCHING + : CERT_REV_M_FORBID_NETWORK_FETCHING) + | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE + | CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE + | CERT_REV_M_IGNORE_MISSING_FRESH_INFO + | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO; + + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] = revMethodFlags; + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = revMethodFlags; + + rev.leafTests.cert_rev_method_independent_flags = + rev.chainTests.cert_rev_method_independent_flags = + // avoiding the network is good, let's try local first + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST + // is overall revocation requirement strict or relaxed? + | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE + ; + + rev.leafTests.preferred_methods[0] = + rev.chainTests.preferred_methods[0] = cert_revocation_method_ocsp; + + cvin[i].type = cert_pi_policyOID; + cvin[i].value.arraySize = 1; + cvin[i].value.array.oids = &evPolicy; + ++i; + MOZ_ASSERT(trustAnchors); + cvin[i].type = cert_pi_trustAnchors; + cvin[i].value.pointer.chain = trustAnchors; + ++i; + + cvin[i].type = cert_pi_end; + + rv = CERT_PKIXVerifyCert(cert, usage, cvin, cvout, pinArg); + if (rv == SECSuccess) { + if (evOidPolicy) { + *evOidPolicy = evPolicy; + } + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, + ("VerifyCert: successful CERT_PKIXVerifyCert(ev) \n")); + goto pkix_done; + } + + if (validationChain && *validationChain) { + // There SHOULD not be a validation chain on failure, asserion here for + // the debug builds AND a fallback for production builds + MOZ_ASSERT(false, + "certPKIXVerifyCert returned failure AND a validationChain"); + CERT_DestroyCertList(*validationChain); + *validationChain = nullptr; + } + + if (verifyLog) { + // Cleanup the log so that it is ready the the next validation + CERTVerifyLogNode *i_node; + for (i_node = verifyLog->head; i_node; i_node = i_node->next) { + //destroy cert if any. + if (i_node->cert) { + CERT_DestroyCertificate(i_node->cert); + } + // No need to cleanup the actual nodes in the arena. + } + verifyLog->count = 0; + verifyLog->head = nullptr; + verifyLog->tail = nullptr; + } + + } + + if (!nsNSSComponent::globalConstFlagUsePKIXVerification){ + // XXX: we do not care about the localOnly flag (currently) as the + // caller that wants localOnly should disable and reenable the fetching. + return ClassicVerifyCert(cert, usage, time, pinArg, validationChain, + verifyLog); + } + + // The current flags check the chain the same way as the leafs + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + // implicit default source - makes no sense for CRLs + CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE + + // let's not stop on fresh CRL. If OCSP is enabled, too, let's check it + | CERT_REV_M_CONTINUE_TESTING_ON_FRESH_INFO + + // no fresh CRL? well, let other flag decide whether to fail or not + | CERT_REV_M_IGNORE_MISSING_FRESH_INFO + + // testing using local CRLs is always allowed + | CERT_REV_M_TEST_USING_THIS_METHOD + + // no local crl and don't know where to get it from? ignore + | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE + + // crl download based on parameter + | ((mCRLDownloadEnabled && !localOnly) ? + CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) + ; + + rev.leafTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + rev.chainTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + // use OCSP + CERT_REV_M_TEST_USING_THIS_METHOD + + // if app has a default OCSP responder configured, let's use it + | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE + + // of course OCSP doesn't work without a source. let's accept such certs + | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE + + // if ocsp is required stop on lack of freshness + | (mOCSPStrict ? + CERT_REV_M_FAIL_ON_MISSING_FRESH_INFO : CERT_REV_M_IGNORE_MISSING_FRESH_INFO) + + // ocsp success is sufficient + | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO + + // ocsp enabled controls network fetching, too + | ((mOCSPDownloadEnabled && !localOnly) ? + CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) + ; + + rev.leafTests.preferred_methods[0] = + rev.chainTests.preferred_methods[0] = + mCRLFirst ? cert_revocation_method_crl : cert_revocation_method_ocsp; + + rev.leafTests.cert_rev_method_independent_flags = + rev.chainTests.cert_rev_method_independent_flags = + // avoiding the network is good, let's try local first + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST + + // is overall revocation requirement strict or relaxed? + | (mRequireRevocationInfo ? + CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE : CERT_REV_MI_NO_OVERALL_INFO_REQUIREMENT) + ; + + // Skip EV parameters + cvin[evParamLocation].type = cert_pi_end; + + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: calling CERT_PKIXVerifyCert(dv) \n")); + rv = CERT_PKIXVerifyCert(cert, usage, cvin, cvout, pinArg); + +pkix_done: + if (validationChain) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: validation chain requested\n")); + ScopedCERTCertificate trustAnchor(cvout[validationTrustAnchorLocation].value.pointer.cert); + + if (rv == SECSuccess) { + if (! cvout[validationChainLocation].value.pointer.chain) { + return SECFailure; + } + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: I have a chain\n")); + *validationChain = cvout[validationChainLocation].value.pointer.chain; + if (trustAnchor) { + // we should only add the issuer to the chain if it is not already + // present. On CA cert checking, the issuer is the same cert, so in + // that case we do not add the cert to the chain. + if (!CERT_CompareCerts(trustAnchor, cert)) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: adding issuer to tail for display\n")); + // note: rv is reused to catch errors on cert creation! + rv = CERT_AddCertToListTail(*validationChain, + CERT_DupCertificate(trustAnchor)); + if (rv != SECSuccess) { + CERT_DestroyCertList(*validationChain); + *validationChain = nullptr; + } + } + } + } else { + // Validation was a fail, clean up if needed + if (cvout[validationChainLocation].value.pointer.chain) { + CERT_DestroyCertList(cvout[validationChainLocation].value.pointer.chain); + } + } + } + return rv; +} + +TemporaryRef +GetDefaultCertVerifier() +{ + static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); + + nsCOMPtr nssComponent(do_GetService(kNSSComponentCID)); + RefPtr certVerifier; + if (nssComponent) { + (void) nssComponent->GetDefaultCertVerifier(certVerifier); + } + return certVerifier; +} + +} } // namespace mozilla::psm diff --git a/security/manager/ssl/src/CertVerifier.h b/security/manager/ssl/src/CertVerifier.h new file mode 100644 index 000000000000..96dbd5441cbd --- /dev/null +++ b/security/manager/ssl/src/CertVerifier.h @@ -0,0 +1,65 @@ +/* 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/. */ + +#ifndef mozilla_psm__CertVerifier_h +#define mozilla_psm__CertVerifier_h + +#include "mozilla/RefPtr.h" +#include "CryptoUtil.h" +#include "nsISupportsImpl.h" +#include "certt.h" + +class nsIInterfaceRequestor; +class nsNSSComponent; + +namespace mozilla { namespace psm { + +class CertVerifier +{ +public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CertVerifier) + + typedef unsigned int Flags; + static const Flags FLAG_LOCAL_ONLY; + // XXX: The localonly flag is ignored in the classic verification case + + // *evOidPolicy == SEC_OID_UNKNOWN means the cert is NOT EV + SECStatus VerifyCert(CERTCertificate * cert, + const SECCertificateUsage usage, + const PRTime time, + nsIInterfaceRequestor * pinArg, + const Flags flags = 0, + /*optional out*/ CERTCertList **validationChain = nullptr, + /*optional out*/ SECOidTag *evOidPolicy = nullptr , + /*optional out*/ CERTVerifyLog *verifyLog = nullptr); + + enum missing_cert_download_config { missing_cert_download_off = 0, missing_cert_download_on }; + enum crl_download_config { crl_local_only = 0, crl_download_allowed }; + enum ocsp_download_config { ocsp_off = 0, ocsp_on }; + enum ocsp_strict_config { ocsp_relaxed = 0, ocsp_strict }; + enum any_revo_fresh_config { any_revo_relaxed = 0, any_revo_strict }; + + bool IsOCSPDownloadEnabled() const { return mOCSPDownloadEnabled; } + +private: + CertVerifier(missing_cert_download_config ac, crl_download_config cdc, + ocsp_download_config odc, ocsp_strict_config osc, + any_revo_fresh_config arfc, + const char *firstNetworkRevocationMethod); + ~CertVerifier(); + + const bool mMissingCertDownloadEnabled; + const bool mCRLDownloadEnabled; + const bool mOCSPDownloadEnabled; + const bool mOCSPStrict; + const bool mRequireRevocationInfo; + const bool mCRLFirst; + friend class ::nsNSSComponent; +}; + +MOZ_WARN_UNUSED_RESULT TemporaryRef GetDefaultCertVerifier(); + +} } // namespace mozilla::psm + +#endif // mozilla_psm__CertVerifier_h diff --git a/security/manager/ssl/src/CryptoUtil.h b/security/manager/ssl/src/CryptoUtil.h new file mode 100644 index 000000000000..8d80f9aeb72f --- /dev/null +++ b/security/manager/ssl/src/CryptoUtil.h @@ -0,0 +1,13 @@ +#ifndef mozilla_psm__CryptoUtil_h +#define mozilla_psm__CryptoUtil_h + +#include +#include "mozilla/Types.h" + +#ifdef MOZILLA_INTERNAL_API +#define MOZ_CRYPTO_API(x) MOZ_EXPORT_API(x) +#else +#define MOZ_CRYPTO_API(x) MOZ_IMPORT_API(x) +#endif + +#endif // mozilla_psm__CryptoUtil_h diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in index 2898fbc7187c..4b87ab48e5e9 100644 --- a/security/manager/ssl/src/Makefile.in +++ b/security/manager/ssl/src/Makefile.in @@ -20,7 +20,7 @@ LIBXUL_LIBRARY = 1 CPPSRCS = \ CryptoTask.cpp \ JARSignatureVerification.cpp \ - nsCERTValInParamWrapper.cpp \ + CertVerifier.cpp \ nsNSSCleaner.cpp \ nsCertOverrideService.cpp \ nsRecentBadCerts.cpp \ diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index 746ed9010dae..773189a2305a 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -95,6 +95,7 @@ */ #include "SSLServerCertVerification.h" +#include "CertVerifier.h" #include "nsIBadCertListener2.h" #include "nsICertOverrideService.h" #include "nsIStrictTransportSecurityService.h" @@ -113,7 +114,6 @@ #include "nsServiceManagerUtils.h" #include "nsIConsoleService.h" #include "PSMRunnable.h" -#include "ScopedNSSTypes.h" #include "SharedSSLState.h" #include "ssl.h" @@ -131,6 +131,7 @@ namespace { NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); +NSSCleanupAutoPtrClass(CERTCertificate, CERT_DestroyCertificate) NSSCleanupAutoPtrClass_WithParam(PLArenaPool, PORT_FreeArena, FalseParam, false) // do not use a nsCOMPtr to avoid static initializer/destructor @@ -467,31 +468,26 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, } SECStatus srv; - nsresult nsrv; - nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) { - NS_ERROR("do_GetService(kNSSComponentCID) failed"); - PR_SetError(defaultErrorCodeToReport, 0); - return nullptr; - } - - RefPtr survivingParams; - nsrv = inss->GetDefaultCERTValInParam(survivingParams); - if (NS_FAILED(nsrv)) { - NS_ERROR("GetDefaultCERTValInParam failed"); + RefPtr certVerifier(GetDefaultCertVerifier()); + if (!certVerifier) { + NS_ERROR("GetDefaultCerVerifier failed"); PR_SetError(defaultErrorCodeToReport, 0); return nullptr; } - PLArenaPool *log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); + PRTime now = PR_Now(); + + PLArenaPool *log_arena = nullptr; PLArenaPoolCleanerFalseParam log_arena_cleaner(log_arena); + CERTVerifyLog * verify_log = nullptr; + + log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!log_arena) { NS_ERROR("PORT_NewArena failed"); return nullptr; // PORT_NewArena set error code } - - CERTVerifyLog *verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); + verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); if (!verify_log) { NS_ERROR("PORT_ArenaZNew failed"); return nullptr; // PORT_ArenaZNew set error code @@ -499,22 +495,8 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, CERTVerifyLogContentsCleaner verify_log_cleaner(verify_log); verify_log->arena = log_arena; - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - srv = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), cert, - true, certificateUsageSSLServer, - PR_Now(), static_cast(infoObject), - verify_log, nullptr); - } - else { - CERTValOutParam cvout[2]; - cvout[0].type = cert_po_errorLog; - cvout[0].value.pointer.log = verify_log; - cvout[1].type = cert_po_end; - - srv = CERT_PKIXVerifyCert(cert, certificateUsageSSLServer, - survivingParams->GetRawPointerForNSS(), - cvout, static_cast(infoObject)); - } + srv = certVerifier->VerifyCert(cert, certificateUsageSSLServer, now, + infoObject, 0, nullptr, nullptr, verify_log); // We ignore the result code of the cert verification. // Either it is a failure, which is expected, and we'll process the @@ -539,40 +521,44 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, errorCodeMismatch = SSL_ERROR_BAD_CERT_DOMAIN; } - CERTVerifyLogNode *i_node; - for (i_node = verify_log->head; i_node; i_node = i_node->next) - { - switch (i_node->error) + if (verify_log) { + CERTVerifyLogNode *i_node; + for (i_node = verify_log->head; i_node; i_node = i_node->next) { - case SEC_ERROR_UNKNOWN_ISSUER: - case SEC_ERROR_CA_CERT_INVALID: - case SEC_ERROR_UNTRUSTED_ISSUER: - case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: - case SEC_ERROR_UNTRUSTED_CERT: - case SEC_ERROR_INADEQUATE_KEY_USAGE: - case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: - // We group all these errors as "cert not trusted" - collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; - if (errorCodeTrust == SECSuccess) { - errorCodeTrust = i_node->error; - } - break; - case SSL_ERROR_BAD_CERT_DOMAIN: - collected_errors |= nsICertOverrideService::ERROR_MISMATCH; - if (errorCodeMismatch == SECSuccess) { - errorCodeMismatch = i_node->error; - } - break; - case SEC_ERROR_EXPIRED_CERTIFICATE: - collected_errors |= nsICertOverrideService::ERROR_TIME; - if (errorCodeExpired == SECSuccess) { - errorCodeExpired = i_node->error; - } - break; - default: - PR_SetError(i_node->error, 0); - return nullptr; + switch (i_node->error) + { + case SEC_ERROR_UNKNOWN_ISSUER: + case SEC_ERROR_CA_CERT_INVALID: + case SEC_ERROR_UNTRUSTED_ISSUER: + case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + case SEC_ERROR_UNTRUSTED_CERT: + case SEC_ERROR_INADEQUATE_KEY_USAGE: + case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: + // We group all these errors as "cert not trusted" + collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; + if (errorCodeTrust == SECSuccess) { + errorCodeTrust = i_node->error; + } + break; + case SSL_ERROR_BAD_CERT_DOMAIN: + collected_errors |= nsICertOverrideService::ERROR_MISMATCH; + if (errorCodeMismatch == SECSuccess) { + errorCodeMismatch = i_node->error; + } + break; + case SEC_ERROR_EXPIRED_CERTIFICATE: + collected_errors |= nsICertOverrideService::ERROR_TIME; + if (errorCodeExpired == SECSuccess) { + errorCodeExpired = i_node->error; + } + break; + default: + PR_SetError(i_node->error, 0); + return nullptr; + } } + } else { + // XXX set errorCodeTrust, errorCodeMismatch, errorCodeExpired, collected_errors } if (!collected_errors) @@ -661,31 +647,21 @@ SSLServerCertVerificationJob::SSLServerCertVerificationJob( } SECStatus -PSM_SSL_PKIX_AuthCertificate(CERTCertificate *peerCert, void * pinarg, - const char * hostname) +PSM_SSL_PKIX_AuthCertificate(CERTCertificate *peerCert, + nsIInterfaceRequestor * pinarg, + const char * hostname, + CERTCertList **validationChain, + SECOidTag *evOidPolicy) { - SECStatus rv; - - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - rv = CERT_VerifyCertNow(CERT_GetDefaultCertDB(), peerCert, true, - certUsageSSLServer, pinarg); + RefPtr certVerifier(GetDefaultCertVerifier()); + if (!certVerifier) { + PR_SetError(PR_INVALID_STATE_ERROR, 0); + return SECFailure; } - else { - nsresult nsrv; - nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) - return SECFailure; - RefPtr survivingParams; - if (NS_FAILED(inss->GetDefaultCERTValInParam(survivingParams))) - return SECFailure; - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; - - rv = CERT_PKIXVerifyCert(peerCert, certificateUsageSSLServer, - survivingParams->GetRawPointerForNSS(), - cvout, pinarg); - } + SECStatus rv = certVerifier->VerifyCert(peerCert, + certificateUsageSSLServer, PR_Now(), + pinarg, 0, validationChain , evOidPolicy); if (rv == SECSuccess) { /* cert is OK. This is the client side of an SSL connection. @@ -897,8 +873,12 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } } + CERTCertList *verifyCertChain = nullptr; + SECOidTag evOidPolicy; SECStatus rv = PSM_SSL_PKIX_AuthCertificate(cert, infoObject, - infoObject->GetHostName()); + infoObject->GetHostName(), + &verifyCertChain, + &evOidPolicy); // We want to remember the CA certs in the temp db, so that the application can find the // complete chain at any time it might need it. @@ -908,7 +888,12 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, RefPtr nsc; if (!status || !status->mServerCert) { - nsc = nsNSSCertificate::Create(cert); + if( rv == SECSuccess ){ + nsc = nsNSSCertificate::Create(cert, &evOidPolicy); + } + else { + nsc = nsNSSCertificate::Create(cert); + } } ScopedCERTCertList certList(CERT_GetCertChainFromCert(cert, PR_Now(), @@ -937,13 +922,6 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } if (rv == SECSuccess) { - if (nsc) { - bool dummyIsEV; - nsc->GetIsExtendedValidation(&dummyIsEV); // the nsc object will cache the status - } - - nsCOMPtr nssComponent; - // We want to avoid storing any intermediate cert information when browsing // in private, transient contexts. if (!(providerFlags & nsISocketProvider::NO_PERMANENT_STORAGE)) { diff --git a/security/manager/ssl/src/nsCERTValInParamWrapper.cpp b/security/manager/ssl/src/nsCERTValInParamWrapper.cpp deleted file mode 100644 index a7efc3727aad..000000000000 --- a/security/manager/ssl/src/nsCERTValInParamWrapper.cpp +++ /dev/null @@ -1,126 +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 "nsCERTValInParamWrapper.h" - -NS_IMPL_THREADSAFE_ADDREF(nsCERTValInParamWrapper) -NS_IMPL_THREADSAFE_RELEASE(nsCERTValInParamWrapper) - -nsCERTValInParamWrapper::nsCERTValInParamWrapper() -:mAlreadyConstructed(false) -,mCVIN(nullptr) -,mRev(nullptr) -{ - MOZ_COUNT_CTOR(nsCERTValInParamWrapper); -} - -nsCERTValInParamWrapper::~nsCERTValInParamWrapper() -{ - MOZ_COUNT_DTOR(nsCERTValInParamWrapper); - if (mRev) { - CERT_DestroyCERTRevocationFlags(mRev); - } - if (mCVIN) - PORT_Free(mCVIN); -} - -nsresult nsCERTValInParamWrapper::Construct(missing_cert_download_config mcdc, - crl_download_config cdc, - ocsp_download_config odc, - ocsp_strict_config osc, - any_revo_fresh_config arfc, - const char *firstNetworkRevocationMethod) -{ - if (mAlreadyConstructed) - return NS_ERROR_FAILURE; - - mOCSPDownloadEnabled = odc == ocsp_on; - - CERTValInParam *p = (CERTValInParam*)PORT_Alloc(3 * sizeof(CERTValInParam)); - if (!p) - return NS_ERROR_OUT_OF_MEMORY; - - CERTRevocationFlags *rev = CERT_AllocCERTRevocationFlags( - cert_revocation_method_ocsp +1, 1, - cert_revocation_method_ocsp +1, 1); - - if (!rev) { - PORT_Free(p); - return NS_ERROR_OUT_OF_MEMORY; - } - - p[0].type = cert_pi_useAIACertFetch; - p[0].value.scalar.b = (mcdc == missing_cert_download_on); - p[1].type = cert_pi_revocationFlags; - p[1].value.pointer.revocation = rev; - p[2].type = cert_pi_end; - - rev->leafTests.cert_rev_flags_per_method[cert_revocation_method_crl] = - rev->chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] = - // implicit default source - makes no sense for CRLs - CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE - - // let's not stop on fresh CRL. If OCSP is enabled, too, let's check it - | CERT_REV_M_CONTINUE_TESTING_ON_FRESH_INFO - - // no fresh CRL? well, let other flag decide whether to fail or not - | CERT_REV_M_IGNORE_MISSING_FRESH_INFO - - // testing using local CRLs is always allowed - | CERT_REV_M_TEST_USING_THIS_METHOD - - // no local crl and don't know where to get it from? ignore - | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE - - // crl download based on parameter - | ((cdc == crl_download_allowed) ? - CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) - ; - - rev->leafTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = - rev->chainTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = - // is ocsp enabled at all? - ((odc == ocsp_on) ? - CERT_REV_M_TEST_USING_THIS_METHOD : CERT_REV_M_DO_NOT_TEST_USING_THIS_METHOD) - - // ocsp enabled controls network fetching, too - | ((odc == ocsp_on) ? - CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) - - // ocsp set to strict==required? - | ((osc == ocsp_strict) ? - CERT_REV_M_FAIL_ON_MISSING_FRESH_INFO : CERT_REV_M_IGNORE_MISSING_FRESH_INFO) - - // if app has a default OCSP responder configured, let's use it - | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE - - // of course OCSP doesn't work without a source. let's accept such certs - | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE - - // ocsp success is sufficient - | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO - ; - - bool wantsCrlFirst = (firstNetworkRevocationMethod != nullptr) - && (strcmp("crl", firstNetworkRevocationMethod) == 0); - - rev->leafTests.preferred_methods[0] = - rev->chainTests.preferred_methods[0] = - wantsCrlFirst ? cert_revocation_method_crl : cert_revocation_method_ocsp; - - rev->leafTests.cert_rev_method_independent_flags = - rev->chainTests.cert_rev_method_independent_flags = - // avoiding the network is good, let's try local first - CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST - - // is overall revocation requirement strict or relaxed? - | ((arfc == any_revo_strict) ? - CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE : CERT_REV_MI_NO_OVERALL_INFO_REQUIREMENT) - ; - - mAlreadyConstructed = true; - mCVIN = p; - mRev = rev; - return NS_OK; -} diff --git a/security/manager/ssl/src/nsCERTValInParamWrapper.h b/security/manager/ssl/src/nsCERTValInParamWrapper.h deleted file mode 100644 index dab0aaabcc90..000000000000 --- a/security/manager/ssl/src/nsCERTValInParamWrapper.h +++ /dev/null @@ -1,71 +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/. */ - -#ifndef _nsCERTValInParamWrapper_H -#define _nsCERTValInParamWrapper_H - -#include "nsISupports.h" -#include "cert.h" - -/* - * This is a wrapper around type - * CERTValInParam is a nested input parameter type for CERT_PKIXVerifyCert. - * The values inside this type depend on application preferences, - * as a consequence it's expensive to construct this object. - * (and we shall avoid to access prefs from secondary threads anyway). - * We want to create an instance of that input type once, and use as long as possible. - * Every time the preferences change, we will create a new default object. - * - * A race is possible between "verification function is active and object in use" - * and "must switch to new defaults". - * - * The global default object may be replaced at any time with a new object. - * The contents of inner CERTValInParam are supposed to be stable (const). - * - * In order to protect against the race, we use a reference counted wrapper. - * Each user of a foreign nsCERTValInParamWrapper object - * (e.g. the current global default object) - * must use RefPtr = other-object - * prior to calling CERT_PKIXVerifyCert. - * - * This guarantees the object will still be alive after the call, - * and if the default object has been replaced in the meantime, - * the reference counter will go to zero, and the old default - * object will get destroyed automatically. - */ -class nsCERTValInParamWrapper -{ -public: - NS_IMETHOD_(nsrefcnt) AddRef(); - NS_IMETHOD_(nsrefcnt) Release(); - - bool IsOCSPDownloadEnabled() const { return mOCSPDownloadEnabled; } - - nsCERTValInParamWrapper(); - virtual ~nsCERTValInParamWrapper(); - - enum missing_cert_download_config { missing_cert_download_off = 0, missing_cert_download_on }; - enum crl_download_config { crl_local_only = 0, crl_download_allowed }; - enum ocsp_download_config { ocsp_off = 0, ocsp_on }; - enum ocsp_strict_config { ocsp_relaxed = 0, ocsp_strict }; - enum any_revo_fresh_config { any_revo_relaxed = 0, any_revo_strict }; - - nsresult Construct(missing_cert_download_config ac, crl_download_config cdc, - ocsp_download_config odc, ocsp_strict_config osc, - any_revo_fresh_config arfc, - const char *firstNetworkRevocationMethod); - -private: - nsAutoRefCnt mRefCnt; - NS_DECL_OWNINGTHREAD - bool mAlreadyConstructed; - CERTValInParam *mCVIN; - CERTRevocationFlags *mRev; - bool mOCSPDownloadEnabled; - -public: - CERTValInParam *GetRawPointerForNSS() { return mCVIN; } -}; - -#endif diff --git a/security/manager/ssl/src/nsCMS.cpp b/security/manager/ssl/src/nsCMS.cpp index 1c183a562ca9..89da4298111a 100644 --- a/security/manager/ssl/src/nsCMS.cpp +++ b/security/manager/ssl/src/nsCMS.cpp @@ -3,8 +3,9 @@ * 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.h" #include "nsCMS.h" +#include "CertVerifier.h" +#include "nsISupports.h" #include "nsNSSHelper.h" #include "nsNSSCertificate.h" #include "smime.h" @@ -13,19 +14,17 @@ #include "nsIArray.h" #include "nsArrayUtils.h" #include "nsCertVerificationThread.h" -#include "nsCERTValInParamWrapper.h" #include "ScopedNSSTypes.h" #include "prlog.h" -#include "nsNSSComponent.h" +using namespace mozilla; +using namespace mozilla::psm; #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; #endif -using namespace mozilla; - static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); NS_IMPL_THREADSAFE_ISUPPORTS2(nsCMSMessage, nsICMSMessage, @@ -218,9 +217,8 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, uint32_ NSSCMSSignedData *sigd = nullptr; NSSCMSSignerInfo *si; int32_t nsigners; + RefPtr certVerifier; nsresult rv = NS_ERROR_FAILURE; - RefPtr survivingParams; - nsCOMPtr inss; if (!NSS_CMSMessage_IsSigned(m_cmsMsg)) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - not signed\n")); @@ -264,32 +262,16 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, uint32_ // See bug 324474. We want to make sure the signing cert is // still valid at the current time. - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), si->cert, true, - certificateUsageEmailSigner, - si->cmsg->pwfn_arg, nullptr) != SECSuccess) { - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); - rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; - goto loser; - } - } - else { - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; + certVerifier = GetDefaultCertVerifier(); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); - inss = do_GetService(kNSSComponentCID, &rv); - if (!inss) { - goto loser; - } - - if (NS_FAILED(inss->GetDefaultCERTValInParam(survivingParams))) { - goto loser; - } - SECStatus stat = CERT_PKIXVerifyCert(si->cert, certificateUsageEmailSigner, - survivingParams->GetRawPointerForNSS(), - cvout, si->cmsg->pwfn_arg); - if (stat != SECSuccess) { - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); + { + SECStatus srv = certVerifier->VerifyCert(si->cert, + certificateUsageEmailSigner, + PR_Now(), nullptr /*XXX pinarg*/); + if (srv != SECSuccess) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, + ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; goto loser; } diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index b9c5ca90a9c3..80e4e5797344 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -4,6 +4,7 @@ * 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 "CertVerifier.h" #include "mozilla/RefPtr.h" #include "nsAppDirectoryServiceDefs.h" #include "nsStreamUtils.h" @@ -20,6 +21,7 @@ #include "ScopedNSSTypes.h" using namespace mozilla; +using namespace mozilla::psm; #ifdef DEBUG #ifndef PSM_ENABLE_TEST_EV_ROOTS @@ -1013,7 +1015,9 @@ isEVPolicy(SECOidTag policyOIDTag) return false; } -static CERTCertList* +namespace mozilla { namespace psm { + +CERTCertList* getRootsForOid(SECOidTag oid_tag) { CERTCertList *certList = CERT_NewCertList(); @@ -1034,6 +1038,8 @@ getRootsForOid(SECOidTag oid_tag) return certList; } +}} + static bool isApprovedForEV(SECOidTag policyOIDTag, CERTCertificate *rootCert) { @@ -1127,8 +1133,10 @@ nsNSSComponent::IdentityInfoInit() return PR_SUCCESS; } +namespace mozilla { namespace psm { + // Find the first policy OID that is known to be an EV policy OID. -static SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) +SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) { if (!cert) return SECFailure; @@ -1173,6 +1181,8 @@ static SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) return SECFailure; } +}} + NS_IMETHODIMP nsSSLStatus::GetIsExtendedValidation(bool* aIsEV) { @@ -1215,101 +1225,23 @@ nsNSSCertificate::hasValidEVOidTag(SECOidTag &resultOidTag, bool &validEV) return nrv; nssComponent->EnsureIdentityInfoLoaded(); - RefPtr certVal; - nrv = nssComponent->GetDefaultCERTValInParam(certVal); - NS_ENSURE_SUCCESS(nrv, nrv); + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); validEV = false; resultOidTag = SEC_OID_UNKNOWN; - SECOidTag oid_tag; - SECStatus rv = getFirstEVPolicy(mCert, oid_tag); - if (rv != SECSuccess) - return NS_OK; + SECStatus rv = certVerifier->VerifyCert(mCert, + certificateUsageSSLServer, PR_Now(), + nullptr /* XXX pinarg*/, + 0, nullptr, &resultOidTag); - if (oid_tag == SEC_OID_UNKNOWN) // not in our list of OIDs accepted for EV - return NS_OK; - - ScopedCERTCertList rootList(getRootsForOid(oid_tag)); - - CERTRevocationMethodIndex preferedRevMethods[1] = { - cert_revocation_method_ocsp - }; - - uint64_t revMethodFlags = - CERT_REV_M_TEST_USING_THIS_METHOD - | (certVal->IsOCSPDownloadEnabled() ? CERT_REV_M_ALLOW_NETWORK_FETCHING - : CERT_REV_M_FORBID_NETWORK_FETCHING) - | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE - | CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE - | CERT_REV_M_IGNORE_MISSING_FRESH_INFO - | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO; - - uint64_t revMethodIndependentFlags = - CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST - | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE; - - uint64_t methodFlags[2]; - methodFlags[cert_revocation_method_crl] = revMethodFlags; - methodFlags[cert_revocation_method_ocsp] = revMethodFlags; - - CERTRevocationFlags rev; - - rev.leafTests.number_of_defined_methods = cert_revocation_method_ocsp +1; - rev.leafTests.cert_rev_flags_per_method = methodFlags; - rev.leafTests.number_of_preferred_methods = 1; - rev.leafTests.preferred_methods = preferedRevMethods; - rev.leafTests.cert_rev_method_independent_flags = - revMethodIndependentFlags; - - rev.chainTests.number_of_defined_methods = cert_revocation_method_ocsp +1; - rev.chainTests.cert_rev_flags_per_method = methodFlags; - rev.chainTests.number_of_preferred_methods = 1; - rev.chainTests.preferred_methods = preferedRevMethods; - rev.chainTests.cert_rev_method_independent_flags = - revMethodIndependentFlags; - - CERTValInParam cvin[4]; - cvin[0].type = cert_pi_policyOID; - cvin[0].value.arraySize = 1; - cvin[0].value.array.oids = &oid_tag; - - cvin[1].type = cert_pi_revocationFlags; - cvin[1].value.pointer.revocation = &rev; - - cvin[2].type = cert_pi_trustAnchors; - cvin[2].value.pointer.chain = rootList; - - cvin[3].type = cert_pi_end; - - CERTValOutParam cvout[2]; - cvout[0].type = cert_po_trustAnchor; - cvout[0].value.pointer.cert = nullptr; - cvout[1].type = cert_po_end; - - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("calling CERT_PKIXVerifyCert nss cert %p\n", mCert.get())); - rv = CERT_PKIXVerifyCert(mCert, certificateUsageSSLServer, - cvin, cvout, nullptr); - if (rv != SECSuccess) - return NS_OK; - - ScopedCERTCertificate issuerCert(cvout[0].value.pointer.cert); - -#ifdef PR_LOGGING - if (PR_LOG_TEST(gPIPNSSLog, PR_LOG_DEBUG)) { - nsNSSCertificate ic(issuerCert); - nsAutoString fingerprint; - ic.GetSha1Fingerprint(fingerprint); - NS_LossyConvertUTF16toASCII fpa(fingerprint); - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CERT_PKIXVerifyCert returned success, issuer: %s, SHA1: %s\n", - issuerCert->subjectName, fpa.get())); + if (rv != SECSuccess) { + resultOidTag = SEC_OID_UNKNOWN; + } + if (resultOidTag != SEC_OID_UNKNOWN) { + validEV = true; } -#endif - - validEV = isApprovedForEV(oid_tag, issuerCert); - if (validEV) - resultOidTag = oid_tag; - return NS_OK; } @@ -1345,8 +1277,10 @@ nsNSSCertificate::GetIsExtendedValidation(bool* aIsEV) if (mCachedEVStatus != ev_status_unknown) { *aIsEV = (mCachedEVStatus == ev_status_valid); + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSSCertificate::GetIsExtendedValidation value IS cached! \n")); return NS_OK; } + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSSCertificate::GetIsExtendedValidation value is NOT cached! \n")); SECOidTag oid_tag; return getValidEVOidTag(oid_tag, *aIsEV); diff --git a/security/manager/ssl/src/nsNSSCertificate.cpp b/security/manager/ssl/src/nsNSSCertificate.cpp index 31d8228bbf5e..5ea2da7d5558 100644 --- a/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/security/manager/ssl/src/nsNSSCertificate.cpp @@ -7,11 +7,12 @@ #include "prerror.h" #include "prprf.h" +#include "nsNSSCertificate.h" +#include "CertVerifier.h" #include "nsNSSComponent.h" // for PIPNSS string bundle calls. #include "nsNSSCleaner.h" #include "nsCOMPtr.h" #include "nsIMutableArray.h" -#include "nsNSSCertificate.h" #include "nsNSSCertValidity.h" #include "nsPKCS12Blob.h" #include "nsPK11TokenDB.h" @@ -48,6 +49,7 @@ #include "plbase64.h" using namespace mozilla; +using namespace mozilla::psm; #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; @@ -75,14 +77,14 @@ NS_IMPL_THREADSAFE_ISUPPORTS7(nsNSSCertificate, nsIX509Cert, /* static */ nsNSSCertificate* -nsNSSCertificate::Create(CERTCertificate *cert) +nsNSSCertificate::Create(CERTCertificate *cert, SECOidTag *evOidPolicy) { if (GeckoProcessType_Default != XRE_GetProcessType()) { NS_ERROR("Trying to initialize nsNSSCertificate in a non-chrome process!"); return nullptr; } if (cert) - return new nsNSSCertificate(cert); + return new nsNSSCertificate(cert, evOidPolicy); else return new nsNSSCertificate(); } @@ -127,7 +129,8 @@ nsNSSCertificate::InitFromDER(char *certDER, int derLen) return true; } -nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert) : +nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert, + SECOidTag *evOidPolicy) : mCert(nullptr), mPermDelete(false), mCertType(CERT_TYPE_NOT_YET_INITIALIZED), @@ -142,8 +145,18 @@ nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert) : if (isAlreadyShutDown()) return; - if (cert) + if (cert) { mCert = CERT_DupCertificate(cert); + if (evOidPolicy) { + if ( *evOidPolicy == SEC_OID_UNKNOWN) { + mCachedEVStatus = ev_status_invalid; + } + else { + mCachedEVStatus = ev_status_valid; + } + mCachedEVOidTag = *evOidPolicy; + } + } } nsNSSCertificate::nsNSSCertificate() : @@ -1201,15 +1214,9 @@ nsNSSCertificate::VerifyForUsage(uint32_t usage, uint32_t *verificationResult) NS_ENSURE_ARG(verificationResult); - nsresult nsrv; - nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) - return nsrv; - RefPtr survivingParams; - nsrv = inss->GetDefaultCERTValInParam(survivingParams); - if (NS_FAILED(nsrv)) - return nsrv; - + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + SECCertificateUsage nss_usage; switch (usage) @@ -1266,19 +1273,8 @@ nsNSSCertificate::VerifyForUsage(uint32_t usage, uint32_t *verificationResult) return NS_ERROR_FAILURE; } - SECStatus verify_result; - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - CERTCertDBHandle *defaultcertdb = CERT_GetDefaultCertDB(); - verify_result = CERT_VerifyCertificateNow(defaultcertdb, mCert, true, - nss_usage, nullptr, nullptr); - } - else { - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; - verify_result = CERT_PKIXVerifyCert(mCert, nss_usage, - survivingParams->GetRawPointerForNSS(), - cvout, nullptr); - } + SECStatus verify_result = certVerifier->VerifyCert(mCert, nss_usage, PR_Now(), + nullptr /*XXX pinarg*/); if (verify_result == SECSuccess) { diff --git a/security/manager/ssl/src/nsNSSCertificate.h b/security/manager/ssl/src/nsNSSCertificate.h index f1c7066778ad..8e3a7059a77e 100644 --- a/security/manager/ssl/src/nsNSSCertificate.h +++ b/security/manager/ssl/src/nsNSSCertificate.h @@ -44,12 +44,12 @@ public: NS_DECL_NSISERIALIZABLE NS_DECL_NSICLASSINFO - nsNSSCertificate(CERTCertificate *cert); + nsNSSCertificate(CERTCertificate *cert,SECOidTag *evOidPolicy = nullptr); nsNSSCertificate(); /* from a request? */ virtual ~nsNSSCertificate(); nsresult FormatUIStrings(const nsAutoString &nickname, nsAutoString &nickWithSerial, nsAutoString &details); - static nsNSSCertificate* Create(CERTCertificate *cert = nullptr); + static nsNSSCertificate* Create(CERTCertificate *cert = nullptr, SECOidTag *evOidPolicy = nullptr); static nsNSSCertificate* ConstructFromDER(char *certDER, int derLen); // It is the responsibility of the caller of this method to free the returned diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index c41f115af1dc..ade4fdb62a8a 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -7,8 +7,10 @@ // only exported so PSM can use it for this specific purpose. #define CERT_AddTempCertToPerm __CERT_AddTempCertToPerm -#include "nsNSSComponent.h" #include "nsNSSCertificateDB.h" + +#include "CertVerifier.h" +#include "nsNSSComponent.h" #include "mozilla/Base64.h" #include "nsCOMPtr.h" #include "nsNSSCertificate.h" @@ -46,6 +48,7 @@ #include "plbase64.h" using namespace mozilla; +using namespace mozilla::psm; using mozilla::psm::SharedSSLState; #ifdef PR_LOGGING @@ -494,22 +497,9 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, CERTCertificate **certArray = nullptr; ScopedCERTCertList certList; CERTCertListNode *node; - PRTime now; - SECCertUsage certusage; - SECCertificateUsage certificateusage; SECItem **rawArray; int numcerts; int i; - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; - - nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) - return nsrv; - RefPtr survivingParams; - nsrv = inss->GetDefaultCERTValInParam(survivingParams); - if (NS_FAILED(nsrv)) - return nsrv; PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!arena) @@ -521,9 +511,11 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, return NS_ERROR_FAILURE; } + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + certdb = CERT_GetDefaultCertDB(); - certusage = certUsageEmailRecipient; - certificateusage = certificateUsageEmailRecipient; + const PRTime now = PR_Now(); numcerts = certCollection->numcerts; @@ -537,7 +529,7 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, rawArray[i] = &certCollection->rawCerts[i]; } - srv = CERT_ImportCerts(certdb, certusage, numcerts, rawArray, + srv = CERT_ImportCerts(certdb, certUsageEmailRecipient, numcerts, rawArray, &certArray, false, false, nullptr); PORT_Free(rawArray); @@ -565,7 +557,6 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, /* go down the remaining list of certs and verify that they have * valid chains, then import them. */ - now = PR_Now(); for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList); @@ -577,25 +568,18 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, continue; } - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - if (CERT_VerifyCert(certdb, node->cert, - true, certusage, now, ctx, nullptr) != SECSuccess) { - alert_and_skip = true; - } - } - else { - if (CERT_PKIXVerifyCert(node->cert, certificateusage, - survivingParams->GetRawPointerForNSS(), - cvout, ctx) - != SECSuccess) { - alert_and_skip = true; - } + SECStatus rv = certVerifier->VerifyCert(node->cert, + certificateUsageEmailRecipient, + now, ctx); + if (rv != SECSuccess) { + alert_and_skip = true; } ScopedCERTCertificateList certChain; if (!alert_and_skip) { - certChain = CERT_CertChainFromCert(node->cert, certusage, false); + certChain = CERT_CertChainFromCert(node->cert, certUsageEmailRecipient, + false); if (!certChain) { alert_and_skip = true; } @@ -619,7 +603,7 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, for (i=0; i < certChain->len; i++) { rawArray[i] = &certChain->certs[i]; } - CERT_ImportCerts(certdb, certusage, certChain->len, + CERT_ImportCerts(certdb, certUsageEmailRecipient, certChain->len, rawArray, nullptr, true, false, nullptr); CERT_SaveSMimeProfile(node->cert, nullptr, nullptr); @@ -752,14 +736,9 @@ nsresult nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfaceRequestor *ctx) { SECItem **rawArray; - nsresult nsrv; - nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) - return nsrv; - RefPtr survivingParams; - nsrv = inss->GetDefaultCERTValInParam(survivingParams); - if (NS_FAILED(nsrv)) - return nsrv; + RefPtr certVerifier(GetDefaultCertVerifier()); + if (!certVerifier) + return NS_ERROR_UNEXPECTED; /* filter out the certs we don't want */ SECStatus srv = CERT_FilterCertListByUsage(certList, certUsageAnyCA, true); @@ -780,19 +759,10 @@ nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfac bool alert_and_skip = false; - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - if (CERT_VerifyCert(CERT_GetDefaultCertDB(), node->cert, - true, certUsageVerifyCA, PR_Now(), ctx, nullptr) != SECSuccess) { - alert_and_skip = true; - } - } - else { - if (CERT_PKIXVerifyCert(node->cert, certificateUsageVerifyCA, - survivingParams->GetRawPointerForNSS(), - cvout, ctx) - != SECSuccess) { - alert_and_skip = true; - } + SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageVerifyCA, + PR_Now(), ctx); + if (rv != SECSuccess) { + alert_and_skip = true; } ScopedCERTCertificateList certChain; @@ -1324,18 +1294,8 @@ nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEma { nsNSSShutDownPreventionLock locker; - nsCOMPtr inss; - RefPtr survivingParams; - nsresult nsrv; - - if (nsNSSComponent::globalConstFlagUsePKIXVerification) { - inss = do_GetService(kNSSComponentCID, &nsrv); - if (!inss) - return nsrv; - nsrv = inss->GetDefaultCERTValInParam(survivingParams); - if (NS_FAILED(nsrv)) - return nsrv; - } + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); ScopedCERTCertList certlist( PK11_FindCertsFromEmailAddress(aEmailAddress, nullptr)); @@ -1354,23 +1314,11 @@ nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEma !CERT_LIST_END(node, certlist); node = CERT_LIST_NEXT(node)) { - if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - if (CERT_VerifyCert(CERT_GetDefaultCertDB(), node->cert, - true, certUsageEmailRecipient, PR_Now(), nullptr, nullptr) == SECSuccess) { - // found a valid certificate - break; - } - } - else { - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; - if (CERT_PKIXVerifyCert(node->cert, certificateUsageEmailRecipient, - survivingParams->GetRawPointerForNSS(), - cvout, nullptr) - == SECSuccess) { - // found a valid certificate - break; - } + SECStatus srv = certVerifier->VerifyCert(node->cert, + certificateUsageEmailRecipient, + PR_Now(), nullptr /*XXX pinarg*/); + if (srv == SECSuccess) { + break; } } diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index 8b91e5fc82e2..57f8ac0528f4 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -9,6 +9,8 @@ #endif #include "nsNSSComponent.h" + +#include "CertVerifier.h" #include "nsNSSCallbacks.h" #include "nsNSSIOLayer.h" #include "nsCertVerificationThread.h" @@ -67,7 +69,6 @@ #include "nsNSSShutDown.h" #include "GeneratedEvents.h" #include "nsIKeyModule.h" -#include "ScopedNSSTypes.h" #include "SharedSSLState.h" #include "nss.h" @@ -1098,23 +1099,18 @@ void nsNSSComponent::setValidationOptions(nsIPrefBranch * pref) ocspMode_FailureIsVerificationFailure : ocspMode_FailureIsNotAVerificationFailure); - RefPtr newCVIN(new nsCERTValInParamWrapper); - if (NS_SUCCEEDED(newCVIN->Construct( + mDefaultCertVerifier = new CertVerifier( aiaDownloadEnabled ? - nsCERTValInParamWrapper::missing_cert_download_on : nsCERTValInParamWrapper::missing_cert_download_off, + CertVerifier::missing_cert_download_on : CertVerifier::missing_cert_download_off, crlDownloading ? - nsCERTValInParamWrapper::crl_download_allowed : nsCERTValInParamWrapper::crl_local_only, + CertVerifier::crl_download_allowed : CertVerifier::crl_local_only, ocspEnabled ? - nsCERTValInParamWrapper::ocsp_on : nsCERTValInParamWrapper::ocsp_off, + CertVerifier::ocsp_on : CertVerifier::ocsp_off, ocspRequired ? - nsCERTValInParamWrapper::ocsp_strict : nsCERTValInParamWrapper::ocsp_relaxed, + CertVerifier::ocsp_strict : CertVerifier::ocsp_relaxed, anyFreshRequired ? - nsCERTValInParamWrapper::any_revo_strict : nsCERTValInParamWrapper::any_revo_relaxed, - firstNetworkRevo.get()))) { - // Swap to new defaults, and will cause the old defaults to be released, - // as soon as any concurrent use of the old default objects has finished. - mDefaultCERTValInParam = newCVIN; - } + CertVerifier::any_revo_strict : CertVerifier::any_revo_relaxed, + firstNetworkRevo.get()); /* * The new defaults might change the validity of already established SSL sessions, @@ -1826,20 +1822,6 @@ nsNSSComponent::InitializeNSS(bool showWarningBox) // dynamic options from prefs setValidationOptions(mPrefBranch); - // static validation options for usagesarray - do not hit the network - mDefaultCERTValInParamLocalOnly = new nsCERTValInParamWrapper; - rv = mDefaultCERTValInParamLocalOnly->Construct( - nsCERTValInParamWrapper::missing_cert_download_off, - nsCERTValInParamWrapper::crl_local_only, - nsCERTValInParamWrapper::ocsp_off, - nsCERTValInParamWrapper::ocsp_relaxed, - nsCERTValInParamWrapper::any_revo_relaxed, - FIRST_REVO_METHOD_DEFAULT); - if (NS_FAILED(rv)) { - nsPSMInitPanic::SetPanic(); - return rv; - } - RegisterMyOCSPAIAInfoCallback(); mHttpForNSS.initTable(); @@ -2053,7 +2035,7 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, *aPrincipal = nullptr; nsNSSShutDownPreventionLock locker; - ScopedSEC_PKCS7ContentInfo p7_info; + ScopedSEC_PKCS7ContentInfo p7_info; unsigned char hash[SHA1_LENGTH]; SECItem item; @@ -2066,10 +2048,6 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, GetDecryptKeyCallback, nullptr, DecryptionAllowedCallback); - if (!p7_info) { - return NS_ERROR_FAILURE; - } - // Make sure we call SEC_PKCS7DestroyContentInfo after this point; // otherwise we leak data in p7_info @@ -2526,22 +2504,12 @@ nsNSSComponent::IsNSSInitialized(bool *initialized) } NS_IMETHODIMP -nsNSSComponent::GetDefaultCERTValInParam(RefPtr &out) +nsNSSComponent::GetDefaultCertVerifier(RefPtr &out) { MutexAutoLock lock(mutex); if (!mNSSInitialized) return NS_ERROR_NOT_INITIALIZED; - out = mDefaultCERTValInParam; - return NS_OK; -} - -NS_IMETHODIMP -nsNSSComponent::GetDefaultCERTValInParamLocalOnly(RefPtr &out) -{ - MutexAutoLock lock(mutex); - if (!mNSSInitialized) - return NS_ERROR_NOT_INITIALIZED; - out = mDefaultCERTValInParamLocalOnly; + out = mDefaultCertVerifier; return NS_OK; } diff --git a/security/manager/ssl/src/nsNSSComponent.h b/security/manager/ssl/src/nsNSSComponent.h index 0f3ee52818ed..160a23390537 100644 --- a/security/manager/ssl/src/nsNSSComponent.h +++ b/security/manager/ssl/src/nsNSSComponent.h @@ -37,7 +37,13 @@ #include "nsNSSHelper.h" #include "nsClientAuthRemember.h" -#include "nsCERTValInParamWrapper.h" + +namespace mozilla { namespace psm { + +class CertVerifier; + +} } // namespace mozilla::psm + #define NS_NSSCOMPONENT_CID \ {0xa277189c, 0x1dd1, 0x11b2, {0xa8, 0xc9, 0xe4, 0xe8, 0xbf, 0xb1, 0x33, 0x8e}} @@ -157,10 +163,8 @@ class NS_NO_VTABLE nsINSSComponent : public nsISupports { NS_IMETHOD IsNSSInitialized(bool *initialized) = 0; - NS_IMETHOD GetDefaultCERTValInParam( - mozilla::RefPtr &out) = 0; - NS_IMETHOD GetDefaultCERTValInParamLocalOnly( - mozilla::RefPtr &out) = 0; + NS_IMETHOD GetDefaultCertVerifier( + mozilla::RefPtr &out) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsINSSComponent, NS_INSSCOMPONENT_IID) @@ -264,10 +268,8 @@ public: NS_IMETHOD EnsureIdentityInfoLoaded(); NS_IMETHOD IsNSSInitialized(bool *initialized); - NS_IMETHOD GetDefaultCERTValInParam( - mozilla::RefPtr &out); - NS_IMETHOD GetDefaultCERTValInParamLocalOnly( - mozilla::RefPtr &out); + NS_IMETHOD GetDefaultCertVerifier( + mozilla::RefPtr &out); private: nsresult InitializeNSS(bool showWarningBox); @@ -327,8 +329,8 @@ private: nsCertVerificationThread *mCertVerificationThread; nsNSSHttpInterface mHttpForNSS; - mozilla::RefPtr mDefaultCERTValInParam; - mozilla::RefPtr mDefaultCERTValInParamLocalOnly; + mozilla::RefPtr mDefaultCertVerifier; + static PRStatus IdentityInfoInit(void); PRCallOnceType mIdentityInfoCallOnce; diff --git a/security/manager/ssl/src/nsUsageArrayHelper.cpp b/security/manager/ssl/src/nsUsageArrayHelper.cpp index a8ed09d95739..38c497d51063 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp @@ -16,6 +16,7 @@ #include "secerr.h" using namespace mozilla; +using namespace mozilla::psm; #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; @@ -118,8 +119,10 @@ isFatalError(uint32_t checkResult) uint32_t nsUsageArrayHelper::check(uint32_t previousCheckResult, const char *suffix, + CertVerifier * certVerifier, SECCertificateUsage aCertUsage, - nsCERTValInParamWrapper * aValInParams, + PRTime time, + CertVerifier::Flags flags, uint32_t &aCounter, PRUnichar **outUsages) { @@ -175,13 +178,8 @@ nsUsageArrayHelper::check(uint32_t previousCheckResult, return nsIX509Cert::NOT_VERIFIED_UNKNOWN; } - SECStatus rv; - CERTValOutParam cvout[1]; - cvout[0].type = cert_po_end; - - rv = CERT_PKIXVerifyCert(mCert, aCertUsage, - aValInParams->GetRawPointerForNSS(), - cvout, nullptr); + SECStatus rv = certVerifier->VerifyCert(mCert, aCertUsage, + time, nullptr /*XXX:wincx*/, flags); if (rv == SECSuccess) { typestr.Append(suffix); @@ -298,7 +296,6 @@ if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { check(suffix, usages & certificateUsageSSLClient, count, outUsages); check(suffix, usages & certificateUsageSSLServer, count, outUsages); - check(suffix, usages & certificateUsageSSLServerWithStepUp, count, outUsages); check(suffix, usages & certificateUsageEmailSigner, count, outUsages); check(suffix, usages & certificateUsageEmailRecipient, count, outUsages); check(suffix, usages & certificateUsageObjectSigner, count, outUsages); @@ -323,43 +320,43 @@ if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { return NS_OK; } - RefPtr params; - nsresult rv = localOnly ? nssComponent->GetDefaultCERTValInParamLocalOnly(params) - : nssComponent->GetDefaultCERTValInParam(params); - NS_ENSURE_SUCCESS(rv, rv); + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + + PRTime now = PR_Now(); + CertVerifier::Flags flags = localOnly ? CertVerifier::FLAG_LOCAL_ONLY : 0; // The following list of checks must be < max_returned_out_array_size uint32_t result; - result = check(nsIX509Cert::VERIFIED_OK, suffix, certificateUsageSSLClient, - params, count, outUsages); - result = check(result, suffix, certificateUsageSSLServer, - params, count, outUsages); - result = check(result, suffix, certificateUsageSSLServerWithStepUp, - params, count, outUsages); - result = check(result, suffix, certificateUsageEmailSigner, - params, count, outUsages); - result = check(result, suffix, certificateUsageEmailRecipient, - params, count, outUsages); - result = check(result, suffix, certificateUsageObjectSigner, - params, count, outUsages); + result = check(nsIX509Cert::VERIFIED_OK, suffix, certVerifier, + certificateUsageSSLClient, now, flags, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageSSLServer, now, flags, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageEmailSigner, now, flags, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageEmailRecipient, now, flags, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageObjectSigner, now, flags, count, outUsages); #if 0 - result = check(result, suffix, certificateUsageProtectedObjectSigner, - params, count, outUsages); - result = check(result, suffix, certificateUsageUserCertImport, - params, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageProtectedObjectSigner, now, flags, count, + outUsages); + result = check(result, suffix, certVerifier, + certificateUsageUserCertImport, now, flags, count, outUsages); #endif - result = check(result, suffix, certificateUsageSSLCA, - params, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageSSLCA, now, flags, count, outUsages); #if 0 - result = check(result, suffix, certificateUsageVerifyCA, - params, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageVerifyCA, now, flags, count, outUsages); #endif - result = check(result, suffix, certificateUsageStatusResponder, - params, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageStatusResponder, now, flags, count, outUsages); #if 0 - result = checkPKIX(result, check(suffix, certificateUsageAnyCA, - params, count, outUsages); + result = check(result, suffix, certVerifier, + certificateUsageAnyCA, now, flags, count, outUsages); #endif if (isFatalError(result) || count == 0) { diff --git a/security/manager/ssl/src/nsUsageArrayHelper.h b/security/manager/ssl/src/nsUsageArrayHelper.h index 63b46257a6ef..c2abc4aa9f47 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.h +++ b/security/manager/ssl/src/nsUsageArrayHelper.h @@ -5,9 +5,9 @@ #ifndef _NSUSAGEARRAYHELPER_H_ #define _NSUSAGEARRAYHELPER_H_ -#include "certt.h" - +#include "CertVerifier.h" #include "nsNSSComponent.h" +#include "certt.h" class nsUsageArrayHelper { @@ -38,8 +38,10 @@ private: uint32_t check(uint32_t previousCheckResult, const char *suffix, + mozilla::psm::CertVerifier * certVerifier, SECCertificateUsage aCertUsage, - nsCERTValInParamWrapper * aValInParams, + PRTime time, + mozilla::psm::CertVerifier::Flags flags, uint32_t &aCounter, PRUnichar **outUsages); From 5dfdbfe9ec3b2e831e030aa9e2e4993df5197e31 Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Mon, 15 Apr 2013 15:39:39 -0700 Subject: [PATCH 038/438] Bug 813418 - Centralize certificate validation (Part 3 Getting chain form verify). r=bsmith --HG-- rename : security/manager/ssl/src/nsCERTValInParamWrapper.cpp => security/manager/ssl/src/CertVerifier.cpp extra : rebase_source : f373c1dabd57b4e0e6d61ac27b2eb0528eac03ba --- security/manager/ssl/src/CertVerifier.cpp | 14 ++- .../ssl/src/SSLServerCertVerification.cpp | 82 ++++++------ .../manager/ssl/src/nsIdentityChecking.cpp | 4 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 119 ++++++++---------- security/manager/ssl/src/nsNSSComponent.cpp | 6 +- 5 files changed, 106 insertions(+), 119 deletions(-) diff --git a/security/manager/ssl/src/CertVerifier.cpp b/security/manager/ssl/src/CertVerifier.cpp index 6b021a8e01d7..355f85cdf7a8 100644 --- a/security/manager/ssl/src/CertVerifier.cpp +++ b/security/manager/ssl/src/CertVerifier.cpp @@ -217,12 +217,12 @@ CertVerifier::VerifyCert(CERTCertificate * cert, if (evPolicy != SEC_OID_UNKNOWN) { // EV setup! - // This flags are not quite correct, but it is what we have now, so keeping - // them identical for bug landing purposes. Should be fixed later! + // XXX 859872 The current flags are not quite correct. (use + // of ocsp flags for crl preferences). uint64_t revMethodFlags = CERT_REV_M_TEST_USING_THIS_METHOD - | (mOCSPDownloadEnabled ? CERT_REV_M_ALLOW_NETWORK_FETCHING - : CERT_REV_M_FORBID_NETWORK_FETCHING) + | ((mOCSPDownloadEnabled && !localOnly) ? + CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE | CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE | CERT_REV_M_IGNORE_MISSING_FRESH_INFO @@ -371,6 +371,7 @@ pkix_done: if (rv == SECSuccess) { if (! cvout[validationChainLocation].value.pointer.chain) { + PR_SetError(PR_UNKNOWN_ERROR, 0); return SECFailure; } PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: I have a chain\n")); @@ -382,8 +383,8 @@ pkix_done: if (!CERT_CompareCerts(trustAnchor, cert)) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: adding issuer to tail for display\n")); // note: rv is reused to catch errors on cert creation! - rv = CERT_AddCertToListTail(*validationChain, - CERT_DupCertificate(trustAnchor)); + ScopedCERTCertificate tempCert(CERT_DupCertificate(trustAnchor)); + rv = CERT_AddCertToListTail(*validationChain, tempCert); if (rv != SECSuccess) { CERT_DestroyCertList(*validationChain); *validationChain = nullptr; @@ -397,6 +398,7 @@ pkix_done: } } } + return rv; } diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index 773189a2305a..a212c2b4954f 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -478,16 +478,14 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, PRTime now = PR_Now(); - PLArenaPool *log_arena = nullptr; + PLArenaPool *log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); PLArenaPoolCleanerFalseParam log_arena_cleaner(log_arena); - CERTVerifyLog * verify_log = nullptr; - - log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!log_arena) { NS_ERROR("PORT_NewArena failed"); return nullptr; // PORT_NewArena set error code } - verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); + + CERTVerifyLog * verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); if (!verify_log) { NS_ERROR("PORT_ArenaZNew failed"); return nullptr; // PORT_ArenaZNew set error code @@ -496,7 +494,7 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, verify_log->arena = log_arena; srv = certVerifier->VerifyCert(cert, certificateUsageSSLServer, now, - infoObject, 0, nullptr, nullptr, verify_log); + infoObject, 0, nullptr, nullptr, verify_log); // We ignore the result code of the cert verification. // Either it is a failure, which is expected, and we'll process the @@ -521,44 +519,40 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, errorCodeMismatch = SSL_ERROR_BAD_CERT_DOMAIN; } - if (verify_log) { - CERTVerifyLogNode *i_node; - for (i_node = verify_log->head; i_node; i_node = i_node->next) + CERTVerifyLogNode *i_node; + for (i_node = verify_log->head; i_node; i_node = i_node->next) + { + switch (i_node->error) { - switch (i_node->error) - { - case SEC_ERROR_UNKNOWN_ISSUER: - case SEC_ERROR_CA_CERT_INVALID: - case SEC_ERROR_UNTRUSTED_ISSUER: - case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: - case SEC_ERROR_UNTRUSTED_CERT: - case SEC_ERROR_INADEQUATE_KEY_USAGE: - case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: - // We group all these errors as "cert not trusted" - collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; - if (errorCodeTrust == SECSuccess) { - errorCodeTrust = i_node->error; - } - break; - case SSL_ERROR_BAD_CERT_DOMAIN: - collected_errors |= nsICertOverrideService::ERROR_MISMATCH; - if (errorCodeMismatch == SECSuccess) { - errorCodeMismatch = i_node->error; - } - break; - case SEC_ERROR_EXPIRED_CERTIFICATE: - collected_errors |= nsICertOverrideService::ERROR_TIME; - if (errorCodeExpired == SECSuccess) { - errorCodeExpired = i_node->error; - } - break; - default: - PR_SetError(i_node->error, 0); - return nullptr; - } + case SEC_ERROR_UNKNOWN_ISSUER: + case SEC_ERROR_CA_CERT_INVALID: + case SEC_ERROR_UNTRUSTED_ISSUER: + case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + case SEC_ERROR_UNTRUSTED_CERT: + case SEC_ERROR_INADEQUATE_KEY_USAGE: + case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: + // We group all these errors as "cert not trusted" + collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; + if (errorCodeTrust == SECSuccess) { + errorCodeTrust = i_node->error; + } + break; + case SSL_ERROR_BAD_CERT_DOMAIN: + collected_errors |= nsICertOverrideService::ERROR_MISMATCH; + if (errorCodeMismatch == SECSuccess) { + errorCodeMismatch = i_node->error; + } + break; + case SEC_ERROR_EXPIRED_CERTIFICATE: + collected_errors |= nsICertOverrideService::ERROR_TIME; + if (errorCodeExpired == SECSuccess) { + errorCodeExpired = i_node->error; + } + break; + default: + PR_SetError(i_node->error, 0); + return nullptr; } - } else { - // XXX set errorCodeTrust, errorCodeMismatch, errorCodeExpired, collected_errors } if (!collected_errors) @@ -896,8 +890,8 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } } - ScopedCERTCertList certList(CERT_GetCertChainFromCert(cert, PR_Now(), - certUsageSSLCA)); + ScopedCERTCertList certList(verifyCertChain); + if (!certList) { rv = SECFailure; } else { diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index 80e4e5797344..52fc227df540 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -1038,7 +1038,7 @@ getRootsForOid(SECOidTag oid_tag) return certList; } -}} +} } // namespace mozilla::psm static bool isApprovedForEV(SECOidTag policyOIDTag, CERTCertificate *rootCert) @@ -1181,7 +1181,7 @@ SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) return SECFailure; } -}} +} } // namespace mozilla::psm NS_IMETHODIMP nsSSLStatus::GetIsExtendedValidation(bool* aIsEV) diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index ade4fdb62a8a..9debd7ed20ee 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -32,7 +32,6 @@ #include "nsComponentManagerUtils.h" #include "nsIPrompt.h" #include "nsThreadUtils.h" -#include "ScopedNSSTypes.h" #include "nsIObserverService.h" #include "nsRecentBadCerts.h" #include "SharedSSLState.h" @@ -480,6 +479,42 @@ nsNSSCertificateDB::ImportCertificates(uint8_t * data, uint32_t length, return nsrv; } +static +SECStatus +ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCertUsage usage, + const PRBool caOnly) +{ + CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); + const PRTime now = PR_Now(); + + int chainLen=0; + + for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); + !CERT_LIST_END(chainNode, certChain); + chainNode = CERT_LIST_NEXT(chainNode)) { + chainLen++; + } + SECItem **rawArray; + rawArray = (SECItem **) PORT_Alloc(chainLen * sizeof(SECItem *)); + if (!rawArray) { + return SECFailure; + } + + int i=0; + for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); + !CERT_LIST_END(chainNode, certChain); + chainNode = CERT_LIST_NEXT(chainNode), i++) { + rawArray[i] = &chainNode->cert->derCert; + } + CERT_ImportCerts(certdb, usage, chainLen, + rawArray, nullptr, true, caOnly, nullptr); + + PORT_Free(rawArray); + + + return SECSuccess; +} + /* * [noscript] void importEmailCertificates(in charPtr data, in unsigned long length, @@ -562,53 +597,29 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, !CERT_LIST_END(node,certList); node = CERT_LIST_NEXT(node)) { - bool alert_and_skip = false; - if (!node->cert) { continue; } + CERTCertList *verifyCertChain = nullptr; + SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageEmailRecipient, - now, ctx); + now, ctx, 0, &verifyCertChain); + + ScopedCERTCertList certChain(verifyCertChain); + if (rv != SECSuccess) { - alert_and_skip = true; - } - - ScopedCERTCertificateList certChain; - - if (!alert_and_skip) { - certChain = CERT_CertChainFromCert(node->cert, certUsageEmailRecipient, - false); - if (!certChain) { - alert_and_skip = true; - } - } - - if (alert_and_skip) { nsCOMPtr certToShow = nsNSSCertificate::Create(node->cert); DisplayCertificateAlert(ctx, "NotImportingUnverifiedCert", certToShow); continue; } - - /* - * CertChain returns an array of SECItems, import expects an array of - * SECItem pointers. Create the SECItem Pointers from the array of - * SECItems. - */ - rawArray = (SECItem **) PORT_Alloc(certChain->len * sizeof(SECItem *)); - if (!rawArray) { - continue; - } - for (i=0; i < certChain->len; i++) { - rawArray[i] = &certChain->certs[i]; - } - CERT_ImportCerts(certdb, certUsageEmailRecipient, certChain->len, - rawArray, nullptr, true, false, nullptr); - + rv = ImportCertsIntoPermanentStorage(certChain, certUsageEmailRecipient, false); + if (rv != SECSuccess) { + goto loser; + } CERT_SaveSMimeProfile(node->cert, nullptr, nullptr); - PORT_Free(rawArray); } loser: @@ -757,45 +768,21 @@ nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfac !CERT_LIST_END(node,certList); node = CERT_LIST_NEXT(node)) { - bool alert_and_skip = false; + //bool alert_and_skip = false; + CERTCertList *verifyCertChain = nullptr; SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageVerifyCA, - PR_Now(), ctx); + PR_Now(), ctx, 0, &verifyCertChain); + + ScopedCERTCertList certChain(verifyCertChain); + if (rv != SECSuccess) { - alert_and_skip = true; - } - - ScopedCERTCertificateList certChain; - - if (!alert_and_skip) { - certChain = CERT_CertChainFromCert(node->cert, certUsageAnyCA, false); - if (!certChain) { - alert_and_skip = true; - } - } - - if (alert_and_skip) { nsCOMPtr certToShow = nsNSSCertificate::Create(node->cert); DisplayCertificateAlert(ctx, "NotImportingUnverifiedCert", certToShow); continue; } - /* - * CertChain returns an array of SECItems, import expects an array of - * SECItem pointers. Create the SECItem Pointers from the array of - * SECItems. - */ - rawArray = (SECItem **) PORT_Alloc(certChain->len * sizeof(SECItem *)); - if (!rawArray) { - continue; - } - for (int i=0; i < certChain->len; i++) { - rawArray[i] = &certChain->certs[i]; - } - CERT_ImportCerts(CERT_GetDefaultCertDB(), certUsageAnyCA, certChain->len, - rawArray, nullptr, true, true, nullptr); - - PORT_Free(rawArray); + ImportCertsIntoPermanentStorage(certChain, certUsageAnyCA, true); } return NS_OK; diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index 57f8ac0528f4..247a36be2cfe 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -2048,9 +2048,13 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, GetDecryptKeyCallback, nullptr, DecryptionAllowedCallback); + if (!p7_info) { + return NS_ERROR_FAILURE; + } + // Make sure we call SEC_PKCS7DestroyContentInfo after this point; // otherwise we leak data in p7_info - + //-- If a plaintext was provided, hash it. SECItem digest; digest.data = nullptr; From 0f9279bce17203d1259ce4069129b5d595ace87e Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Wed, 27 Feb 2013 10:30:10 -0800 Subject: [PATCH 039/438] Bug 813418 - Centralize certificate validation (Part 4 remove verifycertnow). r=bsmith --HG-- extra : rebase_source : 15e6d3b1f70e24384914dfc71b393a00ac5ddf1e --- security/manager/ssl/src/nsNSSCertificate.cpp | 39 ++++- .../manager/ssl/src/nsNSSCertificateDB.cpp | 10 +- .../manager/ssl/src/nsUsageArrayHelper.cpp | 135 +++--------------- 3 files changed, 59 insertions(+), 125 deletions(-) diff --git a/security/manager/ssl/src/nsNSSCertificate.cpp b/security/manager/ssl/src/nsNSSCertificate.cpp index 5ea2da7d5558..66e8ac71c8f8 100644 --- a/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/security/manager/ssl/src/nsNSSCertificate.cpp @@ -825,8 +825,45 @@ nsNSSCertificate::GetChain(nsIArray **_rvChain) nsresult rv; /* Get the cert chain from NSS */ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting chain for \"%s\"\n", mCert->nickname)); + ScopedCERTCertList nssChain; - nssChain = CERT_GetCertChainFromCert(mCert, PR_Now(), certUsageSSLClient); + SECStatus srv; + nssChain = nullptr; + RefPtr certVerifier(GetDefaultCertVerifier()); + NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + CERTCertList *pkixNssChain = nullptr; + + // We want to test all usages, but we start with server because most of the + // time Firefox users care about server certs. + srv = certVerifier->VerifyCert(mCert, + certificateUsageSSLServer, PR_Now(), + nullptr, /*XXX fixme*/ + CertVerifier::FLAG_LOCAL_ONLY, + &pkixNssChain); + for (int usage = certificateUsageSSLClient; + usage < certificateUsageAnyCA && !pkixNssChain; + usage = usage << 1) { + if (usage == certificateUsageSSLServer) { + continue; + } + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: PKIX attempting chain(%d) for '%s'\n",usage, mCert->nickname)); + srv = certVerifier->VerifyCert(mCert, + certificateUsageSSLClient, PR_Now(), + nullptr, /*XXX fixme*/ + CertVerifier::FLAG_LOCAL_ONLY, + &pkixNssChain); + } + + if (!pkixNssChain) { + // There is not verified path for the chain, howeever we still want to + // present to the user as much of a possible chain as possible, in the case + // where there was a problem with the cert or the issuers. + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: getchain :CertVerify failed to get chain for '%s'\n", mCert->nickname)); + nssChain = CERT_GetCertChainFromCert(mCert, PR_Now(), certUsageSSLClient); + } else { + nssChain = pkixNssChain; + } + if (!nssChain) return NS_ERROR_FAILURE; /* enumerate the chain for scripting purposes */ diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index 9debd7ed20ee..f4283e0a5230 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -487,20 +487,20 @@ ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCe CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); const PRTime now = PR_Now(); - int chainLen=0; - + int chainLen = 0; for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); !CERT_LIST_END(chainNode, certChain); chainNode = CERT_LIST_NEXT(chainNode)) { chainLen++; } + SECItem **rawArray; rawArray = (SECItem **) PORT_Alloc(chainLen * sizeof(SECItem *)); if (!rawArray) { return SECFailure; } - int i=0; + int i = 0; for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); !CERT_LIST_END(chainNode, certChain); chainNode = CERT_LIST_NEXT(chainNode), i++) { @@ -509,9 +509,7 @@ ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCe CERT_ImportCerts(certdb, usage, chainLen, rawArray, nullptr, true, caOnly, nullptr); - PORT_Free(rawArray); - - + PORT_Free(rawArray); return SECSuccess; } diff --git a/security/manager/ssl/src/nsUsageArrayHelper.cpp b/security/manager/ssl/src/nsUsageArrayHelper.cpp index 38c497d51063..34b5efdb58a8 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp @@ -32,66 +32,6 @@ nsUsageArrayHelper::nsUsageArrayHelper(CERTCertificate *aCert) nssComponent = do_GetService(kNSSComponentCID, &m_rv); } -// XXX: old, non-libpkix version of check that will be removed after the switch -// to libpkix is final. -void -nsUsageArrayHelper::check(const char *suffix, - SECCertificateUsage aCertUsage, - uint32_t &aCounter, - PRUnichar **outUsages) -{ - if (!aCertUsage) return; - nsAutoCString typestr; - switch (aCertUsage) { - case certificateUsageSSLClient: - typestr = "VerifySSLClient"; - break; - case certificateUsageSSLServer: - typestr = "VerifySSLServer"; - break; - case certificateUsageSSLServerWithStepUp: - typestr = "VerifySSLStepUp"; - break; - case certificateUsageEmailSigner: - typestr = "VerifyEmailSigner"; - break; - case certificateUsageEmailRecipient: - typestr = "VerifyEmailRecip"; - break; - case certificateUsageObjectSigner: - typestr = "VerifyObjSign"; - break; - case certificateUsageProtectedObjectSigner: - typestr = "VerifyProtectObjSign"; - break; - case certificateUsageUserCertImport: - typestr = "VerifyUserImport"; - break; - case certificateUsageSSLCA: - typestr = "VerifySSLCA"; - break; - case certificateUsageVerifyCA: - typestr = "VerifyCAVerifier"; - break; - case certificateUsageStatusResponder: - typestr = "VerifyStatusResponder"; - break; - case certificateUsageAnyCA: - typestr = "VerifyAnyCA"; - break; - default: - break; - } - if (!typestr.IsEmpty()) { - typestr.Append(suffix); - nsAutoString verifyDesc; - m_rv = nssComponent->GetPIPNSSBundleString(typestr.get(), verifyDesc); - if (NS_SUCCEEDED(m_rv)) { - outUsages[aCounter++] = ToNewUnicode(verifyDesc); - } - } -} - namespace { // Some validation errors are non-fatal in that, we should keep checking the @@ -259,67 +199,21 @@ nsUsageArrayHelper::GetUsagesArray(const char *suffix, if (outArraySize < max_returned_out_array_size) return NS_ERROR_FAILURE; + // Bug 860076, this disabling ocsp for all NSS is incorrect. + if (!nsNSSComponent::globalConstFlagUsePKIXVerification && localOnly) { + nsresult rv; + nssComponent = do_GetService(kNSSComponentCID, &rv); + if (NS_FAILED(rv)) + return rv; + + if (nssComponent) { + nssComponent->SkipOcsp(); + } + } + uint32_t &count = *_count; count = 0; -// TODO: This block will be removed as soon as the switch to libpkix is -// complete. -if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { - if (localOnly) { - nssComponent->SkipOcsp(); - } - - SECCertificateUsage usages = 0; - int err = 0; - - // CERT_VerifyCertificateNow returns SECFailure unless the certificate is - // valid for all the given usages. Hoewver, we are only looking for the list - // of usages for which the cert *is* valid. - (void) - CERT_VerifyCertificateNow(defaultcertdb, mCert, true, - certificateUsageSSLClient | - certificateUsageSSLServer | - certificateUsageSSLServerWithStepUp | - certificateUsageEmailSigner | - certificateUsageEmailRecipient | - certificateUsageObjectSigner | - certificateUsageSSLCA | - certificateUsageStatusResponder, - nullptr, &usages); - err = PR_GetError(); - - if (localOnly) { - nssComponent->SkipOcspOff(); - } - - // The following list of checks must be < max_returned_out_array_size - - check(suffix, usages & certificateUsageSSLClient, count, outUsages); - check(suffix, usages & certificateUsageSSLServer, count, outUsages); - check(suffix, usages & certificateUsageEmailSigner, count, outUsages); - check(suffix, usages & certificateUsageEmailRecipient, count, outUsages); - check(suffix, usages & certificateUsageObjectSigner, count, outUsages); -#if 0 - check(suffix, usages & certificateUsageProtectedObjectSigner, count, outUsages); - check(suffix, usages & certificateUsageUserCertImport, count, outUsages); -#endif - check(suffix, usages & certificateUsageSSLCA, count, outUsages); -#if 0 - check(suffix, usages & certificateUsageVerifyCA, count, outUsages); -#endif - check(suffix, usages & certificateUsageStatusResponder, count, outUsages); -#if 0 - check(suffix, usages & certificateUsageAnyCA, count, outUsages); -#endif - - if (count == 0) { - verifyFailed(_verified, err); - } else { - *_verified = nsNSSCertificate::VERIFIED_OK; - } - return NS_OK; -} - RefPtr certVerifier(GetDefaultCertVerifier()); NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); @@ -359,6 +253,11 @@ if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { certificateUsageAnyCA, now, flags, count, outUsages); #endif + // Bug 860076, this disabling ocsp for all NSS is incorrect + if (!nsNSSComponent::globalConstFlagUsePKIXVerification && localOnly) { + nssComponent->SkipOcspOff(); + } + if (isFatalError(result) || count == 0) { MOZ_ASSERT(result != nsIX509Cert::VERIFIED_OK); From 5537f1395ccd3ea31e1a366d2d36d9f94fe46f98 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Tue, 16 Apr 2013 09:40:47 +1200 Subject: [PATCH 040/438] Bug 861731, remove redundent Connect, Attach call. r=nical --HG-- extra : rebase_source : af4a88fd5ddd8cecfceea49e88eebb37bf833517 --- gfx/layers/basic/BasicThebesLayer.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gfx/layers/basic/BasicThebesLayer.cpp b/gfx/layers/basic/BasicThebesLayer.cpp index 4451bcdf57d6..b88e8f4a149b 100644 --- a/gfx/layers/basic/BasicThebesLayer.cpp +++ b/gfx/layers/basic/BasicThebesLayer.cpp @@ -278,11 +278,8 @@ BasicShadowableThebesLayer::PaintBuffer(gfxContext* aContext, void* aCallbackData) { ContentClientRemote* contentClientRemote = static_cast(mContentClient.get()); - if (HasShadow() && !mContentClient->GetIPDLActor()) { - mContentClient->Connect(); - BasicManager()->Attach(mContentClient, this); - } MOZ_ASSERT(contentClientRemote->GetIPDLActor() || !HasShadow()); + // NB: this just throws away the entire valid region if there are // too many rects. mValidRegion.SimplifyInward(8); From d66ab16c1569c91fe085763db89a56e3e312db0d Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Mon, 15 Apr 2013 14:34:18 -0700 Subject: [PATCH 041/438] Bug 859718 - Don't assume we have mImageRequest in RasterImage::IsDecodeFinished. r=joe --HG-- extra : rebase_source : ec57c42b17398f0c90d19f35834e389444059b7f --- image/src/RasterImage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index b2e88bc9295e..19cca9bd4a94 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -3278,7 +3278,6 @@ RasterImage::IsDecodeFinished() // Precondition mDecodingMutex.AssertCurrentThreadOwns(); NS_ABORT_IF_FALSE(mDecoder, "Can't call IsDecodeFinished() without decoder!"); - MOZ_ASSERT(mDecodeRequest); // The decode is complete if we got what we wanted. if (mDecoder->IsSizeDecode()) { @@ -3288,11 +3287,12 @@ RasterImage::IsDecodeFinished() } else if (mDecoder->GetDecodeDone()) { return true; } - + // If the decoder returned because it needed a new frame and we haven't // written to it since then, the decoder may be storing data that it hasn't // decoded yet. - if (mDecoder->NeedsNewFrame() || mDecodeRequest->mAllocatedNewFrame) { + if (mDecoder->NeedsNewFrame() || + (mDecodeRequest && mDecodeRequest->mAllocatedNewFrame)) { return false; } From 7021bbc62cabcee286f009246a3ade90e80b7282 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Fri, 12 Apr 2013 16:34:27 -0700 Subject: [PATCH 042/438] Bug 860572 - Allow JSPropertyDescriptor to use Rooted; r=jonco --HG-- extra : rebase_source : e66e6b99777e19e6c98b4cc6487a65b04495961c --- js/src/gc/RootMarking.cpp | 33 +++++++----- js/src/gc/Verifier.cpp | 17 +++++-- js/src/jsapi.h | 104 +++++++++++++++++++++++++++++++++++++- js/src/jspubtd.h | 1 + 4 files changed, 137 insertions(+), 18 deletions(-) diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index 2f6e71da4ce6..4b55a109c40d 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -68,6 +68,7 @@ MarkExactStackRoot(JSTracer *trc, Rooted *rooter, ThingRootKind kind) case THING_ROOT_ID: MarkIdRoot(trc, (jsid *)addr, "exact-id"); break; case THING_ROOT_PROPERTY_ID: MarkIdRoot(trc, &((js::PropertyId *)addr)->asId(), "exact-propertyid"); break; case THING_ROOT_BINDINGS: ((Bindings *)addr)->trace(trc); break; + case THING_ROOT_PROPERTY_DESCRIPTOR: ((JSPropertyDescriptor *)addr)->trace(trc); break; default: JS_NOT_REACHED("Invalid THING_ROOT kind"); break; } } @@ -416,19 +417,7 @@ AutoGCRooter::trace(JSTracer *trc) case DESCRIPTOR : { PropertyDescriptor &desc = *static_cast(this); - if (desc.obj) - MarkObjectRoot(trc, &desc.obj, "Descriptor::obj"); - MarkValueRoot(trc, &desc.value, "Descriptor::value"); - if ((desc.attrs & JSPROP_GETTER) && desc.getter) { - JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, desc.getter); - MarkObjectRoot(trc, &tmp, "Descriptor::get"); - desc.getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, tmp); - } - if (desc.attrs & JSPROP_SETTER && desc.setter) { - JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, desc.setter); - MarkObjectRoot(trc, &tmp, "Descriptor::set"); - desc.setter = JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, tmp); - } + desc.trace(trc); return; } @@ -649,6 +638,24 @@ StackShape::AutoRooter::trace(JSTracer *trc) MarkIdRoot(trc, (jsid*) &shape->propid, "StackShape::AutoRooter id"); } +void +JSPropertyDescriptor::trace(JSTracer *trc) +{ + if (obj) + MarkObjectRoot(trc, &obj, "Descriptor::obj"); + MarkValueRoot(trc, &value, "Descriptor::value"); + if ((attrs & JSPROP_GETTER) && getter) { + JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, getter); + MarkObjectRoot(trc, &tmp, "Descriptor::get"); + getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, tmp); + } + if ((attrs & JSPROP_SETTER) && setter) { + JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, setter); + MarkObjectRoot(trc, &tmp, "Descriptor::set"); + setter = JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, tmp); + } +} + void js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots) { diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 2a45d31f7b6e..0b20188f9b40 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -30,14 +30,23 @@ using namespace mozilla; #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) +template +bool +CheckNonAddressThing(uintptr_t *w, T *t) +{ + return w >= (uintptr_t*)t && w < (uintptr_t*)(t + 1); +} + JS_ALWAYS_INLINE bool CheckStackRootThing(uintptr_t *w, void *address, ThingRootKind kind) { - if (kind != THING_ROOT_BINDINGS) - return address == static_cast(w); + if (kind == THING_ROOT_BINDINGS) + return CheckNonAddressThing(w, static_cast(address)); - Bindings *bp = static_cast(address); - return w >= (uintptr_t*)bp && w < (uintptr_t*)(bp + 1); + if (kind == THING_ROOT_PROPERTY_DESCRIPTOR) + return CheckNonAddressThing(w, static_cast(address)); + + return address == static_cast(w); } struct Rooter { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index cd4d151ca4f1..3ea75be79d3b 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3307,13 +3307,115 @@ struct JSPropertyDescriptor { unsigned shortid; JSPropertyOp getter; JSStrictPropertyOp setter; - jsval value; + JS::Value value; JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL), setter(NULL), value(JSVAL_VOID) {} + + void trace(JSTracer *trc); }; +namespace JS { + +template +class PropertyDescriptorOperations +{ + const JSPropertyDescriptor * desc() const { return static_cast(this)->extract(); } + JSPropertyDescriptor * desc() { return static_cast(this)->extract(); } + + public: + bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; } + bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; } + bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; } + bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; } + bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; } + bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; } + bool isShared() const { return desc()->attrs & JSPROP_SHARED; } + bool isIndex() const { return desc()->attrs & JSPROP_INDEX; } + bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; } + bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; } + + JS::MutableHandleObject obj() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); } + unsigned attributes() const { return desc()->attrs; } + unsigned shortid() const { + MOZ_ASSERT(hasShortId()); + return desc()->shortid; + } + JSPropertyOp getter() const { MOZ_ASSERT(!hasGetterObject()); return desc()->getter; } + JSStrictPropertyOp setter() const { MOZ_ASSERT(!hasSetterObject()); return desc()->setter; } + JS::HandleObject getterObject() const { + MOZ_ASSERT(hasGetterObject()); + return JS::HandleObject::fromMarkedLocation(reinterpret_cast(&desc()->getter)); + } + JS::HandleObject setterObject() const { + MOZ_ASSERT(hasSetterObject()); + return JS::HandleObject::fromMarkedLocation(reinterpret_cast(&desc()->setter)); + } + JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); } + + void setAttributes(unsigned attrs) { desc()->attrs = attrs; } + void setShortId(unsigned shortid) { desc()->shortid = shortid; } + void setGetter(JSPropertyOp op) { desc->getter = op; } + void setSetter(JSStrictPropertyOp op) { desc->setter = op; } + void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast(obj); } + void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast(obj); } +}; + +} /* namespace JS */ + +namespace js { + +template <> +struct RootMethods { + static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); } + static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; } + static bool poisoned(const JSPropertyDescriptor &desc) { + return (desc.obj && JS::IsPoisonedPtr(desc.obj)) || + (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) || + (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) || + (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing())); + } +}; + +template <> +class RootedBase + : public JS::PropertyDescriptorOperations > +{ + friend class JS::PropertyDescriptorOperations >; + const JSPropertyDescriptor *extract() const { + return static_cast*>(this)->address(); + } + JSPropertyDescriptor *extract() { + return static_cast*>(this)->address(); + } +}; + +template <> +class HandleBase + : public JS::PropertyDescriptorOperations > +{ + friend class JS::PropertyDescriptorOperations >; + const JSPropertyDescriptor *extract() const { + return static_cast*>(this)->address(); + } +}; + +template <> +class MutableHandleBase + : public JS::PropertyDescriptorOperations > +{ + friend class JS::PropertyDescriptorOperations >; + const JSPropertyDescriptor *extract() const { + return static_cast*>(this)->address(); + } + JSPropertyDescriptor *extract() { + return static_cast*>(this)->address(); + } +}; + +} /* namespace js */ + /* * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on * an object on the prototype chain (returned in objp). If data->obj is null, diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 2159dd4f6cc6..5dd1c718d750 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -244,6 +244,7 @@ enum ThingRootKind THING_ROOT_VALUE, THING_ROOT_TYPE, THING_ROOT_BINDINGS, + THING_ROOT_PROPERTY_DESCRIPTOR, THING_ROOT_LIMIT }; From c92aae54d07923ca064a7cc47c6d42b263588910 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Fri, 12 Apr 2013 17:42:59 -0700 Subject: [PATCH 043/438] Bug 860572 - Use Rooted in XPCComponents; r=bholley --HG-- extra : rebase_source : 696cf3ac61d431188d92440bbe506852ecf3c232 --- js/xpconnect/src/XPCComponents.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 3253644d1b70..69bc225c1e8d 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2769,15 +2769,15 @@ nsXPCComponents_Utils::LookupMethod(const JS::Value& object, // Alright, now do the lookup. *retval = JSVAL_VOID; - JSPropertyDescriptor desc; - if (!JS_GetPropertyDescriptorById(cx, xray, methodId, 0, &desc)) + Rooted desc(cx); + if (!JS_GetPropertyDescriptorById(cx, xray, methodId, 0, desc.address())) return NS_ERROR_FAILURE; // First look for a method value. If that's not there, try a getter, // since historically lookupMethod also works for getters. - JSObject *methodObj = desc.value.isObject() ? &desc.value.toObject() : NULL; - if (!methodObj && (desc.attrs & JSPROP_GETTER)) - methodObj = JS_FUNC_TO_DATA_PTR(JSObject *, desc.getter); + JSObject *methodObj = desc.value().isObject() ? &desc.value().toObject() : NULL; + if (!methodObj && desc.hasGetterObject()) + methodObj = desc.getterObject(); // Callers of this function seem to expect bound methods. Make it happen. // Note that this is unnecessary until bug 658909 is fixed. From d61ea30a209e83eccaa91d81b754e35c29406f23 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Fri, 8 Mar 2013 15:23:31 -0500 Subject: [PATCH 044/438] bug 860027 - nuke the interface info super manager r=bsmedberg --- js/xpconnect/src/nsXPConnect.cpp | 22 +---- js/xpconnect/src/xpcprivate.h | 4 +- .../public/nsIInterfaceInfoManager.idl | 10 --- .../xptinfo/src/xptiInterfaceInfoManager.cpp | 80 +------------------ xpcom/reflect/xptinfo/src/xptiprivate.h | 5 +- 5 files changed, 8 insertions(+), 113 deletions(-) diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 84136594fc6e..3193b33a792b 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -225,7 +225,7 @@ nsXPConnect::ReleaseXPConnectSingleton() // static nsresult -nsXPConnect::GetInterfaceInfoManager(nsIInterfaceInfoSuperManager** iim, +nsXPConnect::GetInterfaceInfoManager(nsIInterfaceInfoManager** iim, nsXPConnect* xpc /*= nullptr*/) { if (!xpc && !(xpc = GetXPConnect())) @@ -275,30 +275,12 @@ static bool NameTester(nsIInterfaceInfoManager* manager, const void* data, } static nsresult FindInfo(InfoTester tester, const void* data, - nsIInterfaceInfoSuperManager* iism, + nsIInterfaceInfoManager* iism, nsIInterfaceInfo** info) { if (tester(iism, data, info)) return NS_OK; - // If not found, then let's ask additional managers. - - bool yes; - nsCOMPtr list; - - if (NS_SUCCEEDED(iism->HasAdditionalManagers(&yes)) && yes && - NS_SUCCEEDED(iism->EnumerateAdditionalManagers(getter_AddRefs(list))) && - list) { - bool more; - nsCOMPtr current; - - while (NS_SUCCEEDED(list->HasMoreElements(&more)) && more && - NS_SUCCEEDED(list->GetNext(getter_AddRefs(current))) && current) { - if (tester(current, data, info)) - return NS_OK; - } - } - return NS_ERROR_NO_INTERFACE; } diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 78f86b4acce2..33508ca76318 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -492,7 +492,7 @@ public: #endif // Gets addref'd pointer - static nsresult GetInterfaceInfoManager(nsIInterfaceInfoSuperManager** iim, + static nsresult GetInterfaceInfoManager(nsIInterfaceInfoManager** iim, nsXPConnect* xpc = nullptr); static JSBool IsISupportsDescendant(nsIInterfaceInfo* info); @@ -568,7 +568,7 @@ private: static JSBool gOnceAliveNowDead; XPCJSRuntime* mRuntime; - nsCOMPtr mInterfaceInfoManager; + nsCOMPtr mInterfaceInfoManager; nsIXPCSecurityManager* mDefaultSecurityManager; uint16_t mDefaultSecurityManagerFlags; JSBool mShuttingDown; diff --git a/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl b/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl index 1789728a2655..72fb5f2f8a01 100644 --- a/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl +++ b/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl @@ -28,16 +28,6 @@ interface nsIInterfaceInfoManager : nsISupports nsIEnumerator enumerateInterfacesWhoseNamesStartWith(in string prefix); }; -[uuid(0ee22850-bc6a-11d5-9134-0010a4e73d9a)] -interface nsIInterfaceInfoSuperManager : nsIInterfaceInfoManager -{ - void addAdditionalManager(in nsIInterfaceInfoManager manager); - void removeAdditionalManager(in nsIInterfaceInfoManager manager); - - boolean hasAdditionalManagers(); - nsISimpleEnumerator enumerateAdditionalManagers(); -}; - %{C++ #define NS_INTERFACEINFOMANAGER_SERVICE_CID \ { /* 13bef784-f8e0-4f96-85c1-09f9ef4f9a19 */ \ diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index baf09a0c94b7..3c7185d9bc1d 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -16,9 +16,8 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS2(xptiInterfaceInfoManager, - nsIInterfaceInfoManager, - nsIInterfaceInfoSuperManager) +NS_IMPL_THREADSAFE_ISUPPORTS1(xptiInterfaceInfoManager, + nsIInterfaceInfoManager) static xptiInterfaceInfoManager* gInterfaceInfoManager = nullptr; #ifdef DEBUG @@ -79,9 +78,7 @@ xptiInterfaceInfoManager::FreeInterfaceInfoManager() xptiInterfaceInfoManager::xptiInterfaceInfoManager() : mWorkingSet(), - mResolveLock("xptiInterfaceInfoManager.mResolveLock"), - mAdditionalManagersLock( - "xptiInterfaceInfoManager.mAdditionalManagersLock") + mResolveLock("xptiInterfaceInfoManager.mResolveLock") { NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(xptiWorkingSet)); } @@ -334,74 +331,3 @@ NS_IMETHODIMP xptiInterfaceInfoManager::AutoRegisterInterfaces() { return NS_ERROR_NOT_IMPLEMENTED; } - -/***************************************************************************/ - -/* void addAdditionalManager (in nsIInterfaceInfoManager manager); */ -NS_IMETHODIMP xptiInterfaceInfoManager::AddAdditionalManager(nsIInterfaceInfoManager *manager) -{ - nsCOMPtr weakRef = do_GetWeakReference(manager); - nsISupports* ptrToAdd = weakRef ? - static_cast(weakRef) : - static_cast(manager); - { // scoped lock... - MutexAutoLock lock(mAdditionalManagersLock); - if (mAdditionalManagers.IndexOf(ptrToAdd) != -1) - return NS_ERROR_FAILURE; - if (!mAdditionalManagers.AppendObject(ptrToAdd)) - return NS_ERROR_OUT_OF_MEMORY; - } - return NS_OK; -} - -/* void removeAdditionalManager (in nsIInterfaceInfoManager manager); */ -NS_IMETHODIMP xptiInterfaceInfoManager::RemoveAdditionalManager(nsIInterfaceInfoManager *manager) -{ - nsCOMPtr weakRef = do_GetWeakReference(manager); - nsISupports* ptrToRemove = weakRef ? - static_cast(weakRef) : - static_cast(manager); - { // scoped lock... - MutexAutoLock lock(mAdditionalManagersLock); - if (!mAdditionalManagers.RemoveObject(ptrToRemove)) - return NS_ERROR_FAILURE; - } - return NS_OK; -} - -/* bool hasAdditionalManagers (); */ -NS_IMETHODIMP xptiInterfaceInfoManager::HasAdditionalManagers(bool *_retval) -{ - *_retval = mAdditionalManagers.Count() > 0; - return NS_OK; -} - -/* nsISimpleEnumerator enumerateAdditionalManagers (); */ -NS_IMETHODIMP xptiInterfaceInfoManager::EnumerateAdditionalManagers(nsISimpleEnumerator **_retval) -{ - MutexAutoLock lock(mAdditionalManagersLock); - - nsCOMArray managerArray(mAdditionalManagers); - /* Resolve all the weak references in the array. */ - for(int32_t i = managerArray.Count(); i--; ) { - nsISupports *raw = managerArray.ObjectAt(i); - if (!raw) - return NS_ERROR_FAILURE; - nsCOMPtr weakRef = do_QueryInterface(raw); - if (weakRef) { - nsCOMPtr manager = - do_QueryReferent(weakRef); - if (manager) { - if (!managerArray.ReplaceObjectAt(manager, i)) - return NS_ERROR_FAILURE; - } - else { - // The manager is no more. Remove the element. - mAdditionalManagers.RemoveObjectAt(i); - managerArray.RemoveObjectAt(i); - } - } - } - - return NS_NewArrayEnumerator(_retval, managerArray); -} diff --git a/xpcom/reflect/xptinfo/src/xptiprivate.h b/xpcom/reflect/xptinfo/src/xptiprivate.h index f179b3a9cd26..d072042fe1c5 100644 --- a/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -397,11 +397,10 @@ private: /***************************************************************************/ class xptiInterfaceInfoManager MOZ_FINAL - : public nsIInterfaceInfoSuperManager + : public nsIInterfaceInfoManager { NS_DECL_ISUPPORTS NS_DECL_NSIINTERFACEINFOMANAGER - NS_DECL_NSIINTERFACEINFOSUPERMANAGER typedef mozilla::ReentrantMonitor ReentrantMonitor; typedef mozilla::Mutex Mutex; @@ -441,8 +440,6 @@ private: private: xptiWorkingSet mWorkingSet; Mutex mResolveLock; - Mutex mAdditionalManagersLock; - nsCOMArray mAdditionalManagers; }; #endif /* xptiprivate_h___ */ From 3f28a1017cf5d335c8dbc0bdc4cacaf8962253fd Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Fri, 8 Mar 2013 21:54:10 -0500 Subject: [PATCH 045/438] bug 860027 - export a header declaring XPTInterfaceInfoManager r=bsmedberg --- xpcom/build/nsXPComInit.cpp | 8 +- xpcom/components/nsComponentManager.cpp | 4 +- xpcom/reflect/xptcall/src/xptcall.cpp | 7 +- xpcom/reflect/xptinfo/public/Makefile.in | 5 + .../xptinfo/public/XPTInterfaceInfoManager.h | 114 ++++++++++++++++++ .../reflect/xptinfo/src/xptiInterfaceInfo.cpp | 13 +- .../xptinfo/src/xptiInterfaceInfoManager.cpp | 63 +++++----- xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp | 11 +- xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp | 8 +- xpcom/reflect/xptinfo/src/xptiprivate.h | 86 ------------- 10 files changed, 185 insertions(+), 134 deletions(-) create mode 100644 xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp index 1e548d35380a..ec8afdbf1c67 100644 --- a/xpcom/build/nsXPComInit.cpp +++ b/xpcom/build/nsXPComInit.cpp @@ -48,6 +48,7 @@ #include "xptinfo.h" #include "nsIInterfaceInfoManager.h" #include "xptiprivate.h" +#include "mozilla/XPTInterfaceInfoManager.h" #include "nsTimerImpl.h" #include "TimerThread.h" @@ -126,6 +127,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **) #include "GeckoProfiler.h" +using namespace mozilla; using base::AtExitManager; using mozilla::ipc::BrowserProcessSubThread; #ifdef MOZ_VISUAL_EVENT_TRACER @@ -228,7 +230,7 @@ nsXPTIInterfaceInfoManagerGetSingleton(nsISupports* outer, NS_ENSURE_TRUE(!outer, NS_ERROR_NO_AGGREGATION); nsCOMPtr iim - (xptiInterfaceInfoManager::GetSingleton()); + (XPTInterfaceInfoManager::GetSingleton()); if (!iim) return NS_ERROR_FAILURE; @@ -470,7 +472,7 @@ NS_InitXPCOM2(nsIServiceManager* *result, // The iimanager constructor searches and registers XPT files. // (We trigger the singleton's lazy construction here to make that happen.) - (void) xptiInterfaceInfoManager::GetSingleton(); + (void) XPTInterfaceInfoManager::GetSingleton(); // After autoreg, but before we actually instantiate any components, // add any services listed in the "xpcom-directory-providers" category @@ -688,7 +690,7 @@ ShutdownXPCOM(nsIServiceManager* servMgr) // Do this _after_ shutting down the component manager, because the // JS component loader will use XPConnect to call nsIModule::canUnload, // and that will spin up the InterfaceInfoManager again -- bad mojo - xptiInterfaceInfoManager::FreeInterfaceInfoManager(); + XPTInterfaceInfoManager::FreeInterfaceInfoManager(); // Finally, release the component manager last because it unloads the // libraries: diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index a2298a746c42..b2d7d6d80773 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -36,6 +36,7 @@ #include "nsCategoryManager.h" #include "nsCategoryManagerUtils.h" #include "xptiprivate.h" +#include "mozilla/XPTInterfaceInfoManager.h" #include "nsIConsoleService.h" #include "nsIMemoryReporter.h" #include "nsIObserverService.h" @@ -613,8 +614,7 @@ nsComponentManagerImpl::ManifestXPT(ManifestProcessingContext& cx, int lineno, c rv = data.Copy(buf, len); } if (NS_SUCCEEDED(rv)) { - xptiInterfaceInfoManager::GetSingleton() - ->RegisterBuffer(buf, len); + XPTInterfaceInfoManager::GetSingleton()->RegisterBuffer(buf, len); } else { nsCString uri; f.GetURIString(uri); diff --git a/xpcom/reflect/xptcall/src/xptcall.cpp b/xpcom/reflect/xptcall/src/xptcall.cpp index ed0b99227f77..e46ddd559d3d 100644 --- a/xpcom/reflect/xptcall/src/xptcall.cpp +++ b/xpcom/reflect/xptcall/src/xptcall.cpp @@ -7,6 +7,9 @@ #include "xptcprivate.h" #include "xptiprivate.h" +#include "mozilla/XPTInterfaceInfoManager.h" + +using namespace mozilla; NS_IMETHODIMP nsXPTCStubBase::QueryInterface(REFNSIID aIID, @@ -39,8 +42,8 @@ NS_GetXPTCallStub(REFNSIID aIID, nsIXPTCProxy* aOuter, { NS_ENSURE_ARG(aOuter && aResult); - xptiInterfaceInfoManager *iim = - xptiInterfaceInfoManager::GetSingleton(); + XPTInterfaceInfoManager *iim = + XPTInterfaceInfoManager::GetSingleton(); NS_ENSURE_TRUE(iim, NS_ERROR_NOT_INITIALIZED); xptiInterfaceEntry *iie = iim->GetInterfaceEntryForIID(&aIID); diff --git a/xpcom/reflect/xptinfo/public/Makefile.in b/xpcom/reflect/xptinfo/public/Makefile.in index 9cab747bc2fb..8adec75ca937 100644 --- a/xpcom/reflect/xptinfo/public/Makefile.in +++ b/xpcom/reflect/xptinfo/public/Makefile.in @@ -15,6 +15,11 @@ EXPORTS = \ xptinfo.h \ $(NULL) +EXPORTS_NAMESPACES := mozilla +EXPORTS_mozilla := \ + XPTInterfaceInfoManager.h \ + $(null) + EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) include $(topsrcdir)/config/rules.mk diff --git a/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h b/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h new file mode 100644 index 000000000000..1fddf395f4f5 --- /dev/null +++ b/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=4 et sw=4 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_XPTInterfaceInfoManager_h_ +#define mozilla_XPTInterfaceInfoManager_h_ + +#include "nsIInterfaceInfoManager.h" + +#include "mozilla/Mutex.h" +#include "mozilla/ReentrantMonitor.h" +#include "nsDataHashtable.h" + +template class nsCOMArray; +class XPTHeader; +class XPTInterfaceDirectoryEntry; +class xptiInterfaceEntry; +class xptiInterfaceInfo; +class xptiTypelibGuts; + +namespace mozilla { + +class XPTInterfaceInfoManager MOZ_FINAL + : public nsIInterfaceInfoManager +{ + NS_DECL_ISUPPORTS + NS_DECL_NSIINTERFACEINFOMANAGER + +public: + // GetSingleton() is infallible + static XPTInterfaceInfoManager* GetSingleton(); + static void FreeInterfaceInfoManager(); + + void GetScriptableInterfaces(nsCOMArray& aInterfaces); + + void RegisterBuffer(char *buf, uint32_t length); + + static Mutex& GetResolveLock() + { + return GetSingleton()->mResolveLock; + } + + xptiInterfaceEntry* GetInterfaceEntryForIID(const nsIID *iid); + + size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf); + + static int64_t GetXPTIWorkingSetSize(); + +private: + XPTInterfaceInfoManager(); + ~XPTInterfaceInfoManager(); + + void RegisterXPTHeader(XPTHeader* aHeader); + + // idx is the index of this interface in the XPTHeader + void VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface, + uint16_t idx, + xptiTypelibGuts* typelib); + +private: + + class xptiWorkingSet + { + public: + xptiWorkingSet(); + ~xptiWorkingSet(); + + bool IsValid() const; + + void InvalidateInterfaceInfos(); + void ClearHashTables(); + + // utility methods... + + enum {NOT_FOUND = 0xffffffff}; + + // Directory stuff... + + uint32_t GetDirectoryCount(); + nsresult GetCloneOfDirectoryAt(uint32_t i, nsIFile** dir); + nsresult GetDirectoryAt(uint32_t i, nsIFile** dir); + bool FindDirectory(nsIFile* dir, uint32_t* index); + bool FindDirectoryOfFile(nsIFile* file, uint32_t* index); + bool DirectoryAtMatchesPersistentDescriptor(uint32_t i, const char* desc); + + private: + uint32_t mFileCount; + uint32_t mMaxFileCount; + + public: + // XXX make these private with accessors + // mTableMonitor must be held across: + // * any read from or write to mIIDTable or mNameTable + // * any writing to the links between an xptiInterfaceEntry + // and its xptiInterfaceInfo (mEntry/mInfo) + mozilla::ReentrantMonitor mTableReentrantMonitor; + nsDataHashtable mIIDTable; + nsDataHashtable mNameTable; + }; + + // XXX xptiInterfaceInfo want's to poke at the working set itself + friend class ::xptiInterfaceInfo; + friend class ::xptiInterfaceEntry; + friend class ::xptiTypelibGuts; + + xptiWorkingSet mWorkingSet; + Mutex mResolveLock; +}; + +} + +#endif diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp index 60ab60d1fc87..3a27a78bfcd6 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp @@ -6,6 +6,7 @@ /* Implementation of xptiInterfaceEntry and xptiInterfaceInfo. */ #include "xptiprivate.h" +#include "mozilla/XPTInterfaceInfoManager.h" #include "nsAtomicRefcnt.h" using namespace mozilla; @@ -70,7 +71,7 @@ xptiInterfaceEntry::xptiInterfaceEntry(const char* name, bool xptiInterfaceEntry::Resolve() { - MutexAutoLock lock(xptiInterfaceInfoManager::GetResolveLock()); + MutexAutoLock lock(XPTInterfaceInfoManager::GetResolveLock()); return ResolveLocked(); } @@ -540,7 +541,7 @@ nsresult xptiInterfaceEntry::GetInterfaceInfo(xptiInterfaceInfo** info) { #ifdef DEBUG - xptiInterfaceInfoManager::GetSingleton()->GetWorkingSet()->mTableReentrantMonitor. + XPTInterfaceInfoManager::GetSingleton()->mWorkingSet.mTableReentrantMonitor. AssertCurrentThreadIn(); #endif LOG_INFO_MONITOR_ENTRY; @@ -572,8 +573,8 @@ xptiInterfaceEntry::LockedInvalidateInterfaceInfo() bool xptiInterfaceInfo::BuildParent() { - mozilla::ReentrantMonitorAutoEnter monitor(xptiInterfaceInfoManager::GetSingleton()-> - GetWorkingSet()->mTableReentrantMonitor); + mozilla::ReentrantMonitorAutoEnter monitor(XPTInterfaceInfoManager::GetSingleton()-> + mWorkingSet.mTableReentrantMonitor); NS_ASSERTION(mEntry && mEntry->IsFullyResolved() && !mParent && @@ -615,8 +616,8 @@ xptiInterfaceInfo::Release(void) NS_LOG_RELEASE(this, cnt, "xptiInterfaceInfo"); if(!cnt) { - mozilla::ReentrantMonitorAutoEnter monitor(xptiInterfaceInfoManager:: - GetSingleton()->GetWorkingSet()-> + mozilla::ReentrantMonitorAutoEnter monitor(XPTInterfaceInfoManager:: + GetSingleton()->mWorkingSet. mTableReentrantMonitor); LOG_INFO_MONITOR_ENTRY; diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index 3c7185d9bc1d..e1b7c874b55c 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -5,6 +5,8 @@ /* Implementation of xptiInterfaceInfoManager. */ +#include "mozilla/XPTInterfaceInfoManager.h" + #include "xptiprivate.h" #include "nsDependentString.h" #include "nsString.h" @@ -16,10 +18,10 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS1(xptiInterfaceInfoManager, +NS_IMPL_THREADSAFE_ISUPPORTS1(XPTInterfaceInfoManager, nsIInterfaceInfoManager) -static xptiInterfaceInfoManager* gInterfaceInfoManager = nullptr; +static XPTInterfaceInfoManager* gInterfaceInfoManager = nullptr; #ifdef DEBUG static int gCallCount = 0; #endif @@ -28,7 +30,7 @@ static int gCallCount = 0; NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(XPTMallocSizeOf) size_t -xptiInterfaceInfoManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) +XPTInterfaceInfoManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) { size_t n = aMallocSizeOf(this); ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor); @@ -41,7 +43,7 @@ xptiInterfaceInfoManager::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) // static int64_t -xptiInterfaceInfoManager::GetXPTIWorkingSetSize() +XPTInterfaceInfoManager::GetXPTIWorkingSetSize() { size_t n = XPT_SizeOfArena(gXPTIStructArena, XPTMallocSizeOf); @@ -52,38 +54,38 @@ xptiInterfaceInfoManager::GetXPTIWorkingSetSize() return n; } -NS_MEMORY_REPORTER_IMPLEMENT(xptiWorkingSet, +NS_MEMORY_REPORTER_IMPLEMENT(XPTInterfaceInfoManager, "explicit/xpti-working-set", KIND_HEAP, UNITS_BYTES, - xptiInterfaceInfoManager::GetXPTIWorkingSetSize, + XPTInterfaceInfoManager::GetXPTIWorkingSetSize, "Memory used by the XPCOM typelib system.") // static -xptiInterfaceInfoManager* -xptiInterfaceInfoManager::GetSingleton() +XPTInterfaceInfoManager* +XPTInterfaceInfoManager::GetSingleton() { if (!gInterfaceInfoManager) { - gInterfaceInfoManager = new xptiInterfaceInfoManager(); + gInterfaceInfoManager = new XPTInterfaceInfoManager(); NS_ADDREF(gInterfaceInfoManager); } return gInterfaceInfoManager; } void -xptiInterfaceInfoManager::FreeInterfaceInfoManager() +XPTInterfaceInfoManager::FreeInterfaceInfoManager() { NS_IF_RELEASE(gInterfaceInfoManager); } -xptiInterfaceInfoManager::xptiInterfaceInfoManager() +XPTInterfaceInfoManager::XPTInterfaceInfoManager() : mWorkingSet(), - mResolveLock("xptiInterfaceInfoManager.mResolveLock") + mResolveLock("XPTInterfaceInfoManager.mResolveLock") { - NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(xptiWorkingSet)); + NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(XPTInterfaceInfoManager)); } -xptiInterfaceInfoManager::~xptiInterfaceInfoManager() +XPTInterfaceInfoManager::~XPTInterfaceInfoManager() { // We only do this on shutdown of the service. mWorkingSet.InvalidateInterfaceInfos(); @@ -95,7 +97,7 @@ xptiInterfaceInfoManager::~xptiInterfaceInfoManager() } void -xptiInterfaceInfoManager::RegisterBuffer(char *buf, uint32_t length) +XPTInterfaceInfoManager::RegisterBuffer(char *buf, uint32_t length) { XPTState *state = XPT_NewXDRState(XPT_DECODE, buf, length); if (!state) @@ -116,7 +118,7 @@ xptiInterfaceInfoManager::RegisterBuffer(char *buf, uint32_t length) } void -xptiInterfaceInfoManager::RegisterXPTHeader(XPTHeader* aHeader) +XPTInterfaceInfoManager::RegisterXPTHeader(XPTHeader* aHeader) { if (aHeader->major_version >= XPT_MAJOR_INCOMPATIBLE_VERSION) { NS_ASSERTION(!aHeader->num_interfaces,"bad libxpt"); @@ -131,9 +133,9 @@ xptiInterfaceInfoManager::RegisterXPTHeader(XPTHeader* aHeader) } void -xptiInterfaceInfoManager::VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface, - uint16_t idx, - xptiTypelibGuts* typelib) +XPTInterfaceInfoManager::VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface, + uint16_t idx, + xptiTypelibGuts* typelib) { if (!iface->interface_descriptor) return; @@ -199,14 +201,15 @@ EntryToInfo(xptiInterfaceEntry* entry, nsIInterfaceInfo **_retval) } xptiInterfaceEntry* -xptiInterfaceInfoManager::GetInterfaceEntryForIID(const nsIID *iid) +XPTInterfaceInfoManager::GetInterfaceEntryForIID(const nsIID *iid) { ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor); return mWorkingSet.mIIDTable.Get(*iid); } /* nsIInterfaceInfo getInfoForIID (in nsIIDPtr iid); */ -NS_IMETHODIMP xptiInterfaceInfoManager::GetInfoForIID(const nsIID * iid, nsIInterfaceInfo **_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::GetInfoForIID(const nsIID * iid, nsIInterfaceInfo **_retval) { NS_ASSERTION(iid, "bad param"); NS_ASSERTION(_retval, "bad param"); @@ -217,7 +220,8 @@ NS_IMETHODIMP xptiInterfaceInfoManager::GetInfoForIID(const nsIID * iid, nsIInte } /* nsIInterfaceInfo getInfoForName (in string name); */ -NS_IMETHODIMP xptiInterfaceInfoManager::GetInfoForName(const char *name, nsIInterfaceInfo **_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::GetInfoForName(const char *name, nsIInterfaceInfo **_retval) { NS_ASSERTION(name, "bad param"); NS_ASSERTION(_retval, "bad param"); @@ -228,7 +232,8 @@ NS_IMETHODIMP xptiInterfaceInfoManager::GetInfoForName(const char *name, nsIInte } /* nsIIDPtr getIIDForName (in string name); */ -NS_IMETHODIMP xptiInterfaceInfoManager::GetIIDForName(const char *name, nsIID * *_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::GetIIDForName(const char *name, nsIID * *_retval) { NS_ASSERTION(name, "bad param"); NS_ASSERTION(_retval, "bad param"); @@ -244,7 +249,8 @@ NS_IMETHODIMP xptiInterfaceInfoManager::GetIIDForName(const char *name, nsIID * } /* string getNameForIID (in nsIIDPtr iid); */ -NS_IMETHODIMP xptiInterfaceInfoManager::GetNameForIID(const nsIID * iid, char **_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::GetNameForIID(const nsIID * iid, char **_retval) { NS_ASSERTION(iid, "bad param"); NS_ASSERTION(_retval, "bad param"); @@ -271,7 +277,8 @@ xpti_ArrayAppender(const char* name, xptiInterfaceEntry* entry, void* arg) } /* nsIEnumerator enumerateInterfaces (); */ -NS_IMETHODIMP xptiInterfaceInfoManager::EnumerateInterfaces(nsIEnumerator **_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::EnumerateInterfaces(nsIEnumerator **_retval) { // I didn't want to incur the size overhead of using nsHashtable just to // make building an enumerator easier. So, this code makes a snapshot of @@ -312,7 +319,8 @@ xpti_ArrayPrefixAppender(const char* keyname, xptiInterfaceEntry* entry, void* a } /* nsIEnumerator enumerateInterfacesWhoseNamesStartWith (in string prefix); */ -NS_IMETHODIMP xptiInterfaceInfoManager::EnumerateInterfacesWhoseNamesStartWith(const char *prefix, nsIEnumerator **_retval) +NS_IMETHODIMP +XPTInterfaceInfoManager::EnumerateInterfacesWhoseNamesStartWith(const char *prefix, nsIEnumerator **_retval) { nsCOMPtr array; NS_NewISupportsArray(getter_AddRefs(array)); @@ -327,7 +335,8 @@ NS_IMETHODIMP xptiInterfaceInfoManager::EnumerateInterfacesWhoseNamesStartWith(c } /* void autoRegisterInterfaces (); */ -NS_IMETHODIMP xptiInterfaceInfoManager::AutoRegisterInterfaces() +NS_IMETHODIMP +XPTInterfaceInfoManager::AutoRegisterInterfaces() { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp b/xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp index 6f9a65cc666c..ada3f9abbaed 100644 --- a/xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp +++ b/xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp @@ -6,6 +6,7 @@ /* Implementation of xptiTypelibGuts. */ #include "xptiprivate.h" +#include "mozilla/XPTInterfaceInfoManager.h" using namespace mozilla; @@ -38,15 +39,15 @@ xptiTypelibGuts::GetEntryAt(uint16_t i) XPTInterfaceDirectoryEntry* iface = mHeader->interface_directory + i; - xptiWorkingSet* set = - xptiInterfaceInfoManager::GetSingleton()->GetWorkingSet(); + XPTInterfaceInfoManager::xptiWorkingSet& set = + XPTInterfaceInfoManager::GetSingleton()->mWorkingSet; { - ReentrantMonitorAutoEnter monitor(set->mTableReentrantMonitor); + ReentrantMonitorAutoEnter monitor(set.mTableReentrantMonitor); if (iface->iid.Equals(zeroIID)) - r = set->mNameTable.Get(iface->name); + r = set.mNameTable.Get(iface->name); else - r = set->mIIDTable.Get(iface->iid); + r = set.mIIDTable.Get(iface->iid); } if (r) diff --git a/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp b/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp index 5f6331061955..9eee6d473944 100644 --- a/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp +++ b/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp @@ -5,6 +5,8 @@ /* Implementation of xptiWorkingSet. */ +#include "mozilla/XPTInterfaceInfoManager.h" + #include "xptiprivate.h" #include "nsString.h" @@ -13,7 +15,7 @@ using namespace mozilla; #define XPTI_STRUCT_ARENA_BLOCK_SIZE (1024 * 16) #define XPTI_HASHTABLE_SIZE 2048 -xptiWorkingSet::xptiWorkingSet() +XPTInterfaceInfoManager::xptiWorkingSet::xptiWorkingSet() : mTableReentrantMonitor("xptiWorkingSet::mTableReentrantMonitor") { MOZ_COUNT_CTOR(xptiWorkingSet); @@ -33,13 +35,13 @@ xpti_Invalidator(const char* keyname, xptiInterfaceEntry* entry, void* arg) } void -xptiWorkingSet::InvalidateInterfaceInfos() +XPTInterfaceInfoManager::xptiWorkingSet::InvalidateInterfaceInfos() { ReentrantMonitorAutoEnter monitor(mTableReentrantMonitor); mNameTable.EnumerateRead(xpti_Invalidator, NULL); } -xptiWorkingSet::~xptiWorkingSet() +XPTInterfaceInfoManager::xptiWorkingSet::~xptiWorkingSet() { MOZ_COUNT_DTOR(xptiWorkingSet); diff --git a/xpcom/reflect/xptinfo/src/xptiprivate.h b/xpcom/reflect/xptinfo/src/xptiprivate.h index d072042fe1c5..8637d70a9189 100644 --- a/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -75,7 +75,6 @@ class xptiInterfaceInfo; class xptiInterfaceInfoManager; class xptiInterfaceEntry; class xptiTypelibGuts; -class xptiWorkingSet; extern XPTArena* gXPTIStructArena; @@ -117,45 +116,6 @@ private: /***************************************************************************/ -class xptiWorkingSet -{ -public: - xptiWorkingSet(); - ~xptiWorkingSet(); - - bool IsValid() const; - - void InvalidateInterfaceInfos(); - void ClearHashTables(); - - // utility methods... - - enum {NOT_FOUND = 0xffffffff}; - - // Directory stuff... - - uint32_t GetDirectoryCount(); - nsresult GetCloneOfDirectoryAt(uint32_t i, nsIFile** dir); - nsresult GetDirectoryAt(uint32_t i, nsIFile** dir); - bool FindDirectory(nsIFile* dir, uint32_t* index); - bool FindDirectoryOfFile(nsIFile* file, uint32_t* index); - bool DirectoryAtMatchesPersistentDescriptor(uint32_t i, const char* desc); - -private: - uint32_t mFileCount; - uint32_t mMaxFileCount; - -public: - // XXX make these private with accessors - // mTableMonitor must be held across: - // * any read from or write to mIIDTable or mNameTable - // * any writing to the links between an xptiInterfaceEntry - // and its xptiInterfaceInfo (mEntry/mInfo) - mozilla::ReentrantMonitor mTableReentrantMonitor; - nsDataHashtable mIIDTable; - nsDataHashtable mNameTable; -}; - /***************************************************************************/ // This class exists to help xptiInterfaceInfo store a 4-state (2 bit) value @@ -396,50 +356,4 @@ private: /***************************************************************************/ -class xptiInterfaceInfoManager MOZ_FINAL - : public nsIInterfaceInfoManager -{ - NS_DECL_ISUPPORTS - NS_DECL_NSIINTERFACEINFOMANAGER - - typedef mozilla::ReentrantMonitor ReentrantMonitor; - typedef mozilla::Mutex Mutex; - -public: - // GetSingleton() is infallible - static xptiInterfaceInfoManager* GetSingleton(); - static void FreeInterfaceInfoManager(); - - void RegisterBuffer(char *buf, uint32_t length); - - xptiWorkingSet* GetWorkingSet() {return &mWorkingSet;} - - static Mutex& GetResolveLock(xptiInterfaceInfoManager* self = nullptr) - { - self = self ? self : GetSingleton(); - return self->mResolveLock; - } - - xptiInterfaceEntry* GetInterfaceEntryForIID(const nsIID *iid); - - size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf); - - static int64_t GetXPTIWorkingSetSize(); - -private: - xptiInterfaceInfoManager(); - ~xptiInterfaceInfoManager(); - - void RegisterXPTHeader(XPTHeader* aHeader); - - // idx is the index of this interface in the XPTHeader - void VerifyAndAddEntryIfNew(XPTInterfaceDirectoryEntry* iface, - uint16_t idx, - xptiTypelibGuts* typelib); - -private: - xptiWorkingSet mWorkingSet; - Mutex mResolveLock; -}; - #endif /* xptiprivate_h___ */ From a54c6c7e4eb3b8c8335d217d0944ac01a0c72a06 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Fri, 8 Mar 2013 22:05:08 -0500 Subject: [PATCH 046/438] bug 860027 - remove nsXPConnect::GetInterfaceInfoManager() r=bholley --- js/xpconnect/src/nsXPConnect.cpp | 13 ------------- js/xpconnect/src/xpcprivate.h | 4 ---- 2 files changed, 17 deletions(-) diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 3193b33a792b..b97a98f49c00 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -223,19 +223,6 @@ nsXPConnect::ReleaseXPConnectSingleton() } } -// static -nsresult -nsXPConnect::GetInterfaceInfoManager(nsIInterfaceInfoManager** iim, - nsXPConnect* xpc /*= nullptr*/) -{ - if (!xpc && !(xpc = GetXPConnect())) - return NS_ERROR_FAILURE; - - *iim = xpc->mInterfaceInfoManager; - NS_IF_ADDREF(*iim); - return NS_OK; -} - // static XPCJSRuntime* nsXPConnect::GetRuntimeInstance() diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 33508ca76318..1e3f41fee80b 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -491,10 +491,6 @@ public: void AssertNoObjectsToTrace(void* aPossibleJSHolder); #endif - // Gets addref'd pointer - static nsresult GetInterfaceInfoManager(nsIInterfaceInfoManager** iim, - nsXPConnect* xpc = nullptr); - static JSBool IsISupportsDescendant(nsIInterfaceInfo* info); nsIXPCSecurityManager* GetDefaultSecurityManager() const From 6d48f5d792f1d579a2bdb7c68a21e946da173e2a Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Sun, 10 Mar 2013 20:14:14 -0400 Subject: [PATCH 047/438] bug 860027 - remove nsXPConnect::mInterfaceInfoManager r=bholley --- js/xpconnect/src/nsXPConnect.cpp | 39 ++++---------------------------- js/xpconnect/src/xpcprivate.h | 2 -- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index b97a98f49c00..e8e9ee71e9b3 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -40,7 +40,9 @@ #include "nsDOMMutationObserver.h" #include "nsICycleCollectorListener.h" #include "nsThread.h" +#include "mozilla/XPTInterfaceInfoManager.h" +using namespace mozilla; using namespace mozilla::dom; using namespace xpc; using namespace JS; @@ -76,7 +78,6 @@ const char XPC_XPCONNECT_CONTRACTID[] = "@mozilla.org/js/xpc/XPConnect;1"; nsXPConnect::nsXPConnect() : mRuntime(nullptr), - mInterfaceInfoManager(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)), mDefaultSecurityManager(nullptr), mDefaultSecurityManagerFlags(0), mShuttingDown(false), @@ -150,9 +151,6 @@ nsXPConnect::GetXPConnect() if (!gSelf->mRuntime) { NS_RUNTIMEABORT("Couldn't create XPCJSRuntime."); } - if (!gSelf->mInterfaceInfoManager) { - NS_RUNTIMEABORT("Couldn't get global interface info manager."); - } // Initial extra ref to keep the singleton alive // balanced by explicit call to ReleaseXPConnectSingleton() @@ -244,43 +242,17 @@ nsXPConnect::IsISupportsDescendant(nsIInterfaceInfo* info) /***************************************************************************/ -typedef bool (*InfoTester)(nsIInterfaceInfoManager* manager, const void* data, - nsIInterfaceInfo** info); - -static bool IIDTester(nsIInterfaceInfoManager* manager, const void* data, - nsIInterfaceInfo** info) -{ - return NS_SUCCEEDED(manager->GetInfoForIID((const nsIID *) data, info)) && - *info; -} - -static bool NameTester(nsIInterfaceInfoManager* manager, const void* data, - nsIInterfaceInfo** info) -{ - return NS_SUCCEEDED(manager->GetInfoForName((const char *) data, info)) && - *info; -} - -static nsresult FindInfo(InfoTester tester, const void* data, - nsIInterfaceInfoManager* iism, - nsIInterfaceInfo** info) -{ - if (tester(iism, data, info)) - return NS_OK; - - return NS_ERROR_NO_INTERFACE; -} - nsresult nsXPConnect::GetInfoForIID(const nsIID * aIID, nsIInterfaceInfo** info) { - return FindInfo(IIDTester, aIID, mInterfaceInfoManager, info); + return XPTInterfaceInfoManager::GetSingleton()->GetInfoForIID(aIID, info); } nsresult nsXPConnect::GetInfoForName(const char * name, nsIInterfaceInfo** info) { - return FindInfo(NameTester, name, mInterfaceInfoManager, info); + nsresult rv = XPTInterfaceInfoManager::GetSingleton()->GetInfoForName(name, info); + return NS_FAILED(rv) ? NS_OK : NS_ERROR_NO_INTERFACE; } bool @@ -1740,7 +1712,6 @@ nsXPConnect::DebugDump(int16_t depth) XPC_LOG_ALWAYS(("gOnceAliveNowDead is %d", (int)gOnceAliveNowDead)); XPC_LOG_ALWAYS(("mDefaultSecurityManager @ %x", mDefaultSecurityManager)); XPC_LOG_ALWAYS(("mDefaultSecurityManagerFlags of %x", mDefaultSecurityManagerFlags)); - XPC_LOG_ALWAYS(("mInterfaceInfoManager @ %x", mInterfaceInfoManager.get())); if (mRuntime) { if (depth) mRuntime->DebugDump(depth); diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 1e3f41fee80b..bcc2d5532602 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -119,7 +119,6 @@ #include "nsMemory.h" #include "nsIXPConnect.h" #include "nsIInterfaceInfo.h" -#include "nsIInterfaceInfoManager.h" #include "nsIXPCScriptable.h" #include "nsIXPCSecurityManager.h" #include "nsIJSRuntimeService.h" @@ -564,7 +563,6 @@ private: static JSBool gOnceAliveNowDead; XPCJSRuntime* mRuntime; - nsCOMPtr mInterfaceInfoManager; nsIXPCSecurityManager* mDefaultSecurityManager; uint16_t mDefaultSecurityManagerFlags; JSBool mShuttingDown; From dc8230838c8c5a66ec639181333fe318266b4b85 Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Tue, 16 Apr 2013 13:47:10 -0700 Subject: [PATCH 048/438] Bug 860029 - Standardize Modelines in the JS Module. r=njn --- js/ipc/CPOWTypes.h | 3 +- js/ipc/ContextWrapperChild.h | 3 +- js/ipc/ContextWrapperParent.h | 3 +- js/ipc/ObjectWrapperChild.cpp | 3 +- js/ipc/ObjectWrapperChild.h | 3 +- js/ipc/ObjectWrapperParent.cpp | 3 +- js/ipc/ObjectWrapperParent.h | 3 +- js/jsd/jsd.h | 5 ++- js/jsd/jsd_atom.cpp | 5 ++- js/jsd/jsd_high.cpp | 5 ++- js/jsd/jsd_hook.cpp | 5 ++- js/jsd/jsd_java.cpp | 5 ++- js/jsd/jsd_lock.cpp | 5 ++- js/jsd/jsd_lock.h | 5 ++- js/jsd/jsd_obj.cpp | 5 ++- js/jsd/jsd_scpt.cpp | 5 ++- js/jsd/jsd_stak.cpp | 5 ++- js/jsd/jsd_step.cpp | 5 ++- js/jsd/jsd_text.cpp | 5 ++- js/jsd/jsd_val.cpp | 5 ++- js/jsd/jsd_xpc.cpp | 4 +- js/jsd/jsd_xpc.h | 4 +- js/jsd/jsdebug.cpp | 5 ++- js/jsd/jsdebug.h | 5 ++- js/jsd/jsdstubs.cpp | 5 ++- js/jsd/jshash.cpp | 2 +- js/jsd/jshash.h | 4 +- js/jsd/resource.h | 5 ++- js/public/Anchor.h | 5 +-- js/public/CallArgs.h | 5 +-- js/public/CharacterEncoding.h | 3 +- js/public/GCAPI.h | 8 ++-- js/public/HashTable.h | 5 +-- js/public/HeapAPI.h | 8 ++-- js/public/LegacyIntTypes.h | 5 ++- js/public/MemoryMetrics.h | 5 +-- js/public/PropertyKey.h | 5 +-- js/public/RequiredDefines.h | 3 +- js/public/RootingAPI.h | 3 +- js/public/TemplateLib.h | 5 +-- js/public/Utility.h | 5 +-- js/public/Value.h | 5 +-- js/public/Vector.h | 5 +-- js/src/TraceLogging.cpp | 10 ++--- js/src/TraceLogging.h | 10 ++--- js/src/assembler/assembler/ARMAssembler.cpp | 2 +- js/src/assembler/assembler/ARMAssembler.h | 2 +- js/src/assembler/assembler/ARMv7Assembler.h | 2 +- .../assembler/AbstractMacroAssembler.h | 2 +- js/src/assembler/assembler/AssemblerBuffer.h | 2 +- .../AssemblerBufferWithConstantPool.h | 2 +- js/src/assembler/assembler/CodeLocation.h | 2 +- js/src/assembler/assembler/LinkBuffer.h | 2 +- js/src/assembler/assembler/MacroAssembler.h | 2 +- .../assembler/assembler/MacroAssemblerARM.cpp | 2 +- .../assembler/assembler/MacroAssemblerARM.h | 2 +- .../assembler/assembler/MacroAssemblerARMv7.h | 2 +- .../assembler/MacroAssemblerCodeRef.h | 2 +- .../assembler/assembler/MacroAssemblerSparc.h | 4 +- .../assembler/assembler/MacroAssemblerX86.h | 2 +- .../assembler/MacroAssemblerX86Common.cpp | 4 +- .../assembler/MacroAssemblerX86Common.h | 2 +- .../assembler/MacroAssemblerX86_64.h | 2 +- js/src/assembler/assembler/RepatchBuffer.h | 2 +- js/src/assembler/assembler/SparcAssembler.h | 4 +- js/src/assembler/assembler/X86Assembler.h | 2 +- js/src/assembler/jit/ExecutableAllocator.cpp | 4 +- js/src/assembler/moco/MocoStubs.h | 5 +-- js/src/builtin/Eval.cpp | 3 +- js/src/builtin/Eval.h | 5 +-- js/src/builtin/Intl.cpp | 2 +- js/src/builtin/Intl.h | 2 +- js/src/builtin/Iterator-inl.h | 9 ++-- js/src/builtin/MapObject.cpp | 5 +-- js/src/builtin/MapObject.h | 5 +-- js/src/builtin/Module.cpp | 6 +++ js/src/builtin/Module.h | 6 +++ js/src/builtin/Object.cpp | 5 +-- js/src/builtin/Object.h | 5 +-- js/src/builtin/ParallelArray.cpp | 5 +-- js/src/builtin/ParallelArray.h | 5 +-- js/src/builtin/Profilers.cpp | 9 ++-- js/src/builtin/Profilers.h | 3 +- js/src/builtin/RegExp.cpp | 5 +-- js/src/builtin/RegExp.h | 5 +-- js/src/builtin/TestingFunctions.cpp | 9 ++-- js/src/builtin/TestingFunctions.h | 9 ++-- js/src/ctypes/CTypes.cpp | 5 ++- js/src/ctypes/Library.cpp | 5 ++- js/src/devtools/jint/treesearch.py | 3 +- js/src/devtools/sharkctl.cpp | 3 +- js/src/devtools/sharkctl.h | 3 +- js/src/ds/BitArray.h | 5 +-- js/src/ds/InlineMap.h | 5 +-- js/src/ds/LifoAlloc.cpp | 5 +-- js/src/ds/LifoAlloc.h | 5 +-- js/src/ds/PriorityQueue.h | 5 +-- js/src/ds/Sort.h | 5 +-- js/src/ds/SplayTree.h | 5 +-- js/src/editline/editline.c | 1 - js/src/editline/editline.h | 1 - js/src/editline/sysunix.c | 1 - js/src/editline/unix.h | 1 - js/src/frontend/BytecodeCompiler.cpp | 3 +- js/src/frontend/BytecodeCompiler.h | 3 +- js/src/frontend/BytecodeEmitter.cpp | 3 +- js/src/frontend/BytecodeEmitter.h | 3 +- js/src/frontend/FoldConstants.cpp | 3 +- js/src/frontend/FoldConstants.h | 3 +- js/src/frontend/FullParseHandler.h | 3 +- js/src/frontend/NameFunctions.cpp | 3 +- js/src/frontend/NameFunctions.h | 3 +- js/src/frontend/ParseMaps-inl.h | 5 +-- js/src/frontend/ParseMaps.cpp | 5 +-- js/src/frontend/ParseMaps.h | 5 +-- js/src/frontend/ParseNode-inl.h | 2 +- js/src/frontend/ParseNode.cpp | 3 +- js/src/frontend/ParseNode.h | 3 +- js/src/frontend/Parser-inl.h | 3 +- js/src/frontend/Parser.cpp | 3 +- js/src/frontend/Parser.h | 3 +- js/src/frontend/SharedContext-inl.h | 3 +- js/src/frontend/SharedContext.h | 3 +- js/src/frontend/SyntaxParseHandler.h | 3 +- js/src/frontend/TokenStream.cpp | 3 +- js/src/frontend/TokenStream.h | 4 +- js/src/gc/Barrier-inl.h | 3 +- js/src/gc/Barrier.h | 3 +- js/src/gc/FindSCCs-inl.h | 8 ++-- js/src/gc/FindSCCs.h | 8 ++-- js/src/gc/GCInternals.h | 3 +- js/src/gc/Heap.h | 8 ++-- js/src/gc/Iteration.cpp | 3 +- js/src/gc/Marking.cpp | 9 ++-- js/src/gc/Marking.h | 11 +++-- js/src/gc/Memory.cpp | 7 ++- js/src/gc/Memory.h | 7 ++- js/src/gc/RootMarking.cpp | 3 +- js/src/gc/Statistics.cpp | 3 +- js/src/gc/Statistics.h | 3 +- js/src/gc/StoreBuffer.cpp | 9 ++-- js/src/gc/StoreBuffer.h | 7 ++- js/src/gc/Verifier.cpp | 3 +- js/src/gc/Zone.cpp | 3 +- js/src/gc/Zone.h | 5 +-- js/src/gdb/gdb-tests.h | 2 +- js/src/ion/AliasAnalysis.cpp | 5 +-- js/src/ion/AliasAnalysis.h | 5 +-- js/src/ion/AsmJS.cpp | 5 +-- js/src/ion/AsmJS.h | 5 +-- js/src/ion/AsmJSLink.cpp | 5 +-- js/src/ion/AsmJSModule.h | 5 +-- js/src/ion/AsmJSSignalHandlers.cpp | 5 +-- js/src/ion/BacktrackingAllocator.cpp | 5 +-- js/src/ion/BacktrackingAllocator.h | 5 +-- js/src/ion/Bailouts.cpp | 5 +-- js/src/ion/Bailouts.h | 5 +-- js/src/ion/BaselineBailouts.cpp | 5 +-- js/src/ion/BaselineCompiler.cpp | 5 +-- js/src/ion/BaselineCompiler.h | 5 +-- js/src/ion/BaselineFrame-inl.h | 5 +-- js/src/ion/BaselineFrame.cpp | 5 +-- js/src/ion/BaselineFrame.h | 5 +-- js/src/ion/BaselineFrameInfo.cpp | 5 +-- js/src/ion/BaselineFrameInfo.h | 5 +-- js/src/ion/BaselineHelpers.h | 5 +-- js/src/ion/BaselineIC.cpp | 5 +-- js/src/ion/BaselineIC.h | 5 +-- js/src/ion/BaselineInspector.cpp | 5 +-- js/src/ion/BaselineInspector.h | 5 +-- js/src/ion/BaselineJIT.cpp | 5 +-- js/src/ion/BaselineJIT.h | 5 +-- js/src/ion/BaselineRegisters.h | 5 +-- js/src/ion/BitSet.cpp | 5 +-- js/src/ion/BitSet.h | 5 +-- js/src/ion/C1Spewer.cpp | 5 +-- js/src/ion/C1Spewer.h | 5 +-- js/src/ion/CodeGenerator.cpp | 5 +-- js/src/ion/CodeGenerator.h | 5 +-- js/src/ion/CompactBuffer.h | 5 +-- js/src/ion/CompileInfo-inl.h | 5 +-- js/src/ion/CompileInfo.h | 5 +-- js/src/ion/CompilerRoot.h | 5 +-- js/src/ion/EdgeCaseAnalysis.cpp | 5 +-- js/src/ion/EdgeCaseAnalysis.h | 5 +-- js/src/ion/EffectiveAddressAnalysis.cpp | 5 +-- js/src/ion/EffectiveAddressAnalysis.h | 5 +-- js/src/ion/ExecutionModeInlines.h | 5 +-- js/src/ion/FixedArityList.h | 5 +-- js/src/ion/FixedList.h | 5 +-- js/src/ion/InlineList.h | 5 +-- js/src/ion/Ion.cpp | 5 +-- js/src/ion/Ion.h | 5 +-- js/src/ion/IonAllocPolicy.h | 5 +-- js/src/ion/IonAnalysis.cpp | 5 +-- js/src/ion/IonAnalysis.h | 5 +-- js/src/ion/IonBuilder.cpp | 5 +-- js/src/ion/IonBuilder.h | 5 +-- js/src/ion/IonCaches.cpp | 5 +-- js/src/ion/IonCaches.h | 5 +-- js/src/ion/IonCode.h | 5 +-- js/src/ion/IonCompartment.h | 5 +-- js/src/ion/IonFrameIterator-inl.h | 5 +-- js/src/ion/IonFrameIterator.h | 5 +-- js/src/ion/IonFrames-inl.h | 5 +-- js/src/ion/IonFrames.cpp | 5 +-- js/src/ion/IonFrames.h | 5 +-- js/src/ion/IonInstrumentation.h | 5 +-- js/src/ion/IonLinker.h | 5 +-- js/src/ion/IonMacroAssembler.cpp | 5 +-- js/src/ion/IonMacroAssembler.h | 5 +-- js/src/ion/IonSpewer.cpp | 5 +-- js/src/ion/IonSpewer.h | 5 +-- js/src/ion/IonTypes.h | 5 +-- js/src/ion/JSONSpewer.cpp | 5 +-- js/src/ion/JSONSpewer.h | 5 +-- js/src/ion/LICM.cpp | 5 +-- js/src/ion/LICM.h | 5 +-- js/src/ion/LIR-Common.h | 5 +-- js/src/ion/LIR-inl.h | 5 +-- js/src/ion/LIR.cpp | 5 +-- js/src/ion/LIR.h | 5 +-- js/src/ion/LOpcodes.h | 5 +-- js/src/ion/LinearScan.cpp | 5 +-- js/src/ion/LinearScan.h | 5 +-- js/src/ion/LiveRangeAllocator.cpp | 5 +-- js/src/ion/LiveRangeAllocator.h | 5 +-- js/src/ion/Lowering.cpp | 5 +-- js/src/ion/Lowering.h | 5 +-- js/src/ion/MCallOptimize.cpp | 5 +-- js/src/ion/MIR.cpp | 5 +-- js/src/ion/MIR.h | 5 +-- js/src/ion/MIRGenerator.h | 5 +-- js/src/ion/MIRGraph.cpp | 5 +-- js/src/ion/MIRGraph.h | 5 +-- js/src/ion/MOpcodes.h | 5 +-- js/src/ion/MoveEmitter.h | 5 +-- js/src/ion/MoveResolver.cpp | 5 +-- js/src/ion/MoveResolver.h | 5 +-- js/src/ion/ParallelArrayAnalysis.cpp | 5 +-- js/src/ion/ParallelArrayAnalysis.h | 5 +-- js/src/ion/ParallelFunctions.cpp | 5 +-- js/src/ion/ParallelFunctions.h | 5 +-- js/src/ion/PcScriptCache-inl.h | 5 +-- js/src/ion/PcScriptCache.h | 5 +-- js/src/ion/RangeAnalysis.cpp | 5 +-- js/src/ion/RangeAnalysis.h | 5 +-- js/src/ion/RegisterAllocator.cpp | 5 +-- js/src/ion/RegisterAllocator.h | 5 +-- js/src/ion/RegisterSets.h | 5 +-- js/src/ion/Registers.h | 5 +-- js/src/ion/Safepoints.cpp | 5 +-- js/src/ion/Safepoints.h | 5 +-- js/src/ion/SnapshotReader.h | 5 +-- js/src/ion/SnapshotWriter.h | 5 +-- js/src/ion/Snapshots.cpp | 5 +-- js/src/ion/StackSlotAllocator.h | 5 +-- js/src/ion/StupidAllocator.cpp | 5 +-- js/src/ion/StupidAllocator.h | 5 +-- js/src/ion/TypeOracle.cpp | 5 +-- js/src/ion/TypeOracle.h | 5 +-- js/src/ion/TypePolicy.cpp | 5 +-- js/src/ion/TypePolicy.h | 5 +-- js/src/ion/UnreachableCodeElimination.cpp | 5 +-- js/src/ion/UnreachableCodeElimination.h | 5 +-- js/src/ion/VMFunctions.cpp | 5 +-- js/src/ion/VMFunctions.h | 5 +-- js/src/ion/ValueNumbering.cpp | 5 +-- js/src/ion/ValueNumbering.h | 5 +-- js/src/ion/arm/Architecture-arm.cpp | 6 +-- js/src/ion/arm/Architecture-arm.h | 5 +-- js/src/ion/arm/Assembler-arm.cpp | 5 +-- js/src/ion/arm/Assembler-arm.h | 5 +-- js/src/ion/arm/Bailouts-arm.cpp | 5 +-- js/src/ion/arm/BaselineCompiler-arm.cpp | 5 +-- js/src/ion/arm/BaselineCompiler-arm.h | 5 +-- js/src/ion/arm/BaselineHelpers-arm.h | 5 +-- js/src/ion/arm/BaselineIC-arm.cpp | 5 +-- js/src/ion/arm/BaselineRegisters-arm.h | 5 +-- js/src/ion/arm/CodeGenerator-arm.cpp | 5 +-- js/src/ion/arm/CodeGenerator-arm.h | 5 +-- js/src/ion/arm/IonFrames-arm.cpp | 5 +-- js/src/ion/arm/IonFrames-arm.h | 5 +-- js/src/ion/arm/LIR-arm.h | 5 +-- js/src/ion/arm/LOpcodes-arm.h | 5 +-- js/src/ion/arm/Lowering-arm.cpp | 5 +-- js/src/ion/arm/Lowering-arm.h | 5 +-- js/src/ion/arm/MacroAssembler-arm.cpp | 5 +-- js/src/ion/arm/MacroAssembler-arm.h | 5 +-- js/src/ion/arm/MoveEmitter-arm.cpp | 5 +-- js/src/ion/arm/MoveEmitter-arm.h | 5 +-- js/src/ion/arm/Trampoline-arm.cpp | 5 +-- js/src/ion/shared/Assembler-shared.h | 5 +-- js/src/ion/shared/Assembler-x86-shared.cpp | 5 +-- js/src/ion/shared/Assembler-x86-shared.h | 5 +-- js/src/ion/shared/BaselineCompiler-shared.cpp | 5 +-- js/src/ion/shared/BaselineCompiler-shared.h | 5 +-- .../shared/BaselineCompiler-x86-shared.cpp | 5 +-- .../ion/shared/BaselineCompiler-x86-shared.h | 5 +-- js/src/ion/shared/BaselineIC-x86-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-shared-inl.h | 5 +-- js/src/ion/shared/CodeGenerator-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-shared.h | 5 +-- .../ion/shared/CodeGenerator-x86-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-x86-shared.h | 5 +-- js/src/ion/shared/IonAssemblerBuffer.h | 5 +-- .../IonAssemblerBufferWithConstantPools.h | 5 +-- js/src/ion/shared/IonFrames-shared.h | 44 +++---------------- js/src/ion/shared/IonFrames-x86-shared.cpp | 5 +-- js/src/ion/shared/IonFrames-x86-shared.h | 5 +-- js/src/ion/shared/LIR-x86-shared.h | 5 +-- js/src/ion/shared/Lowering-shared-inl.h | 5 +-- js/src/ion/shared/Lowering-shared.cpp | 5 +-- js/src/ion/shared/Lowering-shared.h | 5 +-- js/src/ion/shared/Lowering-x86-shared.cpp | 5 +-- js/src/ion/shared/Lowering-x86-shared.h | 5 +-- js/src/ion/shared/MacroAssembler-x86-shared.h | 5 +-- js/src/ion/shared/MoveEmitter-x86-shared.cpp | 5 +-- js/src/ion/shared/MoveEmitter-x86-shared.h | 5 +-- js/src/ion/x64/Architecture-x64.h | 5 +-- js/src/ion/x64/Assembler-x64.cpp | 5 +-- js/src/ion/x64/Assembler-x64.h | 5 +-- js/src/ion/x64/Bailouts-x64.cpp | 5 +-- js/src/ion/x64/BaselineCompiler-x64.cpp | 5 +-- js/src/ion/x64/BaselineCompiler-x64.h | 5 +-- js/src/ion/x64/BaselineHelpers-x64.h | 5 +-- js/src/ion/x64/BaselineIC-x64.cpp | 5 +-- js/src/ion/x64/BaselineRegisters-x64.h | 5 +-- js/src/ion/x64/CodeGenerator-x64.cpp | 5 +-- js/src/ion/x64/CodeGenerator-x64.h | 5 +-- js/src/ion/x64/LIR-x64.h | 5 +-- js/src/ion/x64/LOpcodes-x64.h | 5 +-- js/src/ion/x64/Lowering-x64.cpp | 5 +-- js/src/ion/x64/Lowering-x64.h | 5 +-- js/src/ion/x64/MacroAssembler-x64.cpp | 5 +-- js/src/ion/x64/MacroAssembler-x64.h | 5 +-- js/src/ion/x64/Trampoline-x64.cpp | 5 +-- js/src/ion/x86/Architecture-x86.h | 5 +-- js/src/ion/x86/Assembler-x86.cpp | 5 +-- js/src/ion/x86/Assembler-x86.h | 5 +-- js/src/ion/x86/Bailouts-x86.cpp | 5 +-- js/src/ion/x86/BaselineCompiler-x86.cpp | 5 +-- js/src/ion/x86/BaselineCompiler-x86.h | 5 +-- js/src/ion/x86/BaselineHelpers-x86.h | 5 +-- js/src/ion/x86/BaselineIC-x86.cpp | 5 +-- js/src/ion/x86/BaselineRegisters-x86.h | 5 +-- js/src/ion/x86/CodeGenerator-x86.cpp | 5 +-- js/src/ion/x86/CodeGenerator-x86.h | 5 +-- js/src/ion/x86/LIR-x86.h | 5 +-- js/src/ion/x86/LOpcodes-x86.h | 5 +-- js/src/ion/x86/Lowering-x86.cpp | 5 +-- js/src/ion/x86/Lowering-x86.h | 5 +-- js/src/ion/x86/MacroAssembler-x86.cpp | 5 +-- js/src/ion/x86/MacroAssembler-x86.h | 5 +-- js/src/ion/x86/Trampoline-x86.cpp | 5 +-- .../jit-test/tests/auto-regress/bug557946.js | 2 +- .../jit-test/tests/auto-regress/bug558618.js | 2 +- js/src/jit-test/tests/basic/bug535760.js | 2 +- js/src/jit-test/tests/basic/bug541191-1.js | 2 +- js/src/jit-test/tests/basic/bug541191-2.js | 2 +- js/src/jit-test/tests/basic/bug541191-3.js | 2 +- js/src/jit-test/tests/basic/bug541191-4.js | 2 +- js/src/jit-test/tests/basic/bug541191-5.js | 2 +- js/src/jit-test/tests/basic/bug592927.js | 2 +- js/src/jit-test/tests/basic/bug602088.js | 2 +- js/src/jit-test/tests/basic/bug606083.js | 2 +- js/src/jit-test/tests/basic/bug616762.js | 2 +- js/src/jit-test/tests/basic/bug633409-1.js | 2 +- js/src/jit-test/tests/basic/bug633409-2.js | 2 +- js/src/jit-test/tests/ion/bug674664-3.js | 2 +- js/src/jit-test/tests/ion/bug684362.js | 2 +- js/src/jit-test/tests/ion/bug747271.js | 2 +- js/src/jit-test/tests/ion/bug750588.js | 2 +- js/src/jit-test/tests/ion/bug772901.js | 2 +- js/src/jit-test/tests/ion/testPos.js | 2 +- js/src/jit-test/tests/ion/testSubtract.js | 2 +- js/src/jit-test/tests/ion/testVAndBranch.js | 2 +- js/src/jit-test/tests/ion/truncateToInt32.js | 2 +- js/src/jit-test/tests/ion/valueToInt32.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-1.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-3.js | 2 +- js/src/jit-test/tests/jaeger/bug597378.js | 2 +- js/src/jit-test/tests/jaeger/bug600139.js | 2 +- js/src/jit-test/tests/jaeger/bug600424.js | 2 +- js/src/jit-test/tests/jaeger/bug601982.js | 2 +- js/src/jit-test/tests/jaeger/bug604381.js | 2 +- js/src/jit-test/tests/jaeger/bug616508.js | 2 +- js/src/jit-test/tests/jaeger/bug625438.js | 2 +- js/src/jit-test/tests/jaeger/bug627486.js | 2 +- .../jit-test/tests/jaeger/floatTypedArrays.js | 2 +- .../tests/jaeger/normalIntTypedArrays.js | 2 +- .../tests/jaeger/smallIntTypedArrays.js | 2 +- .../tests/jaeger/testCallElemAfterGC.js | 2 +- .../tests/jaeger/testDenseCallElem.js | 2 +- js/src/jit-test/tests/jaeger/testForOps.js | 2 +- .../jit-test/tests/jaeger/testPropCallElem.js | 2 +- .../tests/jaeger/testPropCallElem2.js | 2 +- .../jit-test/tests/jaeger/testSetElem-Easy.js | 2 +- .../tests/jaeger/testSetElem-Indexed.js | 2 +- .../tests/jaeger/testSetElem-NewProto.js | 2 +- .../tests/jaeger/testSetTypedFloatArray.js | 2 +- .../tests/jaeger/testSetTypedIntArray.js | 2 +- .../tests/jaeger/testShiftSameBacking.js | 2 +- js/src/jsalloc.cpp | 5 +-- js/src/jsalloc.h | 5 +-- js/src/jsanalyze.cpp | 6 +-- js/src/jsanalyze.h | 6 +-- js/src/jsapi-tests/selfTest.cpp | 2 +- .../jsapi-tests/testAddPropertyPropcache.cpp | 2 +- js/src/jsapi-tests/testArgumentsObject.cpp | 2 +- js/src/jsapi-tests/testArrayBuffer.cpp | 2 +- js/src/jsapi-tests/testBug604087.cpp | 2 +- js/src/jsapi-tests/testClassGetter.cpp | 2 +- js/src/jsapi-tests/testCloneScript.cpp | 2 +- js/src/jsapi-tests/testContexts.cpp | 6 +-- js/src/jsapi-tests/testDebugger.cpp | 2 +- js/src/jsapi-tests/testDeepFreeze.cpp | 2 +- .../testDefineGetterSetterNonEnumerable.cpp | 2 +- js/src/jsapi-tests/testDefineProperty.cpp | 2 +- js/src/jsapi-tests/testEnclosingFunction.cpp | 2 +- js/src/jsapi-tests/testErrorCopying.cpp | 2 +- js/src/jsapi-tests/testFindSCCs.cpp | 2 +- js/src/jsapi-tests/testFunctionProperties.cpp | 2 +- js/src/jsapi-tests/testGCOutOfMemory.cpp | 2 +- js/src/jsapi-tests/testGetPropertyDefault.cpp | 2 +- js/src/jsapi-tests/testIndexToString.cpp | 2 +- js/src/jsapi-tests/testIntString.cpp | 2 +- js/src/jsapi-tests/testJSEvaluateScript.cpp | 2 +- js/src/jsapi-tests/testLookup.cpp | 2 +- js/src/jsapi-tests/testNewObject.cpp | 2 +- js/src/jsapi-tests/testOps.cpp | 2 +- js/src/jsapi-tests/testParseJSON.cpp | 2 +- js/src/jsapi-tests/testProfileStrings.cpp | 2 +- js/src/jsapi-tests/testPropCache.cpp | 2 +- .../testRegExpInstanceProperties.cpp | 2 +- js/src/jsapi-tests/testResolveRecursion.cpp | 2 +- js/src/jsapi-tests/testSameValue.cpp | 2 +- js/src/jsapi-tests/testScriptInfo.cpp | 2 +- js/src/jsapi-tests/testScriptObject.cpp | 2 +- js/src/jsapi-tests/testSetProperty.cpp | 2 +- js/src/jsapi-tests/testStringBuffer.cpp | 2 +- js/src/jsapi-tests/testTrap.cpp | 2 +- js/src/jsapi-tests/testTypedArrays.cpp | 2 +- js/src/jsapi-tests/testUTF8.cpp | 2 +- js/src/jsapi-tests/testXDR.cpp | 2 +- js/src/jsapi-tests/tests.cpp | 3 +- js/src/jsapi-tests/tests.h | 3 +- js/src/jsapi-tests/valueABI.c | 3 +- js/src/jsapi.cpp | 5 +-- js/src/jsapi.h | 3 +- js/src/jsarray.cpp | 3 +- js/src/jsarray.h | 2 +- js/src/jsatom.cpp | 2 +- js/src/jsatom.h | 2 +- js/src/jsatominlines.h | 4 +- js/src/jsbool.cpp | 2 +- js/src/jsbool.h | 4 +- js/src/jsboolinlines.h | 4 +- js/src/jsclass.h | 5 +-- js/src/jsclist.h | 5 ++- js/src/jsclone.cpp | 1 + js/src/jsclone.h | 1 + js/src/jscntxt.cpp | 5 +-- js/src/jscntxt.h | 3 +- js/src/jscntxtinlines.h | 5 +-- js/src/jscompartment.cpp | 5 +-- js/src/jscompartment.h | 5 +-- js/src/jscompartmentinlines.h | 5 +-- js/src/jscpucfg.h | 4 +- js/src/jscrashformat.h | 5 +-- js/src/jscrashreport.cpp | 5 +-- js/src/jscrashreport.h | 5 +-- js/src/jsdate.cpp | 3 +- js/src/jsdate.h | 4 +- js/src/jsdbgapi.cpp | 3 +- js/src/jsdbgapi.h | 3 +- js/src/jsdhash.cpp | 5 ++- js/src/jsdhash.h | 5 ++- js/src/jsdtoa.cpp | 2 +- js/src/jsdtoa.h | 4 +- js/src/jsexn.cpp | 3 +- js/src/jsexn.h | 4 +- js/src/jsfriendapi.cpp | 5 +-- js/src/jsfriendapi.h | 2 +- js/src/jsfun.cpp | 5 +-- js/src/jsfun.h | 4 +- js/src/jsfuninlines.h | 5 +-- js/src/jsgc.cpp | 3 +- js/src/jsgc.h | 2 +- js/src/jsgcinlines.h | 2 +- js/src/jsinfer.cpp | 6 +-- js/src/jsinfer.h | 6 +-- js/src/jsinferinlines.h | 6 +-- js/src/jsinterp.cpp | 5 +-- js/src/jsinterp.h | 5 +-- js/src/jsinterpinlines.h | 5 +-- js/src/jsiter.cpp | 3 +- js/src/jsiter.h | 3 +- js/src/jskwgen.cpp | 3 +- js/src/jslibmath.h | 5 +-- js/src/jslock.h | 3 +- js/src/jslog2.cpp | 5 ++- js/src/jsmath.cpp | 5 +-- js/src/jsmath.h | 4 +- js/src/jsmemorymetrics.cpp | 5 +-- js/src/jsnativestack.cpp | 5 +-- js/src/jsnativestack.h | 5 +-- js/src/jsnum.cpp | 2 +- js/src/jsnum.h | 4 +- js/src/jsnuminlines.h | 4 +- js/src/jsobj.cpp | 3 +- js/src/jsobj.h | 3 +- js/src/jsobjinlines.h | 3 +- js/src/json.cpp | 3 +- js/src/json.h | 4 +- js/src/jsonparser.cpp | 3 +- js/src/jsonparser.h | 3 +- js/src/jsopcode.cpp | 5 +-- js/src/jsopcode.h | 4 +- js/src/jsopcodeinlines.h | 4 +- js/src/jsoplengen.cpp | 3 +- js/src/jsprf.cpp | 5 ++- js/src/jsprf.h | 5 ++- js/src/jsprobes.cpp | 3 +- js/src/jsprobes.h | 5 +-- js/src/jspropertycache.cpp | 5 +-- js/src/jspropertycache.h | 3 +- js/src/jspropertycacheinlines.h | 3 +- js/src/jspropertytree.cpp | 6 +-- js/src/jspropertytree.h | 6 +-- js/src/jsprototypes.h | 5 +-- js/src/jsproxy.cpp | 9 ++-- js/src/jsproxy.h | 5 +-- js/src/jsprvtd.h | 2 +- js/src/jspubtd.h | 2 +- js/src/jsreflect.cpp | 5 +-- js/src/jsreflect.h | 5 +-- js/src/jsscript.cpp | 3 +- js/src/jsscript.h | 3 +- js/src/jsscriptinlines.h | 3 +- js/src/jsstr.cpp | 5 +-- js/src/jsstr.h | 5 +-- js/src/jsstrinlines.h | 4 +- js/src/jstypedarray.cpp | 6 +-- js/src/jstypedarray.h | 6 +-- js/src/jstypedarrayinlines.h | 6 +-- js/src/jstypes.h | 5 ++- js/src/jsutil.cpp | 4 +- js/src/jsutil.h | 4 +- js/src/jsversion.h | 4 +- js/src/jswatchpoint.cpp | 2 +- js/src/jswatchpoint.h | 2 +- js/src/jsweakcache.h | 5 +-- js/src/jsweakmap.cpp | 5 +-- js/src/jsweakmap.h | 5 +-- js/src/jswin.h | 4 +- js/src/jsworkers.cpp | 6 +-- js/src/jsworkers.h | 6 +-- js/src/jswrapper.cpp | 5 +-- js/src/jswrapper.h | 5 +-- js/src/methodjit/BaseAssembler.h | 5 +-- js/src/methodjit/BaseCompiler.h | 5 +-- js/src/methodjit/CodeGenIncludes.h | 5 +-- js/src/methodjit/Compiler.cpp | 5 +-- js/src/methodjit/Compiler.h | 5 +-- js/src/methodjit/FastArithmetic.cpp | 5 +-- js/src/methodjit/FastBuiltins.cpp | 5 +-- js/src/methodjit/FastOps.cpp | 5 +-- js/src/methodjit/FrameEntry.h | 5 +-- js/src/methodjit/FrameState-inl.h | 5 +-- js/src/methodjit/FrameState.cpp | 5 +-- js/src/methodjit/FrameState.h | 5 +-- js/src/methodjit/ICChecker.h | 5 +-- js/src/methodjit/ICLabels.h | 5 +-- js/src/methodjit/ICRepatcher.h | 5 +-- js/src/methodjit/ImmutableSync.cpp | 5 +-- js/src/methodjit/ImmutableSync.h | 5 +-- js/src/methodjit/InlineFrameAssembler.h | 5 +-- js/src/methodjit/InvokeHelpers.cpp | 5 +-- js/src/methodjit/Logging.cpp | 5 +-- js/src/methodjit/Logging.h | 5 +-- js/src/methodjit/LoopState.cpp | 5 +-- js/src/methodjit/LoopState.h | 5 +-- js/src/methodjit/MachineRegs.h | 5 +-- js/src/methodjit/MethodJIT.cpp | 5 +-- js/src/methodjit/MethodJIT.h | 5 +-- js/src/methodjit/MonoIC.cpp | 5 +-- js/src/methodjit/MonoIC.h | 5 +-- js/src/methodjit/NunboxAssembler.h | 5 +-- js/src/methodjit/PolyIC.cpp | 5 +-- js/src/methodjit/PolyIC.h | 5 +-- js/src/methodjit/PunboxAssembler.h | 5 +-- js/src/methodjit/RematInfo.h | 5 +-- js/src/methodjit/Retcon.cpp | 5 +-- js/src/methodjit/Retcon.h | 5 +-- js/src/methodjit/StubCalls-inl.h | 5 +-- js/src/methodjit/StubCalls.cpp | 5 +-- js/src/methodjit/StubCalls.h | 5 +-- js/src/methodjit/StubCompiler.cpp | 5 +-- js/src/methodjit/StubCompiler.h | 5 +-- js/src/methodjit/TrampolineCompiler.cpp | 5 +-- js/src/methodjit/TrampolineCompiler.h | 5 +-- js/src/methodjit/TrampolineMIPS.cpp | 5 +-- js/src/methodjit/TypedArrayIC.h | 5 +-- js/src/perf/jsperf.cpp | 2 +- js/src/perf/jsperf.h | 2 +- js/src/perf/pm_linux.cpp | 2 +- js/src/perf/pm_stub.cpp | 2 +- js/src/prmjtime.cpp | 2 +- js/src/prmjtime.h | 4 +- js/src/shell/js.cpp | 3 +- js/src/shell/jsheaptools.cpp | 3 +- js/src/shell/jsheaptools.h | 3 +- js/src/shell/jsoptparse.cpp | 3 +- js/src/shell/jsoptparse.h | 3 +- .../ecma_2/Exceptions/exception-010-n.js | 1 - .../ecma_2/Exceptions/exception-011-n.js | 1 - .../ecma_2/FunctionObjects/apply-001-n.js | 1 - .../tests/ecma_3/Exceptions/regress-58946.js | 1 - .../tests/ecma_3/ExecutionContexts/10.1.3.js | 1 - .../ecma_3/ExecutionContexts/10.1.4-1.js | 1 - .../ecma_3/ExecutionContexts/regress-23346.js | 1 - js/src/tests/ecma_3/FunExpr/fe-001-n.js | 1 - js/src/tests/ecma_3/FunExpr/fe-001.js | 1 - js/src/tests/ecma_3/FunExpr/fe-002.js | 1 - .../ecma_3/NumberFormatting/tostring-001.js | 1 - js/src/tests/ecma_3/RegExp/regress-24712.js | 1 - js/src/tests/ecma_3/RegExp/regress-28686.js | 1 - js/src/tests/ecma_3/Unicode/uc-001-n.js | 1 - js/src/tests/ecma_3/Unicode/uc-001.js | 1 - js/src/tests/ecma_3/Unicode/uc-002-n.js | 1 - js/src/tests/ecma_3/Unicode/uc-002.js | 1 - js/src/tests/ecma_3/Unicode/uc-003.js | 1 - js/src/tests/ecma_3/Unicode/uc-004.js | 1 - .../js1_5/Exceptions/catchguard-002-n.js | 1 - .../js1_5/Exceptions/catchguard-003-n.js | 1 - js/src/tests/js1_5/GetSet/getset-002.js | 1 - .../js1_5/extensions/catchguard-001-n.js | 1 - .../tests/js1_5/extensions/catchguard-001.js | 1 - .../tests/js1_5/extensions/catchguard-002.js | 1 - .../tests/js1_5/extensions/catchguard-003.js | 1 - js/src/tests/js1_5/extensions/getset-001.js | 1 - .../tests/js1_5/extensions/regress-50447-1.js | 2 +- .../tests/js1_5/extensions/regress-50447.js | 1 - js/src/tests/js1_6/shell.js | 1 - js/src/tests/js1_7/shell.js | 1 - js/src/tests/js1_8/shell.js | 1 - js/src/tests/js1_8_1/shell.js | 1 - js/src/tests/shell.js | 1 - js/src/vm/ArgumentsObject-inl.h | 3 +- js/src/vm/ArgumentsObject.cpp | 3 +- js/src/vm/ArgumentsObject.h | 3 +- js/src/vm/BooleanObject-inl.h | 3 +- js/src/vm/BooleanObject.h | 3 +- js/src/vm/CharacterEncoding.cpp | 3 +- js/src/vm/CommonPropertyNames.h | 5 +-- js/src/vm/DateTime.cpp | 6 +-- js/src/vm/DateTime.h | 6 +-- js/src/vm/Debugger.cpp | 5 +-- js/src/vm/Debugger.h | 5 +-- js/src/vm/ForkJoin.cpp | 3 +- js/src/vm/ForkJoin.h | 3 +- js/src/vm/GlobalObject-inl.h | 3 +- js/src/vm/GlobalObject.cpp | 3 +- js/src/vm/GlobalObject.h | 3 +- js/src/vm/Keywords.h | 5 +-- js/src/vm/MatchPairs.h | 5 +-- js/src/vm/Monitor.cpp | 3 +- js/src/vm/Monitor.h | 3 +- js/src/vm/NumberObject-inl.h | 3 +- js/src/vm/NumberObject.h | 3 +- js/src/vm/NumericConversions.h | 7 ++- js/src/vm/ObjectImpl-inl.h | 7 ++- js/src/vm/ObjectImpl.cpp | 7 ++- js/src/vm/ObjectImpl.h | 7 ++- js/src/vm/ParallelDo.cpp | 5 +-- js/src/vm/ParallelDo.h | 5 +-- js/src/vm/PropertyKey.cpp | 2 +- js/src/vm/RegExpObject-inl.h | 5 +-- js/src/vm/RegExpObject.cpp | 5 +-- js/src/vm/RegExpObject.h | 5 +-- js/src/vm/RegExpStatics-inl.h | 5 +-- js/src/vm/RegExpStatics.cpp | 5 +-- js/src/vm/RegExpStatics.h | 5 +-- js/src/vm/SPSProfiler.cpp | 5 +-- js/src/vm/SPSProfiler.h | 5 +-- js/src/vm/ScopeObject-inl.h | 3 +- js/src/vm/ScopeObject.cpp | 5 +-- js/src/vm/ScopeObject.h | 3 +- js/src/vm/SelfHosting.cpp | 5 +-- js/src/vm/Shape-inl.h | 5 ++- js/src/vm/Shape.cpp | 3 +- js/src/vm/Shape.h | 5 +-- js/src/vm/Stack-inl.h | 5 +-- js/src/vm/Stack.cpp | 5 +-- js/src/vm/Stack.h | 5 +-- js/src/vm/String-inl.h | 5 +-- js/src/vm/String.cpp | 5 +-- js/src/vm/String.h | 5 +-- js/src/vm/StringBuffer.cpp | 6 +-- js/src/vm/StringBuffer.h | 6 +-- js/src/vm/StringObject-inl.h | 3 +- js/src/vm/StringObject.h | 3 +- js/src/vm/ThreadPool.cpp | 6 +-- js/src/vm/ThreadPool.h | 3 +- js/src/vm/Unicode.h | 4 +- js/src/vm/Xdr.cpp | 2 +- js/src/vm/Xdr.h | 3 +- js/src/yarr/ASCIICType.h | 4 +- js/src/yarr/BumpPointerAllocator.h | 4 +- js/src/yarr/CheckedArithmetic.h | 3 +- js/src/yarr/MatchResult.h | 4 +- js/src/yarr/OSAllocator.h | 4 +- js/src/yarr/OSAllocatorOS2.cpp | 4 +- js/src/yarr/OSAllocatorPosix.cpp | 4 +- js/src/yarr/OSAllocatorWin.cpp | 4 +- js/src/yarr/PageAllocation.h | 4 +- js/src/yarr/PageBlock.cpp | 4 +- js/src/yarr/PageBlock.h | 4 +- js/src/yarr/VMTags.h | 4 +- js/src/yarr/Yarr.h | 4 +- js/src/yarr/YarrCanonicalizeUCS2.cpp | 4 +- js/src/yarr/YarrCanonicalizeUCS2.h | 4 +- js/src/yarr/YarrInterpreter.cpp | 4 +- js/src/yarr/YarrInterpreter.h | 4 +- js/src/yarr/YarrJIT.cpp | 3 +- js/src/yarr/YarrJIT.h | 3 +- js/src/yarr/YarrParser.h | 3 +- js/src/yarr/YarrPattern.cpp | 3 +- js/src/yarr/YarrPattern.h | 3 +- js/src/yarr/YarrSyntaxChecker.cpp | 4 +- js/src/yarr/YarrSyntaxChecker.h | 4 +- js/src/yarr/wtfbridge.h | 6 +-- 733 files changed, 1279 insertions(+), 1724 deletions(-) diff --git a/js/ipc/CPOWTypes.h b/js/ipc/CPOWTypes.h index 46195f9ee72d..56d84cd3f717 100644 --- a/js/ipc/CPOWTypes.h +++ b/js/ipc/CPOWTypes.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ContextWrapperChild.h b/js/ipc/ContextWrapperChild.h index ec42b78ba6d7..b6d1c9505c17 100644 --- a/js/ipc/ContextWrapperChild.h +++ b/js/ipc/ContextWrapperChild.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ContextWrapperParent.h b/js/ipc/ContextWrapperParent.h index 01fca526411d..671521b36b2a 100644 --- a/js/ipc/ContextWrapperParent.h +++ b/js/ipc/ContextWrapperParent.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperChild.cpp b/js/ipc/ObjectWrapperChild.cpp index 7eb823a5440f..145d44d96f66 100644 --- a/js/ipc/ObjectWrapperChild.cpp +++ b/js/ipc/ObjectWrapperChild.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperChild.h b/js/ipc/ObjectWrapperChild.h index dff0afd2f9a9..f9a270cacce5 100644 --- a/js/ipc/ObjectWrapperChild.h +++ b/js/ipc/ObjectWrapperChild.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperParent.cpp b/js/ipc/ObjectWrapperParent.cpp index 61a607107328..f22d9eb0bdc4 100644 --- a/js/ipc/ObjectWrapperParent.cpp +++ b/js/ipc/ObjectWrapperParent.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperParent.h b/js/ipc/ObjectWrapperParent.h index 89b2e5139a70..785fc134250c 100644 --- a/js/ipc/ObjectWrapperParent.h +++ b/js/ipc/ObjectWrapperParent.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index c0043b986a74..a5dab01407a8 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_atom.cpp b/js/jsd/jsd_atom.cpp index 5517b997d644..dec6b391457a 100644 --- a/js/jsd/jsd_atom.cpp +++ b/js/jsd/jsd_atom.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_high.cpp b/js/jsd/jsd_high.cpp index 9ba321cd5e1f..9c0a3ec87497 100644 --- a/js/jsd/jsd_high.cpp +++ b/js/jsd/jsd_high.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_hook.cpp b/js/jsd/jsd_hook.cpp index 9f8fa947f082..95e631804472 100644 --- a/js/jsd/jsd_hook.cpp +++ b/js/jsd/jsd_hook.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_java.cpp b/js/jsd/jsd_java.cpp index 4bfcccde93ba..c5c0aec2aaf9 100644 --- a/js/jsd/jsd_java.cpp +++ b/js/jsd/jsd_java.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_lock.cpp b/js/jsd/jsd_lock.cpp index c8a827b8f941..628d2fd621e7 100644 --- a/js/jsd/jsd_lock.cpp +++ b/js/jsd/jsd_lock.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_lock.h b/js/jsd/jsd_lock.h index a3eb821be953..b1e8c31053bd 100644 --- a/js/jsd/jsd_lock.h +++ b/js/jsd/jsd_lock.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_obj.cpp b/js/jsd/jsd_obj.cpp index dc7c927cab99..cc0e8bb754bf 100644 --- a/js/jsd/jsd_obj.cpp +++ b/js/jsd/jsd_obj.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_scpt.cpp b/js/jsd/jsd_scpt.cpp index f4ef023d45ea..67c53f92791d 100644 --- a/js/jsd/jsd_scpt.cpp +++ b/js/jsd/jsd_scpt.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 8e5fbb384aa5..7dac8eb3befd 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_step.cpp b/js/jsd/jsd_step.cpp index 0396a5cb7318..da1886a2b03f 100644 --- a/js/jsd/jsd_step.cpp +++ b/js/jsd/jsd_step.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_text.cpp b/js/jsd/jsd_text.cpp index bc851a3def41..ab11e82eac8b 100644 --- a/js/jsd/jsd_text.cpp +++ b/js/jsd/jsd_text.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_val.cpp b/js/jsd/jsd_val.cpp index a8cad6d005a9..97385a98af32 100644 --- a/js/jsd/jsd_val.cpp +++ b/js/jsd/jsd_val.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index 8ce10b932552..ea1ef4b837dd 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsd_xpc.h b/js/jsd/jsd_xpc.h index da383e30f9d9..4dbfe7cab405 100644 --- a/js/jsd/jsd_xpc.h +++ b/js/jsd/jsd_xpc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsdebug.cpp b/js/jsd/jsdebug.cpp index 06954cead55f..7e893c69d149 100644 --- a/js/jsd/jsdebug.cpp +++ b/js/jsd/jsdebug.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index 0971ba121f17..a3a05eeb1f15 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsdstubs.cpp b/js/jsd/jsdstubs.cpp index 68cf75b79889..22420410251c 100644 --- a/js/jsd/jsdstubs.cpp +++ b/js/jsd/jsdstubs.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jshash.cpp b/js/jsd/jshash.cpp index 6ae4e549ea34..d4caf2ce833f 100644 --- a/js/jsd/jshash.cpp +++ b/js/jsd/jshash.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jshash.h b/js/jsd/jshash.h index 5c44b7ba964a..e21c7b786a04 100644 --- a/js/jsd/jshash.h +++ b/js/jsd/jshash.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/resource.h b/js/jsd/resource.h index d40e61ae13d1..69874fe0ff30 100644 --- a/js/jsd/resource.h +++ b/js/jsd/resource.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/public/Anchor.h b/js/public/Anchor.h index 166ada5cd28e..d0c2476cf726 100644 --- a/js/public/Anchor.h +++ b/js/public/Anchor.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h index 6ecc4273de8d..5b474f0ac3b3 100644 --- a/js/public/CallArgs.h +++ b/js/public/CallArgs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/CharacterEncoding.h b/js/public/CharacterEncoding.h index 36d8670a0821..63e5cc6650ca 100644 --- a/js/public/CharacterEncoding.h +++ b/js/public/CharacterEncoding.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index 1231ca97b9f9..80d8f8a426fb 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef js_gc_api_h___ #define js_gc_api_h___ diff --git a/js/public/HashTable.h b/js/public/HashTable.h index 5cc7ea4e8b9e..acd4e310ac79 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h index 47cb5602123d..cd50b7e1bbcb 100644 --- a/js/public/HeapAPI.h +++ b/js/public/HeapAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef js_heap_api_h___ #define js_heap_api_h___ diff --git a/js/public/LegacyIntTypes.h b/js/public/LegacyIntTypes.h index 30944efda61e..387a68b9e9d1 100644 --- a/js/public/LegacyIntTypes.h +++ b/js/public/LegacyIntTypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index f14dc73912cf..31262e8d4504 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/PropertyKey.h b/js/public/PropertyKey.h index 5d048195f51e..53158c26f30f 100644 --- a/js/public/PropertyKey.h +++ b/js/public/PropertyKey.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/RequiredDefines.h b/js/public/RequiredDefines.h index 8dc47e251c95..2be2efbf9a3b 100644 --- a/js/public/RequiredDefines.h +++ b/js/public/RequiredDefines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 9f9fa9df53f0..5d139292fe38 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/TemplateLib.h b/js/public/TemplateLib.h index 58966b166f9f..a4ff6829125f 100644 --- a/js/public/TemplateLib.h +++ b/js/public/TemplateLib.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Utility.h b/js/public/Utility.h index 70f09d6b22a9..2a883323ff63 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Value.h b/js/public/Value.h index a9a7bfd40005..57e951a1defd 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Vector.h b/js/public/Vector.h index b8e2ea698504..5f40dd634b8c 100644 --- a/js/public/Vector.h +++ b/js/public/Vector.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/TraceLogging.cpp b/js/src/TraceLogging.cpp index 49fe2d3e8ace..1c64a67fd68d 100644 --- a/js/src/TraceLogging.cpp +++ b/js/src/TraceLogging.cpp @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 sw=4 et tw=79: */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "TraceLogging.h" #include diff --git a/js/src/TraceLogging.h b/js/src/TraceLogging.h index eebadfc1e14d..2e6d5ba9ac38 100644 --- a/js/src/TraceLogging.h +++ b/js/src/TraceLogging.h @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 sw=4 et tw=79: */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #if !defined(TraceLogging_h__) #define TraceLogging_h__ diff --git a/js/src/assembler/assembler/ARMAssembler.cpp b/js/src/assembler/assembler/ARMAssembler.cpp index a9ada8e9a2c5..18f742b80b6a 100644 --- a/js/src/assembler/assembler/ARMAssembler.cpp +++ b/js/src/assembler/assembler/ARMAssembler.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/ARMAssembler.h b/js/src/assembler/assembler/ARMAssembler.h index e04b251b7439..2c1d712158d8 100644 --- a/js/src/assembler/assembler/ARMAssembler.h +++ b/js/src/assembler/assembler/ARMAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009, 2010 University of Szeged diff --git a/js/src/assembler/assembler/ARMv7Assembler.h b/js/src/assembler/assembler/ARMv7Assembler.h index 1f96585ee16c..1a83139887fd 100644 --- a/js/src/assembler/assembler/ARMv7Assembler.h +++ b/js/src/assembler/assembler/ARMv7Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AbstractMacroAssembler.h b/js/src/assembler/assembler/AbstractMacroAssembler.h index 286fad954742..2bfb275b6884 100644 --- a/js/src/assembler/assembler/AbstractMacroAssembler.h +++ b/js/src/assembler/assembler/AbstractMacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBuffer.h b/js/src/assembler/assembler/AssemblerBuffer.h index d21182527b52..a2e7c3840331 100644 --- a/js/src/assembler/assembler/AssemblerBuffer.h +++ b/js/src/assembler/assembler/AssemblerBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h index 467f9c9e8cbe..2578692dc47a 100644 --- a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h +++ b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/CodeLocation.h b/js/src/assembler/assembler/CodeLocation.h index 490157688614..d9bc6d4175fb 100644 --- a/js/src/assembler/assembler/CodeLocation.h +++ b/js/src/assembler/assembler/CodeLocation.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/LinkBuffer.h b/js/src/assembler/assembler/LinkBuffer.h index 35913c87aaf7..1e6fb4b35249 100644 --- a/js/src/assembler/assembler/LinkBuffer.h +++ b/js/src/assembler/assembler/LinkBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssembler.h b/js/src/assembler/assembler/MacroAssembler.h index 8bf9c0b0a80e..2b77445e14cf 100644 --- a/js/src/assembler/assembler/MacroAssembler.h +++ b/js/src/assembler/assembler/MacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerARM.cpp b/js/src/assembler/assembler/MacroAssemblerARM.cpp index 89db1e2d859e..9c76e8fd43e7 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.cpp +++ b/js/src/assembler/assembler/MacroAssemblerARM.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/MacroAssemblerARM.h b/js/src/assembler/assembler/MacroAssemblerARM.h index 831ccbb8a183..6e18c54b84dc 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.h +++ b/js/src/assembler/assembler/MacroAssemblerARM.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. diff --git a/js/src/assembler/assembler/MacroAssemblerARMv7.h b/js/src/assembler/assembler/MacroAssemblerARMv7.h index 2bdb6e8fdb5e..0abeb2b31de0 100644 --- a/js/src/assembler/assembler/MacroAssemblerARMv7.h +++ b/js/src/assembler/assembler/MacroAssemblerARMv7.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerCodeRef.h b/js/src/assembler/assembler/MacroAssemblerCodeRef.h index 101ffcb098d5..bcf3903f9b13 100644 --- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h +++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerSparc.h b/js/src/assembler/assembler/MacroAssemblerSparc.h index 1d89f17790e7..3692b3e0b272 100644 --- a/js/src/assembler/assembler/MacroAssemblerSparc.h +++ b/js/src/assembler/assembler/MacroAssemblerSparc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86.h b/js/src/assembler/assembler/MacroAssemblerX86.h index c6ab40f587fa..c782ad60d006 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86.h +++ b/js/src/assembler/assembler/MacroAssemblerX86.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp index b94a345ff649..e65b2a3d7c62 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.h b/js/src/assembler/assembler/MacroAssemblerX86Common.h index 30bb1ed26afc..b0bef29120c2 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.h +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86_64.h b/js/src/assembler/assembler/MacroAssemblerX86_64.h index c4b67dcaeb03..c3be4145695a 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86_64.h +++ b/js/src/assembler/assembler/MacroAssemblerX86_64.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/RepatchBuffer.h b/js/src/assembler/assembler/RepatchBuffer.h index 003479211b43..0a3deb3c27d2 100644 --- a/js/src/assembler/assembler/RepatchBuffer.h +++ b/js/src/assembler/assembler/RepatchBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/SparcAssembler.h b/js/src/assembler/assembler/SparcAssembler.h index 4e3d5b14559a..19217a7cafd0 100644 --- a/js/src/assembler/assembler/SparcAssembler.h +++ b/js/src/assembler/assembler/SparcAssembler.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/X86Assembler.h b/js/src/assembler/assembler/X86Assembler.h index 2293098864f3..1533bdfa95e9 100644 --- a/js/src/assembler/assembler/X86Assembler.h +++ b/js/src/assembler/assembler/X86Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/jit/ExecutableAllocator.cpp b/js/src/assembler/jit/ExecutableAllocator.cpp index 59e1c259b673..bd8b1d3ba24d 100644 --- a/js/src/assembler/jit/ExecutableAllocator.cpp +++ b/js/src/assembler/jit/ExecutableAllocator.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2008 Apple Inc. All rights reserved. * diff --git a/js/src/assembler/moco/MocoStubs.h b/js/src/assembler/moco/MocoStubs.h index 7ce6da5e329b..df3d1f979745 100644 --- a/js/src/assembler/moco/MocoStubs.h +++ b/js/src/assembler/moco/MocoStubs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index a29c89517709..a5c203d5b342 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Eval.h b/js/src/builtin/Eval.h index e6eaeefa5b04..133c4b28ebcb 100644 --- a/js/src/builtin/Eval.h +++ b/js/src/builtin/Eval.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp index 6e22cc76f358..8c6b0136af52 100644 --- a/js/src/builtin/Intl.cpp +++ b/js/src/builtin/Intl.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Intl.h b/js/src/builtin/Intl.h index 3db27dc63767..eefec5dbcaaa 100644 --- a/js/src/builtin/Intl.h +++ b/js/src/builtin/Intl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Iterator-inl.h b/js/src/builtin/Iterator-inl.h index 7f93219af814..e6c838cdeb98 100644 --- a/js/src/builtin/Iterator-inl.h +++ b/js/src/builtin/Iterator-inl.h @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef Iterator_inl_h_ #define Iterator_inl_h_ diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 08100842e2a9..fc3e21808d68 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index 3661c4cc498b..f8f006472dab 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Module.cpp b/js/src/builtin/Module.cpp index 2aaf96508585..1f33cd7470bf 100644 --- a/js/src/builtin/Module.cpp +++ b/js/src/builtin/Module.cpp @@ -1,3 +1,9 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsobjinlines.h" #include "builtin/Module.h" diff --git a/js/src/builtin/Module.h b/js/src/builtin/Module.h index 7a6386ebc434..f1bdef1ef1ba 100644 --- a/js/src/builtin/Module.h +++ b/js/src/builtin/Module.h @@ -1,3 +1,9 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + #ifndef Module_h___ #define Module_h___ diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 188911c74896..8171d873284b 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Object.h b/js/src/builtin/Object.h index a08fcdfb818e..c6a29225e957 100644 --- a/js/src/builtin/Object.h +++ b/js/src/builtin/Object.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/ParallelArray.cpp b/js/src/builtin/ParallelArray.cpp index 04bcae9f3af5..b136e0ac22c4 100644 --- a/js/src/builtin/ParallelArray.cpp +++ b/js/src/builtin/ParallelArray.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/ParallelArray.h b/js/src/builtin/ParallelArray.h index d63b87872fb2..443ebad5952a 100644 --- a/js/src/builtin/ParallelArray.h +++ b/js/src/builtin/ParallelArray.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Profilers.cpp b/js/src/builtin/Profilers.cpp index 43b9bea178e5..853d61d89111 100644 --- a/js/src/builtin/Profilers.cpp +++ b/js/src/builtin/Profilers.cpp @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ /* Profiling-related API */ diff --git a/js/src/builtin/Profilers.h b/js/src/builtin/Profilers.h index 872830de12d3..59c4e992024d 100644 --- a/js/src/builtin/Profilers.h +++ b/js/src/builtin/Profilers.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index eeccfcb1129c..502ca8fc6784 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/RegExp.h b/js/src/builtin/RegExp.h index 90662e9ed8bf..60fb782be9f9 100644 --- a/js/src/builtin/RegExp.h +++ b/js/src/builtin/RegExp.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 9f9a57adf906..f7f28d1aaf37 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsapi.h" #include "jsbool.h" diff --git a/js/src/builtin/TestingFunctions.h b/js/src/builtin/TestingFunctions.h index 9bcb1e31d2e6..52b9bef76ce3 100644 --- a/js/src/builtin/TestingFunctions.h +++ b/js/src/builtin/TestingFunctions.h @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef TestingFunctions_h__ #define TestingFunctions_h__ diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index e7213fc80c9f..f3444f654644 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/ctypes/Library.cpp b/js/src/ctypes/Library.cpp index 1c2f8ea7c5ff..47c38853b4eb 100644 --- a/js/src/ctypes/Library.cpp +++ b/js/src/ctypes/Library.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=2 sw=2 et tw=99: + * 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/. */ diff --git a/js/src/devtools/jint/treesearch.py b/js/src/devtools/jint/treesearch.py index c06a62b88011..2cbc45335814 100644 --- a/js/src/devtools/jint/treesearch.py +++ b/js/src/devtools/jint/treesearch.py @@ -1,9 +1,8 @@ +# vim: set ts=8 sts=4 et sw=4 tw=99: # 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/. -# vim: set ts=4 sw=4 tw=99 et: - import os, re import tempfile import subprocess diff --git a/js/src/devtools/sharkctl.cpp b/js/src/devtools/sharkctl.cpp index 14a550247af2..86fdfc936d22 100644 --- a/js/src/devtools/sharkctl.cpp +++ b/js/src/devtools/sharkctl.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/devtools/sharkctl.h b/js/src/devtools/sharkctl.h index e381cfd32ba3..bb3038d3ae6a 100644 --- a/js/src/devtools/sharkctl.h +++ b/js/src/devtools/sharkctl.h @@ -1,6 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/BitArray.h b/js/src/ds/BitArray.h index 4d0d0e64bb63..a20796d4dbe4 100644 --- a/js/src/ds/BitArray.h +++ b/js/src/ds/BitArray.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/InlineMap.h b/js/src/ds/InlineMap.h index 68ca36fb3973..d11172463de8 100644 --- a/js/src/ds/InlineMap.h +++ b/js/src/ds/InlineMap.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index c019a7ca12d5..b9621600f512 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index d7233c932a87..167a61c52a90 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/PriorityQueue.h b/js/src/ds/PriorityQueue.h index 1e9e26c918db..8ef6531bb12f 100644 --- a/js/src/ds/PriorityQueue.h +++ b/js/src/ds/PriorityQueue.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/Sort.h b/js/src/ds/Sort.h index 4061f75cb4fe..46542e5bf882 100644 --- a/js/src/ds/Sort.h +++ b/js/src/ds/Sort.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/SplayTree.h b/js/src/ds/SplayTree.h index 390282363f9f..8df268335fa6 100644 --- a/js/src/ds/SplayTree.h +++ b/js/src/ds/SplayTree.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/editline/editline.c b/js/src/editline/editline.c index f98d048a4112..21946a6250b8 100644 --- a/js/src/editline/editline.c +++ b/js/src/editline/editline.c @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/editline.h b/js/src/editline/editline.h index 5895322f1be1..0616de03a221 100644 --- a/js/src/editline/editline.h +++ b/js/src/editline/editline.h @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/sysunix.c b/js/src/editline/sysunix.c index 0035640a29f6..d45db6c79baa 100644 --- a/js/src/editline/sysunix.c +++ b/js/src/editline/sysunix.c @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/unix.h b/js/src/editline/unix.h index 3d8687632232..ec4a762acb58 100644 --- a/js/src/editline/unix.h +++ b/js/src/editline/unix.h @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp index 24fe869ecd53..fc891b210dd1 100644 --- a/js/src/frontend/BytecodeCompiler.cpp +++ b/js/src/frontend/BytecodeCompiler.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h index 1b13ffe9ed13..9f1164e69400 100644 --- a/js/src/frontend/BytecodeCompiler.h +++ b/js/src/frontend/BytecodeCompiler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 336445f7ccec..8d90567bb301 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index 3b0bc3b4a31b..e84c80e29f24 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index b78d821f897b..cbad2eb6675a 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FoldConstants.h b/js/src/frontend/FoldConstants.h index a1bf9d14e9ad..86da781e8d80 100644 --- a/js/src/frontend/FoldConstants.h +++ b/js/src/frontend/FoldConstants.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 4152bc957c9c..57b338de55d6 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index 22b9e961d2c1..01d2585d4e88 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/NameFunctions.h b/js/src/frontend/NameFunctions.h index d2f9437cd191..adfb3920ad4d 100644 --- a/js/src/frontend/NameFunctions.h +++ b/js/src/frontend/NameFunctions.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps-inl.h b/js/src/frontend/ParseMaps-inl.h index 55fca1a6eb66..ceefb4c8af89 100644 --- a/js/src/frontend/ParseMaps-inl.h +++ b/js/src/frontend/ParseMaps-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps.cpp b/js/src/frontend/ParseMaps.cpp index 3426d861d903..34b1c8ede742 100644 --- a/js/src/frontend/ParseMaps.cpp +++ b/js/src/frontend/ParseMaps.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps.h b/js/src/frontend/ParseMaps.h index a8026167be12..b986bb10d0b4 100644 --- a/js/src/frontend/ParseMaps.h +++ b/js/src/frontend/ParseMaps.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode-inl.h b/js/src/frontend/ParseNode-inl.h index d35c61409ec2..15da9b41d96e 100644 --- a/js/src/frontend/ParseNode-inl.h +++ b/js/src/frontend/ParseNode-inl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index f705e604db70..26b22639f07e 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index f280390e2609..7b2acefd33a6 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser-inl.h b/js/src/frontend/Parser-inl.h index 1fe084ce700f..b689f3bddd73 100644 --- a/js/src/frontend/Parser-inl.h +++ b/js/src/frontend/Parser-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index ecbe09be592e..b6a9bb676269 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 2dcab9c3242a..22b006981d50 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SharedContext-inl.h b/js/src/frontend/SharedContext-inl.h index 74cac685efc8..247501f07d01 100644 --- a/js/src/frontend/SharedContext-inl.h +++ b/js/src/frontend/SharedContext-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 4b5bfff63a06..7212e66d3080 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h index dd0ba4faedf1..2d32ae516bee 100644 --- a/js/src/frontend/SyntaxParseHandler.h +++ b/js/src/frontend/SyntaxParseHandler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 69b9477666ab..5435b683f0c7 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 0997a8049aa4..dad7e88ae2c1 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Barrier-inl.h b/js/src/gc/Barrier-inl.h index acab9ef1610d..0329d1e740e6 100644 --- a/js/src/gc/Barrier-inl.h +++ b/js/src/gc/Barrier-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 0a1009721abb..13f2a509a2e1 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/FindSCCs-inl.h b/js/src/gc/FindSCCs-inl.h index 552ce53be271..24ae0b1de3eb 100644 --- a/js/src/gc/FindSCCs-inl.h +++ b/js/src/gc/FindSCCs-inl.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsfriendapi.h" diff --git a/js/src/gc/FindSCCs.h b/js/src/gc/FindSCCs.h index ccd5f5991fbf..c8ed79d70a9c 100644 --- a/js/src/gc/FindSCCs.h +++ b/js/src/gc/FindSCCs.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_findsccs_h___ #define gc_findsccs_h___ diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index e661aac9e88e..f900778b106e 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index bf73c24f80d5..e5e7f7b67bc9 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_heap_h___ #define gc_heap_h___ diff --git a/js/src/gc/Iteration.cpp b/js/src/gc/Iteration.cpp index 607fd215aef5..76693e5fecff 100644 --- a/js/src/gc/Iteration.cpp +++ b/js/src/gc/Iteration.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index f527fb650715..f6b18144a985 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 tw=79 et: - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "mozilla/DebugOnly.h" diff --git a/js/src/gc/Marking.h b/js/src/gc/Marking.h index 499becc6aad8..3d89bd3e607b 100644 --- a/js/src/gc/Marking.h +++ b/js/src/gc/Marking.h @@ -1,9 +1,8 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_marking_h___ #define gc_marking_h___ diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index e2bec9717391..399177771718 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "mozilla/Assertions.h" diff --git a/js/src/gc/Memory.h b/js/src/gc/Memory.h index bf78cd0594bc..b73c266bf2cb 100644 --- a/js/src/gc/Memory.h +++ b/js/src/gc/Memory.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef jsgc_memory_h___ #define jsgc_memory_h___ diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index 2f6e71da4ce6..f97bb1503c81 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index dcbd00f563c9..377c3b21b796 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index 934df0668de8..027600bc0c64 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp index 0a1523096e28..236fcbd1cf6e 100644 --- a/js/src/gc/StoreBuffer.cpp +++ b/js/src/gc/StoreBuffer.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifdef JSGC_GENERATIONAL diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h index 5409eb02a2b5..d927d098f695 100644 --- a/js/src/gc/StoreBuffer.h +++ b/js/src/gc/StoreBuffer.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifdef JSGC_GENERATIONAL #ifndef jsgc_storebuffer_h___ diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 2a45d31f7b6e..d7f714e9679d 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index 49976dd6c65c..8d4be70cdbdf 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h index b9c42184afb3..4fb93bf50250 100644 --- a/js/src/gc/Zone.h +++ b/js/src/gc/Zone.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gdb/gdb-tests.h b/js/src/gdb/gdb-tests.h index 70fdd8e94fc5..e9141d51528e 100644 --- a/js/src/gdb/gdb-tests.h +++ b/js/src/gdb/gdb-tests.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * 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 diff --git a/js/src/ion/AliasAnalysis.cpp b/js/src/ion/AliasAnalysis.cpp index f37c055a2a0d..5fc176480eef 100644 --- a/js/src/ion/AliasAnalysis.cpp +++ b/js/src/ion/AliasAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AliasAnalysis.h b/js/src/ion/AliasAnalysis.h index 36fd648e5467..64de011e513d 100644 --- a/js/src/ion/AliasAnalysis.h +++ b/js/src/ion/AliasAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index b955bc5fd570..7aa7e2561c63 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJS.h b/js/src/ion/AsmJS.h index b27e152e2593..98b297edcbcd 100644 --- a/js/src/ion/AsmJS.h +++ b/js/src/ion/AsmJS.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSLink.cpp b/js/src/ion/AsmJSLink.cpp index 46e87e0841b1..977ab27b46d2 100644 --- a/js/src/ion/AsmJSLink.cpp +++ b/js/src/ion/AsmJSLink.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSModule.h b/js/src/ion/AsmJSModule.h index ae5d1e89a5de..72bf651c5c6a 100644 --- a/js/src/ion/AsmJSModule.h +++ b/js/src/ion/AsmJSModule.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSSignalHandlers.cpp b/js/src/ion/AsmJSSignalHandlers.cpp index 0fa3af4adbc2..4e477392ea1d 100644 --- a/js/src/ion/AsmJSSignalHandlers.cpp +++ b/js/src/ion/AsmJSSignalHandlers.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.cpp b/js/src/ion/BacktrackingAllocator.cpp index 491b49a3bd2f..e42befd3ade5 100644 --- a/js/src/ion/BacktrackingAllocator.cpp +++ b/js/src/ion/BacktrackingAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.h b/js/src/ion/BacktrackingAllocator.h index ccf0a2e611fb..51b8ff62ce4e 100644 --- a/js/src/ion/BacktrackingAllocator.h +++ b/js/src/ion/BacktrackingAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Bailouts.cpp b/js/src/ion/Bailouts.cpp index 2cffb267d201..aa4f2d14a458 100644 --- a/js/src/ion/Bailouts.cpp +++ b/js/src/ion/Bailouts.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Bailouts.h b/js/src/ion/Bailouts.h index 8694db28b92f..d9d514d9e102 100644 --- a/js/src/ion/Bailouts.h +++ b/js/src/ion/Bailouts.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineBailouts.cpp b/js/src/ion/BaselineBailouts.cpp index 75e2573e594f..53b7628f2f15 100644 --- a/js/src/ion/BaselineBailouts.cpp +++ b/js/src/ion/BaselineBailouts.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineCompiler.cpp b/js/src/ion/BaselineCompiler.cpp index c50b0d0b11b7..15f392397a97 100644 --- a/js/src/ion/BaselineCompiler.cpp +++ b/js/src/ion/BaselineCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineCompiler.h b/js/src/ion/BaselineCompiler.h index 7e7fe1d4b6da..3c72e32a66c5 100644 --- a/js/src/ion/BaselineCompiler.h +++ b/js/src/ion/BaselineCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame-inl.h b/js/src/ion/BaselineFrame-inl.h index 37f82ba5019e..cf3226aa5360 100644 --- a/js/src/ion/BaselineFrame-inl.h +++ b/js/src/ion/BaselineFrame-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame.cpp b/js/src/ion/BaselineFrame.cpp index e9d317ea54f4..299ef4af564c 100644 --- a/js/src/ion/BaselineFrame.cpp +++ b/js/src/ion/BaselineFrame.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame.h b/js/src/ion/BaselineFrame.h index 476c66978fae..7d9642b0d12a 100644 --- a/js/src/ion/BaselineFrame.h +++ b/js/src/ion/BaselineFrame.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.cpp b/js/src/ion/BaselineFrameInfo.cpp index 39e1c4556286..17dcd2765c9b 100644 --- a/js/src/ion/BaselineFrameInfo.cpp +++ b/js/src/ion/BaselineFrameInfo.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.h b/js/src/ion/BaselineFrameInfo.h index d02ecbc6af0b..eae34e232184 100644 --- a/js/src/ion/BaselineFrameInfo.h +++ b/js/src/ion/BaselineFrameInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineHelpers.h b/js/src/ion/BaselineHelpers.h index 1502dba2a617..1c2bd3dc0061 100644 --- a/js/src/ion/BaselineHelpers.h +++ b/js/src/ion/BaselineHelpers.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineIC.cpp b/js/src/ion/BaselineIC.cpp index 6c3494bbb287..4403911b76a8 100644 --- a/js/src/ion/BaselineIC.cpp +++ b/js/src/ion/BaselineIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineIC.h b/js/src/ion/BaselineIC.h index f9c08e770f11..461628faf47e 100644 --- a/js/src/ion/BaselineIC.h +++ b/js/src/ion/BaselineIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineInspector.cpp b/js/src/ion/BaselineInspector.cpp index 26a6273f3dd5..b8490f92d4f1 100644 --- a/js/src/ion/BaselineInspector.cpp +++ b/js/src/ion/BaselineInspector.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineInspector.h b/js/src/ion/BaselineInspector.h index 5fb59f6ed015..cef840718a53 100644 --- a/js/src/ion/BaselineInspector.h +++ b/js/src/ion/BaselineInspector.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineJIT.cpp b/js/src/ion/BaselineJIT.cpp index 3dfce7916f15..8061224465aa 100644 --- a/js/src/ion/BaselineJIT.cpp +++ b/js/src/ion/BaselineJIT.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineJIT.h b/js/src/ion/BaselineJIT.h index 2c9e914c5042..33244f8ca2ed 100644 --- a/js/src/ion/BaselineJIT.h +++ b/js/src/ion/BaselineJIT.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineRegisters.h b/js/src/ion/BaselineRegisters.h index c9d0d4136a8e..26365375481d 100644 --- a/js/src/ion/BaselineRegisters.h +++ b/js/src/ion/BaselineRegisters.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BitSet.cpp b/js/src/ion/BitSet.cpp index 1b3ec5863dc2..bbe12ce97f6c 100644 --- a/js/src/ion/BitSet.cpp +++ b/js/src/ion/BitSet.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BitSet.h b/js/src/ion/BitSet.h index 03903c74a3ac..f9b9dc38dd3b 100644 --- a/js/src/ion/BitSet.h +++ b/js/src/ion/BitSet.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/C1Spewer.cpp b/js/src/ion/C1Spewer.cpp index 7f17319efa40..8934dc09d28e 100644 --- a/js/src/ion/C1Spewer.cpp +++ b/js/src/ion/C1Spewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/C1Spewer.h b/js/src/ion/C1Spewer.h index fe05132a9407..66248f3528ba 100644 --- a/js/src/ion/C1Spewer.h +++ b/js/src/ion/C1Spewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 3b827b76d31a..5106493af101 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index 348fb3ce14f5..4130a3611ebc 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompactBuffer.h b/js/src/ion/CompactBuffer.h index c3ca501190d5..fb29b780e3d8 100644 --- a/js/src/ion/CompactBuffer.h +++ b/js/src/ion/CompactBuffer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompileInfo-inl.h b/js/src/ion/CompileInfo-inl.h index 666da9777c4d..85971562381a 100644 --- a/js/src/ion/CompileInfo-inl.h +++ b/js/src/ion/CompileInfo-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompileInfo.h b/js/src/ion/CompileInfo.h index 237e9e4e1a4b..2288b20460f6 100644 --- a/js/src/ion/CompileInfo.h +++ b/js/src/ion/CompileInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompilerRoot.h b/js/src/ion/CompilerRoot.h index 81e9386ac417..141924b7094a 100644 --- a/js/src/ion/CompilerRoot.h +++ b/js/src/ion/CompilerRoot.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.cpp b/js/src/ion/EdgeCaseAnalysis.cpp index 18a7547581e9..38cb200838b4 100644 --- a/js/src/ion/EdgeCaseAnalysis.cpp +++ b/js/src/ion/EdgeCaseAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.h b/js/src/ion/EdgeCaseAnalysis.h index bb744dd40eab..a322257996bf 100644 --- a/js/src/ion/EdgeCaseAnalysis.h +++ b/js/src/ion/EdgeCaseAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.cpp b/js/src/ion/EffectiveAddressAnalysis.cpp index 76fa88a36e06..e936a6ebfe8d 100644 --- a/js/src/ion/EffectiveAddressAnalysis.cpp +++ b/js/src/ion/EffectiveAddressAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.h b/js/src/ion/EffectiveAddressAnalysis.h index e7f3dc9f2e71..a86e871290b1 100644 --- a/js/src/ion/EffectiveAddressAnalysis.h +++ b/js/src/ion/EffectiveAddressAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ExecutionModeInlines.h b/js/src/ion/ExecutionModeInlines.h index 1f86e4a8d294..8a4c2d758ebd 100644 --- a/js/src/ion/ExecutionModeInlines.h +++ b/js/src/ion/ExecutionModeInlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/FixedArityList.h b/js/src/ion/FixedArityList.h index d737ad4e1d02..4cf6ccf51827 100644 --- a/js/src/ion/FixedArityList.h +++ b/js/src/ion/FixedArityList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/FixedList.h b/js/src/ion/FixedList.h index 9213d0744955..2062ad8d64e3 100644 --- a/js/src/ion/FixedList.h +++ b/js/src/ion/FixedList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/InlineList.h b/js/src/ion/InlineList.h index 7bc21801de30..00897619b123 100644 --- a/js/src/ion/InlineList.h +++ b/js/src/ion/InlineList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Ion.cpp b/js/src/ion/Ion.cpp index 3298897730b4..9a227fa73aeb 100644 --- a/js/src/ion/Ion.cpp +++ b/js/src/ion/Ion.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Ion.h b/js/src/ion/Ion.h index c9e4f0cd8fa2..d11485db6fe6 100644 --- a/js/src/ion/Ion.h +++ b/js/src/ion/Ion.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAllocPolicy.h b/js/src/ion/IonAllocPolicy.h index 8c828f71528f..f604a5005b49 100644 --- a/js/src/ion/IonAllocPolicy.h +++ b/js/src/ion/IonAllocPolicy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAnalysis.cpp b/js/src/ion/IonAnalysis.cpp index fc13e62faec3..58a070c42954 100644 --- a/js/src/ion/IonAnalysis.cpp +++ b/js/src/ion/IonAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAnalysis.h b/js/src/ion/IonAnalysis.h index 42b02bb3f961..0f311da802df 100644 --- a/js/src/ion/IonAnalysis.h +++ b/js/src/ion/IonAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index e41193c06496..8a4b4f8f8974 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 4b1422e29608..8f8f2a486734 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index d5be53c9fa12..de522f126ded 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCaches.h b/js/src/ion/IonCaches.h index 855b7535236c..19920883537b 100644 --- a/js/src/ion/IonCaches.h +++ b/js/src/ion/IonCaches.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCode.h b/js/src/ion/IonCode.h index 0a4aeb1f34b9..ec4a86d60e9c 100644 --- a/js/src/ion/IonCode.h +++ b/js/src/ion/IonCode.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCompartment.h b/js/src/ion/IonCompartment.h index 5a5681f110f6..472cf55fba5d 100644 --- a/js/src/ion/IonCompartment.h +++ b/js/src/ion/IonCompartment.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrameIterator-inl.h b/js/src/ion/IonFrameIterator-inl.h index 5b1094bda4d7..2740d9432b5b 100644 --- a/js/src/ion/IonFrameIterator-inl.h +++ b/js/src/ion/IonFrameIterator-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrameIterator.h b/js/src/ion/IonFrameIterator.h index e85656fb4265..fb0a339ae79d 100644 --- a/js/src/ion/IonFrameIterator.h +++ b/js/src/ion/IonFrameIterator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames-inl.h b/js/src/ion/IonFrames-inl.h index 1267a565856f..a1fa889785c8 100644 --- a/js/src/ion/IonFrames-inl.h +++ b/js/src/ion/IonFrames-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index cb6138e0905d..b218d05d802c 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames.h b/js/src/ion/IonFrames.h index 6872c96a3422..5e598e244b27 100644 --- a/js/src/ion/IonFrames.h +++ b/js/src/ion/IonFrames.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonInstrumentation.h b/js/src/ion/IonInstrumentation.h index cb8ceae9119a..62d9ea1f6951 100644 --- a/js/src/ion/IonInstrumentation.h +++ b/js/src/ion/IonInstrumentation.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonLinker.h b/js/src/ion/IonLinker.h index 979385254362..b818368ccbaa 100644 --- a/js/src/ion/IonLinker.h +++ b/js/src/ion/IonLinker.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index 808218f3df8b..bcf85af67d84 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index b08f08d277cc..9b4571354eb8 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonSpewer.cpp b/js/src/ion/IonSpewer.cpp index 002a36193d12..c911955b57cf 100644 --- a/js/src/ion/IonSpewer.cpp +++ b/js/src/ion/IonSpewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonSpewer.h b/js/src/ion/IonSpewer.h index 19696dc286e6..4f6ad0eaa776 100644 --- a/js/src/ion/IonSpewer.h +++ b/js/src/ion/IonSpewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonTypes.h b/js/src/ion/IonTypes.h index b033e28f18c3..6e60a39c6159 100644 --- a/js/src/ion/IonTypes.h +++ b/js/src/ion/IonTypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/JSONSpewer.cpp b/js/src/ion/JSONSpewer.cpp index bc3a4c363984..466941ddd7a5 100644 --- a/js/src/ion/JSONSpewer.cpp +++ b/js/src/ion/JSONSpewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/JSONSpewer.h b/js/src/ion/JSONSpewer.h index 8726b48fcd26..556faa9081bb 100644 --- a/js/src/ion/JSONSpewer.h +++ b/js/src/ion/JSONSpewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LICM.cpp b/js/src/ion/LICM.cpp index d40970a65994..d93f1c22f248 100644 --- a/js/src/ion/LICM.cpp +++ b/js/src/ion/LICM.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LICM.h b/js/src/ion/LICM.h index ab40b2b6df91..e2f53fafdc65 100644 --- a/js/src/ion/LICM.h +++ b/js/src/ion/LICM.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index f2ddb2d08264..5d6ef835e6bf 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR-inl.h b/js/src/ion/LIR-inl.h index af24d9769146..de4d08ede26c 100644 --- a/js/src/ion/LIR-inl.h +++ b/js/src/ion/LIR-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR.cpp b/js/src/ion/LIR.cpp index 7c70b2a51cda..d0f96070f6c0 100644 --- a/js/src/ion/LIR.cpp +++ b/js/src/ion/LIR.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR.h b/js/src/ion/LIR.h index 096cbd374ce0..dcbc44e47b4c 100644 --- a/js/src/ion/LIR.h +++ b/js/src/ion/LIR.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index 227aeac052a4..b7bf009b266c 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LinearScan.cpp b/js/src/ion/LinearScan.cpp index b073db985a1e..8318716ca2d0 100644 --- a/js/src/ion/LinearScan.cpp +++ b/js/src/ion/LinearScan.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LinearScan.h b/js/src/ion/LinearScan.h index 3cf8d80740e3..4dcd24a207ca 100644 --- a/js/src/ion/LinearScan.h +++ b/js/src/ion/LinearScan.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.cpp b/js/src/ion/LiveRangeAllocator.cpp index b35e731eb3ab..154c2767204b 100644 --- a/js/src/ion/LiveRangeAllocator.cpp +++ b/js/src/ion/LiveRangeAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.h b/js/src/ion/LiveRangeAllocator.h index d48aece848d9..3c81bc90903a 100644 --- a/js/src/ion/LiveRangeAllocator.h +++ b/js/src/ion/LiveRangeAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 5a3bbd5c0823..75de254f6577 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index 4d39160fb155..cc8cd249df8b 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MCallOptimize.cpp b/js/src/ion/MCallOptimize.cpp index d05b5f5f1378..98e986259127 100644 --- a/js/src/ion/MCallOptimize.cpp +++ b/js/src/ion/MCallOptimize.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 8eb9b1165495..7b94d6c7419f 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 0e1f6ec87acf..faa0d1ed38fa 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGenerator.h b/js/src/ion/MIRGenerator.h index 39cbba47602c..a734cbdef71b 100644 --- a/js/src/ion/MIRGenerator.h +++ b/js/src/ion/MIRGenerator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGraph.cpp b/js/src/ion/MIRGraph.cpp index 3a02a3394f4d..addbda66aecd 100644 --- a/js/src/ion/MIRGraph.cpp +++ b/js/src/ion/MIRGraph.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGraph.h b/js/src/ion/MIRGraph.h index 21f77942f95d..f5b62e11623e 100644 --- a/js/src/ion/MIRGraph.h +++ b/js/src/ion/MIRGraph.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index c27a8b14251e..a5123a627ccd 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveEmitter.h b/js/src/ion/MoveEmitter.h index 9a88bd12703d..095b5d9e6da6 100644 --- a/js/src/ion/MoveEmitter.h +++ b/js/src/ion/MoveEmitter.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveResolver.cpp b/js/src/ion/MoveResolver.cpp index 1d4c76b7f681..a2b661c3130e 100644 --- a/js/src/ion/MoveResolver.cpp +++ b/js/src/ion/MoveResolver.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveResolver.h b/js/src/ion/MoveResolver.h index 0f816e15be54..8a20e1021a09 100644 --- a/js/src/ion/MoveResolver.h +++ b/js/src/ion/MoveResolver.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 3d92c14267fe..364df7b0902d 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.h b/js/src/ion/ParallelArrayAnalysis.h index 93e4ce36de2d..2c2eba228b37 100644 --- a/js/src/ion/ParallelArrayAnalysis.h +++ b/js/src/ion/ParallelArrayAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelFunctions.cpp b/js/src/ion/ParallelFunctions.cpp index 1b821503b328..e0c7ca406778 100644 --- a/js/src/ion/ParallelFunctions.cpp +++ b/js/src/ion/ParallelFunctions.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelFunctions.h b/js/src/ion/ParallelFunctions.h index b74e5cfa7aee..1fe9fcc333ff 100644 --- a/js/src/ion/ParallelFunctions.h +++ b/js/src/ion/ParallelFunctions.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/PcScriptCache-inl.h b/js/src/ion/PcScriptCache-inl.h index 9a852d0ed453..fdf5acfd19ab 100644 --- a/js/src/ion/PcScriptCache-inl.h +++ b/js/src/ion/PcScriptCache-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/PcScriptCache.h b/js/src/ion/PcScriptCache.h index 4d8eca0cbe31..9f9a3d79c87c 100644 --- a/js/src/ion/PcScriptCache.h +++ b/js/src/ion/PcScriptCache.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RangeAnalysis.cpp b/js/src/ion/RangeAnalysis.cpp index 918dc33bf90b..229b3a552b8d 100644 --- a/js/src/ion/RangeAnalysis.cpp +++ b/js/src/ion/RangeAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RangeAnalysis.h b/js/src/ion/RangeAnalysis.h index 830d3a3167de..0ffdc4752288 100644 --- a/js/src/ion/RangeAnalysis.h +++ b/js/src/ion/RangeAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterAllocator.cpp b/js/src/ion/RegisterAllocator.cpp index f9986453416f..335eae5265a8 100644 --- a/js/src/ion/RegisterAllocator.cpp +++ b/js/src/ion/RegisterAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterAllocator.h b/js/src/ion/RegisterAllocator.h index d98704d38d03..fe76b3504ee9 100644 --- a/js/src/ion/RegisterAllocator.h +++ b/js/src/ion/RegisterAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterSets.h b/js/src/ion/RegisterSets.h index b1ec16bcd735..9679f9f734df 100644 --- a/js/src/ion/RegisterSets.h +++ b/js/src/ion/RegisterSets.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Registers.h b/js/src/ion/Registers.h index e942d2e0474e..988d544f279c 100644 --- a/js/src/ion/Registers.h +++ b/js/src/ion/Registers.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Safepoints.cpp b/js/src/ion/Safepoints.cpp index 180b929d0301..8af0573240d7 100644 --- a/js/src/ion/Safepoints.cpp +++ b/js/src/ion/Safepoints.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Safepoints.h b/js/src/ion/Safepoints.h index 6e81e75e6442..4ae9e14bbfaf 100644 --- a/js/src/ion/Safepoints.h +++ b/js/src/ion/Safepoints.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/SnapshotReader.h b/js/src/ion/SnapshotReader.h index 61c930852a6a..497763da8e8c 100644 --- a/js/src/ion/SnapshotReader.h +++ b/js/src/ion/SnapshotReader.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/SnapshotWriter.h b/js/src/ion/SnapshotWriter.h index 9044da1dc405..9c90e6a7a757 100644 --- a/js/src/ion/SnapshotWriter.h +++ b/js/src/ion/SnapshotWriter.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Snapshots.cpp b/js/src/ion/Snapshots.cpp index bc761faf75f8..3605148521c0 100644 --- a/js/src/ion/Snapshots.cpp +++ b/js/src/ion/Snapshots.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StackSlotAllocator.h b/js/src/ion/StackSlotAllocator.h index d08c63797170..e0b978324b9e 100644 --- a/js/src/ion/StackSlotAllocator.h +++ b/js/src/ion/StackSlotAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StupidAllocator.cpp b/js/src/ion/StupidAllocator.cpp index c0646ac78f24..699194afc6ef 100644 --- a/js/src/ion/StupidAllocator.cpp +++ b/js/src/ion/StupidAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StupidAllocator.h b/js/src/ion/StupidAllocator.h index 77534641f7ba..5c1279ddeaa4 100644 --- a/js/src/ion/StupidAllocator.h +++ b/js/src/ion/StupidAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index 6e67e7956079..a54068563498 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypeOracle.h b/js/src/ion/TypeOracle.h index bf13fdd6b8bf..d75a1cb77f32 100644 --- a/js/src/ion/TypeOracle.h +++ b/js/src/ion/TypeOracle.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index 2d4f90a542d4..ce60a3528c03 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 310dd73e99ec..3f209e53c857 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.cpp b/js/src/ion/UnreachableCodeElimination.cpp index 75367fd313c0..50a27363928f 100644 --- a/js/src/ion/UnreachableCodeElimination.cpp +++ b/js/src/ion/UnreachableCodeElimination.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.h b/js/src/ion/UnreachableCodeElimination.h index 99a61eed7b7b..9999afb47443 100644 --- a/js/src/ion/UnreachableCodeElimination.h +++ b/js/src/ion/UnreachableCodeElimination.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index 15b33c5190d4..c9f2f8dda262 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index 7439a9b56276..c7477ddd2b0f 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ValueNumbering.cpp b/js/src/ion/ValueNumbering.cpp index 597fb89170f4..a8b83b5dc950 100644 --- a/js/src/ion/ValueNumbering.cpp +++ b/js/src/ion/ValueNumbering.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ValueNumbering.h b/js/src/ion/ValueNumbering.h index 24db39cde1a1..edb1f40558f2 100644 --- a/js/src/ion/ValueNumbering.h +++ b/js/src/ion/ValueNumbering.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Architecture-arm.cpp b/js/src/ion/arm/Architecture-arm.cpp index 567715f688d1..7fc302930308 100644 --- a/js/src/ion/arm/Architecture-arm.cpp +++ b/js/src/ion/arm/Architecture-arm.cpp @@ -1,9 +1,9 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + #define HWCAP_ARMv7 (1 << 31) #include diff --git a/js/src/ion/arm/Architecture-arm.h b/js/src/ion/arm/Architecture-arm.h index 3257c31ff1c0..0471efb88357 100644 --- a/js/src/ion/arm/Architecture-arm.h +++ b/js/src/ion/arm/Architecture-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.cpp b/js/src/ion/arm/Assembler-arm.cpp index a2c178ee7f8a..820f99c9b615 100644 --- a/js/src/ion/arm/Assembler-arm.cpp +++ b/js/src/ion/arm/Assembler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.h b/js/src/ion/arm/Assembler-arm.h index 620270bcf3f2..80f1b7737255 100644 --- a/js/src/ion/arm/Assembler-arm.h +++ b/js/src/ion/arm/Assembler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Bailouts-arm.cpp b/js/src/ion/arm/Bailouts-arm.cpp index bb51f8f3fbc6..21968bde4b1d 100644 --- a/js/src/ion/arm/Bailouts-arm.cpp +++ b/js/src/ion/arm/Bailouts-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.cpp b/js/src/ion/arm/BaselineCompiler-arm.cpp index 53ddd75857b0..7ed88a3f246a 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.cpp +++ b/js/src/ion/arm/BaselineCompiler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.h b/js/src/ion/arm/BaselineCompiler-arm.h index baaaff529d02..5485204398d3 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.h +++ b/js/src/ion/arm/BaselineCompiler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineHelpers-arm.h b/js/src/ion/arm/BaselineHelpers-arm.h index 6dd5795c0f39..6d5611eb5437 100644 --- a/js/src/ion/arm/BaselineHelpers-arm.h +++ b/js/src/ion/arm/BaselineHelpers-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineIC-arm.cpp b/js/src/ion/arm/BaselineIC-arm.cpp index 079b5b33d15c..25a1b40c0e5e 100644 --- a/js/src/ion/arm/BaselineIC-arm.cpp +++ b/js/src/ion/arm/BaselineIC-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineRegisters-arm.h b/js/src/ion/arm/BaselineRegisters-arm.h index 4ba983e6e7d5..53c908850855 100644 --- a/js/src/ion/arm/BaselineRegisters-arm.h +++ b/js/src/ion/arm/BaselineRegisters-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.cpp b/js/src/ion/arm/CodeGenerator-arm.cpp index 4acfde24e38c..b28d73f5f080 100644 --- a/js/src/ion/arm/CodeGenerator-arm.cpp +++ b/js/src/ion/arm/CodeGenerator-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.h b/js/src/ion/arm/CodeGenerator-arm.h index a0e421d57ac0..4c9940ade643 100644 --- a/js/src/ion/arm/CodeGenerator-arm.h +++ b/js/src/ion/arm/CodeGenerator-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.cpp b/js/src/ion/arm/IonFrames-arm.cpp index 0b90bb2c48fb..fe5bd1c65b69 100644 --- a/js/src/ion/arm/IonFrames-arm.cpp +++ b/js/src/ion/arm/IonFrames-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.h b/js/src/ion/arm/IonFrames-arm.h index f5b38c324f4a..c9d5268c6af5 100644 --- a/js/src/ion/arm/IonFrames-arm.h +++ b/js/src/ion/arm/IonFrames-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/LIR-arm.h b/js/src/ion/arm/LIR-arm.h index 7e0997c14bb3..f9db2e9b6e05 100644 --- a/js/src/ion/arm/LIR-arm.h +++ b/js/src/ion/arm/LIR-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/LOpcodes-arm.h b/js/src/ion/arm/LOpcodes-arm.h index 7745129aa645..1f53b9baabc8 100644 --- a/js/src/ion/arm/LOpcodes-arm.h +++ b/js/src/ion/arm/LOpcodes-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.cpp b/js/src/ion/arm/Lowering-arm.cpp index 867f69bbffd3..f5aecb3ed4ef 100644 --- a/js/src/ion/arm/Lowering-arm.cpp +++ b/js/src/ion/arm/Lowering-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.h b/js/src/ion/arm/Lowering-arm.h index 4436f2cd1cd3..0472fa1489e5 100644 --- a/js/src/ion/arm/Lowering-arm.h +++ b/js/src/ion/arm/Lowering-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.cpp b/js/src/ion/arm/MacroAssembler-arm.cpp index 561a0b358802..0076f8d27058 100644 --- a/js/src/ion/arm/MacroAssembler-arm.cpp +++ b/js/src/ion/arm/MacroAssembler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.h b/js/src/ion/arm/MacroAssembler-arm.h index a383576e8331..18b258b750cc 100644 --- a/js/src/ion/arm/MacroAssembler-arm.h +++ b/js/src/ion/arm/MacroAssembler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.cpp b/js/src/ion/arm/MoveEmitter-arm.cpp index b6f1b409e900..289ecc795d80 100644 --- a/js/src/ion/arm/MoveEmitter-arm.cpp +++ b/js/src/ion/arm/MoveEmitter-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.h b/js/src/ion/arm/MoveEmitter-arm.h index 783cf1c966e1..8d63c095c83d 100644 --- a/js/src/ion/arm/MoveEmitter-arm.h +++ b/js/src/ion/arm/MoveEmitter-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Trampoline-arm.cpp b/js/src/ion/arm/Trampoline-arm.cpp index a8dd69f463b4..3f313235f059 100644 --- a/js/src/ion/arm/Trampoline-arm.cpp +++ b/js/src/ion/arm/Trampoline-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-shared.h b/js/src/ion/shared/Assembler-shared.h index eb6371fb2b68..dec722212e45 100644 --- a/js/src/ion/shared/Assembler-shared.h +++ b/js/src/ion/shared/Assembler-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.cpp b/js/src/ion/shared/Assembler-x86-shared.cpp index 689a5a6876d3..09accd9c7bb8 100644 --- a/js/src/ion/shared/Assembler-x86-shared.cpp +++ b/js/src/ion/shared/Assembler-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.h b/js/src/ion/shared/Assembler-x86-shared.h index 41cb8e0bc5da..66f49ef47131 100644 --- a/js/src/ion/shared/Assembler-x86-shared.h +++ b/js/src/ion/shared/Assembler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.cpp b/js/src/ion/shared/BaselineCompiler-shared.cpp index 7b8bbfe05fc9..47831a5c82cc 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.h b/js/src/ion/shared/BaselineCompiler-shared.h index a0baa943e584..2a23e44ed56b 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.h +++ b/js/src/ion/shared/BaselineCompiler-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp index 9c23197aafe1..9c3db57f63a2 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.h b/js/src/ion/shared/BaselineCompiler-x86-shared.h index 56d1b2de020b..20ecdec89408 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.h +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineIC-x86-shared.cpp b/js/src/ion/shared/BaselineIC-x86-shared.cpp index cc5bf7e616d4..a671664ad752 100644 --- a/js/src/ion/shared/BaselineIC-x86-shared.cpp +++ b/js/src/ion/shared/BaselineIC-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared-inl.h b/js/src/ion/shared/CodeGenerator-shared-inl.h index 7bf3b611417f..67f4aeee310a 100644 --- a/js/src/ion/shared/CodeGenerator-shared-inl.h +++ b/js/src/ion/shared/CodeGenerator-shared-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.cpp b/js/src/ion/shared/CodeGenerator-shared.cpp index 568e0d684500..3017b431e153 100644 --- a/js/src/ion/shared/CodeGenerator-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.h b/js/src/ion/shared/CodeGenerator-shared.h index 1695dc5c45cc..a99934e46968 100644 --- a/js/src/ion/shared/CodeGenerator-shared.h +++ b/js/src/ion/shared/CodeGenerator-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.cpp b/js/src/ion/shared/CodeGenerator-x86-shared.cpp index eaa4ac482f2e..80a6adb35e5f 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.h b/js/src/ion/shared/CodeGenerator-x86-shared.h index 93305081b7b5..547ddbd588de 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.h +++ b/js/src/ion/shared/CodeGenerator-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBuffer.h b/js/src/ion/shared/IonAssemblerBuffer.h index 47653f94955a..59c51eacc751 100644 --- a/js/src/ion/shared/IonAssemblerBuffer.h +++ b/js/src/ion/shared/IonAssemblerBuffer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h index 8b9b1055e2f4..8dcb2f3eb249 100644 --- a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h +++ b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonFrames-shared.h b/js/src/ion/shared/IonFrames-shared.h index 794da5226709..2b6f12f1da78 100644 --- a/js/src/ion/shared/IonFrames-shared.h +++ b/js/src/ion/shared/IonFrames-shared.h @@ -1,43 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Anderson - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + #ifndef jsion_ionframes_shared_h__ #define jsion_ionframes_shared_h__ diff --git a/js/src/ion/shared/IonFrames-x86-shared.cpp b/js/src/ion/shared/IonFrames-x86-shared.cpp index 55ca61030a89..fe9dc1f19531 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.cpp +++ b/js/src/ion/shared/IonFrames-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonFrames-x86-shared.h b/js/src/ion/shared/IonFrames-x86-shared.h index 04f055884d71..9100f3b38413 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.h +++ b/js/src/ion/shared/IonFrames-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/LIR-x86-shared.h b/js/src/ion/shared/LIR-x86-shared.h index 4cec8fbed08a..5d12830436c9 100644 --- a/js/src/ion/shared/LIR-x86-shared.h +++ b/js/src/ion/shared/LIR-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared-inl.h b/js/src/ion/shared/Lowering-shared-inl.h index a67981a03684..6139c7ea0647 100644 --- a/js/src/ion/shared/Lowering-shared-inl.h +++ b/js/src/ion/shared/Lowering-shared-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.cpp b/js/src/ion/shared/Lowering-shared.cpp index 577196d1aa65..7ab7b2e314f9 100644 --- a/js/src/ion/shared/Lowering-shared.cpp +++ b/js/src/ion/shared/Lowering-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.h b/js/src/ion/shared/Lowering-shared.h index 5f8b34c24237..0808833a0284 100644 --- a/js/src/ion/shared/Lowering-shared.h +++ b/js/src/ion/shared/Lowering-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.cpp b/js/src/ion/shared/Lowering-x86-shared.cpp index 95496d77e916..f2ed21d6b7fb 100644 --- a/js/src/ion/shared/Lowering-x86-shared.cpp +++ b/js/src/ion/shared/Lowering-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.h b/js/src/ion/shared/Lowering-x86-shared.h index 797f552baeb2..99a3c6cf3c50 100644 --- a/js/src/ion/shared/Lowering-x86-shared.h +++ b/js/src/ion/shared/Lowering-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MacroAssembler-x86-shared.h b/js/src/ion/shared/MacroAssembler-x86-shared.h index 644e302b3f5a..f28f229dd7b8 100644 --- a/js/src/ion/shared/MacroAssembler-x86-shared.h +++ b/js/src/ion/shared/MacroAssembler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.cpp b/js/src/ion/shared/MoveEmitter-x86-shared.cpp index 99e50bef2134..8c8c6290923d 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.cpp +++ b/js/src/ion/shared/MoveEmitter-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.h b/js/src/ion/shared/MoveEmitter-x86-shared.h index bbc2a5ef1fe9..915dd13b5091 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.h +++ b/js/src/ion/shared/MoveEmitter-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Architecture-x64.h b/js/src/ion/x64/Architecture-x64.h index 707fb2a43c04..3a832c95df18 100644 --- a/js/src/ion/x64/Architecture-x64.h +++ b/js/src/ion/x64/Architecture-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.cpp b/js/src/ion/x64/Assembler-x64.cpp index bdb88083fb02..bdcbe791d2e1 100644 --- a/js/src/ion/x64/Assembler-x64.cpp +++ b/js/src/ion/x64/Assembler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.h b/js/src/ion/x64/Assembler-x64.h index 379a88eea1ae..fdd7825b1037 100644 --- a/js/src/ion/x64/Assembler-x64.h +++ b/js/src/ion/x64/Assembler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Bailouts-x64.cpp b/js/src/ion/x64/Bailouts-x64.cpp index 8062c8814f3a..4f9e265c62f8 100644 --- a/js/src/ion/x64/Bailouts-x64.cpp +++ b/js/src/ion/x64/Bailouts-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.cpp b/js/src/ion/x64/BaselineCompiler-x64.cpp index 45c9bf09c30b..e0bce0af7d51 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.cpp +++ b/js/src/ion/x64/BaselineCompiler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.h b/js/src/ion/x64/BaselineCompiler-x64.h index 1bfb02ba220b..ddac8c9c4133 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.h +++ b/js/src/ion/x64/BaselineCompiler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineHelpers-x64.h b/js/src/ion/x64/BaselineHelpers-x64.h index 939d8d9f5e9a..0e5c802f13ea 100644 --- a/js/src/ion/x64/BaselineHelpers-x64.h +++ b/js/src/ion/x64/BaselineHelpers-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineIC-x64.cpp b/js/src/ion/x64/BaselineIC-x64.cpp index 57d71a05a150..7359d26eb661 100644 --- a/js/src/ion/x64/BaselineIC-x64.cpp +++ b/js/src/ion/x64/BaselineIC-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineRegisters-x64.h b/js/src/ion/x64/BaselineRegisters-x64.h index f3b9d69d187c..72a64a55bb1f 100644 --- a/js/src/ion/x64/BaselineRegisters-x64.h +++ b/js/src/ion/x64/BaselineRegisters-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.cpp b/js/src/ion/x64/CodeGenerator-x64.cpp index b7d720810de1..e94fe12fdb71 100644 --- a/js/src/ion/x64/CodeGenerator-x64.cpp +++ b/js/src/ion/x64/CodeGenerator-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.h b/js/src/ion/x64/CodeGenerator-x64.h index 5360dc710413..35e103cd3254 100644 --- a/js/src/ion/x64/CodeGenerator-x64.h +++ b/js/src/ion/x64/CodeGenerator-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/LIR-x64.h b/js/src/ion/x64/LIR-x64.h index f1a8d03fe3a5..f5366d747f8d 100644 --- a/js/src/ion/x64/LIR-x64.h +++ b/js/src/ion/x64/LIR-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/LOpcodes-x64.h b/js/src/ion/x64/LOpcodes-x64.h index 8a276914ac25..fb479d48ce5a 100644 --- a/js/src/ion/x64/LOpcodes-x64.h +++ b/js/src/ion/x64/LOpcodes-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.cpp b/js/src/ion/x64/Lowering-x64.cpp index d8eda3c9430b..525d0ecabfb7 100644 --- a/js/src/ion/x64/Lowering-x64.cpp +++ b/js/src/ion/x64/Lowering-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.h b/js/src/ion/x64/Lowering-x64.h index f479e5d1d8b9..176041735618 100644 --- a/js/src/ion/x64/Lowering-x64.h +++ b/js/src/ion/x64/Lowering-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.cpp b/js/src/ion/x64/MacroAssembler-x64.cpp index daf6a8b23875..c91b2471c35e 100644 --- a/js/src/ion/x64/MacroAssembler-x64.cpp +++ b/js/src/ion/x64/MacroAssembler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.h b/js/src/ion/x64/MacroAssembler-x64.h index 6165a0c5fe60..c7b8eecba0aa 100644 --- a/js/src/ion/x64/MacroAssembler-x64.h +++ b/js/src/ion/x64/MacroAssembler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Trampoline-x64.cpp b/js/src/ion/x64/Trampoline-x64.cpp index b25b253bed98..d801cd02c8d6 100644 --- a/js/src/ion/x64/Trampoline-x64.cpp +++ b/js/src/ion/x64/Trampoline-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Architecture-x86.h b/js/src/ion/x86/Architecture-x86.h index 4c32e49df5b3..61ffbdd3f787 100644 --- a/js/src/ion/x86/Architecture-x86.h +++ b/js/src/ion/x86/Architecture-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.cpp b/js/src/ion/x86/Assembler-x86.cpp index d9cf3d312c9a..e09285f8022c 100644 --- a/js/src/ion/x86/Assembler-x86.cpp +++ b/js/src/ion/x86/Assembler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.h b/js/src/ion/x86/Assembler-x86.h index 3f894a8868fb..3099f80a9b6d 100644 --- a/js/src/ion/x86/Assembler-x86.h +++ b/js/src/ion/x86/Assembler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Bailouts-x86.cpp b/js/src/ion/x86/Bailouts-x86.cpp index 72e3eab4081b..731ef2c7e3ad 100644 --- a/js/src/ion/x86/Bailouts-x86.cpp +++ b/js/src/ion/x86/Bailouts-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.cpp b/js/src/ion/x86/BaselineCompiler-x86.cpp index 4ae0b3c74d3d..618ac55080c5 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.cpp +++ b/js/src/ion/x86/BaselineCompiler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.h b/js/src/ion/x86/BaselineCompiler-x86.h index cd1af33574a7..dcc7eeabbfbf 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.h +++ b/js/src/ion/x86/BaselineCompiler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineHelpers-x86.h b/js/src/ion/x86/BaselineHelpers-x86.h index 6222189a46b5..30f7db30986e 100644 --- a/js/src/ion/x86/BaselineHelpers-x86.h +++ b/js/src/ion/x86/BaselineHelpers-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineIC-x86.cpp b/js/src/ion/x86/BaselineIC-x86.cpp index 56a5dd0bba66..01a0b54bfc49 100644 --- a/js/src/ion/x86/BaselineIC-x86.cpp +++ b/js/src/ion/x86/BaselineIC-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineRegisters-x86.h b/js/src/ion/x86/BaselineRegisters-x86.h index e8a88217be9f..b28bda46ea29 100644 --- a/js/src/ion/x86/BaselineRegisters-x86.h +++ b/js/src/ion/x86/BaselineRegisters-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.cpp b/js/src/ion/x86/CodeGenerator-x86.cpp index fd36974e9792..4884d5118e26 100644 --- a/js/src/ion/x86/CodeGenerator-x86.cpp +++ b/js/src/ion/x86/CodeGenerator-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.h b/js/src/ion/x86/CodeGenerator-x86.h index 9fdc4b6a1b05..c4a58322e4db 100644 --- a/js/src/ion/x86/CodeGenerator-x86.h +++ b/js/src/ion/x86/CodeGenerator-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/LIR-x86.h b/js/src/ion/x86/LIR-x86.h index b56ab4788770..a27412302000 100644 --- a/js/src/ion/x86/LIR-x86.h +++ b/js/src/ion/x86/LIR-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/LOpcodes-x86.h b/js/src/ion/x86/LOpcodes-x86.h index 7944813552d1..5b4b9f49e2ca 100644 --- a/js/src/ion/x86/LOpcodes-x86.h +++ b/js/src/ion/x86/LOpcodes-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.cpp b/js/src/ion/x86/Lowering-x86.cpp index debcc669fceb..9ef6d6d51c45 100644 --- a/js/src/ion/x86/Lowering-x86.cpp +++ b/js/src/ion/x86/Lowering-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.h b/js/src/ion/x86/Lowering-x86.h index db6347ea5af3..f283e8a41053 100644 --- a/js/src/ion/x86/Lowering-x86.h +++ b/js/src/ion/x86/Lowering-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.cpp b/js/src/ion/x86/MacroAssembler-x86.cpp index d620f46a0792..4183d3c9f372 100644 --- a/js/src/ion/x86/MacroAssembler-x86.cpp +++ b/js/src/ion/x86/MacroAssembler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.h b/js/src/ion/x86/MacroAssembler-x86.h index 5912f3ec3537..18f95d8bb89d 100644 --- a/js/src/ion/x86/MacroAssembler-x86.h +++ b/js/src/ion/x86/MacroAssembler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Trampoline-x86.cpp b/js/src/ion/x86/Trampoline-x86.cpp index c6345788f956..088d7678bc91 100644 --- a/js/src/ion/x86/Trampoline-x86.cpp +++ b/js/src/ion/x86/Trampoline-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jit-test/tests/auto-regress/bug557946.js b/js/src/jit-test/tests/auto-regress/bug557946.js index 37cde015b269..8d1e95c53b17 100644 --- a/js/src/jit-test/tests/auto-regress/bug557946.js +++ b/js/src/jit-test/tests/auto-regress/bug557946.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-6f1a38b94754-linux // Flags: -j // -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ var x = 0; var y = 0; diff --git a/js/src/jit-test/tests/auto-regress/bug558618.js b/js/src/jit-test/tests/auto-regress/bug558618.js index 1618adb14b19..3fe1dfb257ec 100644 --- a/js/src/jit-test/tests/auto-regress/bug558618.js +++ b/js/src/jit-test/tests/auto-regress/bug558618.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-e69034463eeb-linux // Flags: -j // -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function f() { this.search = function(a, b, c) { arguments[3] = { } diff --git a/js/src/jit-test/tests/basic/bug535760.js b/js/src/jit-test/tests/basic/bug535760.js index e7e1fce14880..dd00b961522c 100644 --- a/js/src/jit-test/tests/basic/bug535760.js +++ b/js/src/jit-test/tests/basic/bug535760.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function foundit(items, n) { for (var i = 0; i < 10; i++) arguments[2](items, this); diff --git a/js/src/jit-test/tests/basic/bug541191-1.js b/js/src/jit-test/tests/basic/bug541191-1.js index 78f0caf10ad8..74ccae82976e 100644 --- a/js/src/jit-test/tests/basic/bug541191-1.js +++ b/js/src/jit-test/tests/basic/bug541191-1.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-2.js b/js/src/jit-test/tests/basic/bug541191-2.js index 1d232dc332a9..d270b7de1e2b 100644 --- a/js/src/jit-test/tests/basic/bug541191-2.js +++ b/js/src/jit-test/tests/basic/bug541191-2.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-3.js b/js/src/jit-test/tests/basic/bug541191-3.js index f4e01b9e1802..f447d49d1e2d 100644 --- a/js/src/jit-test/tests/basic/bug541191-3.js +++ b/js/src/jit-test/tests/basic/bug541191-3.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-4.js b/js/src/jit-test/tests/basic/bug541191-4.js index 0ecbb9177425..5d15bedb5c16 100644 --- a/js/src/jit-test/tests/basic/bug541191-4.js +++ b/js/src/jit-test/tests/basic/bug541191-4.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-5.js b/js/src/jit-test/tests/basic/bug541191-5.js index a2f9e5714f0c..f87217b2ccee 100644 --- a/js/src/jit-test/tests/basic/bug541191-5.js +++ b/js/src/jit-test/tests/basic/bug541191-5.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug592927.js b/js/src/jit-test/tests/basic/bug592927.js index dc74a5af9062..69f0bd237e46 100644 --- a/js/src/jit-test/tests/basic/bug592927.js +++ b/js/src/jit-test/tests/basic/bug592927.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x, y) { x(f); assertEq(y, "hello"); diff --git a/js/src/jit-test/tests/basic/bug602088.js b/js/src/jit-test/tests/basic/bug602088.js index 283b546acc3c..7e00d9b4c26d 100644 --- a/js/src/jit-test/tests/basic/bug602088.js +++ b/js/src/jit-test/tests/basic/bug602088.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ var p = Proxy.createFunction({}, function(x, y) { undefined.x(); }); print(new p(1, 2)); diff --git a/js/src/jit-test/tests/basic/bug606083.js b/js/src/jit-test/tests/basic/bug606083.js index fc2594b0ead3..d8049b94fa13 100644 --- a/js/src/jit-test/tests/basic/bug606083.js +++ b/js/src/jit-test/tests/basic/bug606083.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(L) { do { L: for (var i = 0; i < L; i++) { diff --git a/js/src/jit-test/tests/basic/bug616762.js b/js/src/jit-test/tests/basic/bug616762.js index 89b8ddd18ab0..02f5c953cf59 100644 --- a/js/src/jit-test/tests/basic/bug616762.js +++ b/js/src/jit-test/tests/basic/bug616762.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: document = { ready: function (x) { this.exec = x; diff --git a/js/src/jit-test/tests/basic/bug633409-1.js b/js/src/jit-test/tests/basic/bug633409-1.js index 1f65ccc8445f..20eaa6cda58e 100644 --- a/js/src/jit-test/tests/basic/bug633409-1.js +++ b/js/src/jit-test/tests/basic/bug633409-1.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: x = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }; for (i in x) diff --git a/js/src/jit-test/tests/basic/bug633409-2.js b/js/src/jit-test/tests/basic/bug633409-2.js index 349af466a2b3..d3c498d6d235 100644 --- a/js/src/jit-test/tests/basic/bug633409-2.js +++ b/js/src/jit-test/tests/basic/bug633409-2.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: var o1 = {p1: 1}; var o2 = {p1: 1, p2: 2}; diff --git a/js/src/jit-test/tests/ion/bug674664-3.js b/js/src/jit-test/tests/ion/bug674664-3.js index 7838e8738048..ce5a828d57c3 100644 --- a/js/src/jit-test/tests/ion/bug674664-3.js +++ b/js/src/jit-test/tests/ion/bug674664-3.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f0(p0) { var v0; do { diff --git a/js/src/jit-test/tests/ion/bug684362.js b/js/src/jit-test/tests/ion/bug684362.js index dd2f606fc653..9a83b053d711 100644 --- a/js/src/jit-test/tests/ion/bug684362.js +++ b/js/src/jit-test/tests/ion/bug684362.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var k = a; T: for (;;) { diff --git a/js/src/jit-test/tests/ion/bug747271.js b/js/src/jit-test/tests/ion/bug747271.js index 2a751177f5ad..176a44a5833a 100644 --- a/js/src/jit-test/tests/ion/bug747271.js +++ b/js/src/jit-test/tests/ion/bug747271.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function randomFloat () { // note that in fuzz-testing, this can used as the size of a buffer to allocate. // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big. diff --git a/js/src/jit-test/tests/ion/bug750588.js b/js/src/jit-test/tests/ion/bug750588.js index 63bab41d6190..6fa44d9cce63 100644 --- a/js/src/jit-test/tests/ion/bug750588.js +++ b/js/src/jit-test/tests/ion/bug750588.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function S() { var t = new Float32Array(1); diff --git a/js/src/jit-test/tests/ion/bug772901.js b/js/src/jit-test/tests/ion/bug772901.js index 13928ced8592..eb71f6afb8a2 100644 --- a/js/src/jit-test/tests/ion/bug772901.js +++ b/js/src/jit-test/tests/ion/bug772901.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { delete ((x)++); diff --git a/js/src/jit-test/tests/ion/testPos.js b/js/src/jit-test/tests/ion/testPos.js index 1d79df2fc636..197650e9b1fb 100644 --- a/js/src/jit-test/tests/ion/testPos.js +++ b/js/src/jit-test/tests/ion/testPos.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f_int(x) { return +x; } diff --git a/js/src/jit-test/tests/ion/testSubtract.js b/js/src/jit-test/tests/ion/testSubtract.js index ad75a03f2ef0..2b4389b2a8fe 100644 --- a/js/src/jit-test/tests/ion/testSubtract.js +++ b/js/src/jit-test/tests/ion/testSubtract.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f_int(x, y) { return x - y; } diff --git a/js/src/jit-test/tests/ion/testVAndBranch.js b/js/src/jit-test/tests/ion/testVAndBranch.js index e2ac44234227..c1fcc00e961f 100644 --- a/js/src/jit-test/tests/ion/testVAndBranch.js +++ b/js/src/jit-test/tests/ion/testVAndBranch.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { if (x) return true; diff --git a/js/src/jit-test/tests/ion/truncateToInt32.js b/js/src/jit-test/tests/ion/truncateToInt32.js index f48b7f16aef7..462b411ad1fe 100644 --- a/js/src/jit-test/tests/ion/truncateToInt32.js +++ b/js/src/jit-test/tests/ion/truncateToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function w(y) { diff --git a/js/src/jit-test/tests/ion/valueToInt32.js b/js/src/jit-test/tests/ion/valueToInt32.js index c879c2d75a10..65ad561eca4d 100644 --- a/js/src/jit-test/tests/ion/valueToInt32.js +++ b/js/src/jit-test/tests/ion/valueToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x, y) { // Confuse the type analysis to not know the type of x. diff --git a/js/src/jit-test/tests/jaeger/bug592973-1.js b/js/src/jit-test/tests/jaeger/bug592973-1.js index 470f84ee359b..d3bafac623db 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-1.js +++ b/js/src/jit-test/tests/jaeger/bug592973-1.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { if (x) { let y; diff --git a/js/src/jit-test/tests/jaeger/bug592973-3.js b/js/src/jit-test/tests/jaeger/bug592973-3.js index ae4694955f5c..541c39981a4c 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-3.js +++ b/js/src/jit-test/tests/jaeger/bug592973-3.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f([a, b, c, d]) { a = b; return function () { return a + b + c + d; }; diff --git a/js/src/jit-test/tests/jaeger/bug597378.js b/js/src/jit-test/tests/jaeger/bug597378.js index 454935bb9320..c766407ab58c 100644 --- a/js/src/jit-test/tests/jaeger/bug597378.js +++ b/js/src/jit-test/tests/jaeger/bug597378.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a, b) { var o = a; var q = b; diff --git a/js/src/jit-test/tests/jaeger/bug600139.js b/js/src/jit-test/tests/jaeger/bug600139.js index 2fdedf42d5cf..61fa7283a03a 100644 --- a/js/src/jit-test/tests/jaeger/bug600139.js +++ b/js/src/jit-test/tests/jaeger/bug600139.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a, b, c) { if (!a.__SSi) { throw Components.returnCode = Cr.NS_ERROR_INVALID_ARG; diff --git a/js/src/jit-test/tests/jaeger/bug600424.js b/js/src/jit-test/tests/jaeger/bug600424.js index 44bb4e7c9b4c..e59a06614f21 100644 --- a/js/src/jit-test/tests/jaeger/bug600424.js +++ b/js/src/jit-test/tests/jaeger/bug600424.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var x = { g: function () { diff --git a/js/src/jit-test/tests/jaeger/bug601982.js b/js/src/jit-test/tests/jaeger/bug601982.js index b78f0704c69d..99f4bf906fc4 100644 --- a/js/src/jit-test/tests/jaeger/bug601982.js +++ b/js/src/jit-test/tests/jaeger/bug601982.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function J(i) { /* Cause a branch to build(?) */ diff --git a/js/src/jit-test/tests/jaeger/bug604381.js b/js/src/jit-test/tests/jaeger/bug604381.js index 365c9e3d2b16..3ca01cb36234 100644 --- a/js/src/jit-test/tests/jaeger/bug604381.js +++ b/js/src/jit-test/tests/jaeger/bug604381.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function F() { var T = { }; diff --git a/js/src/jit-test/tests/jaeger/bug616508.js b/js/src/jit-test/tests/jaeger/bug616508.js index 38ca2360f1aa..d29bf75f9b5e 100644 --- a/js/src/jit-test/tests/jaeger/bug616508.js +++ b/js/src/jit-test/tests/jaeger/bug616508.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: // Note: modified from original test, which used Uint32Array in place of Array, // because the behavior has changed in a way that this will throw a TypeError diff --git a/js/src/jit-test/tests/jaeger/bug625438.js b/js/src/jit-test/tests/jaeger/bug625438.js index 494bfd1342fd..32586d8ab4fa 100644 --- a/js/src/jit-test/tests/jaeger/bug625438.js +++ b/js/src/jit-test/tests/jaeger/bug625438.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: var count = 0; this.watch("x", function() { diff --git a/js/src/jit-test/tests/jaeger/bug627486.js b/js/src/jit-test/tests/jaeger/bug627486.js index f87d27e18a47..7acc3b01e957 100644 --- a/js/src/jit-test/tests/jaeger/bug627486.js +++ b/js/src/jit-test/tests/jaeger/bug627486.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: g = undefined; function L() { } diff --git a/js/src/jit-test/tests/jaeger/floatTypedArrays.js b/js/src/jit-test/tests/jaeger/floatTypedArrays.js index da1abe0c40ea..51ea7c0a16f6 100644 --- a/js/src/jit-test/tests/jaeger/floatTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/floatTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testFloat32Array(L) { var f = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js index dc5ed7b45270..8bb4627fa678 100644 --- a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testInt32Array(L) { var f = new Int32Array(8); diff --git a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js index 3ed2f2bcb553..c63d36bf2aea 100644 --- a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testInt8Array(L) { var f = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js index f9e7825a6378..369aa2c6fb86 100644 --- a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js +++ b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js @@ -1,4 +1,4 @@ -// vim: ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function A() { this.x = 12; diff --git a/js/src/jit-test/tests/jaeger/testDenseCallElem.js b/js/src/jit-test/tests/jaeger/testDenseCallElem.js index eadb77f55b9f..0301048bf31a 100644 --- a/js/src/jit-test/tests/jaeger/testDenseCallElem.js +++ b/js/src/jit-test/tests/jaeger/testDenseCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function fillDense(a) { } diff --git a/js/src/jit-test/tests/jaeger/testForOps.js b/js/src/jit-test/tests/jaeger/testForOps.js index 5704e070de07..382f096121ff 100644 --- a/js/src/jit-test/tests/jaeger/testForOps.js +++ b/js/src/jit-test/tests/jaeger/testForOps.js @@ -1,5 +1,5 @@ // |jit-test| mjitalways -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function assertObjectsEqual(obj1, obj2) { assertEq(obj1.a, obj2.a); diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem.js b/js/src/jit-test/tests/jaeger/testPropCallElem.js index fd067bbf7a50..2bb97fbe64a1 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem2.js b/js/src/jit-test/tests/jaeger/testPropCallElem2.js index 328193ae4b21..43f8efb0fb57 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem2.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem2.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js index 9eb9d0688689..ed8fc7c9a9bb 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testBadSetElems(obj, key) { obj[key] = 5; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js index 146092fbb5d4..01b42bd6b392 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js index 91d71401d489..f202513d534a 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js index 49ea74a8b94c..33e38dd3fc3f 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testSetTypedFloat32Array(k) { var ar = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js index bf3099c50c0f..89e943b698a7 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testSetTypedInt8Array(k) { var ar = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js index cb2ce0059b46..1cbe064d3fef 100644 --- a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js +++ b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var x = a; diff --git a/js/src/jsalloc.cpp b/js/src/jsalloc.cpp index a5ceae2a22c5..744eb68cb9d7 100644 --- a/js/src/jsalloc.cpp +++ b/js/src/jsalloc.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsalloc.h b/js/src/jsalloc.h index 7d76a7c701ad..7d2690b69a79 100644 --- a/js/src/jsalloc.h +++ b/js/src/jsalloc.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index 0e5312f58ce2..bda8e36751e5 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsanalyze.h b/js/src/jsanalyze.h index 2be5bcdaf3c2..e1b60575aaed 100644 --- a/js/src/jsanalyze.h +++ b/js/src/jsanalyze.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsapi-tests/selfTest.cpp b/js/src/jsapi-tests/selfTest.cpp index 91f25ccce612..39202abb5720 100644 --- a/js/src/jsapi-tests/selfTest.cpp +++ b/js/src/jsapi-tests/selfTest.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testAddPropertyPropcache.cpp b/js/src/jsapi-tests/testAddPropertyPropcache.cpp index 8c6979e38a39..666898e5bb32 100644 --- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp +++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArgumentsObject.cpp b/js/src/jsapi-tests/testArgumentsObject.cpp index 81c79608fd73..0d34e41b2dad 100644 --- a/js/src/jsapi-tests/testArgumentsObject.cpp +++ b/js/src/jsapi-tests/testArgumentsObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArrayBuffer.cpp b/js/src/jsapi-tests/testArrayBuffer.cpp index 081146c3d690..a8299a611b51 100644 --- a/js/src/jsapi-tests/testArrayBuffer.cpp +++ b/js/src/jsapi-tests/testArrayBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index 100d432b3f7b..4bda71b5e0fd 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests JS_TransplantObject */ diff --git a/js/src/jsapi-tests/testClassGetter.cpp b/js/src/jsapi-tests/testClassGetter.cpp index 86c3229afce7..5ee3efae034f 100644 --- a/js/src/jsapi-tests/testClassGetter.cpp +++ b/js/src/jsapi-tests/testClassGetter.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests the JSClass::getProperty hook */ diff --git a/js/src/jsapi-tests/testCloneScript.cpp b/js/src/jsapi-tests/testCloneScript.cpp index 14e6882dd431..91ff93d76180 100644 --- a/js/src/jsapi-tests/testCloneScript.cpp +++ b/js/src/jsapi-tests/testCloneScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testContexts.cpp b/js/src/jsapi-tests/testContexts.cpp index 1f65b462a2d0..e863a4086ee1 100644 --- a/js/src/jsapi-tests/testContexts.cpp +++ b/js/src/jsapi-tests/testContexts.cpp @@ -1,11 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "tests.h" BEGIN_TEST(testContexts_IsRunning) diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index 586a24da62ba..577fffa08129 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDeepFreeze.cpp b/js/src/jsapi-tests/testDeepFreeze.cpp index 9b95af5b0bbf..48d31f6bcaa2 100644 --- a/js/src/jsapi-tests/testDeepFreeze.cpp +++ b/js/src/jsapi-tests/testDeepFreeze.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp index 7f07b640e842..d28c8affb58a 100644 --- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp +++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineProperty.cpp b/js/src/jsapi-tests/testDefineProperty.cpp index b5617799adae..739dfafdb6c5 100644 --- a/js/src/jsapi-tests/testDefineProperty.cpp +++ b/js/src/jsapi-tests/testDefineProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testEnclosingFunction.cpp b/js/src/jsapi-tests/testEnclosingFunction.cpp index 2549b6f181aa..0a88f6c598e1 100644 --- a/js/src/jsapi-tests/testEnclosingFunction.cpp +++ b/js/src/jsapi-tests/testEnclosingFunction.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testErrorCopying.cpp b/js/src/jsapi-tests/testErrorCopying.cpp index 1923879d2763..bda243b85265 100644 --- a/js/src/jsapi-tests/testErrorCopying.cpp +++ b/js/src/jsapi-tests/testErrorCopying.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests that the column number of error reports is properly copied over from * other reports when invoked from the C++ api. diff --git a/js/src/jsapi-tests/testFindSCCs.cpp b/js/src/jsapi-tests/testFindSCCs.cpp index 1e98800059e4..ad38b56ac036 100644 --- a/js/src/jsapi-tests/testFindSCCs.cpp +++ b/js/src/jsapi-tests/testFindSCCs.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testFunctionProperties.cpp b/js/src/jsapi-tests/testFunctionProperties.cpp index 9fee41561803..b70f95bcb0e0 100644 --- a/js/src/jsapi-tests/testFunctionProperties.cpp +++ b/js/src/jsapi-tests/testFunctionProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp index 83aa3c774f85..49e3db00f819 100644 --- a/js/src/jsapi-tests/testGCOutOfMemory.cpp +++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/licenses/publicdomain/ diff --git a/js/src/jsapi-tests/testGetPropertyDefault.cpp b/js/src/jsapi-tests/testGetPropertyDefault.cpp index 4dc9664fb921..8aa0323d8c3e 100644 --- a/js/src/jsapi-tests/testGetPropertyDefault.cpp +++ b/js/src/jsapi-tests/testGetPropertyDefault.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIndexToString.cpp b/js/src/jsapi-tests/testIndexToString.cpp index 0b59b6f0b402..998e65218614 100644 --- a/js/src/jsapi-tests/testIndexToString.cpp +++ b/js/src/jsapi-tests/testIndexToString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIntString.cpp b/js/src/jsapi-tests/testIntString.cpp index 18b3d53371e5..fc627d62430d 100644 --- a/js/src/jsapi-tests/testIntString.cpp +++ b/js/src/jsapi-tests/testIntString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp index 875ae83094be..72d92e751432 100644 --- a/js/src/jsapi-tests/testJSEvaluateScript.cpp +++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testLookup.cpp b/js/src/jsapi-tests/testLookup.cpp index 65edab7c0ebc..c7fa9f7fea26 100644 --- a/js/src/jsapi-tests/testLookup.cpp +++ b/js/src/jsapi-tests/testLookup.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testNewObject.cpp b/js/src/jsapi-tests/testNewObject.cpp index 5a97aa72e4ad..302708766d4d 100644 --- a/js/src/jsapi-tests/testNewObject.cpp +++ b/js/src/jsapi-tests/testNewObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp index e0f7d8fa68ed..ee7b09ad4193 100644 --- a/js/src/jsapi-tests/testOps.cpp +++ b/js/src/jsapi-tests/testOps.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests for operators and implicit type conversion. */ diff --git a/js/src/jsapi-tests/testParseJSON.cpp b/js/src/jsapi-tests/testParseJSON.cpp index abfe849ec214..87255505bc6f 100644 --- a/js/src/jsapi-tests/testParseJSON.cpp +++ b/js/src/jsapi-tests/testParseJSON.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testProfileStrings.cpp b/js/src/jsapi-tests/testProfileStrings.cpp index d02426e19ec6..a6dd78638af4 100644 --- a/js/src/jsapi-tests/testProfileStrings.cpp +++ b/js/src/jsapi-tests/testProfileStrings.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests the stack-based instrumentation profiler on a JSRuntime */ diff --git a/js/src/jsapi-tests/testPropCache.cpp b/js/src/jsapi-tests/testPropCache.cpp index 799347bd0567..96116535c645 100644 --- a/js/src/jsapi-tests/testPropCache.cpp +++ b/js/src/jsapi-tests/testPropCache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp index 5fdebda8acac..717c7dccac2b 100644 --- a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp +++ b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testResolveRecursion.cpp b/js/src/jsapi-tests/testResolveRecursion.cpp index f5f6bbffa6b5..f860a4970fdf 100644 --- a/js/src/jsapi-tests/testResolveRecursion.cpp +++ b/js/src/jsapi-tests/testResolveRecursion.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSameValue.cpp b/js/src/jsapi-tests/testSameValue.cpp index 6f1c75b54e60..3d35df3a671b 100644 --- a/js/src/jsapi-tests/testSameValue.cpp +++ b/js/src/jsapi-tests/testSameValue.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptInfo.cpp b/js/src/jsapi-tests/testScriptInfo.cpp index 3265ed9fc430..2fa8f29429a4 100644 --- a/js/src/jsapi-tests/testScriptInfo.cpp +++ b/js/src/jsapi-tests/testScriptInfo.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp index 4075976864c7..29a522dfa857 100644 --- a/js/src/jsapi-tests/testScriptObject.cpp +++ b/js/src/jsapi-tests/testScriptObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSetProperty.cpp b/js/src/jsapi-tests/testSetProperty.cpp index 598d5d24d8fa..8003c473b35a 100644 --- a/js/src/jsapi-tests/testSetProperty.cpp +++ b/js/src/jsapi-tests/testSetProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testStringBuffer.cpp b/js/src/jsapi-tests/testStringBuffer.cpp index 51c232381d27..ebbd2dff1f61 100644 --- a/js/src/jsapi-tests/testStringBuffer.cpp +++ b/js/src/jsapi-tests/testStringBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTrap.cpp b/js/src/jsapi-tests/testTrap.cpp index 3e66a388ec06..a1bde8d9d2d8 100644 --- a/js/src/jsapi-tests/testTrap.cpp +++ b/js/src/jsapi-tests/testTrap.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTypedArrays.cpp b/js/src/jsapi-tests/testTypedArrays.cpp index 00ec3704e356..8aba225ac576 100644 --- a/js/src/jsapi-tests/testTypedArrays.cpp +++ b/js/src/jsapi-tests/testTypedArrays.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testUTF8.cpp b/js/src/jsapi-tests/testUTF8.cpp index 941177369b89..2ec6b06898ef 100644 --- a/js/src/jsapi-tests/testUTF8.cpp +++ b/js/src/jsapi-tests/testUTF8.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp index e8d934a83d6d..c47d82897726 100644 --- a/js/src/jsapi-tests/testXDR.cpp +++ b/js/src/jsapi-tests/testXDR.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/tests.cpp b/js/src/jsapi-tests/tests.cpp index 6ce8c30b6244..30b89be2d3b8 100644 --- a/js/src/jsapi-tests/tests.cpp +++ b/js/src/jsapi-tests/tests.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index 60c3ba75d893..c3c7e4cb8265 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi-tests/valueABI.c b/js/src/jsapi-tests/valueABI.c index 89a5693ee393..65b31d38c48e 100644 --- a/js/src/jsapi-tests/valueABI.c +++ b/js/src/jsapi-tests/valueABI.c @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sw=4 et tw=99 ft=c: - * * 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/. */ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index cfba78bcd547..ec8768853859 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi.h b/js/src/jsapi.h index ecc48aa638b2..9bcb80d2f422 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 3a54f904630e..593b7ec9171e 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsarray.h b/js/src/jsarray.h index a61d7a829deb..7cb15822c18b 100644 --- a/js/src/jsarray.h +++ b/js/src/jsarray.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp index e0178dedd302..a675149a54aa 100644 --- a/js/src/jsatom.cpp +++ b/js/src/jsatom.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatom.h b/js/src/jsatom.h index 9ff01bd6fac1..1aa15269e9d6 100644 --- a/js/src/jsatom.h +++ b/js/src/jsatom.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatominlines.h b/js/src/jsatominlines.h index 2d5df3d44029..421bf141b6be 100644 --- a/js/src/jsatominlines.h +++ b/js/src/jsatominlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp index 843c3294c8b8..217572a80310 100644 --- a/js/src/jsbool.cpp +++ b/js/src/jsbool.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsbool.h b/js/src/jsbool.h index 1676d523af87..0d847ec30514 100644 --- a/js/src/jsbool.h +++ b/js/src/jsbool.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsboolinlines.h b/js/src/jsboolinlines.h index 1f2b361d276e..58ed270c1966 100644 --- a/js/src/jsboolinlines.h +++ b/js/src/jsboolinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclass.h b/js/src/jsclass.h index bb01ff046043..7d37d69adfb5 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclist.h b/js/src/jsclist.h index 4881104eee79..8782307fa4ab 100644 --- a/js/src/jsclist.h +++ b/js/src/jsclist.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsclone.cpp b/js/src/jsclone.cpp index e3b249e486eb..885bfc01a1ba 100644 --- a/js/src/jsclone.cpp +++ b/js/src/jsclone.cpp @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclone.h b/js/src/jsclone.h index 5a3326152b65..595bf8f013a1 100644 --- a/js/src/jsclone.h +++ b/js/src/jsclone.h @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 9da194a90cf8..e9738381eee5 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 01ca74eba0e7..e1c73498bb41 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 604b206b5ab9..6384cade797a 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index 41961c8b8b2e..2a6dc4dc4edf 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index d4fda4b68e7d..454f13137d3a 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartmentinlines.h b/js/src/jscompartmentinlines.h index e9724ff9b047..c9c747b55e96 100644 --- a/js/src/jscompartmentinlines.h +++ b/js/src/jscompartmentinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscpucfg.h b/js/src/jscpucfg.h index 3d2022dbe292..1b7baf996f1a 100644 --- a/js/src/jscpucfg.h +++ b/js/src/jscpucfg.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashformat.h b/js/src/jscrashformat.h index cf274f336018..7d3940d9f661 100644 --- a/js/src/jscrashformat.h +++ b/js/src/jscrashformat.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashreport.cpp b/js/src/jscrashreport.cpp index 6cb415aeb716..1ebac89fa44f 100644 --- a/js/src/jscrashreport.cpp +++ b/js/src/jscrashreport.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashreport.h b/js/src/jscrashreport.h index beeb76151ba1..cb2336be00d1 100644 --- a/js/src/jscrashreport.h +++ b/js/src/jscrashreport.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index b3ce396f860d..d98dc5b9e59c 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdate.h b/js/src/jsdate.h index 514160ecd634..67c2ca067981 100644 --- a/js/src/jsdate.h +++ b/js/src/jsdate.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index be6e447aad9c..a3ed445bd705 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index e47c33a85718..d6f5b2e9db25 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdhash.cpp b/js/src/jsdhash.cpp index 51b5cb5d94bd..00b0dbdbc04b 100644 --- a/js/src/jsdhash.cpp +++ b/js/src/jsdhash.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsdhash.h b/js/src/jsdhash.h index c8f02b18b708..1f7830fd2b1f 100644 --- a/js/src/jsdhash.h +++ b/js/src/jsdhash.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.cpp index b8b57eb3f368..9d94bebaf5e9 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/jsdtoa.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdtoa.h b/js/src/jsdtoa.h index c55b8277ed40..dfd5393d1090 100644 --- a/js/src/jsdtoa.h +++ b/js/src/jsdtoa.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 68a5e1da59c2..d6b8e4add71c 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsexn.h b/js/src/jsexn.h index 4d14278db6f8..c7b8882bdce6 100644 --- a/js/src/jsexn.h +++ b/js/src/jsexn.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index d2e8a0b84b12..cb69671550fe 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index a95600ac89a7..c0f4c975cb29 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 80ab7636f8a9..541dc965ce26 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 4fce726bc1cf..d1cf351dcbc0 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ @@ -212,7 +212,7 @@ class JSFunction : public JSObject js::RawScript getOrCreateScript(JSContext *cx) { JS_ASSERT(isInterpreted()); - JS_ASSERT(cx); + JS_ASSERT(cx); if (isInterpretedLazy()) { JS::RootedFunction self(cx, this); js::MaybeCheckStackRoots(cx); diff --git a/js/src/jsfuninlines.h b/js/src/jsfuninlines.h index 0a0b49ad79c4..a15eb7ec3b48 100644 --- a/js/src/jsfuninlines.h +++ b/js/src/jsfuninlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index f89147853304..7e5e0fda211c 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 6b26f57faadb..22894caf3bdf 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index a684d0636d5f..9fc17ff96585 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index 508eb23b1413..75d40a8f30e7 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index 1043a9954265..2d26722ad9f7 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinferinlines.h b/js/src/jsinferinlines.h index c6d29d39a7ea..c3dbb5f8f067 100644 --- a/js/src/jsinferinlines.h +++ b/js/src/jsinferinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index f1bb3881c222..2da5e5a97ba0 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index 9cbd70dbeafa..9887aa0e6db9 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinterpinlines.h b/js/src/jsinterpinlines.h index 56a513dd30bc..989cb28cb43c 100644 --- a/js/src/jsinterpinlines.h +++ b/js/src/jsinterpinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 0308f4daee56..60d9531003c5 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsiter.h b/js/src/jsiter.h index 3d7627384df6..6640de902901 100644 --- a/js/src/jsiter.h +++ b/js/src/jsiter.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jskwgen.cpp b/js/src/jskwgen.cpp index c488184603f7..c5e66707fb98 100644 --- a/js/src/jskwgen.cpp +++ b/js/src/jskwgen.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jslibmath.h b/js/src/jslibmath.h index 778d7f8ae1de..bcd136a1a79b 100644 --- a/js/src/jslibmath.h +++ b/js/src/jslibmath.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jslock.h b/js/src/jslock.h index 025aaea0af82..b4a28a9fa9c4 100644 --- a/js/src/jslock.h +++ b/js/src/jslock.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + #ifndef jslock_h__ #define jslock_h__ diff --git a/js/src/jslog2.cpp b/js/src/jslog2.cpp index d02400721365..cee3d0d13e22 100644 --- a/js/src/jslog2.cpp +++ b/js/src/jslog2.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index aa0526391cac..8f889b82151d 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsmath.h b/js/src/jsmath.h index 91150d809fc9..4f2a4b467eca 100644 --- a/js/src/jsmath.h +++ b/js/src/jsmath.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsmemorymetrics.cpp b/js/src/jsmemorymetrics.cpp index 351d965446e5..2b309f6fbba8 100644 --- a/js/src/jsmemorymetrics.cpp +++ b/js/src/jsmemorymetrics.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 9fec01d35f0d..cd301292d72d 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -1,7 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 et sw=4 tw=80: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsnativestack.h b/js/src/jsnativestack.h index 3f823f56d22f..916bee2d0394 100644 --- a/js/src/jsnativestack.h +++ b/js/src/jsnativestack.h @@ -1,7 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 et sw=4 tw=80: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index e89b967840ae..a982b33ca446 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnum.h b/js/src/jsnum.h index 653ff12fddf0..0f765f3c616b 100644 --- a/js/src/jsnum.h +++ b/js/src/jsnum.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnuminlines.h b/js/src/jsnuminlines.h index c17909fdb52e..1c4dcf515d56 100644 --- a/js/src/jsnuminlines.h +++ b/js/src/jsnuminlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 50097ee541bc..122aa48b0576 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 919e33229145..8579222b1c11 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index a78e32222ba7..e00de1cb4160 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/json.cpp b/js/src/json.cpp index 66e73b9dea9a..f58060abc4a5 100644 --- a/js/src/json.cpp +++ b/js/src/json.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/json.h b/js/src/json.h index bb21f9145151..7fa2c117c804 100644 --- a/js/src/json.h +++ b/js/src/json.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsonparser.cpp b/js/src/jsonparser.cpp index 3b4b1ebb2a8c..9c89d08b4997 100644 --- a/js/src/jsonparser.cpp +++ b/js/src/jsonparser.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsonparser.h b/js/src/jsonparser.h index 10c954055ff8..d8df9946b27b 100644 --- a/js/src/jsonparser.h +++ b/js/src/jsonparser.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index aafd8bbf4b6e..2ce6dfc2c2a0 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcode.h b/js/src/jsopcode.h index 1d1e17cbce46..f0ec5c580cb3 100644 --- a/js/src/jsopcode.h +++ b/js/src/jsopcode.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcodeinlines.h b/js/src/jsopcodeinlines.h index 5fd85cd891da..701be7785e5a 100644 --- a/js/src/jsopcodeinlines.h +++ b/js/src/jsopcodeinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsoplengen.cpp b/js/src/jsoplengen.cpp index 4bef284c5f5f..808f5ed778b9 100644 --- a/js/src/jsoplengen.cpp +++ b/js/src/jsoplengen.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprf.cpp b/js/src/jsprf.cpp index 0a2ebc8e41e5..08fb08ff3fb5 100644 --- a/js/src/jsprf.cpp +++ b/js/src/jsprf.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprf.h b/js/src/jsprf.h index 4c2bef91d29e..c0891f0e9e90 100644 --- a/js/src/jsprf.h +++ b/js/src/jsprf.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprobes.cpp b/js/src/jsprobes.cpp index 3a103ea612b0..b2217b1b8c1f 100644 --- a/js/src/jsprobes.cpp +++ b/js/src/jsprobes.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h index 601bc5c70a03..0bd391a2b70a 100644 --- a/js/src/jsprobes.h +++ b/js/src/jsprobes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycache.cpp b/js/src/jspropertycache.cpp index 20d074edd5f1..98a84f21df78 100644 --- a/js/src/jspropertycache.cpp +++ b/js/src/jspropertycache.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=98: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycache.h b/js/src/jspropertycache.h index b63aff4c7026..ce0acab2c78f 100644 --- a/js/src/jspropertycache.h +++ b/js/src/jspropertycache.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=98: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycacheinlines.h b/js/src/jspropertycacheinlines.h index 48e1a7874db7..910a9e180a74 100644 --- a/js/src/jspropertycacheinlines.h +++ b/js/src/jspropertycacheinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertytree.cpp b/js/src/jspropertytree.cpp index cf32bfac4e1a..6e8843821c1d 100644 --- a/js/src/jspropertytree.cpp +++ b/js/src/jspropertytree.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jspropertytree.h b/js/src/jspropertytree.h index 4c3fbd725a2a..d269e2937c4e 100644 --- a/js/src/jspropertytree.h +++ b/js/src/jspropertytree.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprototypes.h b/js/src/jsprototypes.h index 27f5c84450b1..007d25d7204f 100644 --- a/js/src/jsprototypes.h +++ b/js/src/jsprototypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index 23220564a573..2d726d7e45ee 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -1,10 +1,9 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. - */ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include #include "jsapi.h" #include "jscntxt.h" diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index a6f7851744c8..54e91db7fa61 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index a131e61ba6e0..4db5ed8c36d0 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 2159dd4f6cc6..ab124ee57104 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsreflect.cpp b/js/src/jsreflect.cpp index 16978563e9c8..e97e31344415 100644 --- a/js/src/jsreflect.cpp +++ b/js/src/jsreflect.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsreflect.h b/js/src/jsreflect.h index b517c1bc4d90..be973527970c 100644 --- a/js/src/jsreflect.h +++ b/js/src/jsreflect.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index ed61d59d663b..3135a6159e31 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 595287a6b12b..38f8b8d69d6e 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscriptinlines.h b/js/src/jsscriptinlines.h index 2861ea2e5f4c..560aa44a14ab 100644 --- a/js/src/jsscriptinlines.h +++ b/js/src/jsscriptinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79 ft=cpp: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index de0dd134c7aa..976ca4b776a9 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 10ae7b2fc106..8a1d270ad720 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstrinlines.h b/js/src/jsstrinlines.h index 82550466197c..262a1d11a33a 100644 --- a/js/src/jsstrinlines.h +++ b/js/src/jsstrinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index bc07ee898708..402cf9c35998 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypedarray.h b/js/src/jstypedarray.h index 08ad9479e92c..05cfdec260c2 100644 --- a/js/src/jstypedarray.h +++ b/js/src/jstypedarray.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypedarrayinlines.h b/js/src/jstypedarrayinlines.h index 22e30038b946..952ecb100505 100644 --- a/js/src/jstypedarrayinlines.h +++ b/js/src/jstypedarrayinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypes.h b/js/src/jstypes.h index c83e7fed26e3..b597cf3b987b 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsutil.cpp b/js/src/jsutil.cpp index f04077996b08..fc4341002444 100644 --- a/js/src/jsutil.cpp +++ b/js/src/jsutil.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsutil.h b/js/src/jsutil.h index ff77e41a8893..ed7e0989e0f7 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsversion.h b/js/src/jsversion.h index 50e2fa6beb0b..64f2ad217675 100644 --- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp index 152eb4d0f211..42b6a272bd8d 100644 --- a/js/src/jswatchpoint.cpp +++ b/js/src/jswatchpoint.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswatchpoint.h b/js/src/jswatchpoint.h index 2c05f77c77f3..47179327d6df 100644 --- a/js/src/jswatchpoint.h +++ b/js/src/jswatchpoint.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakcache.h b/js/src/jsweakcache.h index bc3ac58b2c57..54d810032461 100644 --- a/js/src/jsweakcache.h +++ b/js/src/jsweakcache.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index dc0abbea626b..07fcbcd0885c 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakmap.h b/js/src/jsweakmap.h index 47a7f42eff72..bc130e10c6ef 100644 --- a/js/src/jsweakmap.h +++ b/js/src/jsweakmap.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswin.h b/js/src/jswin.h index 50b548cb8fd7..689d23810677 100644 --- a/js/src/jswin.h +++ b/js/src/jswin.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsworkers.cpp b/js/src/jsworkers.cpp index d80ee15f3037..f6a2e279f741 100644 --- a/js/src/jsworkers.cpp +++ b/js/src/jsworkers.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsworkers.h b/js/src/jsworkers.h index a3b7edafda00..89baca26d7ca 100644 --- a/js/src/jsworkers.h +++ b/js/src/jsworkers.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 49958bf7920b..99be761711f8 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index 520191eef739..222ad6c95e48 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/BaseAssembler.h b/js/src/methodjit/BaseAssembler.h index 7b84a48e532f..9e3af92cd4dc 100644 --- a/js/src/methodjit/BaseAssembler.h +++ b/js/src/methodjit/BaseAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/BaseCompiler.h b/js/src/methodjit/BaseCompiler.h index 3531ec04d773..ad3af9d3da38 100644 --- a/js/src/methodjit/BaseCompiler.h +++ b/js/src/methodjit/BaseCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/CodeGenIncludes.h b/js/src/methodjit/CodeGenIncludes.h index 23378e5e7e89..3cddee0a5638 100644 --- a/js/src/methodjit/CodeGenIncludes.h +++ b/js/src/methodjit/CodeGenIncludes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index ef5680120c5d..b934effe95db 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Compiler.h b/js/src/methodjit/Compiler.h index 5cafd3e298a4..9652a071c8fb 100644 --- a/js/src/methodjit/Compiler.h +++ b/js/src/methodjit/Compiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastArithmetic.cpp b/js/src/methodjit/FastArithmetic.cpp index f2f6d19a1ea2..44c2361cacb3 100644 --- a/js/src/methodjit/FastArithmetic.cpp +++ b/js/src/methodjit/FastArithmetic.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastBuiltins.cpp b/js/src/methodjit/FastBuiltins.cpp index 5415930e9ab2..8d907b836fbc 100644 --- a/js/src/methodjit/FastBuiltins.cpp +++ b/js/src/methodjit/FastBuiltins.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastOps.cpp b/js/src/methodjit/FastOps.cpp index 45d038a9047c..4d6ec3126640 100644 --- a/js/src/methodjit/FastOps.cpp +++ b/js/src/methodjit/FastOps.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameEntry.h b/js/src/methodjit/FrameEntry.h index 53e6b0b493c0..5d3b5c38218f 100644 --- a/js/src/methodjit/FrameEntry.h +++ b/js/src/methodjit/FrameEntry.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState-inl.h b/js/src/methodjit/FrameState-inl.h index a12867a47e38..0a4b6439c1e5 100644 --- a/js/src/methodjit/FrameState-inl.h +++ b/js/src/methodjit/FrameState-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState.cpp b/js/src/methodjit/FrameState.cpp index bdfbf2ffbece..186fb524e86c 100644 --- a/js/src/methodjit/FrameState.cpp +++ b/js/src/methodjit/FrameState.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState.h b/js/src/methodjit/FrameState.h index 85f1f959d913..f568943a70c3 100644 --- a/js/src/methodjit/FrameState.h +++ b/js/src/methodjit/FrameState.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICChecker.h b/js/src/methodjit/ICChecker.h index 93c4889bf992..44c06cc100e5 100644 --- a/js/src/methodjit/ICChecker.h +++ b/js/src/methodjit/ICChecker.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICLabels.h b/js/src/methodjit/ICLabels.h index 4b422ff94883..8d4e8ad2106c 100644 --- a/js/src/methodjit/ICLabels.h +++ b/js/src/methodjit/ICLabels.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICRepatcher.h b/js/src/methodjit/ICRepatcher.h index 79c7666b9a00..2d5ea4035caa 100644 --- a/js/src/methodjit/ICRepatcher.h +++ b/js/src/methodjit/ICRepatcher.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.cpp b/js/src/methodjit/ImmutableSync.cpp index a763b5c0a479..7cef76bb72ff 100644 --- a/js/src/methodjit/ImmutableSync.cpp +++ b/js/src/methodjit/ImmutableSync.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.h b/js/src/methodjit/ImmutableSync.h index f232175db78f..bd1429efa655 100644 --- a/js/src/methodjit/ImmutableSync.h +++ b/js/src/methodjit/ImmutableSync.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/InlineFrameAssembler.h b/js/src/methodjit/InlineFrameAssembler.h index 12d3bac8f3b6..b80bb52d24bd 100644 --- a/js/src/methodjit/InlineFrameAssembler.h +++ b/js/src/methodjit/InlineFrameAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp index c02d6db68996..582558fb60f2 100644 --- a/js/src/methodjit/InvokeHelpers.cpp +++ b/js/src/methodjit/InvokeHelpers.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Logging.cpp b/js/src/methodjit/Logging.cpp index 5bca55ccc240..7ecf536d8bb1 100644 --- a/js/src/methodjit/Logging.cpp +++ b/js/src/methodjit/Logging.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Logging.h b/js/src/methodjit/Logging.h index fff123e911ce..6825f0313695 100644 --- a/js/src/methodjit/Logging.h +++ b/js/src/methodjit/Logging.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/LoopState.cpp b/js/src/methodjit/LoopState.cpp index 21e65fd40865..92e9c6dffce8 100644 --- a/js/src/methodjit/LoopState.cpp +++ b/js/src/methodjit/LoopState.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/LoopState.h b/js/src/methodjit/LoopState.h index 6280bf2598bc..3518ba88e5eb 100644 --- a/js/src/methodjit/LoopState.h +++ b/js/src/methodjit/LoopState.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MachineRegs.h b/js/src/methodjit/MachineRegs.h index e355dd7b6cab..2b5d80c51600 100644 --- a/js/src/methodjit/MachineRegs.h +++ b/js/src/methodjit/MachineRegs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp index 94f145bf00fd..7741b59b7fa9 100644 --- a/js/src/methodjit/MethodJIT.cpp +++ b/js/src/methodjit/MethodJIT.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MethodJIT.h b/js/src/methodjit/MethodJIT.h index c813d1fc47f6..a60415f82e0c 100644 --- a/js/src/methodjit/MethodJIT.h +++ b/js/src/methodjit/MethodJIT.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MonoIC.cpp b/js/src/methodjit/MonoIC.cpp index b07bdeab577d..f633ef29d8a9 100644 --- a/js/src/methodjit/MonoIC.cpp +++ b/js/src/methodjit/MonoIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MonoIC.h b/js/src/methodjit/MonoIC.h index 852dacc02f65..acb0acdc6aef 100644 --- a/js/src/methodjit/MonoIC.h +++ b/js/src/methodjit/MonoIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/NunboxAssembler.h b/js/src/methodjit/NunboxAssembler.h index 9d764a5f0e88..8c30afc06815 100644 --- a/js/src/methodjit/NunboxAssembler.h +++ b/js/src/methodjit/NunboxAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PolyIC.cpp b/js/src/methodjit/PolyIC.cpp index df176bc13de1..f76a68abdbf0 100644 --- a/js/src/methodjit/PolyIC.cpp +++ b/js/src/methodjit/PolyIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PolyIC.h b/js/src/methodjit/PolyIC.h index f7b4423c3f09..e17226aaeb2a 100644 --- a/js/src/methodjit/PolyIC.h +++ b/js/src/methodjit/PolyIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PunboxAssembler.h b/js/src/methodjit/PunboxAssembler.h index 959ba595f306..7a066bd4ffc9 100644 --- a/js/src/methodjit/PunboxAssembler.h +++ b/js/src/methodjit/PunboxAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/RematInfo.h b/js/src/methodjit/RematInfo.h index cd9ec7a2e50d..c0bdc40e3881 100644 --- a/js/src/methodjit/RematInfo.h +++ b/js/src/methodjit/RematInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Retcon.cpp b/js/src/methodjit/Retcon.cpp index d91286108123..2479236a3a5c 100644 --- a/js/src/methodjit/Retcon.cpp +++ b/js/src/methodjit/Retcon.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Retcon.h b/js/src/methodjit/Retcon.h index d4e688bf7046..8e4105644347 100644 --- a/js/src/methodjit/Retcon.h +++ b/js/src/methodjit/Retcon.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls-inl.h b/js/src/methodjit/StubCalls-inl.h index cf5903865f93..47f4725e04fa 100644 --- a/js/src/methodjit/StubCalls-inl.h +++ b/js/src/methodjit/StubCalls-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls.cpp b/js/src/methodjit/StubCalls.cpp index 5a6a8f956c2b..f2ba2f6939a9 100644 --- a/js/src/methodjit/StubCalls.cpp +++ b/js/src/methodjit/StubCalls.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls.h b/js/src/methodjit/StubCalls.h index 23dc2420d03f..e620b37dba3d 100644 --- a/js/src/methodjit/StubCalls.h +++ b/js/src/methodjit/StubCalls.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCompiler.cpp b/js/src/methodjit/StubCompiler.cpp index f366d8e826ac..77754e2f60f9 100644 --- a/js/src/methodjit/StubCompiler.cpp +++ b/js/src/methodjit/StubCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCompiler.h b/js/src/methodjit/StubCompiler.h index e2a0d49c4e03..be3b4b97c021 100644 --- a/js/src/methodjit/StubCompiler.h +++ b/js/src/methodjit/StubCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.cpp b/js/src/methodjit/TrampolineCompiler.cpp index 81478f2d8891..4860a7ecb522 100644 --- a/js/src/methodjit/TrampolineCompiler.cpp +++ b/js/src/methodjit/TrampolineCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.h b/js/src/methodjit/TrampolineCompiler.h index 11e118be78fe..e3d4a6e8bffc 100644 --- a/js/src/methodjit/TrampolineCompiler.h +++ b/js/src/methodjit/TrampolineCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineMIPS.cpp b/js/src/methodjit/TrampolineMIPS.cpp index 7be2e42d01a3..4da001eda725 100644 --- a/js/src/methodjit/TrampolineMIPS.cpp +++ b/js/src/methodjit/TrampolineMIPS.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TypedArrayIC.h b/js/src/methodjit/TypedArrayIC.h index aa86cb2f8ead..16deeb770adb 100644 --- a/js/src/methodjit/TypedArrayIC.h +++ b/js/src/methodjit/TypedArrayIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/perf/jsperf.cpp b/js/src/perf/jsperf.cpp index 7caa12a50a28..7c2abd24c11a 100644 --- a/js/src/perf/jsperf.cpp +++ b/js/src/perf/jsperf.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/jsperf.h b/js/src/perf/jsperf.h index 265478c33ebb..aaf513342736 100644 --- a/js/src/perf/jsperf.h +++ b/js/src/perf/jsperf.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_linux.cpp b/js/src/perf/pm_linux.cpp index 3156354bdff7..de5675eff5e9 100644 --- a/js/src/perf/pm_linux.cpp +++ b/js/src/perf/pm_linux.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_stub.cpp b/js/src/perf/pm_stub.cpp index 4af53cb1250f..cf82288f093c 100644 --- a/js/src/perf/pm_stub.cpp +++ b/js/src/perf/pm_stub.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/prmjtime.cpp b/js/src/prmjtime.cpp index a5bb6478220b..4fa2ae2359ff 100644 --- a/js/src/prmjtime.cpp +++ b/js/src/prmjtime.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/prmjtime.h b/js/src/prmjtime.h index e7b13c35d4a0..30ee7c080b99 100644 --- a/js/src/prmjtime.h +++ b/js/src/prmjtime.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 4c496dc4f09b..c58c6c0d1408 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsheaptools.cpp b/js/src/shell/jsheaptools.cpp index 4cae34a43cf5..e5d38ba1538c 100644 --- a/js/src/shell/jsheaptools.cpp +++ b/js/src/shell/jsheaptools.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsheaptools.h b/js/src/shell/jsheaptools.h index 55e12ab39ffc..326102668a2c 100644 --- a/js/src/shell/jsheaptools.h +++ b/js/src/shell/jsheaptools.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index 1a54690de8c8..0556b747eb76 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsoptparse.h b/js/src/shell/jsoptparse.h index 7e2ef72e994a..9e52cb97871a 100644 --- a/js/src/shell/jsoptparse.h +++ b/js/src/shell/jsoptparse.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-010-n.js b/js/src/tests/ecma_2/Exceptions/exception-010-n.js index 95f5ef725d3d..51931804e4ca 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-010-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-010-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-011-n.js b/js/src/tests/ecma_2/Exceptions/exception-011-n.js index 533765a69f28..dc08346ca9a1 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-011-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-011-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js index f19fce62e90f..932f51ab804e 100644 --- a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js +++ b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Exceptions/regress-58946.js b/js/src/tests/ecma_3/Exceptions/regress-58946.js index c961e5ab739a..1147fdd633d6 100644 --- a/js/src/tests/ecma_3/Exceptions/regress-58946.js +++ b/js/src/tests/ecma_3/Exceptions/regress-58946.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js index 3f8b6a84778f..5352534a3f38 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js index 1e6b115a61b2..97ec349a0e59 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js index 41ae113c9123..1a6cb1a21ddc 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js +++ b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001-n.js b/js/src/tests/ecma_3/FunExpr/fe-001-n.js index 55c57212ec40..d1f9c3e49545 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001-n.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001.js b/js/src/tests/ecma_3/FunExpr/fe-001.js index a68d6e10aa12..f80f34e2e8c4 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-002.js b/js/src/tests/ecma_3/FunExpr/fe-002.js index 9ee5bfbaf250..5619fbbb65da 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-002.js +++ b/js/src/tests/ecma_3/FunExpr/fe-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js index 49915472953e..8634f53dd4f7 100644 --- a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js +++ b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-24712.js b/js/src/tests/ecma_3/RegExp/regress-24712.js index dfaded2661f0..d675f6a3c184 100644 --- a/js/src/tests/ecma_3/RegExp/regress-24712.js +++ b/js/src/tests/ecma_3/RegExp/regress-24712.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-28686.js b/js/src/tests/ecma_3/RegExp/regress-28686.js index 669455ba6893..1e3871f1968c 100644 --- a/js/src/tests/ecma_3/RegExp/regress-28686.js +++ b/js/src/tests/ecma_3/RegExp/regress-28686.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001-n.js b/js/src/tests/ecma_3/Unicode/uc-001-n.js index 80dc1a782939..566c7459f5a7 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001.js b/js/src/tests/ecma_3/Unicode/uc-001.js index 2a81693d5ff1..bfb8fd515ef4 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001.js +++ b/js/src/tests/ecma_3/Unicode/uc-001.js @@ -1,6 +1,5 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002-n.js b/js/src/tests/ecma_3/Unicode/uc-002-n.js index 6d673f88b983..ca09090d6304 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-002-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002.js b/js/src/tests/ecma_3/Unicode/uc-002.js index 93d78b9ebb70..1ff15d3769ab 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002.js +++ b/js/src/tests/ecma_3/Unicode/uc-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-003.js b/js/src/tests/ecma_3/Unicode/uc-003.js index f77b3b9dcea0..d06815cf941a 100644 --- a/js/src/tests/ecma_3/Unicode/uc-003.js +++ b/js/src/tests/ecma_3/Unicode/uc-003.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-004.js b/js/src/tests/ecma_3/Unicode/uc-004.js index a82eb3528c37..5d243d56de3f 100644 --- a/js/src/tests/ecma_3/Unicode/uc-004.js +++ b/js/src/tests/ecma_3/Unicode/uc-004.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js index 08b9f52d499a..fbbcecd3bc99 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js index c768f1f046f8..0d4e1767e5e4 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/GetSet/getset-002.js b/js/src/tests/js1_5/GetSet/getset-002.js index 114a282fb778..d2a5c2218024 100644 --- a/js/src/tests/js1_5/GetSet/getset-002.js +++ b/js/src/tests/js1_5/GetSet/getset-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001-n.js b/js/src/tests/js1_5/extensions/catchguard-001-n.js index 8d357fd39ac4..8e0a5ad7feee 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001-n.js +++ b/js/src/tests/js1_5/extensions/catchguard-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001.js b/js/src/tests/js1_5/extensions/catchguard-001.js index c1e447f105f4..da531a13ec3b 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001.js +++ b/js/src/tests/js1_5/extensions/catchguard-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-002.js b/js/src/tests/js1_5/extensions/catchguard-002.js index 8148ca45e455..da590140236a 100644 --- a/js/src/tests/js1_5/extensions/catchguard-002.js +++ b/js/src/tests/js1_5/extensions/catchguard-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-003.js b/js/src/tests/js1_5/extensions/catchguard-003.js index 9e64f89d23ed..97f2cbfea310 100644 --- a/js/src/tests/js1_5/extensions/catchguard-003.js +++ b/js/src/tests/js1_5/extensions/catchguard-003.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/getset-001.js b/js/src/tests/js1_5/extensions/getset-001.js index 2e6b9488dab5..2609f359aa9c 100644 --- a/js/src/tests/js1_5/extensions/getset-001.js +++ b/js/src/tests/js1_5/extensions/getset-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447-1.js b/js/src/tests/js1_5/extensions/regress-50447-1.js index 55ca6aca7f00..4d08d3825e03 100644 --- a/js/src/tests/js1_5/extensions/regress-50447-1.js +++ b/js/src/tests/js1_5/extensions/regress-50447-1.js @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447.js b/js/src/tests/js1_5/extensions/regress-50447.js index 1621d5576395..32044a8edc4e 100644 --- a/js/src/tests/js1_5/extensions/regress-50447.js +++ b/js/src/tests/js1_5/extensions/regress-50447.js @@ -1,6 +1,5 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_6/shell.js b/js/src/tests/js1_6/shell.js index d378e171db67..a5bfae873392 100644 --- a/js/src/tests/js1_6/shell.js +++ b/js/src/tests/js1_6/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_7/shell.js b/js/src/tests/js1_7/shell.js index 13cf0022e7a7..9c935544e6ca 100644 --- a/js/src/tests/js1_7/shell.js +++ b/js/src/tests/js1_7/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_8/shell.js b/js/src/tests/js1_8/shell.js index d61c2d6a07b9..934ae1489d02 100644 --- a/js/src/tests/js1_8/shell.js +++ b/js/src/tests/js1_8/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_8_1/shell.js b/js/src/tests/js1_8_1/shell.js index d8fe725b7444..f4eadfbb411d 100644 --- a/js/src/tests/js1_8_1/shell.js +++ b/js/src/tests/js1_8_1/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/shell.js b/js/src/tests/shell.js index 08abb3bb518e..c2d42e4e6fd3 100644 --- a/js/src/tests/shell.js +++ b/js/src/tests/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * * 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/. */ diff --git a/js/src/vm/ArgumentsObject-inl.h b/js/src/vm/ArgumentsObject-inl.h index b94c1de19f4e..c442eda6e559 100644 --- a/js/src/vm/ArgumentsObject-inl.h +++ b/js/src/vm/ArgumentsObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ArgumentsObject.cpp b/js/src/vm/ArgumentsObject.cpp index 9e77cf3e6da1..73ad153f2464 100644 --- a/js/src/vm/ArgumentsObject.cpp +++ b/js/src/vm/ArgumentsObject.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ArgumentsObject.h b/js/src/vm/ArgumentsObject.h index 162ceeea73e4..fbb70f0b84f4 100644 --- a/js/src/vm/ArgumentsObject.h +++ b/js/src/vm/ArgumentsObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/BooleanObject-inl.h b/js/src/vm/BooleanObject-inl.h index c36e75d05111..b84171b8eb1d 100644 --- a/js/src/vm/BooleanObject-inl.h +++ b/js/src/vm/BooleanObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/BooleanObject.h b/js/src/vm/BooleanObject.h index 0df94da2cf86..3892a404e19e 100644 --- a/js/src/vm/BooleanObject.h +++ b/js/src/vm/BooleanObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/CharacterEncoding.cpp b/js/src/vm/CharacterEncoding.cpp index 96d94d86cb19..79266f4fd4db 100644 --- a/js/src/vm/CharacterEncoding.cpp +++ b/js/src/vm/CharacterEncoding.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 2f363a4a0d51..48acbbbcbbb8 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp index 4bf194cf7add..9c839c7ef156 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "DateTime.h" diff --git a/js/src/vm/DateTime.h b/js/src/vm/DateTime.h index 4dff3186439e..3d006a8f7654 100644 --- a/js/src/vm/DateTime.h +++ b/js/src/vm/DateTime.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef DateTime_h___ #define DateTime_h___ diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 032867ff5841..fa2e5b24fd79 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index 48c759105f9e..b04d1abaa3eb 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ForkJoin.cpp b/js/src/vm/ForkJoin.cpp index 6c654568eeeb..f636cbae1a21 100644 --- a/js/src/vm/ForkJoin.cpp +++ b/js/src/vm/ForkJoin.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ForkJoin.h b/js/src/vm/ForkJoin.h index 1b89efdc4377..a5c244310e73 100644 --- a/js/src/vm/ForkJoin.h +++ b/js/src/vm/ForkJoin.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject-inl.h b/js/src/vm/GlobalObject-inl.h index 9797cfd3918b..06d103aee0f1 100644 --- a/js/src/vm/GlobalObject-inl.h +++ b/js/src/vm/GlobalObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index 97e2300eebf4..67ba84486057 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index 783d4fdf18c7..3886b133c09b 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Keywords.h b/js/src/vm/Keywords.h index 0f0409a2e150..cc2d5dbc982e 100644 --- a/js/src/vm/Keywords.h +++ b/js/src/vm/Keywords.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/MatchPairs.h b/js/src/vm/MatchPairs.h index 8fd9320dab85..1018d7d67b33 100644 --- a/js/src/vm/MatchPairs.h +++ b/js/src/vm/MatchPairs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Monitor.cpp b/js/src/vm/Monitor.cpp index 0cd21ae23443..f92ee48dc477 100644 --- a/js/src/vm/Monitor.cpp +++ b/js/src/vm/Monitor.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Monitor.h b/js/src/vm/Monitor.h index e13f138ce939..9b0144586bde 100644 --- a/js/src/vm/Monitor.h +++ b/js/src/vm/Monitor.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumberObject-inl.h b/js/src/vm/NumberObject-inl.h index e2822f9cc375..651cb93d6ddd 100644 --- a/js/src/vm/NumberObject-inl.h +++ b/js/src/vm/NumberObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumberObject.h b/js/src/vm/NumberObject.h index dc0ab3bdea74..48ee6383da35 100644 --- a/js/src/vm/NumberObject.h +++ b/js/src/vm/NumberObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumericConversions.h b/js/src/vm/NumericConversions.h index 42e69d63dd75..674df8cb58c0 100644 --- a/js/src/vm/NumericConversions.h +++ b/js/src/vm/NumericConversions.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef NumericConversions_h___ #define NumericConversions_h___ diff --git a/js/src/vm/ObjectImpl-inl.h b/js/src/vm/ObjectImpl-inl.h index 8423dacb09ad..a4048fac745a 100644 --- a/js/src/vm/ObjectImpl-inl.h +++ b/js/src/vm/ObjectImpl-inl.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef ObjectImpl_inl_h___ #define ObjectImpl_inl_h___ diff --git a/js/src/vm/ObjectImpl.cpp b/js/src/vm/ObjectImpl.cpp index c009fc680b5e..7375b3da6419 100644 --- a/js/src/vm/ObjectImpl.cpp +++ b/js/src/vm/ObjectImpl.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "mozilla/Assertions.h" #include "mozilla/Attributes.h" diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index 0e757f3e08c0..41237dc2c8e7 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef ObjectImpl_h___ #define ObjectImpl_h___ diff --git a/js/src/vm/ParallelDo.cpp b/js/src/vm/ParallelDo.cpp index 6f4b63fdb064..461e5acff556 100644 --- a/js/src/vm/ParallelDo.cpp +++ b/js/src/vm/ParallelDo.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ParallelDo.h b/js/src/vm/ParallelDo.h index 807174528857..3188c147bd54 100644 --- a/js/src/vm/ParallelDo.h +++ b/js/src/vm/ParallelDo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/PropertyKey.cpp b/js/src/vm/PropertyKey.cpp index d7ca7b371607..0935cd377c8b 100644 --- a/js/src/vm/PropertyKey.cpp +++ b/js/src/vm/PropertyKey.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h index d6a0f04fac13..d1f3371356d2 100644 --- a/js/src/vm/RegExpObject-inl.h +++ b/js/src/vm/RegExpObject-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index b2fe90262352..232c4e8328e5 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h index 61d329dedc73..929d7147ee06 100644 --- a/js/src/vm/RegExpObject.h +++ b/js/src/vm/RegExpObject.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics-inl.h b/js/src/vm/RegExpStatics-inl.h index d70fdf2dccec..8b8842e40c71 100644 --- a/js/src/vm/RegExpStatics-inl.h +++ b/js/src/vm/RegExpStatics-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics.cpp b/js/src/vm/RegExpStatics.cpp index 8f2b761fcaec..99e6d86b5f1b 100644 --- a/js/src/vm/RegExpStatics.cpp +++ b/js/src/vm/RegExpStatics.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics.h b/js/src/vm/RegExpStatics.h index 9a7a84e934da..422424f91a0a 100644 --- a/js/src/vm/RegExpStatics.h +++ b/js/src/vm/RegExpStatics.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SPSProfiler.cpp b/js/src/vm/SPSProfiler.cpp index 8e44d71ca853..d39903b61960 100644 --- a/js/src/vm/SPSProfiler.cpp +++ b/js/src/vm/SPSProfiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SPSProfiler.h b/js/src/vm/SPSProfiler.h index 80c6b09e6baf..16defd8a6f94 100644 --- a/js/src/vm/SPSProfiler.h +++ b/js/src/vm/SPSProfiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject-inl.h b/js/src/vm/ScopeObject-inl.h index 63daedcba784..d85c8879ac26 100644 --- a/js/src/vm/ScopeObject-inl.h +++ b/js/src/vm/ScopeObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject.cpp b/js/src/vm/ScopeObject.cpp index 91025f40cbcf..364f54aea2c1 100644 --- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 6; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject.h b/js/src/vm/ScopeObject.h index fdb9303803e9..b9cb94f584eb 100644 --- a/js/src/vm/ScopeObject.h +++ b/js/src/vm/ScopeObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 0fed32c33a84..7f6ba8028160 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index b0d0ab45f502..2abc80cfaa94 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 8e3c7996f461..674e67958f74 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 53ab88e40db8..dff5a03c63b8 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h index 4d77179b9a29..a925de1e4e9c 100644 --- a/js/src/vm/Stack-inl.h +++ b/js/src/vm/Stack-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index c38bbc188ea6..db4c42ac0d87 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index e10c627d5f22..e197fc03fcec 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String-inl.h b/js/src/vm/String-inl.h index 7be763b696d9..981a9651b55d 100644 --- a/js/src/vm/String-inl.h +++ b/js/src/vm/String-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String.cpp b/js/src/vm/String.cpp index d6d550fd40bf..1bb9b86c641f 100644 --- a/js/src/vm/String.cpp +++ b/js/src/vm/String.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String.h b/js/src/vm/String.h index 9fd5899cd988..e7769c0e4ec9 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/StringBuffer.cpp b/js/src/vm/StringBuffer.cpp index 459571a70dc6..1ecc31c7f046 100644 --- a/js/src/vm/StringBuffer.cpp +++ b/js/src/vm/StringBuffer.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "vm/StringBuffer.h" diff --git a/js/src/vm/StringBuffer.h b/js/src/vm/StringBuffer.h index 7706e83032dd..92ab4f8c6eeb 100644 --- a/js/src/vm/StringBuffer.h +++ b/js/src/vm/StringBuffer.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef StringBuffer_h___ #define StringBuffer_h___ diff --git a/js/src/vm/StringObject-inl.h b/js/src/vm/StringObject-inl.h index 0940081d9e0e..b1b01bbdddc3 100644 --- a/js/src/vm/StringObject-inl.h +++ b/js/src/vm/StringObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/StringObject.h b/js/src/vm/StringObject.h index 75446443365c..59510956a0e6 100644 --- a/js/src/vm/StringObject.h +++ b/js/src/vm/StringObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ThreadPool.cpp b/js/src/vm/ThreadPool.cpp index 7eee4965cc11..754ad507d2cd 100644 --- a/js/src/vm/ThreadPool.cpp +++ b/js/src/vm/ThreadPool.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/ThreadPool.h b/js/src/vm/ThreadPool.h index 901894137ad8..75698d526ad5 100644 --- a/js/src/vm/ThreadPool.h +++ b/js/src/vm/ThreadPool.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Unicode.h b/js/src/vm/Unicode.h index a83a0925de36..27fde7a60373 100644 --- a/js/src/vm/Unicode.h +++ b/js/src/vm/Unicode.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/Xdr.cpp b/js/src/vm/Xdr.cpp index 34fc4b6b0668..d248926f9cca 100644 --- a/js/src/vm/Xdr.cpp +++ b/js/src/vm/Xdr.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 3ad573a6de0f..46a00ba9de51 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/yarr/ASCIICType.h b/js/src/yarr/ASCIICType.h index a3ae9f4455e2..2082b758bc56 100644 --- a/js/src/yarr/ASCIICType.h +++ b/js/src/yarr/ASCIICType.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. diff --git a/js/src/yarr/BumpPointerAllocator.h b/js/src/yarr/BumpPointerAllocator.h index 6d23a684831e..a43a5d8ba2d4 100644 --- a/js/src/yarr/BumpPointerAllocator.h +++ b/js/src/yarr/BumpPointerAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/CheckedArithmetic.h b/js/src/yarr/CheckedArithmetic.h index 0f60971d0f1f..21aa188bd969 100644 --- a/js/src/yarr/CheckedArithmetic.h +++ b/js/src/yarr/CheckedArithmetic.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2011 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/MatchResult.h b/js/src/yarr/MatchResult.h index e28ac4bbf42f..4ebc936779d5 100644 --- a/js/src/yarr/MatchResult.h +++ b/js/src/yarr/MatchResult.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/OSAllocator.h b/js/src/yarr/OSAllocator.h index ecfdc3b042ec..c8b815b52d2e 100644 --- a/js/src/yarr/OSAllocator.h +++ b/js/src/yarr/OSAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorOS2.cpp b/js/src/yarr/OSAllocatorOS2.cpp index ead003084dd1..466b9e949d81 100644 --- a/js/src/yarr/OSAllocatorOS2.cpp +++ b/js/src/yarr/OSAllocatorOS2.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorPosix.cpp b/js/src/yarr/OSAllocatorPosix.cpp index 99bf061467ca..013b6af0771a 100644 --- a/js/src/yarr/OSAllocatorPosix.cpp +++ b/js/src/yarr/OSAllocatorPosix.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorWin.cpp b/js/src/yarr/OSAllocatorWin.cpp index 08df9e98aefb..a5d5fa7db823 100644 --- a/js/src/yarr/OSAllocatorWin.cpp +++ b/js/src/yarr/OSAllocatorWin.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageAllocation.h b/js/src/yarr/PageAllocation.h index a86f37116e50..42a57f6ae5fe 100644 --- a/js/src/yarr/PageAllocation.h +++ b/js/src/yarr/PageAllocation.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.cpp b/js/src/yarr/PageBlock.cpp index 047172d6476f..0ffc1bc95157 100644 --- a/js/src/yarr/PageBlock.cpp +++ b/js/src/yarr/PageBlock.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.h b/js/src/yarr/PageBlock.h index 145bb0a8d63a..ea98f42f2237 100644 --- a/js/src/yarr/PageBlock.h +++ b/js/src/yarr/PageBlock.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/VMTags.h b/js/src/yarr/VMTags.h index fe6a006d3601..f44136907fe7 100644 --- a/js/src/yarr/VMTags.h +++ b/js/src/yarr/VMTags.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/Yarr.h b/js/src/yarr/Yarr.h index 110ae4124bed..da9a0ec70f33 100644 --- a/js/src/yarr/Yarr.h +++ b/js/src/yarr/Yarr.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * All rights reserved. diff --git a/js/src/yarr/YarrCanonicalizeUCS2.cpp b/js/src/yarr/YarrCanonicalizeUCS2.cpp index ce3a372a6a63..e6d334212fd3 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.cpp +++ b/js/src/yarr/YarrCanonicalizeUCS2.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrCanonicalizeUCS2.h b/js/src/yarr/YarrCanonicalizeUCS2.h index 735064ac803b..874af40e8693 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.h +++ b/js/src/yarr/YarrCanonicalizeUCS2.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrInterpreter.cpp b/js/src/yarr/YarrInterpreter.cpp index 296e7d5c9559..176fa381ac6e 100644 --- a/js/src/yarr/YarrInterpreter.cpp +++ b/js/src/yarr/YarrInterpreter.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * diff --git a/js/src/yarr/YarrInterpreter.h b/js/src/yarr/YarrInterpreter.h index ae40fa7d1cac..0a3da2fbb1c9 100644 --- a/js/src/yarr/YarrInterpreter.h +++ b/js/src/yarr/YarrInterpreter.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrJIT.cpp b/js/src/yarr/YarrJIT.cpp index 225933ff5a5a..d570f4697d42 100644 --- a/js/src/yarr/YarrJIT.cpp +++ b/js/src/yarr/YarrJIT.cpp @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrJIT.h b/js/src/yarr/YarrJIT.h index fad19adfdf44..b4c03b7e9b23 100644 --- a/js/src/yarr/YarrJIT.h +++ b/js/src/yarr/YarrJIT.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrParser.h b/js/src/yarr/YarrParser.h index f5d1aca6095c..7cbeea0f010d 100644 --- a/js/src/yarr/YarrParser.h +++ b/js/src/yarr/YarrParser.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrPattern.cpp b/js/src/yarr/YarrPattern.cpp index f091b984884c..3de728032c18 100644 --- a/js/src/yarr/YarrPattern.cpp +++ b/js/src/yarr/YarrPattern.cpp @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrPattern.h b/js/src/yarr/YarrPattern.h index 737de608199f..3baaf5369ed1 100644 --- a/js/src/yarr/YarrPattern.h +++ b/js/src/yarr/YarrPattern.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrSyntaxChecker.cpp b/js/src/yarr/YarrSyntaxChecker.cpp index 34fb5010cfc9..bd4b8dc05025 100644 --- a/js/src/yarr/YarrSyntaxChecker.cpp +++ b/js/src/yarr/YarrSyntaxChecker.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrSyntaxChecker.h b/js/src/yarr/YarrSyntaxChecker.h index b6848e752681..e42d8afa8184 100644 --- a/js/src/yarr/YarrSyntaxChecker.h +++ b/js/src/yarr/YarrSyntaxChecker.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h index a7646b87ea34..890b269355f0 100644 --- a/js/src/yarr/wtfbridge.h +++ b/js/src/yarr/wtfbridge.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ From cbb7e746ff9725bf510896b85ee604cb261ecb85 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 16:08:38 -0500 Subject: [PATCH 049/438] Bug 803719: Add a toDOMRange API to CaretPosition and use it to maintain position for reflow-on-zoom feature. [r=kats,tn] --- content/base/src/nsDOMCaretPosition.cpp | 33 +++++++++++- content/base/src/nsDOMCaretPosition.h | 31 +++++++++++ content/base/src/nsDocument.cpp | 10 ++++ content/base/src/nsRange.cpp | 16 ++++++ content/base/src/nsRange.h | 3 ++ dom/webidl/CaretPosition.webidl | 2 + mobile/android/chrome/content/browser.js | 69 ++++++++++++++---------- 7 files changed, 135 insertions(+), 29 deletions(-) diff --git a/content/base/src/nsDOMCaretPosition.cpp b/content/base/src/nsDOMCaretPosition.cpp index 35711b4a9269..06c45bc3d368 100644 --- a/content/base/src/nsDOMCaretPosition.cpp +++ b/content/base/src/nsDOMCaretPosition.cpp @@ -7,7 +7,7 @@ #include "nsContentUtils.h" nsDOMCaretPosition::nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset) - : mOffset(aOffset), mOffsetNode(aNode) + : mOffset(aOffset), mOffsetNode(aNode), mAnonymousContentNode(nullptr) { SetIsDOMBinding(); } @@ -21,6 +21,37 @@ nsINode* nsDOMCaretPosition::GetOffsetNode() const return mOffsetNode; } +already_AddRefed +nsDOMCaretPosition::GetClientRect() const +{ + if (!mOffsetNode) { + return nullptr; + } + + nsRefPtr rect; + nsRefPtr domRange; + nsCOMPtr node; + + if (mAnonymousContentNode) { + node = mAnonymousContentNode; + } else { + node = mOffsetNode; + } + + nsresult creationRv = nsRange::CreateRange(node, mOffset, node, + mOffset, + getter_AddRefs(domRange)); + if (!NS_SUCCEEDED(creationRv)) { + return nullptr; + } + + NS_ASSERTION(domRange, "unable to retrieve valid dom range from CaretPosition"); + + rect = domRange->GetBoundingClientRect(); + + return rect.forget(); +} + JSObject* nsDOMCaretPosition::WrapObject(JSContext *aCx, JSObject *aScope) { diff --git a/content/base/src/nsDOMCaretPosition.h b/content/base/src/nsDOMCaretPosition.h index 2caef48eeb20..ab9036ed16c6 100644 --- a/content/base/src/nsDOMCaretPosition.h +++ b/content/base/src/nsDOMCaretPosition.h @@ -8,7 +8,10 @@ #include "nsCycleCollectionParticipant.h" #include "nsCOMPtr.h" #include "nsINode.h" +#include "nsRange.h" #include "nsWrapperCache.h" +#include "nsRect.h" +#include "nsClientRect.h" /** * Implementation of a DOM Caret Position, which is a node and offset within @@ -46,6 +49,32 @@ public: */ nsINode* GetOffsetNode() const; + /** + * Retrieve the bounding rectangle of this CaretPosition object. + * + * @returns An nsClientRect representing the bounding rectangle of this + * CaretPosition, if one can be successfully determined, otherwise + * nullptr. + */ + already_AddRefed GetClientRect() const; + + /** + * Set the anonymous content node that is the actual parent of this + * CaretPosition object. In situations where the DOM node for a CaretPosition + * actually lies within an anonymous content node (e.g. a textarea), the + * actual parent is not set as the offset node. This is used to get the + * correct bounding box of a CaretPosition object that lies within a textarea + * or input element. + * + * @param aNode A pointer to an nsINode object that is the actual element + * within which this CaretPosition lies, but is an anonymous content + * node. + */ + void SetAnonymousContentNode(nsINode* aNode) + { + mAnonymousContentNode = aNode; + } + nsISupports* GetParentObject() const { return GetOffsetNode(); @@ -56,8 +85,10 @@ public: protected: virtual ~nsDOMCaretPosition(); + uint32_t mOffset; nsCOMPtr mOffsetNode; + nsCOMPtr mAnonymousContentNode; }; #endif diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3e96cb5af72e..568ff0f779cb 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -9323,6 +9323,13 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) if (textArea || (input && NS_SUCCEEDED(input->MozIsTextField(false, &isText)) && isText)) { + // If the anonymous content node has a child, then we need to make sure + // that we get the appropriate child, as otherwise the offset may not be + // correct when we construct a range for it. + nsCOMPtr firstChild = anonNode->GetFirstChild(); + if (firstChild) { + anonNode = firstChild; + } offset = nsContentUtils::GetAdjustedOffsetInTextControl(ptFrame, offset); node = nonanon; } else { @@ -9332,6 +9339,9 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) } nsRefPtr aCaretPos = new nsDOMCaretPosition(node, offset); + if (nodeIsAnonymous) { + aCaretPos->SetAnonymousContentNode(anonNode); + } return aCaretPos.forget(); } diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp index 2366df5906a6..db51a6dc7d8b 100644 --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -211,6 +211,22 @@ nsRange::~nsRange() DoSetRange(nullptr, 0, nullptr, 0, nullptr); } +/* static */ +nsresult +nsRange::CreateRange(nsINode* aStartParent, int32_t aStartOffset, + nsINode* aEndParent, int32_t aEndOffset, + nsRange** aRange) +{ + nsCOMPtr startDomNode = do_QueryInterface(aStartParent); + nsCOMPtr endDomNode = do_QueryInterface(aEndParent); + + nsresult rv = CreateRange(startDomNode, aStartOffset, endDomNode, aEndOffset, + aRange); + + return rv; + +} + /* static */ nsresult nsRange::CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h index 8932632abe96..a22eca732663 100644 --- a/content/base/src/nsRange.h +++ b/content/base/src/nsRange.h @@ -65,6 +65,9 @@ public: static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, nsIDOMNode* aEndParent, int32_t aEndOffset, nsIDOMRange** aRange); + static nsresult CreateRange(nsINode* aStartParent, int32_t aStartOffset, + nsINode* aEndParent, int32_t aEndOffset, + nsRange** aRange); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange) diff --git a/dom/webidl/CaretPosition.webidl b/dom/webidl/CaretPosition.webidl index 4cc42759f25e..7b0ed78b3e9d 100644 --- a/dom/webidl/CaretPosition.webidl +++ b/dom/webidl/CaretPosition.webidl @@ -9,4 +9,6 @@ interface CaretPosition { */ readonly attribute Node? offsetNode; readonly attribute unsigned long offset; + + ClientRect getClientRect(); }; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 7484e7b45f29..ca681538ad5c 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2836,15 +2836,11 @@ Tab.prototype = { // Adjust the max line box width to be no more than the viewport width, but // only if the reflow-on-zoom preference is enabled. - if (BrowserEventHandler.mReflozPref && BrowserEventHandler._mLastPinchData) { - let webNav = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation); - let docShell = webNav.QueryInterface(Ci.nsIDocShell); - let docViewer = docShell.contentViewer.QueryInterface(Ci.nsIMarkupDocumentViewer); - let viewportWidth = gScreenWidth / aViewport.zoom; - // We add in a bit of fudge just so that the end characters don't accidentally - // get clipped. 15px is an arbitrary choice. - docViewer.changeMaxLineBoxWidth(viewportWidth - 15); - BrowserEventHandler._mLastPinchData = null; + let isZooming = aViewport.zoom != this._zoom; + if (isZooming && + BrowserEventHandler.mReflozPref && + BrowserApp.selectedTab._mReflozPoint) { + BrowserApp.selectedTab.performReflowOnZoom(aViewport); } let win = this.browser.contentWindow; @@ -3890,7 +3886,9 @@ var BrowserEventHandler = { break; case "MozMagnifyGesture": - this.onPinchFinish(aData, this._mLastPinchPoint.x, this._mLastPinchPoint.y); + if (BrowserEventHandler.mReflozPref) { + this.onPinchFinish(aData, BrowserApp.selectedTab._mReflozPoint.x, BrowserApp.selectedTab._mReflozPoint.y); + } break; default: @@ -4001,21 +3999,32 @@ var BrowserEventHandler = { sendMessageToJava(rect); }, - _zoomInAndSnapToElement: function(aX, aY, aElement) { - let viewport = BrowserApp.selectedTab.getViewport(); - if (viewport.zoom < 1.0) { - // We don't want to do this on zoom out. + _zoomInAndSnapToRange: function(aRange) { + if (!aRange) { + Cu.reportError("aRange is null in zoomInAndSnapToRange. Unable to maintain position."); return; } + let viewport = BrowserApp.selectedTab.getViewport(); let fudge = 15; // Add a bit of fudge. - let win = BrowserApp.selectedBrowser.contentWindow; + let boundingElement = aRange.offsetNode; + while (!boundingElement.getBoundingClientRect && boundingElement.parentNode) { + boundingElement = boundingElement.parentNode; + } - let rect = ElementTouchHelper.getBoundingContentRect(aElement); + let rect = ElementTouchHelper.getBoundingContentRect(boundingElement); + let drRect = aRange.getClientRect(); + let scrollTop = + BrowserApp.selectedBrowser.contentDocument.documentElement.scrollTop || + BrowserApp.selectedBrowser.contentDocument.body.scrollTop; + + // We subtract half the height of the viewport so that we can (ideally) + // center the area of interest on the screen. + let topPos = scrollTop + drRect.top - (viewport.cssHeight / 2.0); rect.type = "Browser:ZoomToRect"; rect.x = Math.max(viewport.cssPageLeft, rect.x - fudge); - rect.y = viewport.cssY; + rect.y = Math.max(topPos, viewport.cssPageTop); rect.w = viewport.cssWidth; rect.h = viewport.cssHeight; @@ -4023,18 +4032,24 @@ var BrowserEventHandler = { }, onPinch: function(aData) { - let data = JSON.parse(aData); - this._mLastPinchPoint = {x: data.x, y: data.y}; + // We only want to do this if reflow-on-zoom is enabled. + if (BrowserEventHandler.mReflozPref && + !BrowserApp.selectedTab._mReflozPoint) { + let data = JSON.parse(aData); + let zoomPointX = data.x; + let zoomPointY = data.y; + + BrowserApp.selectedTab._mReflozPoint = { x: zoomPointX, y: zoomPointY, + range: BrowserApp.selectedBrowser.contentDocument.caretPositionFromPoint(zoomPointX, zoomPointY) }; + } }, onPinchFinish: function(aData, aX, aY) { - if (this.mReflozPref) { - let data = JSON.parse(aData); - let pinchElement = ElementTouchHelper.anyElementFromPoint(aX, aY); - data.element = pinchElement; - BrowserApp.selectedTab._mLastPinchElement = pinchElement; - this._mLastPinchData = data; - this._zoomInAndSnapToElement(data.x, data.y, data.element); + // We only want to do this if reflow-on-zoom is enabled. + if (BrowserEventHandler.mReflozPref) { + let range = BrowserApp.selectedTab._mReflozPoint.range; + this._zoomInAndSnapToRange(range); + BrowserApp.selectedTab._mReflozPoint = null; } }, @@ -4055,8 +4070,6 @@ var BrowserEventHandler = { _highlightElement: null, - _mLastPinchData: null, - _doTapHighlight: function _doTapHighlight(aElement) { DOMUtils.setContentState(aElement, kStateActive); this._highlightElement = aElement; From d50f0f6e2a79f78d3622105db7b5427bd78bc633 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 16:10:20 -0500 Subject: [PATCH 050/438] Backed out changeset 6d29c583d5c0 due to incorrect commit message. --- content/base/src/nsDOMCaretPosition.cpp | 33 +----------- content/base/src/nsDOMCaretPosition.h | 31 ----------- content/base/src/nsDocument.cpp | 10 ---- content/base/src/nsRange.cpp | 16 ------ content/base/src/nsRange.h | 3 -- dom/webidl/CaretPosition.webidl | 2 - mobile/android/chrome/content/browser.js | 69 ++++++++++-------------- 7 files changed, 29 insertions(+), 135 deletions(-) diff --git a/content/base/src/nsDOMCaretPosition.cpp b/content/base/src/nsDOMCaretPosition.cpp index 06c45bc3d368..35711b4a9269 100644 --- a/content/base/src/nsDOMCaretPosition.cpp +++ b/content/base/src/nsDOMCaretPosition.cpp @@ -7,7 +7,7 @@ #include "nsContentUtils.h" nsDOMCaretPosition::nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset) - : mOffset(aOffset), mOffsetNode(aNode), mAnonymousContentNode(nullptr) + : mOffset(aOffset), mOffsetNode(aNode) { SetIsDOMBinding(); } @@ -21,37 +21,6 @@ nsINode* nsDOMCaretPosition::GetOffsetNode() const return mOffsetNode; } -already_AddRefed -nsDOMCaretPosition::GetClientRect() const -{ - if (!mOffsetNode) { - return nullptr; - } - - nsRefPtr rect; - nsRefPtr domRange; - nsCOMPtr node; - - if (mAnonymousContentNode) { - node = mAnonymousContentNode; - } else { - node = mOffsetNode; - } - - nsresult creationRv = nsRange::CreateRange(node, mOffset, node, - mOffset, - getter_AddRefs(domRange)); - if (!NS_SUCCEEDED(creationRv)) { - return nullptr; - } - - NS_ASSERTION(domRange, "unable to retrieve valid dom range from CaretPosition"); - - rect = domRange->GetBoundingClientRect(); - - return rect.forget(); -} - JSObject* nsDOMCaretPosition::WrapObject(JSContext *aCx, JSObject *aScope) { diff --git a/content/base/src/nsDOMCaretPosition.h b/content/base/src/nsDOMCaretPosition.h index ab9036ed16c6..2caef48eeb20 100644 --- a/content/base/src/nsDOMCaretPosition.h +++ b/content/base/src/nsDOMCaretPosition.h @@ -8,10 +8,7 @@ #include "nsCycleCollectionParticipant.h" #include "nsCOMPtr.h" #include "nsINode.h" -#include "nsRange.h" #include "nsWrapperCache.h" -#include "nsRect.h" -#include "nsClientRect.h" /** * Implementation of a DOM Caret Position, which is a node and offset within @@ -49,32 +46,6 @@ public: */ nsINode* GetOffsetNode() const; - /** - * Retrieve the bounding rectangle of this CaretPosition object. - * - * @returns An nsClientRect representing the bounding rectangle of this - * CaretPosition, if one can be successfully determined, otherwise - * nullptr. - */ - already_AddRefed GetClientRect() const; - - /** - * Set the anonymous content node that is the actual parent of this - * CaretPosition object. In situations where the DOM node for a CaretPosition - * actually lies within an anonymous content node (e.g. a textarea), the - * actual parent is not set as the offset node. This is used to get the - * correct bounding box of a CaretPosition object that lies within a textarea - * or input element. - * - * @param aNode A pointer to an nsINode object that is the actual element - * within which this CaretPosition lies, but is an anonymous content - * node. - */ - void SetAnonymousContentNode(nsINode* aNode) - { - mAnonymousContentNode = aNode; - } - nsISupports* GetParentObject() const { return GetOffsetNode(); @@ -85,10 +56,8 @@ public: protected: virtual ~nsDOMCaretPosition(); - uint32_t mOffset; nsCOMPtr mOffsetNode; - nsCOMPtr mAnonymousContentNode; }; #endif diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 568ff0f779cb..3e96cb5af72e 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -9323,13 +9323,6 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) if (textArea || (input && NS_SUCCEEDED(input->MozIsTextField(false, &isText)) && isText)) { - // If the anonymous content node has a child, then we need to make sure - // that we get the appropriate child, as otherwise the offset may not be - // correct when we construct a range for it. - nsCOMPtr firstChild = anonNode->GetFirstChild(); - if (firstChild) { - anonNode = firstChild; - } offset = nsContentUtils::GetAdjustedOffsetInTextControl(ptFrame, offset); node = nonanon; } else { @@ -9339,9 +9332,6 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) } nsRefPtr aCaretPos = new nsDOMCaretPosition(node, offset); - if (nodeIsAnonymous) { - aCaretPos->SetAnonymousContentNode(anonNode); - } return aCaretPos.forget(); } diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp index db51a6dc7d8b..2366df5906a6 100644 --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -211,22 +211,6 @@ nsRange::~nsRange() DoSetRange(nullptr, 0, nullptr, 0, nullptr); } -/* static */ -nsresult -nsRange::CreateRange(nsINode* aStartParent, int32_t aStartOffset, - nsINode* aEndParent, int32_t aEndOffset, - nsRange** aRange) -{ - nsCOMPtr startDomNode = do_QueryInterface(aStartParent); - nsCOMPtr endDomNode = do_QueryInterface(aEndParent); - - nsresult rv = CreateRange(startDomNode, aStartOffset, endDomNode, aEndOffset, - aRange); - - return rv; - -} - /* static */ nsresult nsRange::CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h index a22eca732663..8932632abe96 100644 --- a/content/base/src/nsRange.h +++ b/content/base/src/nsRange.h @@ -65,9 +65,6 @@ public: static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, nsIDOMNode* aEndParent, int32_t aEndOffset, nsIDOMRange** aRange); - static nsresult CreateRange(nsINode* aStartParent, int32_t aStartOffset, - nsINode* aEndParent, int32_t aEndOffset, - nsRange** aRange); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange) diff --git a/dom/webidl/CaretPosition.webidl b/dom/webidl/CaretPosition.webidl index 7b0ed78b3e9d..4cc42759f25e 100644 --- a/dom/webidl/CaretPosition.webidl +++ b/dom/webidl/CaretPosition.webidl @@ -9,6 +9,4 @@ interface CaretPosition { */ readonly attribute Node? offsetNode; readonly attribute unsigned long offset; - - ClientRect getClientRect(); }; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index ca681538ad5c..7484e7b45f29 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2836,11 +2836,15 @@ Tab.prototype = { // Adjust the max line box width to be no more than the viewport width, but // only if the reflow-on-zoom preference is enabled. - let isZooming = aViewport.zoom != this._zoom; - if (isZooming && - BrowserEventHandler.mReflozPref && - BrowserApp.selectedTab._mReflozPoint) { - BrowserApp.selectedTab.performReflowOnZoom(aViewport); + if (BrowserEventHandler.mReflozPref && BrowserEventHandler._mLastPinchData) { + let webNav = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation); + let docShell = webNav.QueryInterface(Ci.nsIDocShell); + let docViewer = docShell.contentViewer.QueryInterface(Ci.nsIMarkupDocumentViewer); + let viewportWidth = gScreenWidth / aViewport.zoom; + // We add in a bit of fudge just so that the end characters don't accidentally + // get clipped. 15px is an arbitrary choice. + docViewer.changeMaxLineBoxWidth(viewportWidth - 15); + BrowserEventHandler._mLastPinchData = null; } let win = this.browser.contentWindow; @@ -3886,9 +3890,7 @@ var BrowserEventHandler = { break; case "MozMagnifyGesture": - if (BrowserEventHandler.mReflozPref) { - this.onPinchFinish(aData, BrowserApp.selectedTab._mReflozPoint.x, BrowserApp.selectedTab._mReflozPoint.y); - } + this.onPinchFinish(aData, this._mLastPinchPoint.x, this._mLastPinchPoint.y); break; default: @@ -3999,32 +4001,21 @@ var BrowserEventHandler = { sendMessageToJava(rect); }, - _zoomInAndSnapToRange: function(aRange) { - if (!aRange) { - Cu.reportError("aRange is null in zoomInAndSnapToRange. Unable to maintain position."); + _zoomInAndSnapToElement: function(aX, aY, aElement) { + let viewport = BrowserApp.selectedTab.getViewport(); + if (viewport.zoom < 1.0) { + // We don't want to do this on zoom out. return; } - let viewport = BrowserApp.selectedTab.getViewport(); let fudge = 15; // Add a bit of fudge. - let boundingElement = aRange.offsetNode; - while (!boundingElement.getBoundingClientRect && boundingElement.parentNode) { - boundingElement = boundingElement.parentNode; - } + let win = BrowserApp.selectedBrowser.contentWindow; - let rect = ElementTouchHelper.getBoundingContentRect(boundingElement); - let drRect = aRange.getClientRect(); - let scrollTop = - BrowserApp.selectedBrowser.contentDocument.documentElement.scrollTop || - BrowserApp.selectedBrowser.contentDocument.body.scrollTop; - - // We subtract half the height of the viewport so that we can (ideally) - // center the area of interest on the screen. - let topPos = scrollTop + drRect.top - (viewport.cssHeight / 2.0); + let rect = ElementTouchHelper.getBoundingContentRect(aElement); rect.type = "Browser:ZoomToRect"; rect.x = Math.max(viewport.cssPageLeft, rect.x - fudge); - rect.y = Math.max(topPos, viewport.cssPageTop); + rect.y = viewport.cssY; rect.w = viewport.cssWidth; rect.h = viewport.cssHeight; @@ -4032,24 +4023,18 @@ var BrowserEventHandler = { }, onPinch: function(aData) { - // We only want to do this if reflow-on-zoom is enabled. - if (BrowserEventHandler.mReflozPref && - !BrowserApp.selectedTab._mReflozPoint) { - let data = JSON.parse(aData); - let zoomPointX = data.x; - let zoomPointY = data.y; - - BrowserApp.selectedTab._mReflozPoint = { x: zoomPointX, y: zoomPointY, - range: BrowserApp.selectedBrowser.contentDocument.caretPositionFromPoint(zoomPointX, zoomPointY) }; - } + let data = JSON.parse(aData); + this._mLastPinchPoint = {x: data.x, y: data.y}; }, onPinchFinish: function(aData, aX, aY) { - // We only want to do this if reflow-on-zoom is enabled. - if (BrowserEventHandler.mReflozPref) { - let range = BrowserApp.selectedTab._mReflozPoint.range; - this._zoomInAndSnapToRange(range); - BrowserApp.selectedTab._mReflozPoint = null; + if (this.mReflozPref) { + let data = JSON.parse(aData); + let pinchElement = ElementTouchHelper.anyElementFromPoint(aX, aY); + data.element = pinchElement; + BrowserApp.selectedTab._mLastPinchElement = pinchElement; + this._mLastPinchData = data; + this._zoomInAndSnapToElement(data.x, data.y, data.element); } }, @@ -4070,6 +4055,8 @@ var BrowserEventHandler = { _highlightElement: null, + _mLastPinchData: null, + _doTapHighlight: function _doTapHighlight(aElement) { DOMUtils.setContentState(aElement, kStateActive); this._highlightElement = aElement; From 63715cfdf52355b46294231e3daac694d18807fa Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 16:12:03 -0500 Subject: [PATCH 051/438] Bug 803719: Add a getClientRect API to CaretPosition and use it to maintain position for reflow-on-zoom feature. [r=kats,tn] --- content/base/src/nsDOMCaretPosition.cpp | 33 +++++++++++- content/base/src/nsDOMCaretPosition.h | 31 +++++++++++ content/base/src/nsDocument.cpp | 10 ++++ content/base/src/nsRange.cpp | 16 ++++++ content/base/src/nsRange.h | 3 ++ dom/webidl/CaretPosition.webidl | 2 + mobile/android/chrome/content/browser.js | 69 ++++++++++++++---------- 7 files changed, 135 insertions(+), 29 deletions(-) diff --git a/content/base/src/nsDOMCaretPosition.cpp b/content/base/src/nsDOMCaretPosition.cpp index 35711b4a9269..06c45bc3d368 100644 --- a/content/base/src/nsDOMCaretPosition.cpp +++ b/content/base/src/nsDOMCaretPosition.cpp @@ -7,7 +7,7 @@ #include "nsContentUtils.h" nsDOMCaretPosition::nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset) - : mOffset(aOffset), mOffsetNode(aNode) + : mOffset(aOffset), mOffsetNode(aNode), mAnonymousContentNode(nullptr) { SetIsDOMBinding(); } @@ -21,6 +21,37 @@ nsINode* nsDOMCaretPosition::GetOffsetNode() const return mOffsetNode; } +already_AddRefed +nsDOMCaretPosition::GetClientRect() const +{ + if (!mOffsetNode) { + return nullptr; + } + + nsRefPtr rect; + nsRefPtr domRange; + nsCOMPtr node; + + if (mAnonymousContentNode) { + node = mAnonymousContentNode; + } else { + node = mOffsetNode; + } + + nsresult creationRv = nsRange::CreateRange(node, mOffset, node, + mOffset, + getter_AddRefs(domRange)); + if (!NS_SUCCEEDED(creationRv)) { + return nullptr; + } + + NS_ASSERTION(domRange, "unable to retrieve valid dom range from CaretPosition"); + + rect = domRange->GetBoundingClientRect(); + + return rect.forget(); +} + JSObject* nsDOMCaretPosition::WrapObject(JSContext *aCx, JSObject *aScope) { diff --git a/content/base/src/nsDOMCaretPosition.h b/content/base/src/nsDOMCaretPosition.h index 2caef48eeb20..ab9036ed16c6 100644 --- a/content/base/src/nsDOMCaretPosition.h +++ b/content/base/src/nsDOMCaretPosition.h @@ -8,7 +8,10 @@ #include "nsCycleCollectionParticipant.h" #include "nsCOMPtr.h" #include "nsINode.h" +#include "nsRange.h" #include "nsWrapperCache.h" +#include "nsRect.h" +#include "nsClientRect.h" /** * Implementation of a DOM Caret Position, which is a node and offset within @@ -46,6 +49,32 @@ public: */ nsINode* GetOffsetNode() const; + /** + * Retrieve the bounding rectangle of this CaretPosition object. + * + * @returns An nsClientRect representing the bounding rectangle of this + * CaretPosition, if one can be successfully determined, otherwise + * nullptr. + */ + already_AddRefed GetClientRect() const; + + /** + * Set the anonymous content node that is the actual parent of this + * CaretPosition object. In situations where the DOM node for a CaretPosition + * actually lies within an anonymous content node (e.g. a textarea), the + * actual parent is not set as the offset node. This is used to get the + * correct bounding box of a CaretPosition object that lies within a textarea + * or input element. + * + * @param aNode A pointer to an nsINode object that is the actual element + * within which this CaretPosition lies, but is an anonymous content + * node. + */ + void SetAnonymousContentNode(nsINode* aNode) + { + mAnonymousContentNode = aNode; + } + nsISupports* GetParentObject() const { return GetOffsetNode(); @@ -56,8 +85,10 @@ public: protected: virtual ~nsDOMCaretPosition(); + uint32_t mOffset; nsCOMPtr mOffsetNode; + nsCOMPtr mAnonymousContentNode; }; #endif diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3e96cb5af72e..568ff0f779cb 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -9323,6 +9323,13 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) if (textArea || (input && NS_SUCCEEDED(input->MozIsTextField(false, &isText)) && isText)) { + // If the anonymous content node has a child, then we need to make sure + // that we get the appropriate child, as otherwise the offset may not be + // correct when we construct a range for it. + nsCOMPtr firstChild = anonNode->GetFirstChild(); + if (firstChild) { + anonNode = firstChild; + } offset = nsContentUtils::GetAdjustedOffsetInTextControl(ptFrame, offset); node = nonanon; } else { @@ -9332,6 +9339,9 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY) } nsRefPtr aCaretPos = new nsDOMCaretPosition(node, offset); + if (nodeIsAnonymous) { + aCaretPos->SetAnonymousContentNode(anonNode); + } return aCaretPos.forget(); } diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp index 2366df5906a6..db51a6dc7d8b 100644 --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -211,6 +211,22 @@ nsRange::~nsRange() DoSetRange(nullptr, 0, nullptr, 0, nullptr); } +/* static */ +nsresult +nsRange::CreateRange(nsINode* aStartParent, int32_t aStartOffset, + nsINode* aEndParent, int32_t aEndOffset, + nsRange** aRange) +{ + nsCOMPtr startDomNode = do_QueryInterface(aStartParent); + nsCOMPtr endDomNode = do_QueryInterface(aEndParent); + + nsresult rv = CreateRange(startDomNode, aStartOffset, endDomNode, aEndOffset, + aRange); + + return rv; + +} + /* static */ nsresult nsRange::CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h index 8932632abe96..a22eca732663 100644 --- a/content/base/src/nsRange.h +++ b/content/base/src/nsRange.h @@ -65,6 +65,9 @@ public: static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset, nsIDOMNode* aEndParent, int32_t aEndOffset, nsIDOMRange** aRange); + static nsresult CreateRange(nsINode* aStartParent, int32_t aStartOffset, + nsINode* aEndParent, int32_t aEndOffset, + nsRange** aRange); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange) diff --git a/dom/webidl/CaretPosition.webidl b/dom/webidl/CaretPosition.webidl index 4cc42759f25e..7b0ed78b3e9d 100644 --- a/dom/webidl/CaretPosition.webidl +++ b/dom/webidl/CaretPosition.webidl @@ -9,4 +9,6 @@ interface CaretPosition { */ readonly attribute Node? offsetNode; readonly attribute unsigned long offset; + + ClientRect getClientRect(); }; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 7484e7b45f29..ca681538ad5c 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2836,15 +2836,11 @@ Tab.prototype = { // Adjust the max line box width to be no more than the viewport width, but // only if the reflow-on-zoom preference is enabled. - if (BrowserEventHandler.mReflozPref && BrowserEventHandler._mLastPinchData) { - let webNav = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation); - let docShell = webNav.QueryInterface(Ci.nsIDocShell); - let docViewer = docShell.contentViewer.QueryInterface(Ci.nsIMarkupDocumentViewer); - let viewportWidth = gScreenWidth / aViewport.zoom; - // We add in a bit of fudge just so that the end characters don't accidentally - // get clipped. 15px is an arbitrary choice. - docViewer.changeMaxLineBoxWidth(viewportWidth - 15); - BrowserEventHandler._mLastPinchData = null; + let isZooming = aViewport.zoom != this._zoom; + if (isZooming && + BrowserEventHandler.mReflozPref && + BrowserApp.selectedTab._mReflozPoint) { + BrowserApp.selectedTab.performReflowOnZoom(aViewport); } let win = this.browser.contentWindow; @@ -3890,7 +3886,9 @@ var BrowserEventHandler = { break; case "MozMagnifyGesture": - this.onPinchFinish(aData, this._mLastPinchPoint.x, this._mLastPinchPoint.y); + if (BrowserEventHandler.mReflozPref) { + this.onPinchFinish(aData, BrowserApp.selectedTab._mReflozPoint.x, BrowserApp.selectedTab._mReflozPoint.y); + } break; default: @@ -4001,21 +3999,32 @@ var BrowserEventHandler = { sendMessageToJava(rect); }, - _zoomInAndSnapToElement: function(aX, aY, aElement) { - let viewport = BrowserApp.selectedTab.getViewport(); - if (viewport.zoom < 1.0) { - // We don't want to do this on zoom out. + _zoomInAndSnapToRange: function(aRange) { + if (!aRange) { + Cu.reportError("aRange is null in zoomInAndSnapToRange. Unable to maintain position."); return; } + let viewport = BrowserApp.selectedTab.getViewport(); let fudge = 15; // Add a bit of fudge. - let win = BrowserApp.selectedBrowser.contentWindow; + let boundingElement = aRange.offsetNode; + while (!boundingElement.getBoundingClientRect && boundingElement.parentNode) { + boundingElement = boundingElement.parentNode; + } - let rect = ElementTouchHelper.getBoundingContentRect(aElement); + let rect = ElementTouchHelper.getBoundingContentRect(boundingElement); + let drRect = aRange.getClientRect(); + let scrollTop = + BrowserApp.selectedBrowser.contentDocument.documentElement.scrollTop || + BrowserApp.selectedBrowser.contentDocument.body.scrollTop; + + // We subtract half the height of the viewport so that we can (ideally) + // center the area of interest on the screen. + let topPos = scrollTop + drRect.top - (viewport.cssHeight / 2.0); rect.type = "Browser:ZoomToRect"; rect.x = Math.max(viewport.cssPageLeft, rect.x - fudge); - rect.y = viewport.cssY; + rect.y = Math.max(topPos, viewport.cssPageTop); rect.w = viewport.cssWidth; rect.h = viewport.cssHeight; @@ -4023,18 +4032,24 @@ var BrowserEventHandler = { }, onPinch: function(aData) { - let data = JSON.parse(aData); - this._mLastPinchPoint = {x: data.x, y: data.y}; + // We only want to do this if reflow-on-zoom is enabled. + if (BrowserEventHandler.mReflozPref && + !BrowserApp.selectedTab._mReflozPoint) { + let data = JSON.parse(aData); + let zoomPointX = data.x; + let zoomPointY = data.y; + + BrowserApp.selectedTab._mReflozPoint = { x: zoomPointX, y: zoomPointY, + range: BrowserApp.selectedBrowser.contentDocument.caretPositionFromPoint(zoomPointX, zoomPointY) }; + } }, onPinchFinish: function(aData, aX, aY) { - if (this.mReflozPref) { - let data = JSON.parse(aData); - let pinchElement = ElementTouchHelper.anyElementFromPoint(aX, aY); - data.element = pinchElement; - BrowserApp.selectedTab._mLastPinchElement = pinchElement; - this._mLastPinchData = data; - this._zoomInAndSnapToElement(data.x, data.y, data.element); + // We only want to do this if reflow-on-zoom is enabled. + if (BrowserEventHandler.mReflozPref) { + let range = BrowserApp.selectedTab._mReflozPoint.range; + this._zoomInAndSnapToRange(range); + BrowserApp.selectedTab._mReflozPoint = null; } }, @@ -4055,8 +4070,6 @@ var BrowserEventHandler = { _highlightElement: null, - _mLastPinchData: null, - _doTapHighlight: function _doTapHighlight(aElement) { DOMUtils.setContentState(aElement, kStateActive); this._highlightElement = aElement; From 7586d14b643f55b7231d2cf8e216c1a13fe8f4ac Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 16 Apr 2013 17:14:09 -0400 Subject: [PATCH 052/438] Bug 862388. Fix test_bug328885.html to actually test things. r=bholley --- content/events/test/test_bug328885.html | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/content/events/test/test_bug328885.html b/content/events/test/test_bug328885.html index e935b3a98194..3cd45a75969a 100644 --- a/content/events/test/test_bug328885.html +++ b/content/events/test/test_bug328885.html @@ -6,6 +6,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=328885 Test for Bug 328885 + @@ -29,7 +30,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=328885 } function clickTest() { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); inputelement.addEventListener("DOMSubtreeModified", mutationListener, false); inputelement.addEventListener("DOMNodeInserted", mutationListener, false); inputelement.addEventListener("DOMNodeRemoved", mutationListener, false); @@ -39,10 +39,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=328885 inputelement.addEventListener("DOMCharacterDataModified", mutationListener, false); inputelement.addEventListener('click', - function(evt) { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - ok(evt.originalTarget instanceof HTMLDivElement, "(1) Wrong originalTarget!"); - ok(evt.originalTarget.parentNode == inputelement, "(2) Wront parent node!"); + function(event) { + var evt = SpecialPowers.wrap(event); + ok(SpecialPowers.unwrap(evt.originalTarget) instanceof HTMLDivElement, + "(1) Wrong originalTarget!"); + is(SpecialPowers.unwrap(evt.originalTarget.parentNode), inputelement, + "(2) Wront parent node!"); ok(mutationCount == 0, "(3) No mutations should have happened! [" + mutationCount + "]"); evt.originalTarget.textContent = "foo"; ok(mutationCount == 0, "(4) Mutation listener shouldn't have been called! [" + mutationCount + "]"); @@ -51,14 +53,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=328885 evt.originalTarget.lastChild.data = "bar"; ok(mutationCount == 0, "(6) Mutation listener shouldn't have been called! [" + mutationCount + "]"); - var r = document.createRange(); + var r = SpecialPowers.wrap(document.createRange()); r.selectNodeContents(evt.originalTarget); r.deleteContents(); ok(mutationCount == 0, "(7) Mutation listener shouldn't have been called! [" + mutationCount + "]"); evt.originalTarget.textContent = "foo"; ok(mutationCount == 0, "(8) Mutation listener shouldn't have been called! [" + mutationCount + "]"); - r = document.createRange(); + r = SpecialPowers.wrap(document.createRange()); r.selectNodeContents(evt.originalTarget); r.extractContents(); ok(mutationCount == 0, "(9) Mutation listener shouldn't have been called! [" + mutationCount + "]"); @@ -111,10 +113,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=328885 ok(mutationCount == 19, "(20) Mutation listener should have been called! ["+ mutationCount + "]"); } ,false); - var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor). - getInterface(Components.interfaces.nsIDOMWindowUtils); - utils.sendMouseEvent("mousedown", 5, 5, 0, 1, 0); - utils.sendMouseEvent("mouseup", 5, 5, 0, 1, 0); + synthesizeMouseAtPoint(5, 5, {}, window); SimpleTest.finish(); } From 52f876f3ad138cb456aff242ff1a63b1d0f60f26 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 16 Apr 2013 17:14:30 -0400 Subject: [PATCH 053/438] Bug 835643 part 1. Give CallbackObject an IID so that random things don't QI to it. r=smaug Right now it thinks its IID is the nsISupports IID! --- dom/bindings/CallbackObject.cpp | 1 + dom/bindings/CallbackObject.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index e4a96ab60cd1..794f3b267907 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -18,6 +18,7 @@ namespace mozilla { namespace dom { NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CallbackObject) + NS_INTERFACE_MAP_ENTRY(mozilla::dom::CallbackObject) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index c8a678bc58ea..6d7b1c75c0bc 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -34,9 +34,15 @@ namespace mozilla { namespace dom { +#define DOM_CALLBACKOBJECT_IID \ +{ 0xbe74c190, 0x6d76, 0x4991, \ + { 0x84, 0xb9, 0x65, 0x06, 0x99, 0xe6, 0x93, 0x2b } } + class CallbackObject : public nsISupports { public: + NS_DECLARE_STATIC_IID_ACCESSOR(DOM_CALLBACKOBJECT_IID) + NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CallbackObject) @@ -371,6 +377,8 @@ private: uintptr_t mPtrBits; }; +NS_DEFINE_STATIC_IID_ACCESSOR(CallbackObject, DOM_CALLBACKOBJECT_IID) + template inline void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, From 84188ce00274f3673ab0fecd247b7a35d4698b7c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 16 Apr 2013 17:15:57 -0400 Subject: [PATCH 054/438] Bug 835643 part 2. Store an EventListenerHolder, not an nsIDOMEventListener, in nsListenerStruct. r=smaug --- content/events/src/nsEventListenerManager.cpp | 27 +++++++++++---- content/events/src/nsEventListenerManager.h | 22 ++++++++++--- content/events/src/nsEventListenerService.h | 3 +- dom/bindings/CallbackObject.cpp | 2 +- dom/bindings/CallbackObject.h | 33 +++++++++++++++++-- 5 files changed, 71 insertions(+), 16 deletions(-) diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index fb265c7099f0..587b4a97bc1d 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -54,6 +54,7 @@ #include "nsSandboxFlags.h" #include "mozilla/dom/time/TimeChangeObserver.h" +using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::hal; @@ -159,7 +160,8 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, const char* aName, unsigned aFlags) { - CycleCollectionNoteChild(aCallback, aField.mListener.get(), aName, aFlags); + CycleCollectionNoteChild(aCallback, aField.mListener.GetISupports(), aName, + aFlags); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEventListenerManager) @@ -906,7 +908,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS nsresult nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct, - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, nsIDOMEvent* aDOMEvent, EventTarget* aCurrentTarget, nsCxPusher* aPusher) @@ -927,7 +929,14 @@ nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct, if (NS_SUCCEEDED(result)) { nsAutoMicroTask mt; // nsIDOMEvent::currentTarget is set in nsEventDispatcher. - result = aListener->HandleEvent(aDOMEvent); + if (aListener.HasWebIDLCallback()) { + ErrorResult rv; + aListener.GetWebIDLCallback()-> + HandleEvent(aCurrentTarget, *(aDOMEvent->InternalDOMEvent()), rv); + result = rv.ErrorCode(); + } else { + result = aListener.GetXPCOMCallback()->HandleEvent(aDOMEvent); + } } return result; @@ -996,7 +1005,7 @@ nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext, continue; } - nsRefPtr kungFuDeathGrip = ls->mListener; + EventListenerHolder kungFuDeathGrip(ls->mListener); if (NS_FAILED(HandleEventSubType(ls, ls->mListener, *aDOMEvent, aCurrentTarget, aPusher))) { aEvent->mFlags.mExceptionHasBeenRisen = true; @@ -1159,8 +1168,11 @@ nsEventListenerManager::GetListenerInfo(nsCOMArray* aList) } const nsDependentSubstring& eventType = Substring(nsDependentAtomString(ls.mTypeAtom), 2); + // EventListenerInfo is defined in XPCOM, so we have to go ahead + // and convert to an XPCOM callback here... nsRefPtr info = - new nsEventListenerInfo(eventType, ls.mListener, ls.mFlags.mCapture, + new nsEventListenerInfo(eventType, ls.mListener.ToXPCOMCallback(), + ls.mFlags.mCapture, ls.mFlags.mAllowUntrustedEvents, ls.mFlags.mInSystemGroup); NS_ENSURE_TRUE(info, NS_ERROR_OUT_OF_MEMORY); @@ -1285,7 +1297,10 @@ nsEventListenerManager::MarkForCC() } xpc_UnmarkGrayObject(jsl->GetEventScope()); } else if (ls.mListenerType == eWrappedJSListener) { - xpc_TryUnmarkWrappedGrayObject(ls.mListener); + xpc_TryUnmarkWrappedGrayObject(ls.mListener.GetXPCOMCallback()); + } else if (ls.mListenerType == eWebIDLListener) { + // Callback() unmarks gray + ls.mListener.GetWebIDLCallback()->Callback(); } } if (mRefCnt.IsPurple()) { diff --git a/content/events/src/nsEventListenerManager.h b/content/events/src/nsEventListenerManager.h index c851c605a515..122dc27d171a 100644 --- a/content/events/src/nsEventListenerManager.h +++ b/content/events/src/nsEventListenerManager.h @@ -18,6 +18,7 @@ #include "nsGUIEvent.h" #include "nsIJSEventListener.h" #include "mozilla/dom/EventTarget.h" +#include "mozilla/dom/EventListenerBinding.h" class nsIDOMEvent; class nsIAtom; @@ -35,6 +36,9 @@ class nsEventListenerManager; namespace mozilla { namespace dom { +typedef CallbackObjectHolder + EventListenerHolder; + struct EventListenerFlags { friend struct ::nsListenerStruct; @@ -149,12 +153,14 @@ typedef enum { eNativeListener = 0, eJSEventListener, - eWrappedJSListener + eWrappedJSListener, + eWebIDLListener, + eListenerTypeCount } nsListenerType; struct nsListenerStruct { - nsRefPtr mListener; + mozilla::dom::EventListenerHolder mListener; nsCOMPtr mTypeAtom; uint32_t mEventType; uint8_t mListenerType; @@ -166,13 +172,19 @@ struct nsListenerStruct nsIJSEventListener* GetJSListener() const { return (mListenerType == eJSEventListener) ? - static_cast(mListener.get()) : nullptr; + static_cast(mListener.GetXPCOMCallback()) : nullptr; + } + + nsListenerStruct() + { + MOZ_ASSERT(sizeof(mListenerType) == 1); + MOZ_ASSERT(eListenerTypeCount < 255); } ~nsListenerStruct() { if ((mListenerType == eJSEventListener) && mListener) { - static_cast(mListener.get())->Disconnect(); + static_cast(mListener.GetXPCOMCallback())->Disconnect(); } } @@ -364,7 +376,7 @@ protected: nsCxPusher* aPusher); nsresult HandleEventSubType(nsListenerStruct* aListenerStruct, - nsIDOMEventListener* aListener, + const mozilla::dom::EventListenerHolder& aListener, nsIDOMEvent* aDOMEvent, mozilla::dom::EventTarget* aCurrentTarget, nsCxPusher* aPusher); diff --git a/content/events/src/nsEventListenerService.h b/content/events/src/nsEventListenerService.h index a069e2015f2b..83447efc5e2c 100644 --- a/content/events/src/nsEventListenerService.h +++ b/content/events/src/nsEventListenerService.h @@ -18,7 +18,8 @@ class nsEventListenerInfo : public nsIEventListenerInfo { public: - nsEventListenerInfo(const nsAString& aType, nsIDOMEventListener* aListener, + nsEventListenerInfo(const nsAString& aType, + already_AddRefed aListener, bool aCapturing, bool aAllowsUntrusted, bool aInSystemEventGroup) : mType(aType), mListener(aListener), mCapturing(aCapturing), diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index 794f3b267907..77b9183d1b63 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -185,7 +185,7 @@ CallbackObject::CallSetup::~CallSetup() already_AddRefed CallbackObjectHolderBase::ToXPCOMCallback(CallbackObject* aCallback, - const nsIID& aIID) + const nsIID& aIID) const { if (!aCallback) { return nullptr; diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index 6d7b1c75c0bc..a7399ff9156e 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -207,7 +207,7 @@ class CallbackObjectHolderBase protected: // Returns null on all failures already_AddRefed ToXPCOMCallback(CallbackObject* aCallback, - const nsIID& aIID); + const nsIID& aIID) const; }; template @@ -250,11 +250,38 @@ public: UnlinkSelf(); } + void operator=(WebIDLCallbackT* aCallback) + { + UnlinkSelf(); + mPtrBits = reinterpret_cast(aCallback); + NS_IF_ADDREF(aCallback); + } + + void operator=(XPCOMCallbackT* aCallback) + { + UnlinkSelf(); + mPtrBits = reinterpret_cast(aCallback) | XPCOMCallbackFlag; + NS_IF_ADDREF(aCallback); + } + + void operator=(const CallbackObjectHolder& aOther) + { + UnlinkSelf(); + mPtrBits = aOther.mPtrBits; + NS_IF_ADDREF(GetISupports()); + } + nsISupports* GetISupports() const { return reinterpret_cast(mPtrBits & ~XPCOMCallbackFlag); } + // Boolean conversion operator so people can use this in boolean tests + operator bool() const + { + return GetISupports(); + } + // Even if HasWebIDLCallback returns true, GetWebIDLCallback() might still // return null. bool HasWebIDLCallback() const @@ -310,7 +337,7 @@ public: } // Try to return an XPCOMCallbackT version of this object. - already_AddRefed ToXPCOMCallback() + already_AddRefed ToXPCOMCallback() const { if (!HasWebIDLCallback()) { nsRefPtr callback = GetXPCOMCallback(); @@ -325,7 +352,7 @@ public: } // Try to return a WebIDLCallbackT version of this object. - already_AddRefed ToWebIDLCallback() + already_AddRefed ToWebIDLCallback() const { if (HasWebIDLCallback()) { nsRefPtr callback = GetWebIDLCallback(); From 3f4bc94369025696135aeff1d6eeab50079dc97c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 16 Apr 2013 17:16:08 -0400 Subject: [PATCH 055/438] Bug 835643 part 3. Expose the ability to add WebIDL event listeners to an event listener manager via its API. r=smaug --- content/events/src/nsEventListenerManager.cpp | 30 +++++++---- content/events/src/nsEventListenerManager.h | 53 +++++++++++++++++-- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 587b4a97bc1d..0e9518a8313a 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -201,7 +201,7 @@ nsEventListenerManager::GetTargetAsInnerWindow() const void nsEventListenerManager::AddEventListenerInternal( - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, uint32_t aType, nsIAtom* aTypeAtom, const EventListenerFlags& aFlags, @@ -214,7 +214,9 @@ nsEventListenerManager::AddEventListenerInternal( return; } - nsRefPtr kungFuDeathGrip = aListener; + // Since there is no public API to call us with an EventListenerHolder, we + // know that there's an EventListenerHolder on the stack holding a strong ref + // to the listener. nsListenerStruct* ls; uint32_t count = mListeners.Length(); @@ -243,8 +245,11 @@ nsEventListenerManager::AddEventListenerInternal( // Detect the type of event listener. nsCOMPtr wjs; if (aFlags.mListenerIsJSListener) { + MOZ_ASSERT(!aListener.HasWebIDLCallback()); ls->mListenerType = eJSEventListener; - } else if ((wjs = do_QueryInterface(aListener))) { + } else if (aListener.HasWebIDLCallback()) { + ls->mListenerType = eWebIDLListener; + } else if ((wjs = do_QueryInterface(aListener.GetXPCOMCallback()))) { ls->mListenerType = eWrappedJSListener; } else { ls->mListenerType = eNativeListener; @@ -427,7 +432,7 @@ nsEventListenerManager::DisableDevice(uint32_t aType) void nsEventListenerManager::RemoveEventListenerInternal( - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, uint32_t aType, nsIAtom* aUserType, const EventListenerFlags& aFlags, @@ -501,7 +506,7 @@ ListenerCanHandle(nsListenerStruct* aLs, nsEvent* aEvent) } void -nsEventListenerManager::AddEventListenerByType(nsIDOMEventListener *aListener, +nsEventListenerManager::AddEventListenerByType(const EventListenerHolder& aListener, const nsAString& aType, const EventListenerFlags& aFlags) { @@ -512,7 +517,7 @@ nsEventListenerManager::AddEventListenerByType(nsIDOMEventListener *aListener, void nsEventListenerManager::RemoveEventListenerByType( - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, const nsAString& aType, const EventListenerFlags& aFlags) { @@ -565,7 +570,8 @@ nsEventListenerManager::SetEventHandlerInternal(nsIScriptContext *aContext, aHandler, getter_AddRefs(scriptListener)); if (NS_SUCCEEDED(rv)) { - AddEventListenerInternal(scriptListener, eventType, aName, flags, true); + EventListenerHolder holder(scriptListener); + AddEventListenerInternal(holder, eventType, aName, flags, true); ls = FindEventHandler(eventType, aName); } @@ -1036,7 +1042,7 @@ nsEventListenerManager::Disconnect() void nsEventListenerManager::AddEventListener(const nsAString& aType, - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, bool aUseCapture, bool aWantsUntrusted) { @@ -1048,7 +1054,7 @@ nsEventListenerManager::AddEventListener(const nsAString& aType, void nsEventListenerManager::RemoveEventListener(const nsAString& aType, - nsIDOMEventListener* aListener, + const EventListenerHolder& aListener, bool aUseCapture) { EventListenerFlags flags; @@ -1066,7 +1072,8 @@ nsEventListenerManager::AddListenerForAllEvents(nsIDOMEventListener* aListener, flags.mCapture = aUseCapture; flags.mAllowUntrustedEvents = aWantsUntrusted; flags.mInSystemGroup = aSystemEventGroup; - AddEventListenerInternal(aListener, NS_EVENT_TYPE_ALL, nullptr, flags, + EventListenerHolder holder(aListener); + AddEventListenerInternal(holder, NS_EVENT_TYPE_ALL, nullptr, flags, false, true); } @@ -1078,7 +1085,8 @@ nsEventListenerManager::RemoveListenerForAllEvents(nsIDOMEventListener* aListene EventListenerFlags flags; flags.mCapture = aUseCapture; flags.mInSystemGroup = aSystemEventGroup; - RemoveEventListenerInternal(aListener, NS_EVENT_TYPE_ALL, nullptr, flags, + EventListenerHolder holder(aListener); + RemoveEventListenerInternal(holder, NS_EVENT_TYPE_ALL, nullptr, flags, true); } diff --git a/content/events/src/nsEventListenerManager.h b/content/events/src/nsEventListenerManager.h index 122dc27d171a..878d34fe30bc 100644 --- a/content/events/src/nsEventListenerManager.h +++ b/content/events/src/nsEventListenerManager.h @@ -219,10 +219,33 @@ public: void AddEventListener(const nsAString& aType, nsIDOMEventListener* aListener, bool aUseCapture, - bool aWantsUntrusted); + bool aWantsUntrusted) + { + mozilla::dom::EventListenerHolder holder(aListener); + AddEventListener(aType, holder, aUseCapture, aWantsUntrusted); + } + void AddEventListener(const nsAString& aType, + mozilla::dom::EventListener* aListener, + bool aUseCapture, + bool aWantsUntrusted) + { + mozilla::dom::EventListenerHolder holder(aListener); + AddEventListener(aType, holder, aUseCapture, aWantsUntrusted); + } void RemoveEventListener(const nsAString& aType, nsIDOMEventListener* aListener, - bool aUseCapture); + bool aUseCapture) + { + mozilla::dom::EventListenerHolder holder(aListener); + RemoveEventListener(aType, holder, aUseCapture); + } + void RemoveEventListener(const nsAString& aType, + mozilla::dom::EventListener* aListener, + bool aUseCapture) + { + mozilla::dom::EventListenerHolder holder(aListener); + RemoveEventListener(aType, holder, aUseCapture); + } void AddListenerForAllEvents(nsIDOMEventListener* aListener, bool aUseCapture, @@ -237,9 +260,23 @@ public: * @param an event listener */ void AddEventListenerByType(nsIDOMEventListener *aListener, + const nsAString& type, + const mozilla::dom::EventListenerFlags& aFlags) + { + mozilla::dom::EventListenerHolder holder(aListener); + AddEventListenerByType(holder, type, aFlags); + } + void AddEventListenerByType(const mozilla::dom::EventListenerHolder& aListener, const nsAString& type, const mozilla::dom::EventListenerFlags& aFlags); void RemoveEventListenerByType(nsIDOMEventListener *aListener, + const nsAString& type, + const mozilla::dom::EventListenerFlags& aFlags) + { + mozilla::dom::EventListenerHolder holder(aListener); + RemoveEventListenerByType(holder, type, aFlags); + } + void RemoveEventListenerByType(const mozilla::dom::EventListenerHolder& aListener, const nsAString& type, const mozilla::dom::EventListenerFlags& aFlags); @@ -457,15 +494,23 @@ protected: */ const nsEventHandler* GetEventHandlerInternal(nsIAtom* aEventName); + void AddEventListener(const nsAString& aType, + const mozilla::dom::EventListenerHolder& aListener, + bool aUseCapture, + bool aWantsUntrusted); + void RemoveEventListener(const nsAString& aType, + const mozilla::dom::EventListenerHolder& aListener, + bool aUseCapture); + void AddEventListenerInternal( - nsIDOMEventListener* aListener, + const mozilla::dom::EventListenerHolder& aListener, uint32_t aType, nsIAtom* aTypeAtom, const mozilla::dom::EventListenerFlags& aFlags, bool aHandler = false, bool aAllEvents = false); void RemoveEventListenerInternal( - nsIDOMEventListener* aListener, + const mozilla::dom::EventListenerHolder& aListener, uint32_t aType, nsIAtom* aUserType, const mozilla::dom::EventListenerFlags& aFlags, From de948b12f3d58202a79b0dd2ce5a434a02a442d3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 16 Apr 2013 17:16:08 -0400 Subject: [PATCH 056/438] Bug 835643 part 4. Put in place all the infrastructure to switch EventListener to WebIDL codegen. r=smaug --- content/base/public/nsINode.h | 6 +++ content/base/src/WebSocket.cpp | 28 ++++++++++ content/base/src/WebSocket.h | 9 ++++ content/base/src/nsDOMDataChannel.cpp | 2 +- content/base/src/nsDOMFileReader.h | 2 +- content/base/src/nsINode.cpp | 23 +++++++++ content/base/src/nsInProcessTabChildGlobal.h | 1 + content/base/src/nsXMLHttpRequest.h | 6 +-- content/events/public/EventTarget.h | 26 ++++------ content/events/src/EventTarget.cpp | 26 ++++++++++ content/events/src/Makefile.in | 1 + content/events/src/nsDOMEventTargetHelper.cpp | 30 +++++++++++ content/events/src/nsDOMEventTargetHelper.h | 13 ++++- .../synth/SpeechSynthesisUtterance.h | 2 +- dom/base/DOMRequest.h | 2 +- dom/base/nsGlobalWindow.cpp | 28 ++++++++++ dom/base/nsGlobalWindow.h | 6 +++ dom/base/nsScreen.h | 2 +- dom/base/nsWindowRoot.cpp | 18 +++++++ dom/base/nsWindowRoot.h | 6 +++ dom/bluetooth/BluetoothAdapter.h | 2 +- dom/bluetooth/BluetoothDevice.h | 2 +- dom/bluetooth/BluetoothManager.h | 2 +- dom/cellbroadcast/src/CellBroadcast.h | 2 +- dom/devicestorage/DeviceStorage.h | 11 ++++ dom/devicestorage/nsDeviceStorage.cpp | 51 ++++++++++++++++--- dom/fm/FMRadio.h | 2 +- dom/icc/src/IccManager.h | 2 +- dom/ipc/TabChild.h | 1 + dom/mobilemessage/src/MobileMessageManager.h | 2 +- dom/mobilemessage/src/SmsManager.h | 2 +- dom/network/src/Connection.h | 2 +- dom/network/src/MobileConnection.h | 2 +- dom/telephony/Telephony.h | 2 +- dom/telephony/TelephonyCall.h | 2 +- dom/voicemail/Voicemail.h | 2 +- 36 files changed, 281 insertions(+), 45 deletions(-) create mode 100644 content/events/src/EventTarget.cpp diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index 8a9345cb69c3..69c45fa11224 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -805,7 +805,13 @@ public: * See nsIDOMEventTarget */ NS_DECL_NSIDOMEVENTTARGET + using mozilla::dom::EventTarget::RemoveEventListener; using nsIDOMEventTarget::AddEventListener; + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const mozilla::dom::Nullable& aWantsUntrusted, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; using nsIDOMEventTarget::AddSystemEventListener; /** diff --git a/content/base/src/WebSocket.cpp b/content/base/src/WebSocket.cpp index d90b77f9e7dd..143a56deaee4 100644 --- a/content/base/src/WebSocket.cpp +++ b/content/base/src/WebSocket.cpp @@ -1153,6 +1153,20 @@ WebSocket::RemoveEventListener(const nsAString& aType, return rv; } +void +WebSocket::RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + ErrorResult& aRv) +{ + NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); + nsDOMEventTargetHelper::RemoveEventListener(aType, aListener, + aUseCapture, aRv); + if (!aRv.Failed()) { + UpdateMustKeepAlive(); + } +} + NS_IMETHODIMP WebSocket::AddEventListener(const nsAString& aType, nsIDOMEventListener *aListener, @@ -1172,6 +1186,20 @@ WebSocket::AddEventListener(const nsAString& aType, return rv; } +void +WebSocket::AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); + nsDOMEventTargetHelper::AddEventListener(aType, aListener, aUseCapture, + aWantsUntrusted, aRv); + if (!aRv.Failed()) { + UpdateMustKeepAlive(); + } +} //----------------------------------------------------------------------------- // WebSocket - methods //----------------------------------------------------------------------------- diff --git a/content/base/src/WebSocket.h b/content/base/src/WebSocket.h index a8cc41aeaea0..2028c9c11008 100644 --- a/content/base/src/WebSocket.h +++ b/content/base/src/WebSocket.h @@ -77,9 +77,18 @@ public: bool aUseCapture, bool aWantsUntrusted, uint8_t optional_argc); + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) MOZ_OVERRIDE; NS_IMETHOD RemoveEventListener(const nsAString& aType, nsIDOMEventListener* aListener, bool aUseCapture); + virtual void RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + ErrorResult& aRv) MOZ_OVERRIDE; virtual void DisconnectFromOwner(); diff --git a/content/base/src/nsDOMDataChannel.cpp b/content/base/src/nsDOMDataChannel.cpp index 2f337a106c95..4bcae7095fb2 100644 --- a/content/base/src/nsDOMDataChannel.cpp +++ b/content/base/src/nsDOMDataChannel.cpp @@ -71,7 +71,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMDATACHANNEL - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel, nsDOMEventTargetHelper) diff --git a/content/base/src/nsDOMFileReader.h b/content/base/src/nsDOMFileReader.h index 8be0edb455fe..bdafb4617cee 100644 --- a/content/base/src/nsDOMFileReader.h +++ b/content/base/src/nsDOMFileReader.h @@ -41,7 +41,7 @@ public: NS_DECL_NSIDOMFILEREADER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) // nsIInterfaceRequestor NS_DECL_NSIINTERFACEREQUESTOR diff --git a/content/base/src/nsINode.cpp b/content/base/src/nsINode.cpp index 03de895c6ea7..e4a8c8e8eed8 100644 --- a/content/base/src/nsINode.cpp +++ b/content/base/src/nsINode.cpp @@ -1044,6 +1044,29 @@ nsINode::AddEventListener(const nsAString& aType, return NS_OK; } +void +nsINode::AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + bool wantsUntrusted; + if (aWantsUntrusted.IsNull()) { + wantsUntrusted = !nsContentUtils::IsChromeDoc(OwnerDoc()); + } else { + wantsUntrusted = aWantsUntrusted.Value(); + } + + nsEventListenerManager* listener_manager = GetListenerManager(true); + if (!listener_manager) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + listener_manager->AddEventListener(aType, aListener, aUseCapture, + wantsUntrusted); +} + NS_IMETHODIMP nsINode::AddSystemEventListener(const nsAString& aType, nsIDOMEventListener *aListener, diff --git a/content/base/src/nsInProcessTabChildGlobal.h b/content/base/src/nsInProcessTabChildGlobal.h index 390d61b78a94..a60f23db296c 100644 --- a/content/base/src/nsInProcessTabChildGlobal.h +++ b/content/base/src/nsInProcessTabChildGlobal.h @@ -91,6 +91,7 @@ public: aWantsUntrusted, optional_argc); } + using nsDOMEventTargetHelper::AddEventListener; virtual nsIScriptObjectPrincipal* GetObjectPrincipal() { return this; } virtual JSContext* GetJSContextForEventHandlers() { return mCx; } diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index 9c6b56a8d1e5..c67f54381304 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -67,7 +67,7 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXHREventTarget, nsDOMEventTargetHelper) NS_DECL_NSIXMLHTTPREQUESTEVENTTARGET - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) IMPL_EVENT_HANDLER(loadstart) IMPL_EVENT_HANDLER(progress) @@ -91,7 +91,7 @@ public: } NS_DECL_ISUPPORTS_INHERITED NS_FORWARD_NSIXMLHTTPREQUESTEVENTTARGET(nsXHREventTarget::) - NS_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget) NS_DECL_NSIXMLHTTPREQUESTUPLOAD virtual JSObject* WrapObject(JSContext *cx, JSObject *scope) MOZ_OVERRIDE @@ -226,7 +226,7 @@ public: virtual size_t SizeOfEventTargetIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; - NS_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget) #ifdef DEBUG void StaticAssertions(); diff --git a/content/events/public/EventTarget.h b/content/events/public/EventTarget.h index d946c334fba4..d91a1931e844 100644 --- a/content/events/public/EventTarget.h +++ b/content/events/public/EventTarget.h @@ -17,6 +17,8 @@ class nsDOMEvent; namespace mozilla { namespace dom { +class EventListener; + // IID for the dom::EventTarget interface #define NS_EVENTTARGET_IID \ { 0x0a5aed21, 0x0bab, 0x48b3, \ @@ -32,21 +34,15 @@ public: using nsIDOMEventTarget::AddEventListener; using nsIDOMEventTarget::RemoveEventListener; using nsIDOMEventTarget::DispatchEvent; - void AddEventListener(const nsAString& aType, - nsIDOMEventListener* aCallback, // XXX nullable - bool aCapture, const Nullable& aWantsUntrusted, - mozilla::ErrorResult& aRv) - { - aRv = AddEventListener(aType, aCallback, aCapture, - !aWantsUntrusted.IsNull() && aWantsUntrusted.Value(), - aWantsUntrusted.IsNull() ? 1 : 2); - } - void RemoveEventListener(const nsAString& aType, - nsIDOMEventListener* aCallback, - bool aCapture, mozilla::ErrorResult& aRv) - { - aRv = RemoveEventListener(aType, aCallback, aCapture); - } + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aCallback, + bool aCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) = 0; + virtual void RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aCallback, + bool aCapture, + ErrorResult& aRv); bool DispatchEvent(nsDOMEvent& aEvent, ErrorResult& aRv); }; diff --git a/content/events/src/EventTarget.cpp b/content/events/src/EventTarget.cpp new file mode 100644 index 000000000000..beae68758bca --- /dev/null +++ b/content/events/src/EventTarget.cpp @@ -0,0 +1,26 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "mozilla/dom/EventTarget.h" +#include "nsEventListenerManager.h" + + +namespace mozilla { +namespace dom { + +void +EventTarget::RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + ErrorResult& aRv) +{ + nsEventListenerManager* elm = GetListenerManager(false); + if (elm) { + elm->RemoveEventListener(aType, aListener, aUseCapture); + } +} + +} // namespace dom +} // namespace mozilla diff --git a/content/events/src/Makefile.in b/content/events/src/Makefile.in index 832ef8bb2d75..5b0aee74629a 100644 --- a/content/events/src/Makefile.in +++ b/content/events/src/Makefile.in @@ -15,6 +15,7 @@ LIBXUL_LIBRARY = 1 FAIL_ON_WARNINGS = 1 CPPSRCS = \ + EventTarget.cpp \ nsEventListenerManager.cpp \ nsEventStateManager.cpp \ nsDOMEvent.cpp \ diff --git a/content/events/src/nsDOMEventTargetHelper.cpp b/content/events/src/nsDOMEventTargetHelper.cpp index e7c8e153a32f..cd6c34e6cc06 100644 --- a/content/events/src/nsDOMEventTargetHelper.cpp +++ b/content/events/src/nsDOMEventTargetHelper.cpp @@ -192,6 +192,36 @@ nsDOMEventTargetHelper::AddEventListener(const nsAString& aType, return NS_OK; } +void +nsDOMEventTargetHelper::AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + bool wantsUntrusted; + if (aWantsUntrusted.IsNull()) { + nsresult rv; + nsIScriptContext* context = GetContextForEventHandlers(&rv); + if (NS_FAILED(rv)) { + aRv.Throw(rv); + return; + } + nsCOMPtr doc = + nsContentUtils::GetDocumentFromScriptContext(context); + wantsUntrusted = doc && !nsContentUtils::IsChromeDoc(doc); + } else { + wantsUntrusted = aWantsUntrusted.Value(); + } + + nsEventListenerManager* elm = GetListenerManager(true); + if (!elm) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + elm->AddEventListener(aType, aListener, aUseCapture, wantsUntrusted); +} + NS_IMETHODIMP nsDOMEventTargetHelper::AddSystemEventListener(const nsAString& aType, nsIDOMEventListener *aListener, diff --git a/content/events/src/nsDOMEventTargetHelper.h b/content/events/src/nsDOMEventTargetHelper.h index ab4cf4565b03..c35e9a2fa645 100644 --- a/content/events/src/nsDOMEventTargetHelper.h +++ b/content/events/src/nsDOMEventTargetHelper.h @@ -31,6 +31,12 @@ public: NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMEventTargetHelper) NS_DECL_NSIDOMEVENTTARGET + using mozilla::dom::EventTarget::RemoveEventListener; + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aCapture, + const mozilla::dom::Nullable& aWantsUntrusted, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMEVENTTARGETHELPER_IID) @@ -205,6 +211,11 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMEventTargetHelper, } \ virtual JSContext * GetJSContextForEventHandlers(void) { \ return _to GetJSContextForEventHandlers(); \ - } + } + +#define NS_REALLY_FORWARD_NSIDOMEVENTTARGET(_class) \ + using _class::AddEventListener; \ + using _class::RemoveEventListener; \ + NS_FORWARD_NSIDOMEVENTTARGET(_class::) #endif // nsDOMEventTargetHelper_h_ diff --git a/content/media/webspeech/synth/SpeechSynthesisUtterance.h b/content/media/webspeech/synth/SpeechSynthesisUtterance.h index 7e5d8c8f151f..1ba64df41438 100644 --- a/content/media/webspeech/synth/SpeechSynthesisUtterance.h +++ b/content/media/webspeech/synth/SpeechSynthesisUtterance.h @@ -35,7 +35,7 @@ public: NS_DECL_ISUPPORTS_INHERITED - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) nsISupports* GetParentObject() const; diff --git a/dom/base/DOMRequest.h b/dom/base/DOMRequest.h index e9e1134ff195..8e331dc484b3 100644 --- a/dom/base/DOMRequest.h +++ b/dom/base/DOMRequest.h @@ -30,7 +30,7 @@ protected: public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMDOMREQUEST - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(DOMRequest, nsDOMEventTargetHelper) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index d2d9dcb2f4d5..62f8e589752b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8018,6 +8018,34 @@ nsGlobalWindow::AddEventListener(const nsAString& aType, return NS_OK; } +void +nsGlobalWindow::AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + if (IsOuterWindow() && mInnerWindow && + !nsContentUtils::CanCallerAccess(mInnerWindow)) { + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return; + } + + bool wantsUntrusted; + if (aWantsUntrusted.IsNull()) { + wantsUntrusted = !nsContentUtils::IsChromeDoc(mDoc); + } else { + wantsUntrusted = aWantsUntrusted.Value(); + } + + nsEventListenerManager* manager = GetListenerManager(true); + if (!manager) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + manager->AddEventListener(aType, aListener, aUseCapture, wantsUntrusted); +} + NS_IMETHODIMP nsGlobalWindow::AddSystemEventListener(const nsAString& aType, nsIDOMEventListener *aListener, diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 0684c4b8c2f0..336896427fe3 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -340,6 +340,12 @@ public: // nsIDOMEventTarget NS_DECL_NSIDOMEVENTTARGET + using mozilla::dom::EventTarget::RemoveEventListener; + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const mozilla::dom::Nullable& aWantsUntrusted, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; // nsITouchEventReceiver NS_DECL_NSITOUCHEVENTRECEIVER diff --git a/dom/base/nsScreen.h b/dom/base/nsScreen.h index 4b716db6569f..87b434e9d847 100644 --- a/dom/base/nsScreen.h +++ b/dom/base/nsScreen.h @@ -34,7 +34,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMSCREEN - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) nsPIDOMWindow* GetParentObject() const { diff --git a/dom/base/nsWindowRoot.cpp b/dom/base/nsWindowRoot.cpp index 10b0e1648471..d6cadb60cdc1 100644 --- a/dom/base/nsWindowRoot.cpp +++ b/dom/base/nsWindowRoot.cpp @@ -26,6 +26,7 @@ #include "nsIDOMXULElement.h" #endif +using namespace mozilla; using namespace mozilla::dom; static NS_DEFINE_CID(kEventListenerManagerCID, NS_EVENTLISTENERMANAGER_CID); @@ -110,6 +111,23 @@ nsWindowRoot::AddEventListener(const nsAString& aType, return NS_OK; } +void +nsWindowRoot::AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + bool wantsUntrusted = !aWantsUntrusted.IsNull() && aWantsUntrusted.Value(); + nsEventListenerManager* elm = GetListenerManager(true); + if (!elm) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + elm->AddEventListener(aType, aListener, aUseCapture, wantsUntrusted); +} + + NS_IMETHODIMP nsWindowRoot::AddSystemEventListener(const nsAString& aType, nsIDOMEventListener *aListener, diff --git a/dom/base/nsWindowRoot.h b/dom/base/nsWindowRoot.h index b67a97ee63af..1348b399f2b4 100644 --- a/dom/base/nsWindowRoot.h +++ b/dom/base/nsWindowRoot.h @@ -27,6 +27,12 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_NSIDOMEVENTTARGET + using mozilla::dom::EventTarget::RemoveEventListener; + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const mozilla::dom::Nullable& aWantsUntrusted, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; // nsPIWindowRoot diff --git a/dom/bluetooth/BluetoothAdapter.h b/dom/bluetooth/BluetoothAdapter.h index d52b89d47c31..6594a1d42bac 100644 --- a/dom/bluetooth/BluetoothAdapter.h +++ b/dom/bluetooth/BluetoothAdapter.h @@ -31,7 +31,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMBLUETOOTHADAPTER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(BluetoothAdapter, nsDOMEventTargetHelper) diff --git a/dom/bluetooth/BluetoothDevice.h b/dom/bluetooth/BluetoothDevice.h index 9bfe74b166be..b74c2864f435 100644 --- a/dom/bluetooth/BluetoothDevice.h +++ b/dom/bluetooth/BluetoothDevice.h @@ -31,7 +31,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMBLUETOOTHDEVICE - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(BluetoothDevice, nsDOMEventTargetHelper) diff --git a/dom/bluetooth/BluetoothManager.h b/dom/bluetooth/BluetoothManager.h index a17c67cfed12..dcaf9abb957a 100644 --- a/dom/bluetooth/BluetoothManager.h +++ b/dom/bluetooth/BluetoothManager.h @@ -26,7 +26,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMBLUETOOTHMANAGER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) static already_AddRefed Create(nsPIDOMWindow* aWindow); diff --git a/dom/cellbroadcast/src/CellBroadcast.h b/dom/cellbroadcast/src/CellBroadcast.h index 6908f2c874bc..bc23451e260c 100644 --- a/dom/cellbroadcast/src/CellBroadcast.h +++ b/dom/cellbroadcast/src/CellBroadcast.h @@ -33,7 +33,7 @@ public: NS_DECL_NSIDOMMOZCELLBROADCAST NS_DECL_NSICELLBROADCASTLISTENER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) CellBroadcast() MOZ_DELETE; CellBroadcast(nsPIDOMWindow *aWindow, diff --git a/dom/devicestorage/DeviceStorage.h b/dom/devicestorage/DeviceStorage.h index ac5fa9c5b160..4d478306548a 100644 --- a/dom/devicestorage/DeviceStorage.h +++ b/dom/devicestorage/DeviceStorage.h @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sw=2 et tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -80,6 +82,15 @@ public: NS_DECL_NSIOBSERVER NS_DECL_NSIDOMEVENTTARGET + virtual void AddEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + const mozilla::dom::Nullable& aWantsUntrusted, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; + virtual void RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aUseCapture, + mozilla::ErrorResult& aRv) MOZ_OVERRIDE; nsDOMDeviceStorage(); diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index ceacad4d062f..1e848f9083d6 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sw=2 et tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -1527,15 +1529,14 @@ public: nsIPrincipal *aPrincipal, DeviceStorageFile *aFile, DOMRequest* aRequest, - nsDOMDeviceStorage *aDeviceStorage, - nsIDOMEventListener *aListener) + nsDOMDeviceStorage *aDeviceStorage) : mRequestType(aRequestType) , mWindow(aWindow) , mPrincipal(aPrincipal) , mFile(aFile) , mRequest(aRequest) , mDeviceStorage(aDeviceStorage) - , mListener(aListener) {} + {} DeviceStorageRequest(const DeviceStorageRequestType aRequestType, nsPIDOMWindow *aWindow, @@ -1821,7 +1822,6 @@ private: nsRefPtr mRequest; nsCOMPtr mBlob; nsRefPtr mDeviceStorage; - nsCOMPtr mListener; }; NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DeviceStorageRequest) @@ -1833,12 +1833,11 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(DeviceStorageRequest) NS_IMPL_CYCLE_COLLECTING_RELEASE(DeviceStorageRequest) -NS_IMPL_CYCLE_COLLECTION_5(DeviceStorageRequest, +NS_IMPL_CYCLE_COLLECTION_4(DeviceStorageRequest, mRequest, mWindow, mBlob, - mDeviceStorage, - mListener) + mDeviceStorage) DOMCI_DATA(DeviceStorage, nsDOMDeviceStorage) @@ -2455,11 +2454,32 @@ nsDOMDeviceStorage::AddEventListener(const nsAString & aType, nsRefPtr request = new DOMRequest(win); nsRefPtr dsf = new DeviceStorageFile(mStorageType, mRootDirectory); nsCOMPtr r = new DeviceStorageRequest(DEVICE_STORAGE_REQUEST_WATCH, - win, mPrincipal, dsf, request, this, aListener); + win, mPrincipal, dsf, request, this); NS_DispatchToMainThread(r); return nsDOMEventTargetHelper::AddEventListener(aType, aListener, aUseCapture, aWantsUntrusted, aArgc); } +void +nsDOMDeviceStorage::AddEventListener(const nsAString & aType, + nsIDOMEventListener *aListener, + bool aUseCapture, + const Nullable& aWantsUntrusted, + ErrorResult& aRv) +{ + nsCOMPtr win = GetOwner(); + if (!win) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return; + } + + nsRefPtr request = new DOMRequest(win); + nsRefPtr dsf = new DeviceStorageFile(mStorageType, mRootDirectory); + nsCOMPtr r = new DeviceStorageRequest(DEVICE_STORAGE_REQUEST_WATCH, + win, mPrincipal, dsf, request, this); + NS_DispatchToMainThread(r); + nsDOMEventTargetHelper::AddEventListener(aType, aListener, aUseCapture, aWantsUntrusted, aRv); +} + NS_IMETHODIMP nsDOMDeviceStorage::AddSystemEventListener(const nsAString & aType, nsIDOMEventListener *aListener, @@ -2491,6 +2511,21 @@ nsDOMDeviceStorage::RemoveEventListener(const nsAString & aType, return NS_OK; } +void +nsDOMDeviceStorage::RemoveEventListener(const nsAString& aType, + nsIDOMEventListener* aListener, + bool aCapture, + ErrorResult& aRv) +{ + nsDOMEventTargetHelper::RemoveEventListener(aType, aListener, aCapture, aRv); + + if (mIsWatchingFile && !HasListenersFor(nsGkAtoms::onchange)) { + mIsWatchingFile = false; + nsCOMPtr obs = mozilla::services::GetObserverService(); + obs->RemoveObserver(this, "file-watcher-update"); + } +} + NS_IMETHODIMP nsDOMDeviceStorage::RemoveSystemEventListener(const nsAString & aType, nsIDOMEventListener *aListener, diff --git a/dom/fm/FMRadio.h b/dom/fm/FMRadio.h index e1800590cbcc..19977bfb84ac 100644 --- a/dom/fm/FMRadio.h +++ b/dom/fm/FMRadio.h @@ -34,7 +34,7 @@ public: NS_DECL_NSIFMRADIO NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) FMRadio(); virtual void Notify(const hal::FMRadioOperationInformation& info); virtual void Notify(const hal::SwitchEvent& aEvent); diff --git a/dom/icc/src/IccManager.h b/dom/icc/src/IccManager.h index d8be3adc9c58..650b01d8d05e 100644 --- a/dom/icc/src/IccManager.h +++ b/dom/icc/src/IccManager.h @@ -30,7 +30,7 @@ public: NS_DECL_NSIDOMMOZICCMANAGER NS_DECL_NSIICCLISTENER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) IccManager(); diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 42a683377891..c024f160879b 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -113,6 +113,7 @@ public: return nsDOMEventTargetHelper::AddEventListener(aType, aListener, aUseCapture, false, 2); } + using nsDOMEventTargetHelper::AddEventListener; NS_IMETHOD AddEventListener(const nsAString& aType, nsIDOMEventListener* aListener, bool aUseCapture, bool aWantsUntrusted, diff --git a/dom/mobilemessage/src/MobileMessageManager.h b/dom/mobilemessage/src/MobileMessageManager.h index fa438cd7b9d0..287ad3b0a872 100644 --- a/dom/mobilemessage/src/MobileMessageManager.h +++ b/dom/mobilemessage/src/MobileMessageManager.h @@ -25,7 +25,7 @@ public: NS_DECL_NSIOBSERVER NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) void Init(nsPIDOMWindow *aWindow); void Shutdown(); diff --git a/dom/mobilemessage/src/SmsManager.h b/dom/mobilemessage/src/SmsManager.h index f47ea98680a3..d7e06b9e20cc 100644 --- a/dom/mobilemessage/src/SmsManager.h +++ b/dom/mobilemessage/src/SmsManager.h @@ -24,7 +24,7 @@ public: NS_DECL_NSIOBSERVER NS_DECL_NSIDOMMOZSMSMANAGER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) static already_AddRefed CreateInstanceIfAllowed(nsPIDOMWindow *aWindow); diff --git a/dom/network/src/Connection.h b/dom/network/src/Connection.h index 060ab0d921c3..015994d13083 100644 --- a/dom/network/src/Connection.h +++ b/dom/network/src/Connection.h @@ -29,7 +29,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMMOZCONNECTION - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) Connection(); diff --git a/dom/network/src/MobileConnection.h b/dom/network/src/MobileConnection.h index b7cd86aa9d5b..1ef32f1a93b7 100644 --- a/dom/network/src/MobileConnection.h +++ b/dom/network/src/MobileConnection.h @@ -37,7 +37,7 @@ public: NS_DECL_NSIDOMMOZMOBILECONNECTION NS_DECL_NSIMOBILECONNECTIONLISTENER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) MobileConnection(); diff --git a/dom/telephony/Telephony.h b/dom/telephony/Telephony.h index 5e17bfd346da..2bf6e1b66119 100644 --- a/dom/telephony/Telephony.h +++ b/dom/telephony/Telephony.h @@ -47,7 +47,7 @@ public: NS_DECL_NSIDOMTELEPHONY NS_DECL_NSITELEPHONYLISTENER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED( Telephony, nsDOMEventTargetHelper) diff --git a/dom/telephony/TelephonyCall.h b/dom/telephony/TelephonyCall.h index 3cb2dd592d7c..429547502d1c 100644 --- a/dom/telephony/TelephonyCall.h +++ b/dom/telephony/TelephonyCall.h @@ -32,7 +32,7 @@ class TelephonyCall : public nsDOMEventTargetHelper, public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMTELEPHONYCALL - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall, nsDOMEventTargetHelper) diff --git a/dom/voicemail/Voicemail.h b/dom/voicemail/Voicemail.h index 40befe036dea..d622b8de4186 100644 --- a/dom/voicemail/Voicemail.h +++ b/dom/voicemail/Voicemail.h @@ -35,7 +35,7 @@ public: NS_DECL_NSIDOMMOZVOICEMAIL NS_DECL_NSIVOICEMAILLISTENER - NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::) + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper) Voicemail(nsPIDOMWindow* aWindow, nsIVoicemailProvider* aProvider); virtual ~Voicemail(); From d74a374a6926da951c0c672080f78f814a4f363b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 5 Apr 2013 00:57:39 -0400 Subject: [PATCH 057/438] Bug 850090. Don't assert things about our stylesheets during unlink, since our state can be kinda inconsistent then. r=smaug --- content/base/src/nsDocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 568ff0f779cb..9e5e77800733 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -3758,7 +3758,7 @@ nsDocument::RemoveStyleSheet(nsIStyleSheet* aSheet) nsCOMPtr sheet = aSheet; // hold ref so it won't die too soon if (!mStyleSheets.RemoveObject(aSheet)) { - NS_NOTREACHED("stylesheet not found"); + NS_ASSERTION(mInUnlinkOrDeletion, "stylesheet not found"); return; } From a0a8b12fb73ace170b219fe19319fc5ab187adff Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 16:29:04 -0500 Subject: [PATCH 058/438] Bug 836565, Part 1: Make pinch gestures perform reflow-on-zoom operations only once to improve performance. [r=kats] --- layout/base/nsPresShell.cpp | 7 ++++--- mobile/android/chrome/content/browser.js | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 7cc667dbfb21..bfbce3512efe 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -9506,7 +9506,8 @@ nsIPresShell::SetMaxLineBoxWidth(nscoord aMaxLineBoxWidth) { NS_ASSERTION(aMaxLineBoxWidth >= 0, "attempting to set max line box width to a negative value"); - mMaxLineBoxWidth = aMaxLineBoxWidth; - - FrameNeedsReflow(GetRootFrame(), eResize, NS_FRAME_IS_DIRTY); + if (mMaxLineBoxWidth != aMaxLineBoxWidth) { + mMaxLineBoxWidth = aMaxLineBoxWidth; + FrameNeedsReflow(GetRootFrame(), eResize, NS_FRAME_IS_DIRTY); + } } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index ca681538ad5c..6b91cf30ae24 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2836,11 +2836,13 @@ Tab.prototype = { // Adjust the max line box width to be no more than the viewport width, but // only if the reflow-on-zoom preference is enabled. - let isZooming = aViewport.zoom != this._zoom; + let isZooming = Math.abs(aViewport.zoom - this._zoom) >= 1e-6; if (isZooming && BrowserEventHandler.mReflozPref && - BrowserApp.selectedTab._mReflozPoint) { + BrowserApp.selectedTab._mReflozPoint && + BrowserApp.selectedTab.probablyNeedRefloz) { BrowserApp.selectedTab.performReflowOnZoom(aViewport); + BrowserApp.selectedTab.probablyNeedRefloz = false; } let win = this.browser.contentWindow; @@ -4041,6 +4043,7 @@ var BrowserEventHandler = { BrowserApp.selectedTab._mReflozPoint = { x: zoomPointX, y: zoomPointY, range: BrowserApp.selectedBrowser.contentDocument.caretPositionFromPoint(zoomPointX, zoomPointY) }; + BrowserApp.selectedTab.probablyNeedRefloz = true; } }, From b50787e6b678b8e287381ee527960ea08436f6db Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 16 Apr 2013 16:29:11 -0500 Subject: [PATCH 059/438] Bug 800805: Account for left border and padding when snapping in to text after reflow on zoom. [r=kats] --- mobile/android/chrome/content/browser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 6b91cf30ae24..662453d73c75 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -4024,8 +4024,13 @@ var BrowserEventHandler = { // center the area of interest on the screen. let topPos = scrollTop + drRect.top - (viewport.cssHeight / 2.0); + // Factor in the border and padding + let boundingStyle = window.getComputedStyle(boundingElement); + let leftAdjustment = parseInt(boundingStyle.paddingLeft) + + parseInt(boundingStyle.borderLeftWidth); + rect.type = "Browser:ZoomToRect"; - rect.x = Math.max(viewport.cssPageLeft, rect.x - fudge); + rect.x = Math.max(viewport.cssPageLeft, rect.x - fudge + leftAdjustment); rect.y = Math.max(topPos, viewport.cssPageTop); rect.w = viewport.cssWidth; rect.h = viewport.cssHeight; From 830f0c9453dcd85630739fa03f34b5a7e1c71a17 Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Tue, 16 Apr 2013 14:34:46 -0700 Subject: [PATCH 060/438] Bug 838793 - Part 1: Convert AboutHomeContent to a Fragment. r=lucasr --- mobile/android/base/AwesomeBar.java | 22 +- mobile/android/base/BrowserApp.java | 180 ++++------- mobile/android/base/GeckoActivity.java | 4 +- mobile/android/base/GeckoApp.java | 89 +++--- mobile/android/base/GeckoViewsFactory.java | 4 +- mobile/android/base/Makefile.in | 3 +- mobile/android/base/PrivateTab.java | 6 +- mobile/android/base/Tab.java | 21 +- mobile/android/base/Tabs.java | 4 +- mobile/android/base/gfx/LayerView.java | 9 +- .../abouthome_content.xml | 11 +- .../resources/layout/abouthome_content.xml | 11 +- .../base/resources/layout/gecko_app.xml | 5 - mobile/android/base/widget/AboutHome.java | 279 ++++++++++++++++++ .../android/base/widget/AboutHomeContent.java | 235 --------------- mobile/android/base/widget/AboutHomeView.java | 55 ++++ mobile/android/base/widget/AddonsSection.java | 14 +- .../android/base/widget/LastTabsSection.java | 4 +- mobile/android/base/widget/TopSitesView.java | 20 +- 19 files changed, 528 insertions(+), 448 deletions(-) create mode 100644 mobile/android/base/widget/AboutHome.java delete mode 100644 mobile/android/base/widget/AboutHomeContent.java create mode 100644 mobile/android/base/widget/AboutHomeView.java diff --git a/mobile/android/base/AwesomeBar.java b/mobile/android/base/AwesomeBar.java index 13d1b6f9fe9e..ecebc736e617 100644 --- a/mobile/android/base/AwesomeBar.java +++ b/mobile/android/base/AwesomeBar.java @@ -28,6 +28,7 @@ import android.text.InputType; import android.text.Spanned; import android.text.TextUtils; import android.text.TextWatcher; +import android.util.AttributeSet; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; @@ -40,7 +41,6 @@ import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; -import android.widget.ListView; import android.widget.TabWidget; import android.widget.Toast; @@ -68,11 +68,12 @@ public class AwesomeBar extends GeckoActivity { @Override public void onCreate(Bundle savedInstanceState) { + LayoutInflater.from(this).setFactory(this); + super.onCreate(savedInstanceState); Log.d(LOGTAG, "creating awesomebar"); - LayoutInflater.from(this).setFactory(GeckoViewsFactory.getInstance()); setContentView(R.layout.awesomebar); mGoButton = (ImageButton) findViewById(R.id.awesomebar_button); @@ -265,6 +266,21 @@ public class AwesomeBar extends GeckoActivity { } } + /* + * Only one factory can be set on the inflater; however, we want to use two + * factories (GeckoViewsFactory and the FragmentActivity factory). + * Overriding onCreateView() here allows us to dispatch view creation to + * both factories. + */ + @Override + public View onCreateView(String name, Context context, AttributeSet attrs) { + View view = GeckoViewsFactory.getInstance().onCreateView(name, context, attrs); + if (view == null) { + view = super.onCreateView(name, context, attrs); + } + return view; + } + private boolean handleBackKey() { // Let mAwesomeTabs try to handle the back press, since we may be in a // bookmarks sub-folder. @@ -527,7 +543,6 @@ public class AwesomeBar extends GeckoActivity { @Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, view, menuInfo); - ListView list = (ListView) view; AwesomeBarTab tab = mAwesomeTabs.getAwesomeBarTabForView(view); mContextMenuSubject = tab.getSubject(menu, view, menuInfo); } @@ -542,7 +557,6 @@ public class AwesomeBar extends GeckoActivity { final byte[] b = mContextMenuSubject.favicon; final String title = mContextMenuSubject.title; final String keyword = mContextMenuSubject.keyword; - final int display = mContextMenuSubject.display; switch (item.getItemId()) { case R.id.open_in_reader: { diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index ecdf25b6b618..14377ae99fd2 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -15,8 +15,7 @@ import org.mozilla.gecko.util.GamepadUtils; import org.mozilla.gecko.util.HardwareUtils; import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.UiAsyncTask; -import org.mozilla.gecko.widget.AboutHomeContent; -import org.mozilla.gecko.widget.TopSitesView; +import org.mozilla.gecko.widget.AboutHome; import org.json.JSONArray; import org.json.JSONException; @@ -42,7 +41,6 @@ import android.nfc.NfcEvent; import android.os.Build; import android.os.Bundle; import android.util.Log; -import android.view.ContextMenu.ContextMenuInfo; import android.view.InputDevice; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -66,7 +64,9 @@ import java.util.Vector; abstract public class BrowserApp extends GeckoApp implements TabsPanel.TabsLayoutChangeListener, PropertyAnimator.PropertyAnimationListener, - View.OnKeyListener { + View.OnKeyListener, + AboutHome.UriLoadListener, + AboutHome.LoadCompleteListener { private static final String LOGTAG = "GeckoBrowserApp"; private static final String PREF_CHROME_DYNAMICTOOLBAR = "browser.chrome.dynamictoolbar"; @@ -74,8 +74,7 @@ abstract public class BrowserApp extends GeckoApp private static final int TABS_ANIMATION_DURATION = 450; public static BrowserToolbar mBrowserToolbar; - private AboutHomeContent mAboutHomeContent; - private Boolean mAboutHomeShowing = null; + private AboutHome mAboutHome; protected Telemetry.Timer mAboutHomeStartupTimer = null; private static final int ADDON_MENU_OFFSET = 1000; @@ -362,8 +361,7 @@ abstract public class BrowserApp extends GeckoApp case KeyEvent.KEYCODE_BUTTON_Y: // Toggle/focus the address bar on gamepad-y button. if (mBrowserToolbar.isVisible()) { - if (isDynamicToolbarEnabled() && - Boolean.FALSE.equals(mAboutHomeShowing)) { + if (isDynamicToolbarEnabled() && !mAboutHome.getUserVisibleHint()) { mBrowserToolbar.animateVisibility(false); mLayerView.requestFocus(); } else { @@ -463,8 +461,8 @@ abstract public class BrowserApp extends GeckoApp ThreadUtils.postToUiThread(new Runnable() { @Override public void run() { - if (mAboutHomeContent != null) - mAboutHomeContent.setLastTabsVisibility(false); + if (mAboutHome != null) + mAboutHome.setLastTabsVisibility(false); } }); @@ -488,16 +486,23 @@ abstract public class BrowserApp extends GeckoApp // put the focus on the layerview and carry on LayerView layerView = mLayerView; if (layerView != null && !layerView.hasFocus() && GamepadUtils.isPanningControl(event)) { - if (Boolean.FALSE.equals(mAboutHomeShowing)) { + if (mAboutHome.getUserVisibleHint()) { layerView.requestFocus(); } else { - mAboutHomeContent.requestFocus(); + mAboutHome.requestFocus(); } } return false; } }); + // AboutHome will be dynamically attached and detached as + // about:home is shown. Adding/removing the fragment is not synchronous, + // so we can't use Fragment#isVisible() to determine whether the + // about:home is shown. Instead, we use Fragment#getUserVisibleHint() + // with the hint we set ourselves. + mAboutHome = AboutHome.newInstance(); + mAboutHome.setUserVisibleHint(false); mBrowserToolbar = new BrowserToolbar(this); mBrowserToolbar.from(actionBar); @@ -574,9 +579,7 @@ abstract public class BrowserApp extends GeckoApp } else { // Immediately show the toolbar when disabling the dynamic // toolbar. - if (mAboutHomeContent != null) { - mAboutHomeContent.setPadding(0, 0, 0, 0); - } + mAboutHome.setPadding(0, 0, 0, 0); mBrowserToolbar.cancelVisibilityAnimation(); mBrowserToolbar.getLayout().scrollTo(0, 0); } @@ -610,8 +613,6 @@ abstract public class BrowserApp extends GeckoApp PrefsHelper.removeObserver(mPrefObserverId); mPrefObserverId = null; } - if (mAboutHomeContent != null) - mAboutHomeContent.onDestroy(); if (mBrowserToolbar != null) mBrowserToolbar.onDestroy(); @@ -635,13 +636,6 @@ abstract public class BrowserApp extends GeckoApp super.onDestroy(); } - @Override - public void onContentChanged() { - super.onContentChanged(); - if (mAboutHomeContent != null) - mAboutHomeContent.onActivityContentChanged(); - } - @Override protected void finishProfileMigration() { // Update about:home with the new information. @@ -698,7 +692,7 @@ abstract public class BrowserApp extends GeckoApp } public void setToolbarHeight(int aHeight, int aVisibleHeight) { - if (!isDynamicToolbarEnabled() || Boolean.TRUE.equals(mAboutHomeShowing)) { + if (!isDynamicToolbarEnabled() || mAboutHome.getUserVisibleHint()) { // Use aVisibleHeight here so that when the dynamic toolbar is // enabled, the padding will animate with the toolbar becoming // visible. @@ -706,7 +700,7 @@ abstract public class BrowserApp extends GeckoApp // When the dynamic toolbar is enabled, set the padding on the // about:home widget directly - this is to avoid resizing the // LayerView, which can cause visible artifacts. - mAboutHomeContent.setPadding(0, aVisibleHeight, 0, 0); + mAboutHome.setPadding(0, aVisibleHeight, 0, 0); } else { setToolbarMargin(aVisibleHeight); } @@ -793,9 +787,6 @@ abstract public class BrowserApp extends GeckoApp invalidateOptionsMenu(); updateSideBarState(); mTabsPanel.refresh(); - - if (mAboutHomeContent != null) - mAboutHomeContent.refresh(); } @Override @@ -1194,75 +1185,46 @@ abstract public class BrowserApp extends GeckoApp /* About:home UI */ void updateAboutHomeTopSites() { - if (mAboutHomeContent == null) - return; - - mAboutHomeContent.update(EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES)); + mAboutHome.update(EnumSet.of(AboutHome.UpdateFlags.TOP_SITES)); } private void showAboutHome() { - // Don't create an additional AboutHomeRunnable if about:home - // is already visible. - if (mAboutHomeShowing != null && mAboutHomeShowing) + if (mAboutHome.getUserVisibleHint()) { return; + } - mAboutHomeShowing = true; - Runnable r = new AboutHomeRunnable(true); - ThreadUtils.getUiHandler().postAtFrontOfQueue(r); + // We use commitAllowingStateLoss() instead of commit() here to avoid an + // IllegalStateException. showAboutHome() and hideAboutHome() are + // executed inside of tab's onChange() callback. Since that callback can + // be triggered asynchronously from Gecko, it's possible that this + // method can be called while Fennec is in the background. If that + // happens, using commit() would throw an IllegalStateException since + // it can't be used between the Activity's onSaveInstanceState() and + // onResume(). + getSupportFragmentManager().beginTransaction() + .add(R.id.gecko_layout, mAboutHome).commitAllowingStateLoss(); + mAboutHome.setUserVisibleHint(true); + + mBrowserToolbar.setNextFocusDownId(R.id.abouthome_content); + + // Refresh margins to possibly restore the toolbar padding + ((BrowserToolbarLayout)mBrowserToolbar.getLayout()).refreshMargins(); } private void hideAboutHome() { - // If hideAboutHome gets called before showAboutHome, we still need - // to create an AboutHomeRunnable to hide the about:home content. - if (mAboutHomeShowing != null && !mAboutHomeShowing) + if (!mAboutHome.getUserVisibleHint()) { return; + } + + getSupportFragmentManager().beginTransaction() + .remove(mAboutHome).commitAllowingStateLoss(); + mAboutHome.setUserVisibleHint(false); mBrowserToolbar.setShadowVisibility(true); - mAboutHomeShowing = false; - Runnable r = new AboutHomeRunnable(false); - ThreadUtils.getUiHandler().postAtFrontOfQueue(r); - } + mBrowserToolbar.setNextFocusDownId(R.id.layer_view); - private class AboutHomeRunnable implements Runnable { - boolean mShow; - AboutHomeRunnable(boolean show) { - mShow = show; - } - - @Override - public void run() { - if (mShow) { - if (mAboutHomeContent == null) { - mAboutHomeContent = (AboutHomeContent) findViewById(R.id.abouthome_content); - mAboutHomeContent.init(); - mAboutHomeContent.update(AboutHomeContent.UpdateFlags.ALL); - mAboutHomeContent.setUriLoadCallback(new AboutHomeContent.UriLoadCallback() { - @Override - public void callback(String url) { - mBrowserToolbar.setProgressVisibility(true); - Tabs.getInstance().loadUrl(url); - } - }); - mAboutHomeContent.setLoadCompleteCallback(new AboutHomeContent.VoidCallback() { - @Override - public void callback() { - mAboutHomeStartupTimer.stop(); - } - }); - } else { - mAboutHomeContent.update(EnumSet.of(AboutHomeContent.UpdateFlags.TOP_SITES, - AboutHomeContent.UpdateFlags.REMOTE_TABS)); - } - mAboutHomeContent.setVisibility(View.VISIBLE); - mBrowserToolbar.setNextFocusDownId(R.id.abouthome_content); - } else { - findViewById(R.id.abouthome_content).setVisibility(View.GONE); - mBrowserToolbar.setNextFocusDownId(R.id.layer_view); - } - - // Refresh margins to possibly restore the toolbar padding - ((BrowserToolbarLayout)mBrowserToolbar.getLayout()).refreshMargins(); - } + // Refresh margins to possibly restore the toolbar padding + ((BrowserToolbarLayout)mBrowserToolbar.getLayout()).refreshMargins(); } private class HideTabsTouchListener implements TouchEventInterceptor { @@ -1576,39 +1538,6 @@ abstract public class BrowserApp extends GeckoApp return true; } - @Override - public boolean onContextItemSelected(MenuItem item) { - ContextMenuInfo info = item.getMenuInfo(); - - switch (item.getItemId()) { - case R.id.abouthome_open_new_tab: - mAboutHomeContent.openNewTab(info); - return true; - - case R.id.abouthome_open_private_tab: - mAboutHomeContent.openNewPrivateTab(info); - return true; - - case R.id.abouthome_topsites_edit: - mAboutHomeContent.editSite(info); - return true; - - case R.id.abouthome_topsites_unpin: - mAboutHomeContent.unpinSite(info, TopSitesView.UnpinFlags.REMOVE_PIN); - return true; - - case R.id.abouthome_topsites_pin: - mAboutHomeContent.pinSite(info); - return true; - - case R.id.abouthome_topsites_remove: - mAboutHomeContent.unpinSite(info, TopSitesView.UnpinFlags.REMOVE_HISTORY); - return true; - - } - return super.onContextItemSelected(item); - } - @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.toggle_profiling) { @@ -1792,13 +1721,14 @@ abstract public class BrowserApp extends GeckoApp } @Override - public void onResume() - { - super.onResume(); - if (mAboutHomeContent != null) { - mAboutHomeContent.refresh(); - } + public void onAboutHomeUriLoad(String url) { + mBrowserToolbar.setProgressVisibility(true); + Tabs.getInstance().loadUrl(url); + } + @Override + public void onAboutHomeLoadComplete() { + mAboutHomeStartupTimer.stop(); } @Override diff --git a/mobile/android/base/GeckoActivity.java b/mobile/android/base/GeckoActivity.java index 53b853a2c568..762cde8e7aa9 100644 --- a/mobile/android/base/GeckoActivity.java +++ b/mobile/android/base/GeckoActivity.java @@ -4,16 +4,16 @@ package org.mozilla.gecko; -import android.app.Activity; import android.content.ComponentName; import android.content.Intent; +import android.support.v4.app.FragmentActivity; interface GeckoActivityStatus { public boolean isGeckoActivityOpened(); public boolean isFinishing(); // typically from android.app.Activity }; -public class GeckoActivity extends Activity implements GeckoActivityStatus { +public class GeckoActivity extends FragmentActivity implements GeckoActivityStatus { // has this activity recently started another Gecko activity? private boolean mGeckoActivityOpened = false; diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index bcd3f43f3b5c..aa3669279d1c 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -1318,6 +1318,37 @@ abstract public class GeckoApp mJavaUiStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_JAVAUI"); mGeckoReadyStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_GECKOREADY"); + String args = getIntent().getStringExtra("args"); + + String profileName = null; + String profilePath = null; + if (args != null) { + if (args.contains("-P")) { + Pattern p = Pattern.compile("(?:-P\\s*)(\\w*)(\\s*)"); + Matcher m = p.matcher(args); + if (m.find()) { + profileName = m.group(1); + } + } + if (args.contains("-profile")) { + Pattern p = Pattern.compile("(?:-profile\\s*)(\\S*)(\\s*)"); + Matcher m = p.matcher(args); + if (m.find()) { + profilePath = m.group(1); + } + if (profileName == null) { + profileName = getDefaultProfileName(); + if (profileName == null) + profileName = "default"; + } + GeckoApp.sIsUsingCustomProfile = true; + } + if (profileName != null || profilePath != null) { + mProfile = GeckoProfile.get(this, profileName, profilePath); + } + } + + BrowserDB.initialize(getProfile().getName()); ((GeckoApplication)getApplication()).initialize(); mAppContext = this; @@ -1327,7 +1358,7 @@ abstract public class GeckoApp Favicons.getInstance().attachToContext(this); // Check to see if the activity is restarted after configuration change. - if (getLastNonConfigurationInstance() != null) { + if (getLastCustomNonConfigurationInstance() != null) { // Restart the application as a safe way to handle the configuration change. doRestart(); System.exit(0); @@ -1356,7 +1387,7 @@ abstract public class GeckoApp } } - LayoutInflater.from(this).setFactory(GeckoViewsFactory.getInstance()); + LayoutInflater.from(this).setFactory(this); super.onCreate(savedInstanceState); @@ -1439,37 +1470,6 @@ abstract public class GeckoApp Intent intent = getIntent(); String action = intent.getAction(); - String args = intent.getStringExtra("args"); - - String profileName = null; - String profilePath = null; - if (args != null) { - if (args.contains("-P")) { - Pattern p = Pattern.compile("(?:-P\\s*)(\\w*)(\\s*)"); - Matcher m = p.matcher(args); - if (m.find()) { - profileName = m.group(1); - } - } - if (args.contains("-profile")) { - Pattern p = Pattern.compile("(?:-profile\\s*)(\\S*)(\\s*)"); - Matcher m = p.matcher(args); - if (m.find()) { - profilePath = m.group(1); - } - if (profileName == null) { - profileName = getDefaultProfileName(); - if (profileName == null) - profileName = "default"; - } - GeckoApp.sIsUsingCustomProfile = true; - } - if (profileName != null || profilePath != null) { - mProfile = GeckoProfile.get(this, profileName, profilePath); - } - } - - BrowserDB.initialize(getProfile().getName()); String passedUri = null; String uri = getURIFromIntent(intent); @@ -2061,12 +2061,6 @@ abstract public class GeckoApp } } - @Override - public void onContentChanged() { - super.onContentChanged(); - } - - @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); @@ -2081,7 +2075,7 @@ abstract public class GeckoApp } @Override - public Object onRetainNonConfigurationInstance() { + public Object onRetainCustomNonConfigurationInstance() { // Send a non-null value so that we can restart the application, // when activity restarts due to configuration change. return Boolean.TRUE; @@ -2091,6 +2085,21 @@ abstract public class GeckoApp return AppConstants.MOZ_CHILD_PROCESS_NAME; } + /* + * Only one factory can be set on the inflater; however, we want to use two + * factories (GeckoViewsFactory and the FragmentActivity factory). + * Overriding onCreateView() here allows us to dispatch view creation to + * both factories. + */ + @Override + public View onCreateView(String name, Context context, AttributeSet attrs) { + View view = GeckoViewsFactory.getInstance().onCreateView(name, context, attrs); + if (view == null) { + view = super.onCreateView(name, context, attrs); + } + return view; + } + public void addEnvToIntent(Intent intent) { Map envMap = System.getenv(); Set> envSet = envMap.entrySet(); diff --git a/mobile/android/base/GeckoViewsFactory.java b/mobile/android/base/GeckoViewsFactory.java index 44d2b3d80d11..ea35eda79e3c 100644 --- a/mobile/android/base/GeckoViewsFactory.java +++ b/mobile/android/base/GeckoViewsFactory.java @@ -5,7 +5,7 @@ package org.mozilla.gecko; import org.mozilla.gecko.gfx.LayerView; -import org.mozilla.gecko.widget.AboutHomeContent; +import org.mozilla.gecko.widget.AboutHomeView; import org.mozilla.gecko.widget.AddonsSection; import org.mozilla.gecko.widget.IconTabWidget; import org.mozilla.gecko.widget.LastTabsSection; @@ -46,7 +46,7 @@ public final class GeckoViewsFactory implements LayoutInflater.Factory { Class arg1Class = Context.class; Class arg2Class = AttributeSet.class; try { - mFactoryMap.put("AboutHomeContent", AboutHomeContent.class.getConstructor(arg1Class, arg2Class)); + mFactoryMap.put("AboutHomeView", AboutHomeView.class.getConstructor(arg1Class, arg2Class)); mFactoryMap.put("AddonsSection", AddonsSection.class.getConstructor(arg1Class, arg2Class)); mFactoryMap.put("LastTabsSection", LastTabsSection.class.getConstructor(arg1Class, arg2Class)); mFactoryMap.put("PromoBox", PromoBox.class.getConstructor(arg1Class, arg2Class)); diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index 85a1cb250e03..056216f37563 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -209,7 +209,8 @@ FENNEC_JAVA_FILES = \ gfx/TouchEventHandler.java \ gfx/ViewTransform.java \ gfx/VirtualLayer.java \ - widget/AboutHomeContent.java \ + widget/AboutHome.java \ + widget/AboutHomeView.java \ widget/AboutHomeSection.java \ widget/AddonsSection.java \ widget/DateTimePicker.java \ diff --git a/mobile/android/base/PrivateTab.java b/mobile/android/base/PrivateTab.java index 1994a153283b..7f6d0b5350f5 100644 --- a/mobile/android/base/PrivateTab.java +++ b/mobile/android/base/PrivateTab.java @@ -5,9 +5,11 @@ package org.mozilla.gecko; +import android.content.Context; + public class PrivateTab extends Tab { - public PrivateTab(int id, String url, boolean external, int parentId, String title) { - super(id, url, external, parentId, title); + public PrivateTab(Context context, int id, String url, boolean external, int parentId, String title) { + super(context, id, url, external, parentId, title); } @Override diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 1fa7aa12ab68..adf80ec5b745 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -13,6 +13,7 @@ import org.json.JSONException; import org.json.JSONObject; import android.content.ContentResolver; +import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; @@ -57,11 +58,12 @@ public class Tab { private ZoomConstraints mZoomConstraints; private ArrayList mPluginViews; private HashMap mPluginLayers; - private int mBackgroundColor = Color.WHITE; + private int mBackgroundColor; private int mState; private Bitmap mThumbnailBitmap; private boolean mDesktopMode; private boolean mEnteringReaderMode; + private Context mContext; private static final int MAX_HISTORY_LIST_SIZE = 50; public static final int STATE_DELAYED = 0; @@ -69,7 +71,8 @@ public class Tab { public static final int STATE_SUCCESS = 2; public static final int STATE_ERROR = 3; - public Tab(int id, String url, boolean external, int parentId, String title) { + public Tab(Context context, int id, String url, boolean external, int parentId, String title) { + mContext = context; mId = id; mLastUsed = 0; mUrl = url; @@ -96,6 +99,11 @@ public class Tab { mPluginViews = new ArrayList(); mPluginLayers = new HashMap(); mState = shouldShowProgress(url) ? STATE_SUCCESS : STATE_LOADING; + + // At startup, the background is set to a color specified by LayerView + // when the LayerView is created. Shortly after, this background color + // will be used before the tab's content is shown. + mBackgroundColor = getBackgroundColorForUrl(url); } private ContentResolver getContentResolver() { @@ -554,7 +562,7 @@ public class Tab { setReaderEnabled(false); setZoomConstraints(new ZoomConstraints(true)); setHasTouchListeners(false); - setBackgroundColor(Color.WHITE); + setBackgroundColor(getBackgroundColorForUrl(uri)); Tabs.getInstance().notifyListeners(this, Tabs.TabEvents.LOCATION_CHANGE, uri); } @@ -563,6 +571,13 @@ public class Tab { return "about:home".equals(url) || ReaderModeUtils.isAboutReader(url); } + private int getBackgroundColorForUrl(String url) { + if ("about:home".equals(url)) { + return mContext.getResources().getColor(R.color.background_normal); + } + return Color.WHITE; + } + void handleDocumentStart(boolean showProgress, String url) { setState(shouldShowProgress(url) ? STATE_SUCCESS : STATE_LOADING); updateIdentityData(null); diff --git a/mobile/android/base/Tabs.java b/mobile/android/base/Tabs.java index 07e2c037b660..6152f5d23be5 100644 --- a/mobile/android/base/Tabs.java +++ b/mobile/android/base/Tabs.java @@ -171,8 +171,8 @@ public class Tabs implements GeckoEventListener { } private Tab addTab(int id, String url, boolean external, int parentId, String title, boolean isPrivate) { - final Tab tab = isPrivate ? new PrivateTab(id, url, external, parentId, title) : - new Tab(id, url, external, parentId, title); + final Tab tab = isPrivate ? new PrivateTab(mActivity, id, url, external, parentId, title) : + new Tab(mActivity, id, url, external, parentId, title); synchronized (this) { lazyRegisterBookmarkObserver(); mTabs.put(id, tab); diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java index 9cb060f91b68..380c2edc220e 100644 --- a/mobile/android/base/gfx/LayerView.java +++ b/mobile/android/base/gfx/LayerView.java @@ -183,7 +183,12 @@ public class LayerView extends FrameLayout { if (shouldUseTextureView()) { mTextureView = new TextureView(getContext()); mTextureView.setSurfaceTextureListener(new SurfaceTextureListener()); - mTextureView.setBackgroundColor(Color.WHITE); + + // The background is set to this color when the LayerView is + // created, and it will be shown immediately at startup. Shortly + // after, the tab's background color will be used before any content + // is shown. + mTextureView.setBackgroundResource(R.color.background_normal); addView(mTextureView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); } else { // This will stop PropertyAnimator from creating a drawing cache (i.e. a bitmap) @@ -191,7 +196,7 @@ public class LayerView extends FrameLayout { setWillNotCacheDrawing(false); mSurfaceView = new LayerSurfaceView(getContext(), this); - mSurfaceView.setBackgroundColor(Color.WHITE); + mSurfaceView.setBackgroundResource(R.color.background_normal); addView(mSurfaceView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); SurfaceHolder holder = mSurfaceView.getHolder(); diff --git a/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml b/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml index 053c50f8e703..2fd37f815743 100644 --- a/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml +++ b/mobile/android/base/resources/layout-xlarge-land-v11/abouthome_content.xml @@ -3,8 +3,13 @@ - 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/. --> - + - + diff --git a/mobile/android/base/resources/layout/abouthome_content.xml b/mobile/android/base/resources/layout/abouthome_content.xml index 6e3074383fc5..ec0c44c6b652 100644 --- a/mobile/android/base/resources/layout/abouthome_content.xml +++ b/mobile/android/base/resources/layout/abouthome_content.xml @@ -3,8 +3,13 @@ - 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/. --> - + - + diff --git a/mobile/android/base/resources/layout/gecko_app.xml b/mobile/android/base/resources/layout/gecko_app.xml index 814ce4659f87..98904a9b1ac3 100644 --- a/mobile/android/base/resources/layout/gecko_app.xml +++ b/mobile/android/base/resources/layout/gecko_app.xml @@ -28,11 +28,6 @@ - - ALL = EnumSet.allOf(UpdateFlags.class); + } + + private UriLoadListener mUriLoadListener; + private LoadCompleteListener mLoadCompleteListener; + private LightweightTheme mLightweightTheme; + private ContentObserver mTabsContentObserver; + private int mPaddingLeft; + private int mPaddingRight; + private int mPaddingTop; + private int mPaddingBottom; + private AboutHomeView mAboutHomeView; + private AddonsSection mAddonsSection; + private LastTabsSection mLastTabsSection; + private RemoteTabsSection mRemoteTabsSection; + private TopSitesView mTopSitesView; + + public interface UriLoadListener { + public void onAboutHomeUriLoad(String uriSpec); + } + + public interface LoadCompleteListener { + public void onAboutHomeLoadComplete(); + } + + public static AboutHome newInstance() { + return new AboutHome(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + mLightweightTheme = ((GeckoApplication) getActivity().getApplication()).getLightweightTheme(); + } + + @Override + public void onAttach(Activity activity) { + super.onAttach(activity); + + try { + mUriLoadListener = (UriLoadListener) activity; + } catch (ClassCastException e) { + throw new ClassCastException(activity.toString() + + " must implement UriLoadListener"); + } + + try { + mLoadCompleteListener = (LoadCompleteListener) activity; + } catch (ClassCastException e) { + throw new ClassCastException(activity.toString() + + " must implement LoadCompleteListener"); + } + } + + @Override + public void onDetach() { + super.onDetach(); + + mUriLoadListener = null; + mLoadCompleteListener = null; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + super.onCreateView(inflater, container, savedInstanceState); + + // Synchronized with onUpdate(), which runs in a background thread. + synchronized (this) { + mAboutHomeView = (AboutHomeView) inflater.inflate(R.layout.abouthome_content, container, false); + mAddonsSection = (AddonsSection) mAboutHomeView.findViewById(R.id.recommended_addons); + mLastTabsSection = (LastTabsSection) mAboutHomeView.findViewById(R.id.last_tabs); + mRemoteTabsSection = (RemoteTabsSection) mAboutHomeView.findViewById(R.id.remote_tabs); + mTopSitesView = (TopSitesView) mAboutHomeView.findViewById(R.id.top_sites_grid); + } + + mAboutHomeView.setLightweightTheme(mLightweightTheme); + mLightweightTheme.addListener(mAboutHomeView); + + return mAboutHomeView; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + view.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom); + ((PromoBox) view.findViewById(R.id.promo_box)).showRandomPromo(); + update(AboutHome.UpdateFlags.ALL); + + mTopSitesView.setLoadCompleteListener(mLoadCompleteListener); + mTopSitesView.setUriLoadListener(mUriLoadListener); + mAddonsSection.setUriLoadListener(mUriLoadListener); + + // Reload the mobile homepage on inbound tab syncs + // Because the tabs URI is coarse grained, this updates the + // remote tabs component on *every* tab change + // The observer will run on the background thread (see constructor argument) + mTabsContentObserver = new ContentObserver(ThreadUtils.getBackgroundHandler()) { + @Override + public void onChange(boolean selfChange) { + update(EnumSet.of(AboutHome.UpdateFlags.REMOTE_TABS)); + } + }; + getActivity().getContentResolver().registerContentObserver(BrowserContract.Tabs.CONTENT_URI, + false, mTabsContentObserver); + } + + @Override + public void onDestroyView() { + mLightweightTheme.removeListener(mAboutHomeView); + getActivity().getContentResolver().unregisterContentObserver(mTabsContentObserver); + + synchronized (this) { + mTopSitesView.onDestroy(); + mAboutHomeView = null; + mAddonsSection = null; + mLastTabsSection = null; + mRemoteTabsSection = null; + mTopSitesView = null; + } + + super.onDestroyView(); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + + // Reattach the fragment, forcing a reinflation of its view. + // We use commitAllowingStateLoss() instead of commit() here to avoid + // an IllegalStateException. If the phone is rotated while Fennec + // is in the background, onConfigurationChanged() is fired. + // onConfigurationChanged() is called before onResume(), so + // using commit() would throw an IllegalStateException since it can't + // be used between the Activity's onSaveInstanceState() and + // onResume(). + if (isVisible()) { + getFragmentManager().beginTransaction() + .detach(this) + .attach(this) + .commitAllowingStateLoss(); + } + } + + @Override + public boolean onContextItemSelected(MenuItem item) { + ContextMenuInfo info = item.getMenuInfo(); + + if (getView() == null) { + return true; + } + + switch (item.getItemId()) { + case R.id.abouthome_open_new_tab: + mTopSitesView.openNewTab(info); + return true; + + case R.id.abouthome_open_private_tab: + mTopSitesView.openNewPrivateTab(info); + return true; + + case R.id.abouthome_topsites_edit: + mTopSitesView.editSite(info); + return true; + + case R.id.abouthome_topsites_unpin: + mTopSitesView.unpinSite(info, TopSitesView.UnpinFlags.REMOVE_PIN); + return true; + + case R.id.abouthome_topsites_pin: + mTopSitesView.pinSite(info); + return true; + + case R.id.abouthome_topsites_remove: + mTopSitesView.unpinSite(info, TopSitesView.UnpinFlags.REMOVE_HISTORY); + return true; + + } + return super.onContextItemSelected(item); + } + + public void update(final EnumSet flags) { + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + synchronized (AboutHome.this) { + if (getView() == null) { + return; + } + + if (flags.contains(UpdateFlags.TOP_SITES)) { + mTopSitesView.loadTopSites(); + } + + if (flags.contains(UpdateFlags.PREVIOUS_TABS)) { + mLastTabsSection.readLastTabs(); + } + + if (flags.contains(UpdateFlags.RECOMMENDED_ADDONS)) { + mAddonsSection.readRecommendedAddons(); + } + + if (flags.contains(UpdateFlags.REMOTE_TABS)) { + mRemoteTabsSection.loadRemoteTabs(); + } + } + } + }); + } + + // Must be run on the UI thread + public void setLastTabsVisibility(boolean visible) { + if (mAboutHomeView == null) { + return; + } + + if (visible) + mLastTabsSection.show(); + else + mLastTabsSection.hide(); + } + + public void requestFocus() { + View view = getView(); + if (view != null) { + view.requestFocus(); + } + } + + // Must be run on the UI thread + public void setPadding(int left, int top, int right, int bottom) { + View view = getView(); + if (view != null) { + view.setPadding(left, top, right, bottom); + } + + // If the padding has changed but the view hasn't been created yet, + // store the padding values here; they will be used later in + // onViewCreated(). + mPaddingLeft = left; + mPaddingRight = right; + mPaddingTop = top; + mPaddingBottom = bottom; + } +} diff --git a/mobile/android/base/widget/AboutHomeContent.java b/mobile/android/base/widget/AboutHomeContent.java deleted file mode 100644 index 667eab713149..000000000000 --- a/mobile/android/base/widget/AboutHomeContent.java +++ /dev/null @@ -1,235 +0,0 @@ -/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- - * 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/. */ - -package org.mozilla.gecko.widget; - -import org.mozilla.gecko.BrowserApp; -import org.mozilla.gecko.LightweightTheme; -import org.mozilla.gecko.LightweightThemeDrawable; -import org.mozilla.gecko.R; -import org.mozilla.gecko.db.BrowserContract; -import org.mozilla.gecko.util.ThreadUtils; - -import android.content.Context; -import android.database.ContentObserver; -import android.util.AttributeSet; -import android.view.ContextMenu.ContextMenuInfo; -import android.view.LayoutInflater; -import android.widget.ScrollView; - -import java.util.EnumSet; - -public class AboutHomeContent extends ScrollView - implements LightweightTheme.OnChangeListener { - public static enum UpdateFlags { - TOP_SITES, - PREVIOUS_TABS, - RECOMMENDED_ADDONS, - REMOTE_TABS; - - public static final EnumSet ALL = EnumSet.allOf(UpdateFlags.class); - } - - private Context mContext; - private BrowserApp mActivity; - private UriLoadCallback mUriLoadCallback = null; - - private ContentObserver mTabsContentObserver = null; - - protected TopSitesView mTopSites; - protected AddonsSection mAddons; - protected LastTabsSection mLastTabs; - protected RemoteTabsSection mRemoteTabs; - private PromoBox mPromoBox; - - public interface UriLoadCallback { - public void callback(String uriSpec); - } - - public interface VoidCallback { - public void callback(); - } - - public AboutHomeContent(Context context) { - super(context); - mContext = context; - mActivity = (BrowserApp) context; - } - - public AboutHomeContent(Context context, AttributeSet attrs) { - super(context, attrs); - mContext = context; - mActivity = (BrowserApp) context; - } - - public void init() { - inflate(); - - // Reload the mobile homepage on inbound tab syncs - // Because the tabs URI is coarse grained, this updates the - // remote tabs component on *every* tab change - // The observer will run on the background thread (see constructor argument) - mTabsContentObserver = new ContentObserver(ThreadUtils.getBackgroundHandler()) { - @Override - public void onChange(boolean selfChange) { - update(EnumSet.of(AboutHomeContent.UpdateFlags.REMOTE_TABS)); - } - }; - mActivity.getContentResolver().registerContentObserver(BrowserContract.Tabs.CONTENT_URI, - false, mTabsContentObserver); - } - - private void inflate() { - LayoutInflater.from(mContext).inflate(R.layout.abouthome_content, this); - - mTopSites = (TopSitesView) findViewById(R.id.top_sites_grid); - mPromoBox = (PromoBox) findViewById(R.id.promo_box); - mAddons = (AddonsSection) findViewById(R.id.recommended_addons); - mLastTabs = (LastTabsSection) findViewById(R.id.last_tabs); - mRemoteTabs = (RemoteTabsSection) findViewById(R.id.remote_tabs); - - // Inform the new views about the UriLoadCallback - if (mUriLoadCallback != null) - setUriLoadCallback(mUriLoadCallback); - - mPromoBox.showRandomPromo(); - } - - @Override - public void onAttachedToWindow() { - super.onAttachedToWindow(); - mActivity.getLightweightTheme().addListener(this); - } - - @Override - public void onDetachedFromWindow() { - super.onDetachedFromWindow(); - mActivity.getLightweightTheme().removeListener(this); - } - - public void onDestroy() { - if (mTopSites != null) { - mTopSites.onDestroy(); - } - - if (mTabsContentObserver != null) { - mActivity.getContentResolver().unregisterContentObserver(mTabsContentObserver); - mTabsContentObserver = null; - } - } - - private void loadTopSites() { - mTopSites.loadTopSites(); - } - - public void openNewTab(ContextMenuInfo info) { - mTopSites.openNewTab(info); - } - - public void openNewPrivateTab(ContextMenuInfo info) { - mTopSites.openNewPrivateTab(info); - } - - public void pinSite(ContextMenuInfo info) { - mTopSites.pinSite(info); - } - - public void unpinSite(ContextMenuInfo info, final TopSitesView.UnpinFlags flags) { - mTopSites.unpinSite(info, flags); - } - - public void editSite(ContextMenuInfo info) { - mTopSites.editSite(info); - } - - public void update(final EnumSet flags) { - ThreadUtils.postToBackgroundThread(new Runnable() { - @Override - public void run() { - if (flags.contains(UpdateFlags.TOP_SITES)) - loadTopSites(); - - if (flags.contains(UpdateFlags.PREVIOUS_TABS)) - readLastTabs(); - - if (flags.contains(UpdateFlags.RECOMMENDED_ADDONS)) - readRecommendedAddons(); - - if (flags.contains(UpdateFlags.REMOTE_TABS)) - loadRemoteTabs(); - } - }); - } - - public void setUriLoadCallback(UriLoadCallback uriLoadCallback) { - mUriLoadCallback = uriLoadCallback; - mTopSites.setUriLoadCallback(uriLoadCallback); - mAddons.setUriLoadCallback(uriLoadCallback); - } - - public void setLoadCompleteCallback(VoidCallback callback) { - if (mTopSites != null) - mTopSites.setLoadCompleteCallback(callback); - } - - public void onActivityContentChanged() { - update(EnumSet.of(UpdateFlags.TOP_SITES)); - } - - /** - * Reinflates and updates all components of this view. - */ - public void refresh() { - mTopSites.onDestroy(); - - // We must remove the currently inflated view to allow for reinflation. - removeAllViews(); - - inflate(); - - // Refresh all elements. - update(AboutHomeContent.UpdateFlags.ALL); - } - - public void setLastTabsVisibility(boolean visible) { - if (visible) - mLastTabs.show(); - else - mLastTabs.hide(); - } - - private void readLastTabs() { - mLastTabs.readLastTabs(mActivity.getProfile()); - } - - private void loadRemoteTabs() { - mRemoteTabs.loadRemoteTabs(); - } - - private void readRecommendedAddons() { - mAddons.readRecommendedAddons(); - } - - @Override - public void onLightweightThemeChanged() { - LightweightThemeDrawable drawable = mActivity.getLightweightTheme().getColorDrawable(this); - if (drawable == null) - return; - - drawable.setAlpha(255, 0); - setBackgroundDrawable(drawable); - } - - @Override - public void onLightweightThemeReset() { - setBackgroundColor(getContext().getResources().getColor(R.color.background_normal)); - } - - @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - super.onLayout(changed, left, top, right, bottom); - onLightweightThemeChanged(); - } -} diff --git a/mobile/android/base/widget/AboutHomeView.java b/mobile/android/base/widget/AboutHomeView.java new file mode 100644 index 000000000000..c2bd390110f8 --- /dev/null +++ b/mobile/android/base/widget/AboutHomeView.java @@ -0,0 +1,55 @@ +package org.mozilla.gecko.widget; + +import org.mozilla.gecko.LightweightTheme; +import org.mozilla.gecko.LightweightThemeDrawable; +import org.mozilla.gecko.R; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.ScrollView; + +public class AboutHomeView extends ScrollView implements LightweightTheme.OnChangeListener { + private LightweightTheme mLightweightTheme; + + public AboutHomeView(Context context) { + super(context); + } + + public AboutHomeView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public AboutHomeView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + public void setLightweightTheme(LightweightTheme theme) { + mLightweightTheme = theme; + } + + @Override + public void onLightweightThemeChanged() { + if (mLightweightTheme == null) { + throw new IllegalStateException("setLightweightTheme() must be called before this view can listen to theme changes."); + } + + LightweightThemeDrawable drawable = mLightweightTheme.getColorDrawable(this); + if (drawable == null) { + return; + } + + drawable.setAlpha(255, 0); + setBackgroundDrawable(drawable); + } + + @Override + public void onLightweightThemeReset() { + setBackgroundColor(getResources().getColor(R.color.background_normal)); + } + + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + super.onLayout(changed, l, t, r, b); + onLightweightThemeChanged(); + } +} diff --git a/mobile/android/base/widget/AddonsSection.java b/mobile/android/base/widget/AddonsSection.java index 5a5f473abc81..c9948e1d42b5 100644 --- a/mobile/android/base/widget/AddonsSection.java +++ b/mobile/android/base/widget/AddonsSection.java @@ -40,7 +40,7 @@ public class AddonsSection extends AboutHomeSection { private Context mContext; private BrowserApp mActivity; - private AboutHomeContent.UriLoadCallback mUriLoadCallback = null; + private AboutHome.UriLoadListener mUriLoadListener; private static Rect sIconBounds; private static TextAppearanceSpan sSubTitleSpan; @@ -57,14 +57,14 @@ public class AddonsSection extends AboutHomeSection { setOnMoreTextClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (mUriLoadCallback != null) - mUriLoadCallback.callback("https://addons.mozilla.org/android"); + if (mUriLoadListener != null) + mUriLoadListener.onAboutHomeUriLoad(mContext.getString(R.string.bookmarkdefaults_url_addons)); } }); } - public void setUriLoadCallback(AboutHomeContent.UriLoadCallback uriLoadCallback) { - mUriLoadCallback = uriLoadCallback; + public void setUriLoadListener(AboutHome.UriLoadListener uriLoadListener) { + mUriLoadListener = uriLoadListener; } private String readFromZipFile(String filename) { @@ -190,8 +190,8 @@ public class AddonsSection extends AboutHomeSection { row.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (mUriLoadCallback != null) - mUriLoadCallback.callback(homepageUrl); + if (mUriLoadListener != null) + mUriLoadListener.onAboutHomeUriLoad(homepageUrl); } }); row.setOnKeyListener(GamepadUtils.getClickDispatcher()); diff --git a/mobile/android/base/widget/LastTabsSection.java b/mobile/android/base/widget/LastTabsSection.java index dd3b2a772a0d..3ce8e8b0b0c9 100644 --- a/mobile/android/base/widget/LastTabsSection.java +++ b/mobile/android/base/widget/LastTabsSection.java @@ -31,8 +31,8 @@ public class LastTabsSection extends AboutHomeSection { mContext = context; } - public void readLastTabs(GeckoProfile profile) { - String jsonString = profile.readSessionFile(true); + public void readLastTabs() { + String jsonString = GeckoProfile.get(mContext).readSessionFile(true); if (jsonString == null) { // no previous session data return; diff --git a/mobile/android/base/widget/TopSitesView.java b/mobile/android/base/widget/TopSitesView.java index 606a1923b971..a30b7d456b6a 100644 --- a/mobile/android/base/widget/TopSitesView.java +++ b/mobile/android/base/widget/TopSitesView.java @@ -66,8 +66,8 @@ public class TopSitesView extends GridView { private Context mContext; private BrowserApp mActivity; - private AboutHomeContent.UriLoadCallback mUriLoadCallback = null; - private AboutHomeContent.VoidCallback mLoadCompleteCallback = null; + private AboutHome.UriLoadListener mUriLoadListener; + private AboutHome.LoadCompleteListener mLoadCompleteListener; protected TopSitesCursorAdapter mTopSitesAdapter; @@ -105,8 +105,8 @@ public class TopSitesView extends GridView { return; } - if (mUriLoadCallback != null) - mUriLoadCallback.callback(spec); + if (mUriLoadListener != null) + mUriLoadListener.onAboutHomeUriLoad(spec); } }); @@ -224,8 +224,8 @@ public class TopSitesView extends GridView { // Even if AboutHome isn't necessarily entirely loaded if we // get here, for phones this is the part the user initially sees, // so it's the one we will care about for now. - if (mLoadCompleteCallback != null) - mLoadCompleteCallback.callback(); + if (mLoadCompleteListener != null) + mLoadCompleteListener.onAboutHomeLoadComplete(); } }); } @@ -354,12 +354,12 @@ public class TopSitesView extends GridView { mNumberOfCols = getResources().getInteger(R.integer.number_of_top_sites_cols); } - public void setUriLoadCallback(AboutHomeContent.UriLoadCallback uriLoadCallback) { - mUriLoadCallback = uriLoadCallback; + public void setUriLoadListener(AboutHome.UriLoadListener uriLoadListener) { + mUriLoadListener = uriLoadListener; } - public void setLoadCompleteCallback(AboutHomeContent.VoidCallback callback) { - mLoadCompleteCallback = callback; + public void setLoadCompleteListener(AboutHome.LoadCompleteListener listener) { + mLoadCompleteListener = listener; } private class TopSitesViewHolder { From 4b61e6ad555c671dfd3137037ff89b473c07491f Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Tue, 16 Apr 2013 14:34:46 -0700 Subject: [PATCH 061/438] Bug 838793 - Part 2: Move AboutHome update to foreground thread. r=lucasr --- mobile/android/base/widget/AboutHome.java | 70 +++----- mobile/android/base/widget/AddonsSection.java | 154 +++++++++--------- .../android/base/widget/LastTabsSection.java | 122 +++++++------- .../base/widget/RemoteTabsSection.java | 24 ++- mobile/android/base/widget/TopSitesView.java | 59 ++++--- 5 files changed, 217 insertions(+), 212 deletions(-) diff --git a/mobile/android/base/widget/AboutHome.java b/mobile/android/base/widget/AboutHome.java index 74a99a777398..f52285ba59d4 100644 --- a/mobile/android/base/widget/AboutHome.java +++ b/mobile/android/base/widget/AboutHome.java @@ -11,7 +11,6 @@ import org.mozilla.gecko.GeckoApplication; import org.mozilla.gecko.LightweightTheme; import org.mozilla.gecko.R; import org.mozilla.gecko.db.BrowserContract; -import org.mozilla.gecko.util.ThreadUtils; import android.app.Activity; import android.content.res.Configuration; @@ -98,14 +97,11 @@ public class AboutHome extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); - // Synchronized with onUpdate(), which runs in a background thread. - synchronized (this) { - mAboutHomeView = (AboutHomeView) inflater.inflate(R.layout.abouthome_content, container, false); - mAddonsSection = (AddonsSection) mAboutHomeView.findViewById(R.id.recommended_addons); - mLastTabsSection = (LastTabsSection) mAboutHomeView.findViewById(R.id.last_tabs); - mRemoteTabsSection = (RemoteTabsSection) mAboutHomeView.findViewById(R.id.remote_tabs); - mTopSitesView = (TopSitesView) mAboutHomeView.findViewById(R.id.top_sites_grid); - } + mAboutHomeView = (AboutHomeView) inflater.inflate(R.layout.abouthome_content, container, false); + mAddonsSection = (AddonsSection) mAboutHomeView.findViewById(R.id.recommended_addons); + mLastTabsSection = (LastTabsSection) mAboutHomeView.findViewById(R.id.last_tabs); + mRemoteTabsSection = (RemoteTabsSection) mAboutHomeView.findViewById(R.id.remote_tabs); + mTopSitesView = (TopSitesView) mAboutHomeView.findViewById(R.id.top_sites_grid); mAboutHomeView.setLightweightTheme(mLightweightTheme); mLightweightTheme.addListener(mAboutHomeView); @@ -128,8 +124,7 @@ public class AboutHome extends Fragment { // Reload the mobile homepage on inbound tab syncs // Because the tabs URI is coarse grained, this updates the // remote tabs component on *every* tab change - // The observer will run on the background thread (see constructor argument) - mTabsContentObserver = new ContentObserver(ThreadUtils.getBackgroundHandler()) { + mTabsContentObserver = new ContentObserver(null) { @Override public void onChange(boolean selfChange) { update(EnumSet.of(AboutHome.UpdateFlags.REMOTE_TABS)); @@ -143,15 +138,13 @@ public class AboutHome extends Fragment { public void onDestroyView() { mLightweightTheme.removeListener(mAboutHomeView); getActivity().getContentResolver().unregisterContentObserver(mTabsContentObserver); + mTopSitesView.onDestroy(); - synchronized (this) { - mTopSitesView.onDestroy(); - mAboutHomeView = null; - mAddonsSection = null; - mLastTabsSection = null; - mRemoteTabsSection = null; - mTopSitesView = null; - } + mAboutHomeView = null; + mAddonsSection = null; + mLastTabsSection = null; + mRemoteTabsSection = null; + mTopSitesView = null; super.onDestroyView(); } @@ -214,35 +207,27 @@ public class AboutHome extends Fragment { } public void update(final EnumSet flags) { - ThreadUtils.postToBackgroundThread(new Runnable() { - @Override - public void run() { - synchronized (AboutHome.this) { - if (getView() == null) { - return; - } + if (getView() == null) { + return; + } - if (flags.contains(UpdateFlags.TOP_SITES)) { - mTopSitesView.loadTopSites(); - } + if (flags.contains(UpdateFlags.TOP_SITES)) { + mTopSitesView.loadTopSites(); + } - if (flags.contains(UpdateFlags.PREVIOUS_TABS)) { - mLastTabsSection.readLastTabs(); - } + if (flags.contains(UpdateFlags.PREVIOUS_TABS)) { + mLastTabsSection.readLastTabs(); + } - if (flags.contains(UpdateFlags.RECOMMENDED_ADDONS)) { - mAddonsSection.readRecommendedAddons(); - } + if (flags.contains(UpdateFlags.RECOMMENDED_ADDONS)) { + mAddonsSection.readRecommendedAddons(); + } - if (flags.contains(UpdateFlags.REMOTE_TABS)) { - mRemoteTabsSection.loadRemoteTabs(); - } - } - } - }); + if (flags.contains(UpdateFlags.REMOTE_TABS)) { + mRemoteTabsSection.loadRemoteTabs(); + } } - // Must be run on the UI thread public void setLastTabsVisibility(boolean visible) { if (mAboutHomeView == null) { return; @@ -261,7 +246,6 @@ public class AboutHome extends Fragment { } } - // Must be run on the UI thread public void setPadding(int left, int top, int right, int bottom) { View view = getView(); if (view != null) { diff --git a/mobile/android/base/widget/AddonsSection.java b/mobile/android/base/widget/AddonsSection.java index c9948e1d42b5..c87978e1be1e 100644 --- a/mobile/android/base/widget/AddonsSection.java +++ b/mobile/android/base/widget/AddonsSection.java @@ -9,6 +9,7 @@ import org.mozilla.gecko.BrowserApp; import org.mozilla.gecko.Favicons; import org.mozilla.gecko.R; import org.mozilla.gecko.util.GamepadUtils; +import org.mozilla.gecko.util.ThreadUtils; import org.json.JSONArray; import org.json.JSONException; @@ -74,8 +75,6 @@ public class AddonsSection extends AboutHomeSection { InputStream fileStream = null; File applicationPackage = new File(mActivity.getApplication().getPackageResourcePath()); zip = new ZipFile(applicationPackage); - if (zip == null) - return null; ZipEntry fileEntry = zip.getEntry(filename); if (fileEntry == null) return null; @@ -139,83 +138,88 @@ public class AddonsSection extends AboutHomeSection { } public void readRecommendedAddons() { - final String addonsFilename = "recommended-addons.json"; - String jsonString; - try { - jsonString = mActivity.getProfile().readFile(addonsFilename); - } catch (IOException ioe) { - Log.i(LOGTAG, "filestream is null"); - jsonString = readFromZipFile(addonsFilename); - } - - JSONArray addonsArray = null; - if (jsonString != null) { - try { - addonsArray = new JSONObject(jsonString).getJSONArray("addons"); - } catch (JSONException e) { - Log.i(LOGTAG, "error reading json file", e); - } - } - - final JSONArray array = addonsArray; - post(new Runnable() { + ThreadUtils.postToBackgroundThread(new Runnable() { @Override public void run() { + final String addonsFilename = "recommended-addons.json"; + String jsonString; try { - if (array == null || array.length() == 0) { - hide(); - return; - } - - for (int i = 0; i < array.length(); i++) { - JSONObject jsonobj = array.getJSONObject(i); - String name = jsonobj.getString("name"); - String version = jsonobj.getString("version"); - String text = name + " " + version; - - SpannableString spannable = new SpannableString(text); - spannable.setSpan(sSubTitleSpan, name.length() + 1, text.length(), 0); - - final TextView row = (TextView) LayoutInflater.from(mContext).inflate(R.layout.abouthome_addon_row, getItemsContainer(), false); - row.setText(spannable, TextView.BufferType.SPANNABLE); - - Drawable drawable = mContext.getResources().getDrawable(R.drawable.ic_addons_empty); - drawable.setBounds(sIconBounds); - row.setCompoundDrawables(drawable, null, null, null); - - String iconUrl = jsonobj.getString("iconURL"); - String pageUrl = getPageUrlFromIconUrl(iconUrl); - - final String homepageUrl = jsonobj.getString("homepageURL"); - row.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mUriLoadListener != null) - mUriLoadListener.onAboutHomeUriLoad(homepageUrl); - } - }); - row.setOnKeyListener(GamepadUtils.getClickDispatcher()); - - Favicons favicons = Favicons.getInstance(); - favicons.loadFavicon(pageUrl, iconUrl, true, - new Favicons.OnFaviconLoadedListener() { - @Override - public void onFaviconLoaded(String url, Bitmap favicon) { - if (favicon != null) { - Drawable drawable = new BitmapDrawable(favicon); - drawable.setBounds(sIconBounds); - row.setCompoundDrawables(drawable, null, null, null); - } - } - }); - - addItem(row); - } - - show(); - } catch (JSONException e) { - Log.i(LOGTAG, "error reading json file", e); + jsonString = mActivity.getProfile().readFile(addonsFilename); + } catch (IOException ioe) { + Log.i(LOGTAG, "filestream is null"); + jsonString = readFromZipFile(addonsFilename); } + + JSONArray addonsArray = null; + if (jsonString != null) { + try { + addonsArray = new JSONObject(jsonString).getJSONArray("addons"); + } catch (JSONException e) { + Log.i(LOGTAG, "error reading json file", e); + } + } + + final JSONArray array = addonsArray; + post(new Runnable() { + @Override + public void run() { + try { + if (array == null || array.length() == 0) { + hide(); + return; + } + + for (int i = 0; i < array.length(); i++) { + JSONObject jsonobj = array.getJSONObject(i); + String name = jsonobj.getString("name"); + String version = jsonobj.getString("version"); + String text = name + " " + version; + + SpannableString spannable = new SpannableString(text); + spannable.setSpan(sSubTitleSpan, name.length() + 1, text.length(), 0); + + final TextView row = (TextView) LayoutInflater.from(mContext).inflate(R.layout.abouthome_addon_row, getItemsContainer(), false); + row.setText(spannable, TextView.BufferType.SPANNABLE); + + Drawable drawable = mContext.getResources().getDrawable(R.drawable.ic_addons_empty); + drawable.setBounds(sIconBounds); + row.setCompoundDrawables(drawable, null, null, null); + + String iconUrl = jsonobj.getString("iconURL"); + String pageUrl = getPageUrlFromIconUrl(iconUrl); + + final String homepageUrl = jsonobj.getString("homepageURL"); + row.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mUriLoadListener != null) + mUriLoadListener.onAboutHomeUriLoad(homepageUrl); + } + }); + row.setOnKeyListener(GamepadUtils.getClickDispatcher()); + + Favicons favicons = Favicons.getInstance(); + favicons.loadFavicon(pageUrl, iconUrl, true, + new Favicons.OnFaviconLoadedListener() { + @Override + public void onFaviconLoaded(String url, Bitmap favicon) { + if (favicon != null) { + Drawable drawable = new BitmapDrawable(favicon); + drawable.setBounds(sIconBounds); + row.setCompoundDrawables(drawable, null, null, null); + } + } + }); + + addItem(row); + } + + show(); + } catch (JSONException e) { + Log.i(LOGTAG, "error reading json file", e); + } + } + }); } }); } diff --git a/mobile/android/base/widget/LastTabsSection.java b/mobile/android/base/widget/LastTabsSection.java index 3ce8e8b0b0c9..01b45fb97b32 100644 --- a/mobile/android/base/widget/LastTabsSection.java +++ b/mobile/android/base/widget/LastTabsSection.java @@ -11,6 +11,7 @@ import org.mozilla.gecko.SessionParser; import org.mozilla.gecko.Tabs; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.util.GamepadUtils; +import org.mozilla.gecko.util.ThreadUtils; import android.content.ContentResolver; import android.content.Context; @@ -32,77 +33,82 @@ public class LastTabsSection extends AboutHomeSection { } public void readLastTabs() { - String jsonString = GeckoProfile.get(mContext).readSessionFile(true); - if (jsonString == null) { - // no previous session data - return; - } - - final ArrayList lastTabUrlsList = new ArrayList(); - new SessionParser() { + ThreadUtils.postToBackgroundThread(new Runnable() { @Override - public void onTabRead(final SessionTab tab) { - final String url = tab.getSelectedUrl(); - // don't show last tabs for about:home - if (url.equals("about:home")) { + public void run() { + String jsonString = GeckoProfile.get(mContext).readSessionFile(true); + if (jsonString == null) { + // no previous session data return; } - ContentResolver resolver = mContext.getContentResolver(); - final Bitmap favicon = BrowserDB.getFaviconForUrl(resolver, url); - lastTabUrlsList.add(url); - - LastTabsSection.this.post(new Runnable() { + final ArrayList lastTabUrlsList = new ArrayList(); + new SessionParser() { @Override - public void run() { - View container = LayoutInflater.from(mContext).inflate(R.layout.abouthome_last_tabs_row, getItemsContainer(), false); - ((TextView) container.findViewById(R.id.last_tab_title)).setText(tab.getSelectedTitle()); - ((TextView) container.findViewById(R.id.last_tab_url)).setText(tab.getSelectedUrl()); - if (favicon != null) { - ((ImageView) container.findViewById(R.id.last_tab_favicon)).setImageBitmap(favicon); + public void onTabRead(final SessionTab tab) { + final String url = tab.getSelectedUrl(); + // don't show last tabs for about:home + if (url.equals("about:home")) { + return; } - container.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - int flags = Tabs.LOADURL_NEW_TAB; - if (Tabs.getInstance().getSelectedTab().isPrivate()) - flags |= Tabs.LOADURL_PRIVATE; - Tabs.getInstance().loadUrl(url, flags); - } - }); - container.setOnKeyListener(GamepadUtils.getClickDispatcher()); + ContentResolver resolver = mContext.getContentResolver(); + final Bitmap favicon = BrowserDB.getFaviconForUrl(resolver, url); + lastTabUrlsList.add(url); - addItem(container); - } - }); - } - }.parse(jsonString); - - final int nu = lastTabUrlsList.size(); - if (nu >= 1) { - post(new Runnable() { - @Override - public void run() { - if (nu > 1) { - showMoreText(); - setOnMoreTextClickListener(new View.OnClickListener() { + LastTabsSection.this.post(new Runnable() { @Override - public void onClick(View v) { - int flags = Tabs.LOADURL_NEW_TAB; - if (Tabs.getInstance().getSelectedTab().isPrivate()) - flags |= Tabs.LOADURL_PRIVATE; - for (String url : lastTabUrlsList) { - Tabs.getInstance().loadUrl(url, flags); + public void run() { + View container = LayoutInflater.from(mContext).inflate(R.layout.abouthome_last_tabs_row, getItemsContainer(), false); + ((TextView) container.findViewById(R.id.last_tab_title)).setText(tab.getSelectedTitle()); + ((TextView) container.findViewById(R.id.last_tab_url)).setText(tab.getSelectedUrl()); + if (favicon != null) { + ((ImageView) container.findViewById(R.id.last_tab_favicon)).setImageBitmap(favicon); } + + container.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + int flags = Tabs.LOADURL_NEW_TAB; + if (Tabs.getInstance().getSelectedTab().isPrivate()) + flags |= Tabs.LOADURL_PRIVATE; + Tabs.getInstance().loadUrl(url, flags); + } + }); + container.setOnKeyListener(GamepadUtils.getClickDispatcher()); + + addItem(container); } }); - } else if (nu == 1) { - hideMoreText(); } - show(); + }.parse(jsonString); + + final int nu = lastTabUrlsList.size(); + if (nu >= 1) { + post(new Runnable() { + @Override + public void run() { + if (nu > 1) { + showMoreText(); + setOnMoreTextClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + int flags = Tabs.LOADURL_NEW_TAB; + if (Tabs.getInstance().getSelectedTab().isPrivate()) + flags |= Tabs.LOADURL_PRIVATE; + for (String url : lastTabUrlsList) { + Tabs.getInstance().loadUrl(url, flags); + } + } + }); + } else if (nu == 1) { + hideMoreText(); + } + show(); + } + }); } - }); - } + } + }); } } diff --git a/mobile/android/base/widget/RemoteTabsSection.java b/mobile/android/base/widget/RemoteTabsSection.java index 88bca8893bc5..b8f0ba56e2c9 100644 --- a/mobile/android/base/widget/RemoteTabsSection.java +++ b/mobile/android/base/widget/RemoteTabsSection.java @@ -11,6 +11,7 @@ import org.mozilla.gecko.Tabs; import org.mozilla.gecko.TabsAccessor; import org.mozilla.gecko.sync.setup.SyncAccounts; import org.mozilla.gecko.util.GamepadUtils; +import org.mozilla.gecko.util.ThreadUtils; import android.content.Context; import android.text.TextUtils; @@ -55,17 +56,22 @@ public class RemoteTabsSection extends AboutHomeSection } public void loadRemoteTabs() { - if (!SyncAccounts.syncAccountsExist(mActivity)) { - post(new Runnable() { - @Override - public void run() { - hide(); + ThreadUtils.postToBackgroundThread(new Runnable() { + @Override + public void run() { + if (!SyncAccounts.syncAccountsExist(mActivity)) { + post(new Runnable() { + @Override + public void run() { + hide(); + } + }); + return; } - }); - return; - } - TabsAccessor.getTabs(getContext(), NUMBER_OF_REMOTE_TABS, this); + TabsAccessor.getTabs(getContext(), NUMBER_OF_REMOTE_TABS, RemoteTabsSection.this); + } + }); } @Override diff --git a/mobile/android/base/widget/TopSitesView.java b/mobile/android/base/widget/TopSitesView.java index a30b7d456b6a..b77c5259df91 100644 --- a/mobile/android/base/widget/TopSitesView.java +++ b/mobile/android/base/widget/TopSitesView.java @@ -193,39 +193,44 @@ public class TopSitesView extends GridView { } public void loadTopSites() { - final ContentResolver resolver = mContext.getContentResolver(); - - // Swap in the new cursor. - final Cursor oldCursor = (mTopSitesAdapter != null) ? mTopSitesAdapter.getCursor() : null; - final Cursor newCursor = BrowserDB.getTopSites(resolver, mNumberOfTopSites); - - post(new Runnable() { + ThreadUtils.postToBackgroundThread(new Runnable() { @Override public void run() { - if (mTopSitesAdapter == null) { - mTopSitesAdapter = new TopSitesCursorAdapter(mContext, - R.layout.abouthome_topsite_item, - newCursor, - new String[] { URLColumns.TITLE }, - new int[] { R.id.title }); + final ContentResolver resolver = mContext.getContentResolver(); - setAdapter(mTopSitesAdapter); - } else { - mTopSitesAdapter.changeCursor(newCursor); - } + // Swap in the new cursor. + final Cursor oldCursor = (mTopSitesAdapter != null) ? mTopSitesAdapter.getCursor() : null; + final Cursor newCursor = BrowserDB.getTopSites(resolver, mNumberOfTopSites); - if (mTopSitesAdapter.getCount() > 0) - loadTopSitesThumbnails(resolver); + post(new Runnable() { + @Override + public void run() { + if (mTopSitesAdapter == null) { + mTopSitesAdapter = new TopSitesCursorAdapter(mContext, + R.layout.abouthome_topsite_item, + newCursor, + new String[] { URLColumns.TITLE }, + new int[] { R.id.title }); - // Free the old Cursor in the right thread now. - if (oldCursor != null && !oldCursor.isClosed()) - oldCursor.close(); + setAdapter(mTopSitesAdapter); + } else { + mTopSitesAdapter.changeCursor(newCursor); + } - // Even if AboutHome isn't necessarily entirely loaded if we - // get here, for phones this is the part the user initially sees, - // so it's the one we will care about for now. - if (mLoadCompleteListener != null) - mLoadCompleteListener.onAboutHomeLoadComplete(); + if (mTopSitesAdapter.getCount() > 0) + loadTopSitesThumbnails(resolver); + + // Free the old Cursor in the right thread now. + if (oldCursor != null && !oldCursor.isClosed()) + oldCursor.close(); + + // Even if AboutHome isn't necessarily entirely loaded if we + // get here, for phones this is the part the user initially sees, + // so it's the one we will care about for now. + if (mLoadCompleteListener != null) + mLoadCompleteListener.onAboutHomeLoadComplete(); + } + }); } }); } From 01c87f8dfce97fe52ade2757f8094a91e5c0c3c7 Mon Sep 17 00:00:00 2001 From: Dave Hunt Date: Tue, 16 Apr 2013 22:35:07 +0100 Subject: [PATCH 062/438] Bug 857607 - Reduce log level when launching B2G desktop client with mozrunner. r=jgriffin --- .../client/marionette/geckoinstance.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/testing/marionette/client/marionette/geckoinstance.py b/testing/marionette/client/marionette/geckoinstance.py index 73fa771aaf7d..a047b5d441a5 100644 --- a/testing/marionette/client/marionette/geckoinstance.py +++ b/testing/marionette/client/marionette/geckoinstance.py @@ -2,6 +2,8 @@ # 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/ +import os + from mozprofile import Profile from mozrunner import Runner @@ -28,10 +30,13 @@ class GeckoInstance(object): else: runner_class = CloneRunner profile_args["path_from"] = profile_path - print "starting runner" - self.runner = runner_class.create(binary=self.bin, - profile_args=profile_args, - cmdargs=['-no-remote']) + self.runner = runner_class.create( + binary=self.bin, + profile_args=profile_args, + cmdargs=['-no-remote'], + kp_kwargs={ + 'processOutputLine': [NullOutput()], + 'logfile': os.path.abspath('gecko.log')}) self.runner.start() def close(self): @@ -49,3 +54,9 @@ apps = {'b2gdesktop': B2GDesktopInstance} class CloneRunner(Runner): profile_class = Profile.clone + + +class NullOutput(object): + + def __call__(self, line): + pass From 3a4be4332ae3ec2f6b0e75e67f1b298c717e0ad8 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Wed, 17 Apr 2013 09:35:57 +1200 Subject: [PATCH 063/438] Bug 861490, fix crash in MaybeDrawRoundedBottomCorners with OMTC. r=mattwoodrow --HG-- extra : rebase_source : 849e63417a94cd260e6722c83018f9937c0cb339 --- gfx/layers/Makefile.in | 5 +- gfx/layers/composite/LayerManagerComposite.h | 1 - gfx/layers/opengl/CompositorOGL.h | 3 + gfx/layers/opengl/GLManager.cpp | 80 ++++++++++++++++++++ gfx/layers/opengl/GLManager.h | 37 +++++++++ widget/cocoa/nsChildView.h | 6 +- widget/cocoa/nsChildView.mm | 19 ++--- 7 files changed, 137 insertions(+), 14 deletions(-) create mode 100644 gfx/layers/opengl/GLManager.cpp create mode 100644 gfx/layers/opengl/GLManager.h diff --git a/gfx/layers/Makefile.in b/gfx/layers/Makefile.in index a2d7a51b1303..b39a0566ac0c 100644 --- a/gfx/layers/Makefile.in +++ b/gfx/layers/Makefile.in @@ -141,7 +141,10 @@ DEFINES += -DMOZ_ENABLE_D3D10_LAYER endif ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) -CPPSRCS += ShadowLayerUtilsMac.cpp +EXPORTS_mozilla/layers += GLManager.h +CPPSRCS += ShadowLayerUtilsMac.cpp \ + GLManager.cpp \ + $(NULL) endif # NB: Gralloc is available on other platforms that use the android GL diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index 90480bbaf5fc..54d849ccbeae 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -135,7 +135,6 @@ public: virtual LayersBackend GetBackendType() MOZ_OVERRIDE { - MOZ_ASSERT(false, "Shouldn't be called for composited layer manager"); return LAYERS_NONE; } virtual void GetBackendName(nsAString& name) MOZ_OVERRIDE diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index 55d3791bdca2..43c965d15289 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -18,11 +18,14 @@ namespace layers { struct FPSState; class CompositingRenderTargetOGL; +class GLManagerCompositor; class CompositorOGL : public Compositor { typedef mozilla::gl::GLContext GLContext; typedef mozilla::gl::ShaderProgramType ProgramType; + + friend class GLManagerCompositor; public: CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1, diff --git a/gfx/layers/opengl/GLManager.cpp b/gfx/layers/opengl/GLManager.cpp new file mode 100644 index 000000000000..7a4723be035a --- /dev/null +++ b/gfx/layers/opengl/GLManager.cpp @@ -0,0 +1,80 @@ +#include "GLManager.h" +#include "LayerManagerOGL.h" +#include "CompositorOGL.h" +#include "LayerManagerComposite.h" +#include "GLContext.h" + +using namespace mozilla::gl; + +namespace mozilla { +namespace layers { + +class GLManagerLayerManager : public GLManager +{ +public: + GLManagerLayerManager(LayerManagerOGL* aManager) + : mImpl(aManager) + {} + + virtual GLContext* gl() const MOZ_OVERRIDE + { + return mImpl->gl(); + } + + virtual ShaderProgramOGL* GetProgram(ShaderProgramType aType) MOZ_OVERRIDE + { + return mImpl->GetProgram(aType); + } + + virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) MOZ_OVERRIDE + { + mImpl->BindAndDrawQuad(aProg); + } + +private: + nsRefPtr mImpl; +}; + +class GLManagerCompositor : public GLManager +{ +public: + GLManagerCompositor(CompositorOGL* aCompositor) + : mImpl(aCompositor) + {} + + virtual GLContext* gl() const MOZ_OVERRIDE + { + return mImpl->gl(); + } + + virtual ShaderProgramOGL* GetProgram(gl::ShaderProgramType aType) MOZ_OVERRIDE + { + return mImpl->GetProgram(aType); + } + + virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) MOZ_OVERRIDE + { + mImpl->BindAndDrawQuad(aProg); + } + +private: + RefPtr mImpl; +}; + +/* static */ GLManager* +GLManager::CreateGLManager(LayerManager* aManager) +{ + if (aManager->GetBackendType() == LAYERS_OPENGL) { + return new GLManagerLayerManager(static_cast(aManager)); + } + if (aManager->GetBackendType() == LAYERS_NONE) { + return new GLManagerCompositor(static_cast( + static_cast(aManager)->GetCompositor())); + } + + MOZ_NOT_REACHED("Cannot create GLManager for non-GL layer manager"); + return nullptr; +} + +} +} \ No newline at end of file diff --git a/gfx/layers/opengl/GLManager.h b/gfx/layers/opengl/GLManager.h new file mode 100644 index 000000000000..cf00b04ef676 --- /dev/null +++ b/gfx/layers/opengl/GLManager.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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/. */ + +#ifndef MOZILLA_GFX_GLMANAGER_H +#define MOZILLA_GFX_GLMANAGER_H + +#include "LayerManagerOGL.h" + +namespace mozilla { +namespace gl { +class GLContext; +} +namespace layers { + +/** + * Minimal interface to allow widgets to draw using OpenGL. Abstracts + * LayerManagerOGL and CompositorOGL. Call CreateGLManager with either a + * LayerManagerOGL or a LayerManagerComposite backed by a CompositorOGL. + */ +class GLManager +{ +public: + static GLManager* CreateGLManager(LayerManager* aManager); + + virtual ~GLManager() {} + + virtual gl::GLContext* gl() const = 0; + virtual ShaderProgramOGL* GetProgram(gl::ShaderProgramType aType) = 0; + virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) = 0; + +}; + +} +} +#endif diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 46e658ed16f1..0439b93e2afa 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -90,7 +90,7 @@ class TextureImage; } namespace layers { -class LayerManagerOGL; +class GLManager; } } @@ -573,8 +573,8 @@ protected: return widget.forget(); } - void MaybeDrawResizeIndicator(mozilla::layers::LayerManagerOGL* aManager, nsIntRect aRect); - void MaybeDrawRoundedBottomCorners(mozilla::layers::LayerManagerOGL* aManager, nsIntRect aRect); + void MaybeDrawResizeIndicator(mozilla::layers::GLManager* aManager, nsIntRect aRect); + void MaybeDrawRoundedBottomCorners(mozilla::layers::GLManager* aManager, nsIntRect aRect); nsIWidget* GetWidgetForListenerEvents(); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 4cc26dcf5895..91ccf9566c80 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -51,8 +51,9 @@ #include "nsRegion.h" #include "Layers.h" #include "LayerManagerOGL.h" -#include "GLTextureImage.h" #include "LayerManagerComposite.h" +#include "GLTextureImage.h" +#include "mozilla/layers/GLManager.h" #include "mozilla/layers/CompositorCocoaWidgetHelper.h" #include "mozilla/layers/CompositorOGL.h" #ifdef ACCESSIBILITY @@ -1865,7 +1866,7 @@ nsChildView::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) return; } - LayerManagerOGL *manager = static_cast(aManager); + nsAutoPtr manager(GLManager::CreateGLManager(aManager)); MaybeDrawResizeIndicator(manager, aRect); MaybeDrawRoundedBottomCorners(manager, aRect); } @@ -1904,7 +1905,7 @@ DrawResizer(CGContextRef aCtx) } void -nsChildView::MaybeDrawResizeIndicator(LayerManagerOGL* aManager, nsIntRect aRect) +nsChildView::MaybeDrawResizeIndicator(GLManager* aManager, nsIntRect aRect) { nsIntRect resizeRect; if (!ShowsResizeIndicator(&resizeRect) || mFailedResizerImage) { @@ -1914,9 +1915,9 @@ nsChildView::MaybeDrawResizeIndicator(LayerManagerOGL* aManager, nsIntRect aRect if (!mResizerImage) { mResizerImage = aManager->gl()->CreateTextureImage(nsIntSize(resizeRect.width, resizeRect.height), - gfxASurface::CONTENT_COLOR_ALPHA, - LOCAL_GL_CLAMP_TO_EDGE, - TextureImage::UseNearestFilter); + gfxASurface::CONTENT_COLOR_ALPHA, + LOCAL_GL_CLAMP_TO_EDGE, + TextureImage::UseNearestFilter); // Creation of texture images can fail. if (!mResizerImage) @@ -1953,7 +1954,7 @@ nsChildView::MaybeDrawResizeIndicator(LayerManagerOGL* aManager, nsIntRect aRect TextureImage::ScopedBindTexture texBind(mResizerImage, LOCAL_GL_TEXTURE0); ShaderProgramOGL *program = - aManager->GetProgram(mResizerImage->GetShaderProgramType(), nullptr); + aManager->GetProgram(mResizerImage->GetShaderProgramType()); program->Activate(); program->SetLayerQuadRect(nsIntRect(bottomX - resizeIndicatorWidth, bottomY - resizeIndicatorHeight, @@ -1975,7 +1976,7 @@ DrawTopLeftCornerMask(CGContextRef aCtx, int aRadius) } void -nsChildView::MaybeDrawRoundedBottomCorners(LayerManagerOGL* aManager, nsIntRect aRect) +nsChildView::MaybeDrawRoundedBottomCorners(GLManager* aManager, nsIntRect aRect) { if (![mView isKindOfClass:[ChildView class]] || ![(ChildView*)mView hasRoundedBottomCorners] || @@ -2023,7 +2024,7 @@ nsChildView::MaybeDrawRoundedBottomCorners(LayerManagerOGL* aManager, nsIntRect TextureImage::ScopedBindTexture texBind(mCornerMaskImage, LOCAL_GL_TEXTURE0); - ShaderProgramOGL *program = aManager->GetProgram(mCornerMaskImage->GetShaderProgramType(), nullptr); + ShaderProgramOGL *program = aManager->GetProgram(mCornerMaskImage->GetShaderProgramType()); program->Activate(); program->SetLayerQuadRect(nsIntRect(0, 0, // aRect.x, aRect.y, devPixelCornerRadius, From ec2b05364995689bc9822ae2002d0b3cbf1fb3af Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Wed, 17 Apr 2013 09:36:06 +1200 Subject: [PATCH 064/438] Bug 862064; use PCompositable for tiled layers and add TiledContentClient. r=nical --HG-- extra : rebase_source : b0055e13b661f78bc0e7168c0df8c6082cfdb34e --- gfx/layers/CompositorTypes.h | 2 +- gfx/layers/basic/BasicTiledThebesLayer.cpp | 65 +++++++++++-------- gfx/layers/basic/BasicTiledThebesLayer.h | 3 +- gfx/layers/client/TiledContentClient.cpp | 49 ++++++++++---- gfx/layers/client/TiledContentClient.h | 50 ++++++++++---- gfx/layers/composite/CompositableHost.cpp | 12 ++-- gfx/layers/composite/CompositableHost.h | 12 ++-- gfx/layers/composite/ContentHost.cpp | 5 +- gfx/layers/composite/ContentHost.h | 16 ++--- gfx/layers/composite/ImageHost.h | 12 ++-- .../composite/LayerManagerComposite.cpp | 2 +- gfx/layers/composite/LayerManagerComposite.h | 7 +- gfx/layers/composite/ThebesLayerComposite.cpp | 17 +---- gfx/layers/composite/ThebesLayerComposite.h | 4 +- gfx/layers/composite/TiledContentHost.cpp | 8 +++ gfx/layers/composite/TiledContentHost.h | 26 ++++++-- gfx/layers/ipc/CompositableForwarder.h | 4 ++ .../ipc/CompositableTransactionParent.cpp | 14 ++++ gfx/layers/ipc/ImageBridgeChild.h | 6 ++ gfx/layers/ipc/LayerTransaction.ipdlh | 5 +- gfx/layers/ipc/ShadowLayers.cpp | 4 +- gfx/layers/ipc/ShadowLayers.h | 5 +- gfx/layers/ipc/ShadowLayersParent.cpp | 15 ----- 23 files changed, 207 insertions(+), 136 deletions(-) diff --git a/gfx/layers/CompositorTypes.h b/gfx/layers/CompositorTypes.h index 9e2214a2f974..020b705a7833 100644 --- a/gfx/layers/CompositorTypes.h +++ b/gfx/layers/CompositorTypes.h @@ -74,7 +74,7 @@ enum TextureHostFlags { TEXTURE_HOST_DEFAULT = 0, // The default texture host for the given // SurfaceDescriptor - TEXTURE_HOST_TILED = 1 << 0, // A texture host that supports tiling + TEXTURE_HOST_TILED = 1 << 0 // A texture host that supports tiling }; /** diff --git a/gfx/layers/basic/BasicTiledThebesLayer.cpp b/gfx/layers/basic/BasicTiledThebesLayer.cpp index 20dfe99629f8..35d3743ef583 100644 --- a/gfx/layers/basic/BasicTiledThebesLayer.cpp +++ b/gfx/layers/basic/BasicTiledThebesLayer.cpp @@ -15,11 +15,9 @@ namespace layers { BasicTiledThebesLayer::BasicTiledThebesLayer(BasicShadowLayerManager* const aManager) : ThebesLayer(aManager, static_cast(this)) - , mTiledBuffer(this, aManager) - , mLowPrecisionTiledBuffer(this, aManager) + , mContentClient() { MOZ_COUNT_CTOR(BasicTiledThebesLayer); - mLowPrecisionTiledBuffer.SetResolution(gfxPlatform::GetLowPrecisionResolution()); mPaintData.mLastScrollOffset = gfx::Point(0, 0); mPaintData.mFirstPaint = true; } @@ -126,7 +124,15 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext, return; } - if (mTiledBuffer.HasFormatChanged()) { + if (!mContentClient) { + mContentClient = new TiledContentClient(this, BasicManager()); + + mContentClient->Connect(); + BasicManager()->Attach(mContentClient, this); + MOZ_ASSERT(mContentClient->GetForwarder()); + } + + if (mContentClient->mTiledBuffer.HasFormatChanged()) { mValidRegion = nsIntRegion(); } @@ -151,9 +157,11 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext, NS_ASSERTION(!BasicManager()->IsRepeatTransaction(), "Didn't paint our mask layer"); - mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, aCallback, aCallbackData); + mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, + aCallback, aCallbackData); - mTiledBuffer.LockCopyAndWrite(); + BasicManager()->Hold(this); + mContentClient->LockCopyAndWrite(TiledContentClient::TILED_BUFFER); return; } @@ -199,33 +207,35 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext, // Only draw progressively when the resolution is unchanged. if (gfxPlatform::UseProgressiveTilePainting() && !BasicManager()->HasShadowTarget() && - mTiledBuffer.GetFrameResolution() == mPaintData.mResolution) { + mContentClient->mTiledBuffer.GetFrameResolution() == mPaintData.mResolution) { // Store the old valid region, then clear it before painting. // We clip the old valid region to the visible region, as it only gets // used to decide stale content (currently valid and previously visible) - nsIntRegion oldValidRegion = mTiledBuffer.GetValidRegion(); + nsIntRegion oldValidRegion = mContentClient->mTiledBuffer.GetValidRegion(); oldValidRegion.And(oldValidRegion, mVisibleRegion); if (!mPaintData.mLayerCriticalDisplayPort.IsEmpty()) { oldValidRegion.And(oldValidRegion, mPaintData.mLayerCriticalDisplayPort); } updatedBuffer = - mTiledBuffer.ProgressiveUpdate(mValidRegion, invalidRegion, - oldValidRegion, &mPaintData, aCallback, - aCallbackData); + mContentClient->mTiledBuffer.ProgressiveUpdate(mValidRegion, invalidRegion, + oldValidRegion, &mPaintData, + aCallback, aCallbackData); } else { updatedBuffer = true; mValidRegion = mVisibleRegion; if (!mPaintData.mLayerCriticalDisplayPort.IsEmpty()) { mValidRegion.And(mValidRegion, mPaintData.mLayerCriticalDisplayPort); } - mTiledBuffer.SetFrameResolution(mPaintData.mResolution); - mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, aCallback, aCallbackData); + mContentClient->mTiledBuffer.SetFrameResolution(mPaintData.mResolution); + mContentClient->mTiledBuffer.PaintThebes(mValidRegion, invalidRegion, + aCallback, aCallbackData); } if (updatedBuffer) { mPaintData.mFirstPaint = false; - mTiledBuffer.LockCopyAndWrite(); + BasicManager()->Hold(this); + mContentClient->LockCopyAndWrite(TiledContentClient::TILED_BUFFER); // If there are low precision updates, mark the paint as unfinished and // request a repeat transaction. @@ -247,18 +257,19 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext, bool updatedLowPrecision = false; if (!lowPrecisionInvalidRegion.IsEmpty() && !nsIntRegion(mPaintData.mLayerCriticalDisplayPort).Contains(mVisibleRegion)) { - nsIntRegion oldValidRegion = mLowPrecisionTiledBuffer.GetValidRegion(); + nsIntRegion oldValidRegion = + mContentClient->mLowPrecisionTiledBuffer.GetValidRegion(); oldValidRegion.And(oldValidRegion, mVisibleRegion); // If the frame resolution or format have changed, invalidate the buffer - if (mLowPrecisionTiledBuffer.GetFrameResolution() != mPaintData.mResolution || - mLowPrecisionTiledBuffer.HasFormatChanged()) { + if (mContentClient->mLowPrecisionTiledBuffer.GetFrameResolution() != mPaintData.mResolution || + mContentClient->mLowPrecisionTiledBuffer.HasFormatChanged()) { if (!mLowPrecisionValidRegion.IsEmpty()) { updatedLowPrecision = true; } oldValidRegion.SetEmpty(); mLowPrecisionValidRegion.SetEmpty(); - mLowPrecisionTiledBuffer.SetFrameResolution(mPaintData.mResolution); + mContentClient->mLowPrecisionTiledBuffer.SetFrameResolution(mPaintData.mResolution); lowPrecisionInvalidRegion = mVisibleRegion; } @@ -273,25 +284,27 @@ BasicTiledThebesLayer::PaintThebes(gfxContext* aContext, lowPrecisionInvalidRegion.Sub(lowPrecisionInvalidRegion, mValidRegion); if (!lowPrecisionInvalidRegion.IsEmpty()) { - updatedLowPrecision = - mLowPrecisionTiledBuffer.ProgressiveUpdate(mLowPrecisionValidRegion, - lowPrecisionInvalidRegion, oldValidRegion, - &mPaintData, aCallback, aCallbackData); + updatedLowPrecision = mContentClient->mLowPrecisionTiledBuffer + .ProgressiveUpdate(mLowPrecisionValidRegion, + lowPrecisionInvalidRegion, + oldValidRegion, &mPaintData, + aCallback, aCallbackData); } } else if (!mLowPrecisionValidRegion.IsEmpty()) { // Clear the low precision tiled buffer updatedLowPrecision = true; mLowPrecisionValidRegion.SetEmpty(); - mLowPrecisionTiledBuffer.PaintThebes(mLowPrecisionValidRegion, - mLowPrecisionValidRegion, aCallback, - aCallbackData); + mContentClient->mLowPrecisionTiledBuffer.PaintThebes(mLowPrecisionValidRegion, + mLowPrecisionValidRegion, + aCallback, aCallbackData); } // We send a Painted callback if we clear the valid region of the low // precision buffer, so that the shadow buffer's valid region can be updated // and the associated resources can be freed. if (updatedLowPrecision) { - mLowPrecisionTiledBuffer.LockCopyAndWrite(); + BasicManager()->Hold(this); + mContentClient->LockCopyAndWrite(TiledContentClient::LOW_PRECISION_TILED_BUFFER); } EndPaint(false); diff --git a/gfx/layers/basic/BasicTiledThebesLayer.h b/gfx/layers/basic/BasicTiledThebesLayer.h index 7eaa7deebafc..2ce44776cbbe 100644 --- a/gfx/layers/basic/BasicTiledThebesLayer.h +++ b/gfx/layers/basic/BasicTiledThebesLayer.h @@ -94,8 +94,7 @@ private: */ void EndPaint(bool aFinish); - BasicTiledLayerBuffer mTiledBuffer; - BasicTiledLayerBuffer mLowPrecisionTiledBuffer; + RefPtr mContentClient; nsIntRegion mLowPrecisionValidRegion; BasicTiledLayerPaintData mPaintData; }; diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index 1f8199621284..425257a1c1fb 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -58,6 +58,43 @@ using namespace gfx; namespace layers { + +TiledContentClient::TiledContentClient(BasicTiledThebesLayer* aThebesLayer, + BasicShadowLayerManager* aManager) + : CompositableClient(aManager->AsShadowForwarder()) + , mTiledBuffer(aThebesLayer, aManager) + , mLowPrecisionTiledBuffer(aThebesLayer, aManager) +{ + MOZ_COUNT_CTOR(TiledContentClient); + + mLowPrecisionTiledBuffer.SetResolution(gfxPlatform::GetLowPrecisionResolution()); +} + +void +TiledContentClient::LockCopyAndWrite(TiledBufferType aType) +{ + // Create a heap copy owned and released by the compositor. This is needed + // since we're sending this over an async message and content needs to be + // be able to modify the tiled buffer in the next transaction. + // TODO: Remove me once Bug 747811 lands. + BasicTiledLayerBuffer* buffer = aType == LOW_PRECISION_TILED_BUFFER + ? &mLowPrecisionTiledBuffer + : &mTiledBuffer; + + BasicTiledLayerBuffer* heapCopy = new BasicTiledLayerBuffer(buffer->DeepCopy()); + buffer->ReadLock(); + mForwarder->PaintedTiledLayerBuffer(this, heapCopy); + buffer->ClearPaintedRegion(); +} + +BasicTiledLayerBuffer::BasicTiledLayerBuffer(BasicTiledThebesLayer* aThebesLayer, + BasicShadowLayerManager* aManager) + : mThebesLayer(aThebesLayer) + , mManager(aManager) + , mLastPaintOpaque(false) +{ +} + bool BasicTiledLayerBuffer::HasFormatChanged() const { @@ -75,18 +112,6 @@ BasicTiledLayerBuffer::GetContentType() const } } -void -BasicTiledLayerBuffer::LockCopyAndWrite() -{ - // Create a heap copy owned and released by the compositor. This is needed - // since we're sending this over an async message and content needs to be - // be able to modify the tiled buffer in the next transaction. - // TODO: Remove me once Bug 747811 lands. - BasicTiledLayerBuffer *heapCopy = new BasicTiledLayerBuffer(this->DeepCopy()); - ReadLock(); - mManager->PaintedTiledLayerBuffer(mManager->Hold(mThebesLayer), heapCopy); - ClearPaintedRegion(); -} void BasicTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion, diff --git a/gfx/layers/client/TiledContentClient.h b/gfx/layers/client/TiledContentClient.h index 69a50865362d..a1f23c83a3dc 100644 --- a/gfx/layers/client/TiledContentClient.h +++ b/gfx/layers/client/TiledContentClient.h @@ -100,16 +100,12 @@ class BasicTiledLayerBuffer public: BasicTiledLayerBuffer(BasicTiledThebesLayer* aThebesLayer, - BasicShadowLayerManager* aManager) - : mThebesLayer(aThebesLayer) - , mManager(aManager) - , mLastPaintOpaque(false) - {} - BasicTiledLayerBuffer() + BasicShadowLayerManager* aManager); + BasicTiledLayerBuffer() : mThebesLayer(nullptr) , mManager(nullptr) , mLastPaintOpaque(false) - {} + {} void PaintThebes(const nsIntRegion& aNewValidRegion, const nsIntRegion& aPaintRegion, @@ -135,8 +131,6 @@ public: bool HasFormatChanged() const; - void LockCopyAndWrite(); - /** * Performs a progressive update of a given tiled buffer. * See ComputeProgressiveUpdateRegion above for parameter documentation. @@ -175,6 +169,7 @@ protected: } BasicTiledLayerTile GetPlaceholderTile() const { return BasicTiledLayerTile(); } + private: gfxASurface::gfxContentType GetContentType() const; BasicTiledThebesLayer* mThebesLayer; @@ -189,8 +184,8 @@ private: nsIntPoint mSinglePaintBufferOffset; BasicTiledLayerTile ValidateTileInternal(BasicTiledLayerTile aTile, - const nsIntPoint& aTileOrigin, - const nsIntRect& aDirtyRect); + const nsIntPoint& aTileOrigin, + const nsIntRect& aDirtyRect); /** * Calculates the region to update in a single progressive update transaction. @@ -220,6 +215,39 @@ private: bool aIsRepeated); }; +class TiledContentClient : public CompositableClient +{ + // XXX: for now the layer which owns us interacts directly with our buffers. + // We should have a content client for each tiled buffer which manages its + // own valid region, resolution, etc. Then we could have a much cleaner + // interface and tidy up BasicTiledThebesLayer::PaintThebes (bug 862547). + friend class BasicTiledThebesLayer; + +public: + TiledContentClient(BasicTiledThebesLayer* aThebesLayer, + BasicShadowLayerManager* aManager); + + ~TiledContentClient() + { + MOZ_COUNT_DTOR(TiledContentClient); + } + + virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE + { + return TextureInfo(BUFFER_TILED); + } + + enum TiledBufferType { + TILED_BUFFER, + LOW_PRECISION_TILED_BUFFER + }; + void LockCopyAndWrite(TiledBufferType aType); + +private: + BasicTiledLayerBuffer mTiledBuffer; + BasicTiledLayerBuffer mLowPrecisionTiledBuffer; +}; + } } diff --git a/gfx/layers/composite/CompositableHost.cpp b/gfx/layers/composite/CompositableHost.cpp index 8cc7ebfdd643..6b126ae523d1 100644 --- a/gfx/layers/composite/CompositableHost.cpp +++ b/gfx/layers/composite/CompositableHost.cpp @@ -43,24 +43,24 @@ CompositableHost::AddMaskEffect(EffectChain& aEffects, } /* static */ TemporaryRef -CompositableHost::Create(const TextureInfo& aTextureInfo, Compositor* aCompositor) +CompositableHost::Create(const TextureInfo& aTextureInfo) { RefPtr result; switch (aTextureInfo.mCompositableType) { case BUFFER_IMAGE_BUFFERED: - result = new ImageHostBuffered(aTextureInfo, aCompositor); + result = new ImageHostBuffered(aTextureInfo); return result; case BUFFER_IMAGE_SINGLE: - result = new ImageHostSingle(aTextureInfo, aCompositor); + result = new ImageHostSingle(aTextureInfo); return result; case BUFFER_TILED: - result = new TiledContentHost(aTextureInfo, aCompositor); + result = new TiledContentHost(aTextureInfo); return result; case BUFFER_CONTENT: - result = new ContentHostSingleBuffered(aTextureInfo, aCompositor); + result = new ContentHostSingleBuffered(aTextureInfo); return result; case BUFFER_CONTENT_DIRECT: - result = new ContentHostDoubleBuffered(aTextureInfo, aCompositor); + result = new ContentHostDoubleBuffered(aTextureInfo); return result; default: MOZ_NOT_REACHED("Unknown CompositableType"); diff --git a/gfx/layers/composite/CompositableHost.h b/gfx/layers/composite/CompositableHost.h index 1443a59e0a7a..8f82209391eb 100644 --- a/gfx/layers/composite/CompositableHost.h +++ b/gfx/layers/composite/CompositableHost.h @@ -48,10 +48,9 @@ class SurfaceDescriptor; class CompositableHost : public RefCounted { public: - CompositableHost(const TextureInfo& aTextureInfo, - Compositor* aCompositor = nullptr) + CompositableHost(const TextureInfo& aTextureInfo) : mTextureInfo(aTextureInfo) - , mCompositor(aCompositor) + , mCompositor(nullptr) , mLayer(nullptr) { MOZ_COUNT_CTOR(CompositableHost); @@ -62,8 +61,7 @@ public: MOZ_COUNT_DTOR(CompositableHost); } - static TemporaryRef Create(const TextureInfo& aTextureInfo, - Compositor* aCompositor = nullptr); + static TemporaryRef Create(const TextureInfo& aTextureInfo); virtual CompositableType GetType() = 0; @@ -146,7 +144,9 @@ public: Layer* GetLayer() const { return mLayer; } void SetLayer(Layer* aLayer) { mLayer = aLayer; } - void Attach(Layer* aLayer, Compositor* aCompositor) + virtual TiledLayerComposer* AsTiledLayerComposer() { return nullptr; } + + virtual void Attach(Layer* aLayer, Compositor* aCompositor) { SetCompositor(aCompositor); SetLayer(aLayer); diff --git a/gfx/layers/composite/ContentHost.cpp b/gfx/layers/composite/ContentHost.cpp index befda04a7088..52773f23e8d8 100644 --- a/gfx/layers/composite/ContentHost.cpp +++ b/gfx/layers/composite/ContentHost.cpp @@ -11,9 +11,8 @@ namespace mozilla { using namespace gfx; namespace layers { -ContentHostBase::ContentHostBase(const TextureInfo& aTextureInfo, - Compositor* aCompositor) - : ContentHost(aTextureInfo, aCompositor) +ContentHostBase::ContentHostBase(const TextureInfo& aTextureInfo) + : ContentHost(aTextureInfo) , mPaintWillResample(false) , mInitialised(false) {} diff --git a/gfx/layers/composite/ContentHost.h b/gfx/layers/composite/ContentHost.h index b80c51600a8a..069e7500240f 100644 --- a/gfx/layers/composite/ContentHost.h +++ b/gfx/layers/composite/ContentHost.h @@ -39,8 +39,8 @@ public: #endif protected: - ContentHost(const TextureInfo& aTextureInfo, Compositor* aCompositor) - : CompositableHost(aTextureInfo, aCompositor) + ContentHost(const TextureInfo& aTextureInfo) + : CompositableHost(aTextureInfo) {} }; @@ -61,7 +61,7 @@ public: typedef ThebesLayerBuffer::ContentType ContentType; typedef ThebesLayerBuffer::PaintState PaintState; - ContentHostBase(const TextureInfo& aTextureInfo, Compositor* aCompositor); + ContentHostBase(const TextureInfo& aTextureInfo); ~ContentHostBase(); virtual void Composite(EffectChain& aEffectChain, @@ -135,9 +135,8 @@ protected: class ContentHostDoubleBuffered : public ContentHostBase { public: - ContentHostDoubleBuffered(const TextureInfo& aTextureInfo, - Compositor* aCompositor) - : ContentHostBase(aTextureInfo, aCompositor) + ContentHostDoubleBuffered(const TextureInfo& aTextureInfo) + : ContentHostBase(aTextureInfo) {} ~ContentHostDoubleBuffered(); @@ -173,9 +172,8 @@ protected: class ContentHostSingleBuffered : public ContentHostBase { public: - ContentHostSingleBuffered(const TextureInfo& aTextureInfo, - Compositor* aCompositor) - : ContentHostBase(aTextureInfo, aCompositor) + ContentHostSingleBuffered(const TextureInfo& aTextureInfo) + : ContentHostBase(aTextureInfo) {} virtual ~ContentHostSingleBuffered(); diff --git a/gfx/layers/composite/ImageHost.h b/gfx/layers/composite/ImageHost.h index 6b01432a5264..ff1f854ba37f 100644 --- a/gfx/layers/composite/ImageHost.h +++ b/gfx/layers/composite/ImageHost.h @@ -24,8 +24,8 @@ public: TextureHost* GetTextureHost() MOZ_OVERRIDE { return nullptr; } protected: - ImageHost(const TextureInfo& aTextureInfo, Compositor* aCompositor) - : CompositableHost(aTextureInfo, aCompositor) + ImageHost(const TextureInfo& aTextureInfo) + : CompositableHost(aTextureInfo) { MOZ_COUNT_CTOR(ImageHost); } @@ -40,8 +40,8 @@ protected: class ImageHostSingle : public ImageHost { public: - ImageHostSingle(const TextureInfo& aTextureInfo, Compositor* aCompositor) - : ImageHost(aTextureInfo, aCompositor) + ImageHostSingle(const TextureInfo& aTextureInfo) + : ImageHost(aTextureInfo) , mTextureHost(nullptr) , mHasPictureRect(false) {} @@ -99,8 +99,8 @@ protected: class ImageHostBuffered : public ImageHostSingle { public: - ImageHostBuffered(const TextureInfo& aTextureInfo, Compositor* aCompositor) - : ImageHostSingle(aTextureInfo, aCompositor) + ImageHostBuffered(const TextureInfo& aTextureInfo) + : ImageHostSingle(aTextureInfo) {} virtual bool Update(const SurfaceDescriptor& aImage, diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 8b1c623f09d6..2ee0614f4581 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -389,7 +389,7 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer, TiledLayerComposer* composer = nullptr; LayerComposite* shadow = aLayer->AsLayerComposite(); if (shadow) { - composer = shadow->AsTiledLayerComposer(); + composer = shadow->GetTiledLayerComposer(); if (composer) { incompleteRegion.Sub(incompleteRegion, composer->GetValidLowPrecisionRegion()); if (!incompleteRegion.IsEmpty()) { diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index 54d849ccbeae..c4af147865ff 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -287,12 +287,7 @@ public: virtual void CleanupResources() = 0; - virtual TiledLayerComposer* AsTiledLayerComposer() { return NULL; } - - virtual void EnsureBuffer(CompositableType aType) - { - MOZ_ASSERT(false, "Should not be called unless overriden."); - } + virtual TiledLayerComposer* GetTiledLayerComposer() { return nullptr; } protected: LayerManagerComposite* mCompositeManager; diff --git a/gfx/layers/composite/ThebesLayerComposite.cpp b/gfx/layers/composite/ThebesLayerComposite.cpp index 5949a2551f3b..c16487ce886f 100644 --- a/gfx/layers/composite/ThebesLayerComposite.cpp +++ b/gfx/layers/composite/ThebesLayerComposite.cpp @@ -47,21 +47,6 @@ ThebesLayerComposite::SetCompositableHost(CompositableHost* aHost) mBuffer= static_cast(aHost); } -void -ThebesLayerComposite::EnsureBuffer(CompositableType aType) -{ - MOZ_ASSERT(aType == BUFFER_TILED, - "Should only be called for tiled layers."); - if (!mBuffer || - mBuffer->GetType() != aType) { - RefPtr bufferHost - = CompositableHost::Create(TextureInfo(aType), mCompositeManager->GetCompositor()); - NS_ASSERTION(bufferHost->GetType() == BUFFER_TILED, "bad buffer type"); - mBuffer = static_cast(bufferHost.get()); - mRequiresTiledProperties = true; - } -} - void ThebesLayerComposite::Disconnect() { @@ -87,7 +72,7 @@ ThebesLayerComposite::GetLayer() } TiledLayerComposer* -ThebesLayerComposite::AsTiledLayerComposer() +ThebesLayerComposite::GetTiledLayerComposer() { return mBuffer->AsTiledLayerComposer(); } diff --git a/gfx/layers/composite/ThebesLayerComposite.h b/gfx/layers/composite/ThebesLayerComposite.h index 15f4132032c5..c524cc8ca150 100644 --- a/gfx/layers/composite/ThebesLayerComposite.h +++ b/gfx/layers/composite/ThebesLayerComposite.h @@ -47,7 +47,7 @@ public: virtual Layer* GetLayer() MOZ_OVERRIDE; - virtual TiledLayerComposer* AsTiledLayerComposer() MOZ_OVERRIDE; + virtual TiledLayerComposer* GetTiledLayerComposer() MOZ_OVERRIDE; virtual void RenderLayer(const nsIntPoint& aOffset, const nsIntRect& aClipRect) MOZ_OVERRIDE; @@ -58,7 +58,7 @@ public: virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; } - virtual void EnsureBuffer(CompositableType aType) MOZ_OVERRIDE; + void EnsureTiled() { mRequiresTiledProperties = true; } #ifdef MOZ_LAYERS_HAVE_LOG virtual const char* Name() const MOZ_OVERRIDE { return "ThebesLayerComposite"; } diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index 25399dc80a57..c6355aef8ea7 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -6,6 +6,7 @@ #include "TiledContentHost.h" #include "mozilla/layers/Effects.h" #include "nsPrintfCString.h" +#include "ThebesLayerComposite.h" namespace mozilla { using namespace gfx; @@ -59,6 +60,13 @@ TiledContentHost::~TiledContentHost() mLowPrecisionMainMemoryTiledBuffer.ReadUnlock(); } +void +TiledContentHost::Attach(Layer* aLayer, Compositor* aCompositor) +{ + CompositableHost::Attach(aLayer, aCompositor); + static_cast(aLayer)->EnsureTiled(); +} + void TiledContentHost::PaintedTiledLayerBuffer(const BasicTiledLayerBuffer* mTiledBuffer) { diff --git a/gfx/layers/composite/TiledContentHost.h b/gfx/layers/composite/TiledContentHost.h index 01ddc45a2f56..9116f193e94f 100644 --- a/gfx/layers/composite/TiledContentHost.h +++ b/gfx/layers/composite/TiledContentHost.h @@ -66,8 +66,8 @@ class TiledLayerBufferComposite friend class TiledLayerBuffer; public: - TiledLayerBufferComposite(Compositor* aCompositor) - : mCompositor(aCompositor) + TiledLayerBufferComposite() + : mCompositor(nullptr) {} void Upload(const BasicTiledLayerBuffer* aMainMemoryTiledBuffer, @@ -81,6 +81,11 @@ public: // by the sum of the resolutions of all parent layers' FrameMetrics. const gfxSize& GetFrameResolution() { return mFrameResolution; } + void SetCompositor(Compositor* aCompositor) + { + mCompositor = aCompositor; + } + protected: TiledTexture ValidateTile(TiledTexture aTile, const nsIntPoint& aTileRect, @@ -126,10 +131,8 @@ class TiledContentHost : public ContentHost, public TiledLayerComposer { public: - TiledContentHost(const TextureInfo& aTextureInfo, Compositor* aCompositor) - : ContentHost(aTextureInfo, aCompositor) - , mVideoMemoryTiledBuffer(aCompositor) - , mLowPrecisionVideoMemoryTiledBuffer(aCompositor) + TiledContentHost(const TextureInfo& aTextureInfo) + : ContentHost(aTextureInfo) , mPendingUpload(false) , mPendingLowPrecisionUpload(false) {} @@ -179,7 +182,7 @@ public: virtual CompositableType GetType() { return BUFFER_TILED; } - virtual TiledLayerComposer* AsTiledLayerComposer() { return this; } + virtual TiledLayerComposer* AsTiledLayerComposer() MOZ_OVERRIDE { return this; } virtual bool EnsureTextureHost(TextureIdentifier aTextureId, const SurfaceDescriptor& aSurface, @@ -190,6 +193,15 @@ public: return false; } + virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE + { + CompositableHost::SetCompositor(aCompositor); + mVideoMemoryTiledBuffer.SetCompositor(aCompositor); + mLowPrecisionVideoMemoryTiledBuffer.SetCompositor(aCompositor); + } + + virtual void Attach(Layer* aLayer, Compositor* aCompositor) MOZ_OVERRIDE; + #ifdef MOZ_LAYERS_HAVE_LOG virtual void PrintInfo(nsACString& aTo, const char* aPrefix); #endif diff --git a/gfx/layers/ipc/CompositableForwarder.h b/gfx/layers/ipc/CompositableForwarder.h index 9167a7dc71c8..b71ba7f032ed 100644 --- a/gfx/layers/ipc/CompositableForwarder.h +++ b/gfx/layers/ipc/CompositableForwarder.h @@ -20,6 +20,7 @@ class TextureFactoryIdentifier; class SurfaceDescriptor; class ThebesBufferData; class TextureClient; +class BasicTiledLayerBuffer; /** * A transaction is a set of changes that happenned on the content side, that @@ -69,6 +70,9 @@ public: */ virtual void DestroyThebesBuffer(CompositableClient* aCompositable) = 0; + virtual void PaintedTiledLayerBuffer(CompositableClient* aCompositable, + BasicTiledLayerBuffer* aTiledLayerBuffer) = 0; + /** * Communicate to the compositor that the texture identified by aCompositable * and aTextureId has been updated to aImage. diff --git a/gfx/layers/ipc/CompositableTransactionParent.cpp b/gfx/layers/ipc/CompositableTransactionParent.cpp index 0daaf2e98da1..303e049ffb15 100644 --- a/gfx/layers/ipc/CompositableTransactionParent.cpp +++ b/gfx/layers/ipc/CompositableTransactionParent.cpp @@ -132,6 +132,20 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation compositable->SetPictureRect(op.picture()); break; } + case CompositableOperation::TOpPaintTiledLayerBuffer: { + MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer")); + const OpPaintTiledLayerBuffer& op = aEdit.get_OpPaintTiledLayerBuffer(); + CompositableParent* compositableParent = static_cast(op.compositableParent()); + CompositableHost* compositable = + compositableParent->GetCompositableHost(); + + TiledLayerComposer* tileComposer = compositable->AsTiledLayerComposer(); + NS_ASSERTION(tileComposer, "compositable is not a tile composer"); + + BasicTiledLayerBuffer* p = reinterpret_cast(op.tiledLayerBuffer()); + tileComposer->PaintedTiledLayerBuffer(p); + break; + } default: { MOZ_ASSERT(false, "bad type"); } diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h index 7b2419071961..d36fa8a44451 100644 --- a/gfx/layers/ipc/ImageBridgeChild.h +++ b/gfx/layers/ipc/ImageBridgeChild.h @@ -230,6 +230,12 @@ public: virtual void Connect(CompositableClient* aCompositable) MOZ_OVERRIDE; + virtual void PaintedTiledLayerBuffer(CompositableClient* aCompositable, + BasicTiledLayerBuffer* aTiledLayerBuffer) MOZ_OVERRIDE + { + NS_RUNTIMEABORT("should not be called"); + } + /** * Communicate to the compositor that the texture identified by aCompositable * and aTextureId has been updated to aDescriptor. diff --git a/gfx/layers/ipc/LayerTransaction.ipdlh b/gfx/layers/ipc/LayerTransaction.ipdlh index 57e0772e58f4..fb988090e942 100644 --- a/gfx/layers/ipc/LayerTransaction.ipdlh +++ b/gfx/layers/ipc/LayerTransaction.ipdlh @@ -235,7 +235,7 @@ struct OpRaiseToTopChild { PLayer container; PLayer childLayer; }; // Paint (buffer update) struct OpPaintTiledLayerBuffer { - PLayer layer; + PCompositable compositable; // Bug 747811 // FIXME: We need to support sharing tile across process. uintptr_t tiledLayerBuffer; @@ -277,6 +277,8 @@ union CompositableOperation { OpPaintTexture; OpPaintTextureRegion; + + OpPaintTiledLayerBuffer; }; // A unit of a changeset; a set of these comprise a changeset @@ -300,7 +302,6 @@ union Edit { OpAttachCompositable; OpAttachAsyncCompositable; - OpPaintTiledLayerBuffer; CompositableOperation; }; diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index f9206e639f1d..4be9b116408b 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -290,12 +290,12 @@ ShadowLayerForwarder::RepositionChild(ShadowableLayer* aContainer, } void -ShadowLayerForwarder::PaintedTiledLayerBuffer(ShadowableLayer* aLayer, +ShadowLayerForwarder::PaintedTiledLayerBuffer(CompositableClient* aCompositable, BasicTiledLayerBuffer* aTiledLayerBuffer) { if (XRE_GetProcessType() != GeckoProcessType_Default) NS_RUNTIMEABORT("PaintedTiledLayerBuffer must be made IPC safe (not share pointers)"); - mTxn->AddNoSwapPaint(OpPaintTiledLayerBuffer(NULL, Shadow(aLayer), + mTxn->AddNoSwapPaint(OpPaintTiledLayerBuffer(NULL, aCompositable->GetIPDLActor(), uintptr_t(aTiledLayerBuffer))); } diff --git a/gfx/layers/ipc/ShadowLayers.h b/gfx/layers/ipc/ShadowLayers.h index 22da90d36d67..abc8a877822f 100644 --- a/gfx/layers/ipc/ShadowLayers.h +++ b/gfx/layers/ipc/ShadowLayers.h @@ -50,7 +50,6 @@ class TiledLayerComposer; class Transaction; class SurfaceDescriptor; class CanvasSurface; -class BasicTiledLayerBuffer; class TextureClientShmem; class ContentClientRemote; class CompositableChild; @@ -258,8 +257,8 @@ public: * and is free to choose it's own internal representation (double buffering, * copy on write, tiling). */ - void PaintedTiledLayerBuffer(ShadowableLayer* aThebes, - BasicTiledLayerBuffer* aTiledLayerBuffer); + virtual void PaintedTiledLayerBuffer(CompositableClient* aCompositable, + BasicTiledLayerBuffer* aTiledLayerBuffer) MOZ_OVERRIDE; /** * Notify the compositor that a compositable will be updated asynchronously diff --git a/gfx/layers/ipc/ShadowLayersParent.cpp b/gfx/layers/ipc/ShadowLayersParent.cpp index 9389ddc4b5c8..421a9426fb93 100644 --- a/gfx/layers/ipc/ShadowLayersParent.cpp +++ b/gfx/layers/ipc/ShadowLayersParent.cpp @@ -389,21 +389,6 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray& cset, compositableParent->SetCompositorID(mLayerManager->GetCompositor()->GetCompositorID()); break; } - case Edit::TOpPaintTiledLayerBuffer: { - MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer")); - const OpPaintTiledLayerBuffer& op = edit.get_OpPaintTiledLayerBuffer(); - ShadowLayerParent* shadow = AsShadowLayer(op); - - LayerComposite* compositeLayer = shadow->AsLayer()->AsLayerComposite(); - compositeLayer->EnsureBuffer(BUFFER_TILED); - TiledLayerComposer* tileComposer = compositeLayer->AsTiledLayerComposer(); - - NS_ASSERTION(tileComposer, "compositeLayer is not a tile composer"); - - BasicTiledLayerBuffer* p = reinterpret_cast(op.tiledLayerBuffer()); - tileComposer->PaintedTiledLayerBuffer(p); - break; - } default: NS_RUNTIMEABORT("not reached"); } From 9a37c9d3fd5f7b31774d7b213373b49ac89154c9 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Wed, 17 Apr 2013 09:36:06 +1200 Subject: [PATCH 065/438] Bug 862106. Use Create*Client directly. r=nical --HG-- extra : rebase_source : d903db2fcb68bbccff9548dfbcd215d9a25ba41c --- gfx/layers/basic/BasicCanvasLayer.cpp | 3 ++- gfx/layers/basic/BasicImageLayer.cpp | 13 +++++++---- gfx/layers/basic/BasicThebesLayer.cpp | 2 +- gfx/layers/client/CanvasClient.cpp | 5 ++-- gfx/layers/client/CanvasClient.h | 3 +-- gfx/layers/client/ContentClient.cpp | 5 ++-- gfx/layers/client/ContentClient.h | 3 +-- gfx/layers/client/ImageClient.cpp | 9 ++++---- gfx/layers/client/ImageClient.h | 3 +-- gfx/layers/ipc/ImageBridgeChild.cpp | 2 +- gfx/layers/ipc/ShadowLayers.cpp | 33 --------------------------- gfx/layers/ipc/ShadowLayers.h | 11 --------- 12 files changed, 24 insertions(+), 68 deletions(-) diff --git a/gfx/layers/basic/BasicCanvasLayer.cpp b/gfx/layers/basic/BasicCanvasLayer.cpp index 7506933e1989..b2b4d1b21c17 100644 --- a/gfx/layers/basic/BasicCanvasLayer.cpp +++ b/gfx/layers/basic/BasicCanvasLayer.cpp @@ -295,7 +295,8 @@ BasicShadowableCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer) if (mNeedsYFlip) { flags |= NeedsYFlip; } - mCanvasClient = BasicManager()->CreateCanvasClientFor(GetCompositableClientType(), this, flags); + mCanvasClient = CanvasClient::CreateCanvasClient(GetCompositableClientType(), + BasicManager(), flags); if (!mCanvasClient) { return; } diff --git a/gfx/layers/basic/BasicImageLayer.cpp b/gfx/layers/basic/BasicImageLayer.cpp index ab51e36d3b84..7da766f5df1f 100644 --- a/gfx/layers/basic/BasicImageLayer.cpp +++ b/gfx/layers/basic/BasicImageLayer.cpp @@ -258,10 +258,15 @@ BasicShadowableImageLayer::Paint(gfxContext* aContext, Layer* aMaskLayer) if (!mImageClient || !mImageClient->UpdateImage(mContainer, GetContentFlags())) { - mImageClient = BasicManager()->CreateImageClientFor(GetImageClientType(), this, - mForceSingleTile - ? ForceSingleTile - : 0); + mImageClient = ImageClient::CreateImageClient(GetImageClientType(), + BasicManager(), + mForceSingleTile + ? ForceSingleTile + : 0); + if (GetImageClientType() == BUFFER_BRIDGE) { + static_cast(mImageClient.get())->SetLayer(this); + } + if (!mImageClient) { return; } diff --git a/gfx/layers/basic/BasicThebesLayer.cpp b/gfx/layers/basic/BasicThebesLayer.cpp index b88e8f4a149b..3de5cabaf05b 100644 --- a/gfx/layers/basic/BasicThebesLayer.cpp +++ b/gfx/layers/basic/BasicThebesLayer.cpp @@ -254,7 +254,7 @@ BasicShadowableThebesLayer::PaintThebes(gfxContext* aContext, } if (!mContentClient) { - mContentClient = BasicManager()->CreateContentClientFor(this); + mContentClient = ContentClient::CreateContentClient(BasicManager()); if (!mContentClient) { return; } diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 56db914ccbf6..0c4253af86e8 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -18,8 +18,7 @@ namespace mozilla { namespace layers { /* static */ TemporaryRef -CanvasClient::CreateCanvasClient(LayersBackend aParentBackend, - CompositableType aCompositableHostType, +CanvasClient::CreateCanvasClient(CompositableType aCompositableHostType, CompositableForwarder* aForwarder, TextureFlags aFlags) { @@ -27,7 +26,7 @@ CanvasClient::CreateCanvasClient(LayersBackend aParentBackend, return new CanvasClient2D(aForwarder, aFlags); } if (aCompositableHostType == BUFFER_IMAGE_BUFFERED) { - if (aParentBackend == LAYERS_OPENGL) { + if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) { return new CanvasClientWebGL(aForwarder, aFlags); } return new CanvasClient2D(aForwarder, aFlags); diff --git a/gfx/layers/client/CanvasClient.h b/gfx/layers/client/CanvasClient.h index 44b59f3bdbaf..3ef775eab6d5 100644 --- a/gfx/layers/client/CanvasClient.h +++ b/gfx/layers/client/CanvasClient.h @@ -26,8 +26,7 @@ public: * message will be sent to the compositor to create a corresponding image * host. */ - static TemporaryRef CreateCanvasClient(LayersBackend aBackendType, - CompositableType aImageHostType, + static TemporaryRef CreateCanvasClient(CompositableType aImageHostType, CompositableForwarder* aFwd, TextureFlags aFlags); diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index a58806971b31..5986785bb35f 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -17,10 +17,9 @@ using namespace gfx; namespace layers { /* static */ TemporaryRef -ContentClient::CreateContentClient(LayersBackend aParentBackend, - CompositableForwarder* aForwarder) +ContentClient::CreateContentClient(CompositableForwarder* aForwarder) { - if (aParentBackend != LAYERS_OPENGL) { + if (aForwarder->GetCompositorBackendType() != LAYERS_OPENGL) { return nullptr; } if (ShadowLayerManager::SupportsDirectTexturing() || diff --git a/gfx/layers/client/ContentClient.h b/gfx/layers/client/ContentClient.h index 928a602ddc96..7914b95d32b0 100644 --- a/gfx/layers/client/ContentClient.h +++ b/gfx/layers/client/ContentClient.h @@ -64,8 +64,7 @@ public: * message will be sent to the compositor to create a corresponding content * host. */ - static TemporaryRef CreateContentClient(LayersBackend aBackendType, - CompositableForwarder* aFwd); + static TemporaryRef CreateContentClient(CompositableForwarder* aFwd); ContentClient(CompositableForwarder* aForwarder) : CompositableClient(aForwarder) diff --git a/gfx/layers/client/ImageClient.cpp b/gfx/layers/client/ImageClient.cpp index 69007e1610de..e0d661d0edf1 100644 --- a/gfx/layers/client/ImageClient.cpp +++ b/gfx/layers/client/ImageClient.cpp @@ -21,25 +21,24 @@ namespace mozilla { namespace layers { /* static */ TemporaryRef -ImageClient::CreateImageClient(LayersBackend aParentBackend, - CompositableType aCompositableHostType, +ImageClient::CreateImageClient(CompositableType aCompositableHostType, CompositableForwarder* aForwarder, TextureFlags aFlags) { RefPtr result = nullptr; switch (aCompositableHostType) { case BUFFER_IMAGE_SINGLE: - if (aParentBackend == LAYERS_OPENGL) { + if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) { result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE); } break; case BUFFER_IMAGE_BUFFERED: - if (aParentBackend == LAYERS_OPENGL) { + if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) { result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED); } break; case BUFFER_BRIDGE: - if (aParentBackend == LAYERS_OPENGL) { + if (aForwarder->GetCompositorBackendType() == LAYERS_OPENGL) { result = new ImageClientBridge(aForwarder, aFlags); } break; diff --git a/gfx/layers/client/ImageClient.h b/gfx/layers/client/ImageClient.h index 9453a441572b..1676823baebf 100644 --- a/gfx/layers/client/ImageClient.h +++ b/gfx/layers/client/ImageClient.h @@ -31,8 +31,7 @@ public: * message will be sent to the compositor to create a corresponding image * host. */ - static TemporaryRef CreateImageClient(LayersBackend aBackendType, - CompositableType aImageHostType, + static TemporaryRef CreateImageClient(CompositableType aImageHostType, CompositableForwarder* aFwd, TextureFlags aFlags); diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index fbcede1927cf..38f8b6031ba5 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -485,7 +485,7 @@ ImageBridgeChild::CreateImageClientNow(CompositableType aType) mCompositorBackend = LAYERS_OPENGL; RefPtr client - = ImageClient::CreateImageClient(mCompositorBackend, aType, this, 0); + = ImageClient::CreateImageClient(aType, this, 0); MOZ_ASSERT(client, "failed to create ImageClient"); if (client) { client->Connect(); diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index 4be9b116408b..e57ec019bbec 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -532,39 +532,6 @@ ShadowLayerForwarder::CloseDescriptor(const SurfaceDescriptor& aDescriptor) // There's no "close" needed for Shmem surfaces. } -TemporaryRef -ShadowLayerForwarder::CreateImageClientFor(const CompositableType& aCompositableType, - ShadowableLayer* aLayer, - TextureFlags aFlags) -{ - RefPtr client = ImageClient::CreateImageClient(GetCompositorBackendType(), - aCompositableType, - this, aFlags); - if (aCompositableType == BUFFER_BRIDGE) { - static_cast(client.get())->SetLayer(aLayer); - } - return client.forget(); -} - -TemporaryRef -ShadowLayerForwarder::CreateCanvasClientFor(const CompositableType& aCompositableType, - ShadowableLayer* aLayer, - TextureFlags aFlags) -{ - RefPtr client = CanvasClient::CreateCanvasClient(GetCompositorBackendType(), - aCompositableType, - this, aFlags); - return client.forget(); -} - -TemporaryRef -ShadowLayerForwarder::CreateContentClientFor(ShadowableLayer* aLayer) -{ - RefPtr client = ContentClient::CreateContentClient(GetCompositorBackendType(), - this); - return client.forget(); -} - PLayerChild* ShadowLayerForwarder::ConstructShadowFor(ShadowableLayer* aLayer) { diff --git a/gfx/layers/ipc/ShadowLayers.h b/gfx/layers/ipc/ShadowLayers.h index abc8a877822f..7d266395c5b2 100644 --- a/gfx/layers/ipc/ShadowLayers.h +++ b/gfx/layers/ipc/ShadowLayers.h @@ -363,17 +363,6 @@ public: */ void SetIsFirstPaint() { mIsFirstPaint = true; } - /** - * Create compositable clients, see comments in CompositingFactory - */ - TemporaryRef CreateImageClientFor(const CompositableType& aCompositableType, - ShadowableLayer* aLayer, - TextureFlags aFlags); - TemporaryRef CreateCanvasClientFor(const CompositableType& aCompositableType, - ShadowableLayer* aLayer, - TextureFlags aFlags); - TemporaryRef CreateContentClientFor(ShadowableLayer* aLayer); - static void PlatformSyncBeforeUpdate(); static already_AddRefed From 977188f1752a462f5cf8fe43805b781ead4923cf Mon Sep 17 00:00:00 2001 From: Drew Willcoxon Date: Tue, 16 Apr 2013 14:46:48 -0700 Subject: [PATCH 066/438] Bug 806046 - Try to fix intermittent failure browser_bug719271.js. r=test --- browser/base/content/test/browser_bug719271.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/browser/base/content/test/browser_bug719271.js b/browser/base/content/test/browser_bug719271.js index 53aca641e457..5a2553a8f859 100644 --- a/browser/base/content/test/browser_bug719271.js +++ b/browser/base/content/test/browser_bug719271.js @@ -58,13 +58,21 @@ function testNavigation() { Task.spawn(function () { yield FullZoomHelper.load(gTab1, TEST_VIDEO); FullZoomHelper.zoomTest(gTab1, 1, "Zoom should be 1 when a video was loaded"); + yield waitForNextTurn(); // trying to fix orange bug 806046 yield FullZoomHelper.navigate(FullZoomHelper.BACK); FullZoomHelper.zoomTest(gTab1, gLevel1, "Zoom should be restored when a page is loaded"); + yield waitForNextTurn(); // trying to fix orange bug 806046 yield FullZoomHelper.navigate(FullZoomHelper.FORWARD); FullZoomHelper.zoomTest(gTab1, 1, "Zoom should be 1 again when navigating back to a video"); }).then(finishTest, FullZoomHelper.failAndContinue(finish)); } +function waitForNextTurn() { + let deferred = Promise.defer(); + setTimeout(function () deferred.resolve(), 0); + return deferred.promise; +} + var finishTestStarted = false; function finishTest() { Task.spawn(function () { From ec45787e928d6d7063f747394d6f8aec1d383d04 Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Tue, 16 Apr 2013 14:54:00 -0700 Subject: [PATCH 067/438] Bug 861980 - Change sockopt length to be a socklen_t; r=echou --- dom/bluetooth/BluetoothUnixSocketConnector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/bluetooth/BluetoothUnixSocketConnector.cpp b/dom/bluetooth/BluetoothUnixSocketConnector.cpp index dee1cae4cd51..55db5d7f70c8 100644 --- a/dom/bluetooth/BluetoothUnixSocketConnector.cpp +++ b/dom/bluetooth/BluetoothUnixSocketConnector.cpp @@ -123,7 +123,8 @@ BluetoothUnixSocketConnector::SetUp(int aFd) if (mType == BluetoothSocketType::L2CAP || mType == BluetoothSocketType::EL2CAP) { struct l2cap_options opts; - int optlen = sizeof(opts), err; + socklen_t optlen = sizeof(opts); + int err; err = getsockopt(aFd, SOL_L2CAP, L2CAP_OPTIONS, &opts, &optlen); if (!err) { /* setting MTU for [E]L2CAP */ From 0a8e5cb5592af143bfdef1dc35944e01cfe46498 Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Tue, 16 Apr 2013 14:54:00 -0700 Subject: [PATCH 068/438] Bug 855062 - Add initialization function for DOMRequest FireSuccessAsync; r=mrbkap --- dom/base/DOMRequest.cpp | 56 ++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/dom/base/DOMRequest.cpp b/dom/base/DOMRequest.cpp index b2794e087de8..97a3d81a64ed 100644 --- a/dom/base/DOMRequest.cpp +++ b/dom/base/DOMRequest.cpp @@ -239,19 +239,51 @@ DOMRequestService::FireError(nsIDOMDOMRequest* aRequest, class FireSuccessAsyncTask : public nsRunnable { -public: + FireSuccessAsyncTask(DOMRequest* aRequest, const JS::Value& aResult) : mReq(aRequest), - mResult(aResult) + mResult(aResult), + mIsSetup(false) + { + } + +public: + + nsresult + Setup() { - NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); nsresult rv; nsIScriptContext* sc = mReq->GetContextForEventHandlers(&rv); + if (!NS_SUCCEEDED(rv)) { + return rv; + } AutoPushJSContext cx(sc->GetNativeContext()); - MOZ_ASSERT(NS_SUCCEEDED(rv) && cx); + if (!cx) { + return NS_ERROR_FAILURE; + } JSAutoRequest ar(cx); JS_AddValueRoot(cx, &mResult); + mIsSetup = true; + return NS_OK; + } + + // Due to the fact that initialization can fail during shutdown (since we + // can't fetch a js context), set up an initiatization function to make sure + // we can return the failure appropriately + static nsresult + Dispatch(DOMRequest* aRequest, + const JS::Value& aResult) + { + NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); + nsRefPtr asyncTask = new FireSuccessAsyncTask(aRequest, aResult); + nsresult rv = asyncTask->Setup(); + NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(NS_DispatchToMainThread(asyncTask))) { + NS_WARNING("Failed to dispatch to main thread!"); + return NS_ERROR_FAILURE; + } + return NS_OK; } NS_IMETHODIMP @@ -264,10 +296,15 @@ public: ~FireSuccessAsyncTask() { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); + if(!mIsSetup) { + // If we never set up, no reason to unroot + return; + } nsresult rv; nsIScriptContext* sc = mReq->GetContextForEventHandlers(&rv); + MOZ_ASSERT(NS_SUCCEEDED(rv)); AutoPushJSContext cx(sc->GetNativeContext()); - MOZ_ASSERT(NS_SUCCEEDED(rv) && cx); + MOZ_ASSERT(cx); // We need to build a new request, otherwise we assert since there won't be // a request available yet. @@ -277,6 +314,7 @@ public: private: nsRefPtr mReq; JS::Value mResult; + bool mIsSetup; }; class FireErrorAsyncTask : public nsRunnable @@ -305,13 +343,7 @@ DOMRequestService::FireSuccessAsync(nsIDOMDOMRequest* aRequest, const JS::Value& aResult) { NS_ENSURE_STATE(aRequest); - nsCOMPtr asyncTask = - new FireSuccessAsyncTask(static_cast(aRequest), aResult); - if (NS_FAILED(NS_DispatchToMainThread(asyncTask))) { - NS_WARNING("Failed to dispatch to main thread!"); - return NS_ERROR_FAILURE; - } - return NS_OK; + return FireSuccessAsyncTask::Dispatch(static_cast(aRequest), aResult); } NS_IMETHODIMP From ebc496af05759f1c1aa759d5a5d08d9f8aef4d7c Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Tue, 16 Apr 2013 14:54:00 -0700 Subject: [PATCH 069/438] Bug 862462 - Make sure BluetoothAdapter unroots before destruction; r=mrbkap --- dom/bluetooth/BluetoothAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/bluetooth/BluetoothAdapter.cpp b/dom/bluetooth/BluetoothAdapter.cpp index 81bc06863922..4799df3d66a7 100644 --- a/dom/bluetooth/BluetoothAdapter.cpp +++ b/dom/bluetooth/BluetoothAdapter.cpp @@ -168,11 +168,11 @@ BluetoothAdapter::BluetoothAdapter(nsPIDOMWindow* aWindow, BluetoothAdapter::~BluetoothAdapter() { + Unroot(); BluetoothService* bs = BluetoothService::Get(); // We can be null on shutdown, where this might happen NS_ENSURE_TRUE_VOID(bs); bs->UnregisterBluetoothSignalHandler(NS_LITERAL_STRING(KEY_ADAPTER), this); - Unroot(); } void From 640afdb409e60be2077dd897754891689d214d09 Mon Sep 17 00:00:00 2001 From: Wes Johnston Date: Tue, 16 Apr 2013 15:06:19 -0700 Subject: [PATCH 070/438] Bug 837132 - Remove 'remove' option from top sites page. r=margaret --- mobile/android/base/locales/en-US/android_strings.dtd | 1 - .../base/resources/menu/abouthome_topsites_contextmenu.xml | 2 -- mobile/android/base/strings.xml.in | 1 - mobile/android/base/widget/AboutHome.java | 4 ---- mobile/android/base/widget/TopSitesView.java | 7 +------ 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 8ea11cc1cbd6..2aab6e913012 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -205,7 +205,6 @@ size. --> - + + diff --git a/mobile/android/base/resources/layout/simple_dropdown_item_1line.xml b/mobile/android/base/resources/layout/simple_dropdown_item_1line.xml new file mode 100644 index 000000000000..bc1c7999e44d --- /dev/null +++ b/mobile/android/base/resources/layout/simple_dropdown_item_1line.xml @@ -0,0 +1,24 @@ + + + + diff --git a/mobile/android/base/resources/values-v11/styles.xml b/mobile/android/base/resources/values-v11/styles.xml index 5a070b697af8..1a55cd33aa80 100644 --- a/mobile/android/base/resources/values-v11/styles.xml +++ b/mobile/android/base/resources/values-v11/styles.xml @@ -15,6 +15,8 @@ --> + + @@ -34,6 +40,10 @@ @style/TextAppearance.Widget.TextView + + + + diff --git a/mobile/android/base/resources/values/themes.xml b/mobile/android/base/resources/values/themes.xml index cdc593353416..ebfb354eeefe 100644 --- a/mobile/android/base/resources/values/themes.xml +++ b/mobile/android/base/resources/values/themes.xml @@ -79,7 +79,10 @@ From af8c451de11301ea4a8e3527c35d6cd1946bcda9 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 16 Apr 2013 17:39:47 -0700 Subject: [PATCH 078/438] Bug 860326 - Don't update BrowserToolbar after editing a top site on about:home. r=wesj --- mobile/android/base/BrowserApp.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 14377ae99fd2..955e5fa6b843 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -792,8 +792,18 @@ abstract public class BrowserApp extends GeckoApp @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); - String url = resultCode == Activity.RESULT_OK ? data.getStringExtra(AwesomeBar.URL_KEY) : null; - mBrowserToolbar.fromAwesomeBarSearch(url); + + // Don't update the url in the toolbar if the activity was cancelled, or if it was launched to pick + // a site. The order of these checks matters because data will be null if the activity was cancelled. + if (resultCode != Activity.RESULT_OK || + data.getStringExtra(AwesomeBar.TARGET_KEY).equals(AwesomeBar.Target.PICK_SITE.toString())) { + // We still need to call fromAwesomeBarSearch to perform the toolbar animation. + mBrowserToolbar.fromAwesomeBarSearch(null); + return; + } + + // Otherwise, update the toolbar with the url that was just entered. + mBrowserToolbar.fromAwesomeBarSearch(data.getStringExtra(AwesomeBar.URL_KEY)); } public View getActionBarLayout() { From 7b50d97cf8ada52c9d62549f3810eb83148e6111 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 16 Apr 2013 17:39:47 -0700 Subject: [PATCH 079/438] Bug 862125 - Properly quote addon id when passing string to querySelector. r=bnicholson --- mobile/android/chrome/content/aboutAddons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/chrome/content/aboutAddons.js b/mobile/android/chrome/content/aboutAddons.js index c0f055c066a2..7da74aa5a3ec 100644 --- a/mobile/android/chrome/content/aboutAddons.js +++ b/mobile/android/chrome/content/aboutAddons.js @@ -221,7 +221,7 @@ var Addons = { _getElementForAddon: function(aKey) { let list = document.getElementById("addons-list"); - let element = list.querySelector("div[addonID='" + aKey + "']"); + let element = list.querySelector("div[addonID=" + aKey.quote() + "]"); return element; }, From 3f720e92d2a5e9e5a7f53cfb6e4eae5fa0d291a3 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 16 Apr 2013 17:39:47 -0700 Subject: [PATCH 080/438] Bug 858323 - Focus tab.browser when the tab is selected. r=wesj --- mobile/android/chrome/content/browser.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 662453d73c75..46f8c47fc54a 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -625,6 +625,8 @@ var BrowserApp = { aTab.setResolution(aTab._zoom, true); this.displayedDocumentChanged(); this.deck.selectedPanel = aTab.browser; + // Focus the browser so that things like selection will be styled correctly. + aTab.browser.focus(); }, get selectedBrowser() { From f03b61a4bd927f2303b23f6be212de11d708c245 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Tue, 16 Apr 2013 18:50:22 -0600 Subject: [PATCH 081/438] Bug 826851: Back out Plugin Hang UI unit tests due to intermittent WinXP oranges on inbound. r=bustage --- dom/plugins/ipc/hangui/PluginHangUIChild.cpp | 1 - dom/plugins/test/mochitest/Makefile.in | 5 - dom/plugins/test/mochitest/dialog_watcher.js | 172 ------------ dom/plugins/test/mochitest/hangui_common.js | 20 -- dom/plugins/test/mochitest/hangui_iface.js | 121 -------- .../test/mochitest/hangui_subpage.html | 4 - dom/plugins/test/mochitest/test_hangui.xul | 263 ------------------ dom/plugins/test/testplugin/nptest.cpp | 21 -- 8 files changed, 607 deletions(-) delete mode 100644 dom/plugins/test/mochitest/dialog_watcher.js delete mode 100644 dom/plugins/test/mochitest/hangui_common.js delete mode 100644 dom/plugins/test/mochitest/hangui_iface.js delete mode 100644 dom/plugins/test/mochitest/hangui_subpage.html delete mode 100644 dom/plugins/test/mochitest/test_hangui.xul diff --git a/dom/plugins/ipc/hangui/PluginHangUIChild.cpp b/dom/plugins/ipc/hangui/PluginHangUIChild.cpp index ff49e2dfb6e1..eee2ffd7550c 100644 --- a/dom/plugins/ipc/hangui/PluginHangUIChild.cpp +++ b/dom/plugins/ipc/hangui/PluginHangUIChild.cpp @@ -308,7 +308,6 @@ PluginHangUIChild::HangUIDlgProc(HWND aDlgHandle, UINT aMsgCode, WPARAM aWParam, } case WM_DESTROY: { EnableWindow(mParentWindow, TRUE); - SetForegroundWindow(mParentWindow); break; } default: diff --git a/dom/plugins/test/mochitest/Makefile.in b/dom/plugins/test/mochitest/Makefile.in index 17821040fd7c..51e95374ae26 100644 --- a/dom/plugins/test/mochitest/Makefile.in +++ b/dom/plugins/test/mochitest/Makefile.in @@ -141,11 +141,6 @@ MOCHITEST_CHROME_FILES += \ test_idle_hang.xul \ test_busy_hang.xul \ hang_test.js \ - test_hangui.xul \ - hangui_subpage.html \ - hangui_common.js \ - hangui_iface.js \ - dialog_watcher.js \ $(NULL) endif endif diff --git a/dom/plugins/test/mochitest/dialog_watcher.js b/dom/plugins/test/mochitest/dialog_watcher.js deleted file mode 100644 index b146a4aa8470..000000000000 --- a/dom/plugins/test/mochitest/dialog_watcher.js +++ /dev/null @@ -1,172 +0,0 @@ -const EVENT_OBJECT_SHOW = 0x8002; -const EVENT_OBJECT_HIDE = 0x8003; -const WINEVENT_OUTOFCONTEXT = 0; -const WINEVENT_SKIPOWNPROCESS = 2; -const QS_ALLINPUT = 0x04FF; -const INFINITE = 0xFFFFFFFF; -const WAIT_OBJECT_0 = 0; -const WAIT_TIMEOUT = 258; -const PM_NOREMOVE = 0; - -function DialogWatcher(titleText, onDialogStart, onDialogEnd) { - this.titleText = titleText; - this.onDialogStart = onDialogStart; - this.onDialogEnd = onDialogEnd; -} - -DialogWatcher.prototype.init = function() { - this.hwnd = undefined; - if (!this.user32) { - this.user32 = ctypes.open("user32.dll"); - } - if (!this.findWindow) { - this.findWindow = user32.declare("FindWindowW", - ctypes.winapi_abi, - ctypes.uintptr_t, - ctypes.jschar.ptr, - ctypes.jschar.ptr); - } - if (!this.winEventProcType) { - this.winEventProcType = ctypes.FunctionType(ctypes.stdcall_abi, - ctypes.void_t, - [ctypes.uintptr_t, - ctypes.uint32_t, - ctypes.uintptr_t, - ctypes.long, - ctypes.long, - ctypes.uint32_t, - ctypes.uint32_t]).ptr; - } - if (!this.setWinEventHook) { - this.setWinEventHook = user32.declare("SetWinEventHook", - ctypes.winapi_abi, - ctypes.uintptr_t, - ctypes.uint32_t, - ctypes.uint32_t, - ctypes.uintptr_t, - this.winEventProcType, - ctypes.uint32_t, - ctypes.uint32_t, - ctypes.uint32_t); - } - if (!this.unhookWinEvent) { - this.unhookWinEvent = user32.declare("UnhookWinEvent", - ctypes.winapi_abi, - ctypes.int, - ctypes.uintptr_t); - } - if (!this.pointType) { - this.pointType = ctypes.StructType("tagPOINT", - [ { "x": ctypes.long }, - { "y": ctypes.long } ] ); - } - if (!this.msgType) { - this.msgType = ctypes.StructType("tagMSG", - [ { "hwnd": ctypes.uintptr_t }, - { "message": ctypes.uint32_t }, - { "wParam": ctypes.uintptr_t }, - { "lParam": ctypes.intptr_t }, - { "time": ctypes.uint32_t }, - { "pt": this.pointType } ] ); - } - if (!this.peekMessage) { - this.peekMessage = user32.declare("PeekMessageW", - ctypes.winapi_abi, - ctypes.int, - this.msgType.ptr, - ctypes.uintptr_t, - ctypes.uint32_t, - ctypes.uint32_t, - ctypes.uint32_t); - } - if (!this.msgWaitForMultipleObjects) { - this.msgWaitForMultipleObjects = user32.declare("MsgWaitForMultipleObjects", - ctypes.winapi_abi, - ctypes.uint32_t, - ctypes.uint32_t, - ctypes.uintptr_t.ptr, - ctypes.int, - ctypes.uint32_t, - ctypes.uint32_t); - } - if (!this.getWindowTextW) { - this.getWindowTextW = user32.declare("GetWindowTextW", - ctypes.winapi_abi, - ctypes.int, - ctypes.uintptr_t, - ctypes.jschar.ptr, - ctypes.int); - } -}; - -DialogWatcher.prototype.getWindowText = function(hwnd) { - var bufType = ctypes.ArrayType(ctypes.jschar); - var buffer = new bufType(256); - - if (this.getWindowTextW(hwnd, buffer, buffer.length)) { - return buffer.readString(); - } -}; - -DialogWatcher.prototype.processWindowEvents = function(timeout) { - var onWinEvent = function(self, hook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime) { - var nhwnd = Number(hwnd) - if (event == EVENT_OBJECT_SHOW) { - if (nhwnd == self.hwnd) { - // We've already picked up this event via FindWindow - return; - } - var windowText = self.getWindowText(hwnd); - if (windowText == self.titleText && self.onDialogStart) { - self.hwnd = nhwnd; - self.onDialogStart(nhwnd); - } - } else if (event == EVENT_OBJECT_HIDE && nhwnd == self.hwnd && self.onDialogEnd) { - self.onDialogEnd(); - self.hwnd = null; - } - }; - var self = this; - var callback = this.winEventProcType(function(hook, event, hwnd, idObject, - idChild, dwEventThread, - dwmsEventTime) { - onWinEvent(self, hook, event, hwnd, idObject, idChild, dwEventThread, - dwmsEventTime); - } ); - var hook = this.setWinEventHook(EVENT_OBJECT_SHOW, EVENT_OBJECT_HIDE, - 0, callback, 0, 0, - WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); - if (!hook) { - return; - } - // Check if the window is already showing - var hwnd = this.findWindow(null, this.titleText); - if (hwnd && hwnd > 0) { - this.hwnd = Number(hwnd); - if (this.onDialogStart) { - this.onDialogStart(this.hwnd); - } - } - - if (!timeout) { - timeout = INFINITE; - } - - var waitStatus = WAIT_OBJECT_0; - var expectingStart = this.onDialogStart && this.hwnd === undefined; - while (this.hwnd === undefined || this.onDialogEnd && this.hwnd) { - waitStatus = this.msgWaitForMultipleObjects(0, null, 0, expectingStart ? - INFINITE : timeout, 0); - if (waitStatus == WAIT_OBJECT_0) { - var msg = new this.msgType; - this.peekMessage(msg.address(), 0, 0, 0, PM_NOREMOVE); - } else if (waitStatus == WAIT_TIMEOUT) { - break; - } - } - - this.unhookWinEvent(hook); - // Returns true if the hook was successful, something was found, and we never timed out - return this.hwnd !== undefined && waitStatus == WAIT_OBJECT_0; -}; - diff --git a/dom/plugins/test/mochitest/hangui_common.js b/dom/plugins/test/mochitest/hangui_common.js deleted file mode 100644 index 776357efc361..000000000000 --- a/dom/plugins/test/mochitest/hangui_common.js +++ /dev/null @@ -1,20 +0,0 @@ -// Plugin Hang UI constants -const HANGUIOP_NOTHING = 0; -const HANGUIOP_CANCEL = 1; -const HANGUIOP_COMMAND = 2; -const IDC_CONTINUE = 1001; -const IDC_STOP = 1002; -const IDC_NOFUTURE = 1003; - -// Windows constants -const WM_CLOSE = 0x0010; -const WM_COMMAND = 0x0111; -const BM_GETCHECK = 0x00F0; -const BM_SETCHECK = 0x00F1; -const BN_CLICKED = 0; -const BST_CHECKED = 1; - -// Test-specific constants -const EPSILON_MS = 1000; -const STALL_DURATION = 5; - diff --git a/dom/plugins/test/mochitest/hangui_iface.js b/dom/plugins/test/mochitest/hangui_iface.js deleted file mode 100644 index 4cd559c54527..000000000000 --- a/dom/plugins/test/mochitest/hangui_iface.js +++ /dev/null @@ -1,121 +0,0 @@ -var user32; -var sendMessage; -var getDlgItem; -var messageBox; -var watcher; - -importScripts("hangui_common.js"); -importScripts("dialog_watcher.js"); - -function initCTypes() { - if (!user32) { - user32 = ctypes.open("user32.dll"); - } - if (!getDlgItem) { - getDlgItem = user32.declare("GetDlgItem", - ctypes.winapi_abi, - ctypes.uintptr_t, - ctypes.uintptr_t, - ctypes.int); - } - if (!sendMessage) { - sendMessage = user32.declare("SendMessageW", - ctypes.winapi_abi, - ctypes.intptr_t, - ctypes.uintptr_t, - ctypes.uint32_t, - ctypes.uintptr_t, - ctypes.intptr_t); - } - if (!messageBox) { - // Handy for debugging the test itself - messageBox = user32.declare("MessageBoxW", - ctypes.winapi_abi, - ctypes.int, - ctypes.uintptr_t, - ctypes.jschar.ptr, - ctypes.jschar.ptr, - ctypes.uint32_t); - } - if (!watcher) { - watcher = new DialogWatcher("Warning: Unresponsive plugin"); - } -} - -function postSuccess(params) { - self.postMessage({"status": true, "params": params}); -} - -function postFail(params, msg) { - self.postMessage({"status": false, "params": params, "msg": msg}); -} - -function onDialogStart(inparams, hwnd) { - var params = Object.create(inparams); - params.testName += " (Start)"; - params.callback = null; - if (!params.expectToFind) { - postFail(params, "Dialog showed when we weren't expecting it to!"); - return; - } - if (params.opCode == HANGUIOP_CANCEL) { - sendMessage(hwnd, WM_CLOSE, 0, 0); - } else if (params.opCode == HANGUIOP_COMMAND) { - if (params.check) { - var checkbox = getDlgItem(hwnd, IDC_NOFUTURE); - if (!checkbox) { - postFail(params, "Couldn't find checkbox"); - return; - } - sendMessage(checkbox, BM_SETCHECK, BST_CHECKED, 0); - sendMessage(hwnd, WM_COMMAND, (BN_CLICKED << 16) | IDC_NOFUTURE, checkbox); - } - var button = getDlgItem(hwnd, params.commandId); - if (!button) { - postFail(params, - "GetDlgItem failed to find button with ID " + params.commandId); - return; - } - sendMessage(hwnd, WM_COMMAND, (BN_CLICKED << 16) | params.commandId, button); - } - postSuccess(params); -} - -function onDialogEnd(inparams) { - var params = Object.create(inparams); - params.testName += " (End)"; - params.callback = inparams.callback; - postSuccess(params); -} - -self.onmessage = function(event) { - initCTypes(); - watcher.init(); - var params = event.data; - var timeout = params.timeoutMs; - if (params.expectToFind) { - watcher.onDialogStart = function(hwnd) { onDialogStart(params, hwnd); }; - if (params.expectToClose) { - watcher.onDialogEnd = function() { onDialogEnd(params); }; - } - } else { - watcher.onDialogStart = null; - watcher.onDialogEnd = null; - } - var result = watcher.processWindowEvents(timeout); - if (result === null) { - postFail(params, "Hook failed"); - } else if (!result) { - if (params.expectToFind) { - postFail(params, "The dialog didn't show but we were expecting it to"); - } else { - postSuccess(params); - } - } -} - -self.onerror = function(event) { - var msg = "Error: " + event.message + " at " + event.filename + ":" + event.lineno; - postFail(null, msg); -}; - diff --git a/dom/plugins/test/mochitest/hangui_subpage.html b/dom/plugins/test/mochitest/hangui_subpage.html deleted file mode 100644 index 401912f68e07..000000000000 --- a/dom/plugins/test/mochitest/hangui_subpage.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dom/plugins/test/mochitest/test_hangui.xul b/dom/plugins/test/mochitest/test_hangui.xul deleted file mode 100644 index 2842a79c1c4a..000000000000 --- a/dom/plugins/test/mochitest/test_hangui.xul +++ /dev/null @@ -1,263 +0,0 @@ - - - - - Plugin Hang UI Test - - diff --git a/dom/plugins/test/testplugin/nptest.cpp b/dom/plugins/test/testplugin/nptest.cpp index 2b7c6feb5b5c..f52937e87865 100644 --- a/dom/plugins/test/testplugin/nptest.cpp +++ b/dom/plugins/test/testplugin/nptest.cpp @@ -147,7 +147,6 @@ static bool getAuthInfo(NPObject* npobj, const NPVariant* args, uint32_t argCoun static bool asyncCallbackTest(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool checkGCRace(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool hangPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); -static bool stallPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool getClipboardText(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool callOnDestroy(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); static bool reinitWidget(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result); @@ -211,7 +210,6 @@ static const NPUTF8* sPluginMethodIdentifierNames[] = { "asyncCallbackTest", "checkGCRace", "hang", - "stall", "getClipboardText", "callOnDestroy", "reinitWidget", @@ -276,7 +274,6 @@ static const ScriptableFunction sPluginMethodFunctions[] = { asyncCallbackTest, checkGCRace, hangPlugin, - stallPlugin, getClipboardText, callOnDestroy, reinitWidget, @@ -3317,24 +3314,6 @@ hangPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, return true; } -bool -stallPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, - NPVariant* result) -{ - uint32_t stallTimeSeconds = 0; - if ((argCount == 1) && NPVARIANT_IS_INT32(args[0])) { - stallTimeSeconds = (uint32_t) NPVARIANT_TO_INT32(args[0]); - } - -#ifdef XP_WIN - Sleep(stallTimeSeconds * 1000U); -#else - sleep(stallTimeSeconds); -#endif - - return true; -} - #if defined(MOZ_WIDGET_GTK) bool getClipboardText(NPObject* npobj, const NPVariant* args, uint32_t argCount, From 1fd67803cc15d6ab8bb6f1269c16f8ef971351da Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Wed, 17 Apr 2013 11:29:03 +1000 Subject: [PATCH 082/438] Bug 809733 - add css transitions for width and height to chatboxes. r=jaws --- browser/base/content/browser.css | 9 ++++++ browser/base/content/socialchat.xml | 35 ++++++++--------------- browser/themes/shared/social/chat.inc.css | 7 ----- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index d1e127efcecb..a2d7b6b1d778 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -640,8 +640,17 @@ toolbarbutton[type="badged"] { -moz-binding: url("chrome://browser/content/urlbarBindings.xml#toolbarbutton-badged"); } +/* Note the chatbox 'width' values are duplicated in socialchat.xml */ chatbox { -moz-binding: url("chrome://browser/content/socialchat.xml#chatbox"); + transition: height 150ms ease-out, width 150ms ease-out; + height: 285px; + width: 260px; /* CHAT_WIDTH_OPEN in socialchat.xml */ +} + +chatbox[minimized="true"] { + width: 160px; + height: 20px; /* CHAT_WIDTH_MINIMIZED in socialchat.xml */ } chatbar { diff --git a/browser/base/content/socialchat.xml b/browser/base/content/socialchat.xml index 2550d725cafe..0ebfadea4668 100644 --- a/browser/base/content/socialchat.xml +++ b/browser/base/content/socialchat.xml @@ -63,7 +63,8 @@ return this.getAttribute("minimized") == "true"; + + if (this.isActive == this.minimized) + this.isActive = !this.minimized; + @@ -160,9 +165,7 @@ - // to avoid reflows we cache the values for various widths. - this.cachedWidthOpen = 0; - this.cachedWidthMinimized = 0; + // to avoid reflows we cache the width of the nub. this.cachedWidthNub = 0; this._selectedChat = null; @@ -326,25 +329,11 @@ diff --git a/browser/themes/shared/social/chat.inc.css b/browser/themes/shared/social/chat.inc.css index 1f135fbce001..c708218558d2 100644 --- a/browser/themes/shared/social/chat.inc.css +++ b/browser/themes/shared/social/chat.inc.css @@ -128,15 +128,8 @@ chatbar { } chatbox { - height: 285px; - width: 260px; -moz-margin-start: 4px; background-color: white; border: 1px solid #ccc; border-bottom: none; } - -chatbox[minimized="true"] { - width: 160px; - height: 20px; -} From ad828e25f5081f1d73edfb62512d5aceee676fa7 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Wed, 17 Apr 2013 11:29:03 +1000 Subject: [PATCH 083/438] Bug 860176 - always remove document-element-inserted observer from frameworkers. r=jaws --- toolkit/components/social/FrameWorker.jsm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/toolkit/components/social/FrameWorker.jsm b/toolkit/components/social/FrameWorker.jsm index 4e5ab5319a44..c7cb9ba47ce1 100644 --- a/toolkit/components/social/FrameWorker.jsm +++ b/toolkit/components/social/FrameWorker.jsm @@ -77,6 +77,7 @@ function FrameWorker(url, name, origin) { this.loaded = false; this.reloading = false; this.origin = origin; + this._injectController = null; this.frame = makeHiddenFrame(); this.load(); @@ -84,22 +85,29 @@ function FrameWorker(url, name, origin) { FrameWorker.prototype = { load: function FrameWorker_loadWorker() { - var self = this; - Services.obs.addObserver(function injectController(doc, topic, data) { - if (!doc.defaultView || doc.defaultView != self.frame.contentWindow) { + this._injectController = function(doc, topic, data) { + if (!doc.defaultView || doc.defaultView != this.frame.contentWindow) { return; } - Services.obs.removeObserver(injectController, "document-element-inserted"); + this._maybeRemoveInjectController(); try { - self.createSandbox(); + this.createSandbox(); } catch (e) { Cu.reportError("FrameWorker: failed to create sandbox for " + url + ". " + e); } - }, "document-element-inserted", false); + }.bind(this); + Services.obs.addObserver(this._injectController, "document-element-inserted", false); this.frame.setAttribute("src", this.url); }, + _maybeRemoveInjectController: function() { + if (this._injectController) { + Services.obs.removeObserver(this._injectController, "document-element-inserted"); + this._injectController = null; + } + }, + reload: function FrameWorker_reloadWorker() { // push all the ports into pending ports, they will be re-entangled // during the call to createSandbox after the document is reloaded @@ -308,6 +316,7 @@ FrameWorker.prototype = { // terminating an already terminated worker - ignore it return; } + this._maybeRemoveInjectController(); // we want to "forget" about this worker now even though the termination // may not be complete for a little while... delete workerCache[this.url]; From 5f2b7f2d84d679d20538caf160caf423ce21458a Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Tue, 16 Apr 2013 16:43:28 +1000 Subject: [PATCH 084/438] Bug 862158 - Propagate implied SVG text rotate="" values over the top of inherited values. r=longsonr --- layout/reftests/svg/reftest.list | 7 +++++-- layout/reftests/svg/tspan-rotate-02-ref.svg | 11 +++++++++++ layout/reftests/svg/tspan-rotate-04-ref.svg | 11 +++++++++++ layout/reftests/svg/tspan-rotate-07-ref.svg | 8 ++++++++ layout/reftests/svg/tspan-rotate-07.svg | 8 ++++++++ layout/svg/nsSVGTextFrame2.cpp | 6 +----- 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 layout/reftests/svg/tspan-rotate-02-ref.svg create mode 100644 layout/reftests/svg/tspan-rotate-04-ref.svg create mode 100644 layout/reftests/svg/tspan-rotate-07-ref.svg create mode 100644 layout/reftests/svg/tspan-rotate-07.svg diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 893ff82de179..eb7d2ce0b5cf 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -319,11 +319,14 @@ HTTP(..) == text-scale-03.svg text-scale-03-ref.svg == tspan-dxdy-06.svg tspan-dxdy-ref.svg == tspan-dxdy-textPath-01.svg tspan-dxdy-textPath-01-ref.svg skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-01.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 -skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-02.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 +skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) pref(svg.text.css-frames.enabled,false) == tspan-rotate-02.svg tspan-rotate-02.svg # Bug 629718 for random failure on WinXP # bug 773482 +skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) pref(svg.text.css-frames.enabled,true) == tspan-rotate-02.svg tspan-rotate-02-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-03.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 -skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-04.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 +skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) pref(svg.text.css-frames.enabled,false) == tspan-rotate-04.svg tspan-rotate-04.svg # Bug 629718 for random failure on WinXP # bug 773482 +skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) pref(svg.text.css-frames.enabled,true) == tspan-rotate-04.svg tspan-rotate-04-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-05.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP skip-if(B2G) random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == tspan-rotate-06.svg tspan-rotate-ref.svg # Bug 629718 for random failure on WinXP # bug 773482 +== tspan-rotate-07.svg tspan-rotate-07-ref.svg == tspan-rotate-textPath-01.svg tspan-rotate-textPath-01-ref.svg skip-if(B2G) == tspan-xy-01.svg tspan-xy-ref.svg # bug 773482 skip-if(B2G) == tspan-xy-02.svg tspan-xy-ref.svg # bug 773482 diff --git a/layout/reftests/svg/tspan-rotate-02-ref.svg b/layout/reftests/svg/tspan-rotate-02-ref.svg new file mode 100644 index 000000000000..54160f32363c --- /dev/null +++ b/layout/reftests/svg/tspan-rotate-02-ref.svg @@ -0,0 +1,11 @@ + + + Reference for tspan with ancestor rotate attribute + + abcdef + + diff --git a/layout/reftests/svg/tspan-rotate-04-ref.svg b/layout/reftests/svg/tspan-rotate-04-ref.svg new file mode 100644 index 000000000000..700b85dfb545 --- /dev/null +++ b/layout/reftests/svg/tspan-rotate-04-ref.svg @@ -0,0 +1,11 @@ + + + Reference for tspan with ancestor rotate attribute + + abcdef + + diff --git a/layout/reftests/svg/tspan-rotate-07-ref.svg b/layout/reftests/svg/tspan-rotate-07-ref.svg new file mode 100644 index 000000000000..5494cda6c2c3 --- /dev/null +++ b/layout/reftests/svg/tspan-rotate-07-ref.svg @@ -0,0 +1,8 @@ + + + + A B + diff --git a/layout/reftests/svg/tspan-rotate-07.svg b/layout/reftests/svg/tspan-rotate-07.svg new file mode 100644 index 000000000000..83b1dbdde1eb --- /dev/null +++ b/layout/reftests/svg/tspan-rotate-07.svg @@ -0,0 +1,8 @@ + + + + A B + diff --git a/layout/svg/nsSVGTextFrame2.cpp b/layout/svg/nsSVGTextFrame2.cpp index f003a243cb0d..4f166f43058f 100644 --- a/layout/svg/nsSVGTextFrame2.cpp +++ b/layout/svg/nsSVGTextFrame2.cpp @@ -4673,11 +4673,7 @@ nsSVGTextFrame2::DoGlyphPositioning() } // Fill in unspecified rotation values. if (!mPositions[i].IsAngleSpecified()) { - mPositions[i].mAngle = mPositions[i - 1].mAngle; - if (mPositions[i].mAngle != 0.0f) { - // Any non-zero rotation must begin a run boundary. - mPositions[i].mRunBoundary = true; - } + mPositions[i].mAngle = 0.0f; } } From e86ee52760133a7e019939d7d488322ecd8b3e4f Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:06 +1200 Subject: [PATCH 085/438] Bug 844693 - Remove MacIOSurfaceImage::SetUpdateCallback. r=BenWa --- dom/plugins/base/nsPluginInstanceOwner.cpp | 34 +--------------------- gfx/layers/ImageContainer.cpp | 8 ----- gfx/layers/ImageContainer.h | 32 +------------------- gfx/layers/opengl/ImageLayerOGL.cpp | 16 ---------- layout/generic/nsObjectFrame.cpp | 28 ++++-------------- layout/generic/nsObjectFrame.h | 2 -- 6 files changed, 7 insertions(+), 113 deletions(-) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 4b1dcd71c366..66d94b20b22f 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -149,22 +149,6 @@ nsPluginInstanceOwner::NotifyPaintWaiter(nsDisplayListBuilder* aBuilder) } } -#ifdef XP_MACOSX -static void DrawPlugin(ImageContainer* aContainer, void* aPluginInstanceOwner) -{ - nsObjectFrame* frame = static_cast(aPluginInstanceOwner)->GetFrame(); - if (frame) { - frame->UpdateImageLayer(gfxRect(0,0,0,0)); - } -} - -static void OnDestroyImage(void* aPluginInstanceOwner) -{ - nsPluginInstanceOwner* owner = static_cast(aPluginInstanceOwner); - NS_IF_RELEASE(owner); -} -#endif // XP_MACOSX - already_AddRefed nsPluginInstanceOwner::GetImageContainer() { @@ -206,22 +190,7 @@ nsPluginInstanceOwner::GetImageContainer() #endif mInstance->GetImageContainer(getter_AddRefs(container)); - if (container) { -#ifdef XP_MACOSX - AutoLockImage autoLock(container); - Image* image = autoLock.GetImage(); - if (image && image->GetFormat() == MAC_IO_SURFACE && mObjectFrame) { - // With this drawing model, every call to - // nsIPluginInstance::GetImage() creates a new image. - MacIOSurfaceImage *oglImage = static_cast(image); - NS_ADDREF_THIS(); - oglImage->SetUpdateCallback(&DrawPlugin, this); - oglImage->SetDestroyCallback(&OnDestroyImage); - } -#endif - return container.forget(); - } - return nullptr; + return container.forget(); } void @@ -634,7 +603,6 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect) #if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) // Each time an asynchronously-drawing plugin sends a new surface to display, // the image in the ImageContainer is updated and InvalidateRect is called. - // MacIOSurfaceImages callbacks are attached here. // There are different side effects for (sync) Android plugins. nsRefPtr container; mInstance->GetImageContainer(getter_AddRefs(container)); diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index a4d8bdd640df..95cd6215c2f2 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -569,14 +569,6 @@ MacIOSurfaceImage::GetAsSurface() return imgSurface.forget(); } - -void -MacIOSurfaceImage::Update(ImageContainer* aContainer) -{ - if (mUpdateCallback) { - mUpdateCallback(aContainer, mPluginInstanceOwner); - } -} #endif already_AddRefed diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 91adc2f7e02c..13c77b4d23aa 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -806,17 +806,10 @@ public: MacIOSurfaceImage() : Image(NULL, MAC_IO_SURFACE) , mSize(0, 0) - , mPluginInstanceOwner(NULL) - , mUpdateCallback(NULL) - , mDestroyCallback(NULL) {} virtual ~MacIOSurfaceImage() - { - if (mDestroyCallback) { - mDestroyCallback(mPluginInstanceOwner); - } - } + { } /** * This can only be called on the main thread. It may add a reference @@ -825,24 +818,6 @@ public: */ virtual void SetData(const Data& aData); - /** - * Temporary hacks to force plugin drawing during an empty transaction. - * This should not be used for anything else, and will be removed - * when async plugin rendering is complete. - */ - typedef void (*UpdateSurfaceCallback)(ImageContainer* aContainer, void* aInstanceOwner); - virtual void SetUpdateCallback(UpdateSurfaceCallback aCallback, void* aInstanceOwner) - { - mUpdateCallback = aCallback; - mPluginInstanceOwner = aInstanceOwner; - } - - typedef void (*DestroyCallback)(void* aInstanceOwner); - virtual void SetDestroyCallback(DestroyCallback aCallback) - { - mDestroyCallback = aCallback; - } - virtual gfxIntSize GetSize() { return mSize; @@ -853,16 +828,11 @@ public: return mIOSurface; } - void Update(ImageContainer* aContainer); - virtual already_AddRefed GetAsSurface(); private: gfxIntSize mSize; RefPtr mIOSurface; - void* mPluginInstanceOwner; - UpdateSurfaceCallback mUpdateCallback; - DestroyCallback mDestroyCallback; }; #endif diff --git a/gfx/layers/opengl/ImageLayerOGL.cpp b/gfx/layers/opengl/ImageLayerOGL.cpp index d9879e93201d..7db0aec4f6a6 100644 --- a/gfx/layers/opengl/ImageLayerOGL.cpp +++ b/gfx/layers/opengl/ImageLayerOGL.cpp @@ -348,22 +348,6 @@ ImageLayerOGL::RenderLayer(int, MacIOSurfaceImage *ioImage = static_cast(image); - if (!mOGLManager->GetThebesLayerCallback()) { - // If its an empty transaction we still need to update - // the plugin IO Surface and make sure we grab the - // new image - ioImage->Update(GetContainer()); - image = nullptr; - autoLock.Refresh(); - image = autoLock.GetImage(); - gl()->MakeCurrent(); - ioImage = static_cast(image); - } - - if (!ioImage) { - return; - } - gl()->fActiveTexture(LOCAL_GL_TEXTURE0); if (!ioImage->GetBackendData(LAYERS_OPENGL)) { diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index bc8b5cfe71e5..ab8753624cf9 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1534,20 +1534,6 @@ nsObjectFrame::GetPaintedRect(nsDisplayPlugin* aItem) return r; } -void -nsObjectFrame::UpdateImageLayer(const gfxRect& aRect) -{ - if (!mInstanceOwner) { - return; - } - -#ifdef XP_MACOSX - if (!mInstanceOwner->UseAsyncRendering()) { - mInstanceOwner->DoCocoaEventDrawRect(aRect, nullptr); - } -#endif -} - LayerState nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager) @@ -1555,14 +1541,6 @@ nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder, if (!mInstanceOwner) return LAYER_NONE; -#ifdef XP_MACOSX - if (!mInstanceOwner->UseAsyncRendering() && - mInstanceOwner->IsRemoteDrawingCoreAnimation() && - mInstanceOwner->GetEventModel() == NPEventModelCocoa) { - return LAYER_ACTIVE; - } -#endif - #ifdef MOZ_WIDGET_ANDROID // We always want a layer on Honeycomb and later if (AndroidBridge::Bridge()->GetAPIVersion() >= 11) @@ -1626,7 +1604,11 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder, NS_ASSERTION(layer->GetType() == Layer::TYPE_IMAGE, "Bad layer type"); ImageLayer* imglayer = static_cast(layer.get()); - UpdateImageLayer(r); +#ifdef XP_MACOSX + if (!mInstanceOwner->UseAsyncRendering()) { + mInstanceOwner->DoCocoaEventDrawRect(r, nullptr); + } +#endif imglayer->SetScaleToSize(size, ImageLayer::SCALE_STRETCH); imglayer->SetContainer(container); diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 4d3f4b44e640..c5a7ded5da6b 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -159,8 +159,6 @@ public: virtual bool ReflowFinished() MOZ_OVERRIDE; virtual void ReflowCallbackCanceled() MOZ_OVERRIDE; - void UpdateImageLayer(const gfxRect& aRect); - /** * Builds either an ImageLayer or a ReadbackLayer, depending on the type * of aItem (TYPE_PLUGIN or TYPE_PLUGIN_READBACK respectively). From ca690f5eec98b91549d03f29ec55d98b6a619b53 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:06 +1200 Subject: [PATCH 086/438] Bug 860615 - Add CreateSharedHandle to GLContextProvider so we can create one without a GLContext. r=jgilbert --- gfx/gl/GLContext.h | 5 ----- gfx/gl/GLContextProviderCGL.mm | 8 ++++++++ gfx/gl/GLContextProviderEGL.cpp | 34 ++++++++------------------------ gfx/gl/GLContextProviderGLX.cpp | 8 ++++++++ gfx/gl/GLContextProviderImpl.h | 10 ++++++++++ gfx/gl/GLContextProviderNull.cpp | 8 ++++++++ gfx/gl/GLContextProviderWGL.cpp | 8 ++++++++ 7 files changed, 50 insertions(+), 31 deletions(-) diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 0f2aea62ff8a..a658b3de4413 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -442,11 +442,6 @@ public: #endif }; - /** - * Create new shared GLContext content handle, must be released by ReleaseSharedHandle. - */ - virtual SharedTextureHandle CreateSharedHandle(SharedTextureShareType shareType) - { return 0; } /* * Create a new shared GLContext content handle, using the passed buffer as a source. * Must be released by ReleaseSharedHandle. UpdateSharedHandle will have no effect diff --git a/gfx/gl/GLContextProviderCGL.mm b/gfx/gl/GLContextProviderCGL.mm index a44073c83de5..a2307f4d13f7 100644 --- a/gfx/gl/GLContextProviderCGL.mm +++ b/gfx/gl/GLContextProviderCGL.mm @@ -414,6 +414,14 @@ GLContextProviderCGL::GetGlobalContext(const ContextFlags) return gGlobalContext; } +SharedTextureHandle +GLContextProviderCGL::CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType) +{ + return 0; +} + void GLContextProviderCGL::Shutdown() { diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index e7953e9942c9..eeb3725b927f 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -665,7 +665,6 @@ public: return sEGLLibrary.HasKHRLockSurface(); } - virtual SharedTextureHandle CreateSharedHandle(SharedTextureShareType shareType); virtual SharedTextureHandle CreateSharedHandle(SharedTextureShareType shareType, void* buffer, SharedTextureBufferType bufferType); @@ -909,31 +908,6 @@ GLContextEGL::UpdateSharedHandle(SharedTextureShareType shareType, wrap->MakeSync(this); } -SharedTextureHandle -GLContextEGL::CreateSharedHandle(SharedTextureShareType shareType) -{ - if (shareType != SameProcess) - return 0; - - if (!mShareWithEGLImage) - return 0; - - MakeCurrent(); - mTemporaryEGLImageTexture = CreateTextureForOffscreen(GetGLFormats(), OffscreenSize()); - - EGLTextureWrapper* tex = new EGLTextureWrapper(); - bool ok = tex->CreateEGLImage(this, mTemporaryEGLImageTexture); - - if (!ok) { - NS_ERROR("EGLImage creation for EGLTextureWrapper failed"); - ReleaseSharedHandle(shareType, (SharedTextureHandle)tex); - return 0; - } - - // Raw pointer shared across threads - return (SharedTextureHandle)tex; -} - SharedTextureHandle GLContextEGL::CreateSharedHandle(SharedTextureShareType shareType, void* buffer, @@ -2364,6 +2338,14 @@ GLContextProviderEGL::CreateOffscreen(const gfxIntSize& size, return glContext.forget(); } +SharedTextureHandle +GLContextProviderEGL::CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType) +{ + return 0; +} + // Don't want a global context on Android as 1) share groups across 2 threads fail on many Tegra drivers (bug 759225) // and 2) some mobile devices have a very strict limit on global number of GL contexts (bug 754257) // and 3) each EGL context eats 750k on B2G (bug 813783) diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index 3ff453696dff..04e965eb8aa0 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -1415,6 +1415,14 @@ GLContextProviderGLX::CreateOffscreen(const gfxIntSize& size, return glContext.forget(); } +SharedTextureHandle +GLContextProviderGLX::CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType) +{ + return 0; +} + static nsRefPtr gGlobalContext[GLXLibrary::LIBS_MAX]; // TODO move that out of static initializaion static bool gUseContextSharing = getenv("MOZ_DISABLE_CONTEXT_SHARING_GLX") == 0; diff --git a/gfx/gl/GLContextProviderImpl.h b/gfx/gl/GLContextProviderImpl.h index 52657caacd41..cef25676d55d 100644 --- a/gfx/gl/GLContextProviderImpl.h +++ b/gfx/gl/GLContextProviderImpl.h @@ -68,6 +68,16 @@ public: */ static GLContext* GetGlobalContext(ContextFlags flags = GLContext::ContextFlagsNone); + + /* + * Create a new shared GLContext content handle, using the passed buffer as a source. + * Must be released by ReleaseSharedHandle. UpdateSharedHandle will have no effect + * on handles created with this method, as the caller owns the source (the passed buffer) + * and is responsible for updating it accordingly. + */ + static SharedTextureHandle CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType); /** * Free any resources held by this Context Provider. diff --git a/gfx/gl/GLContextProviderNull.cpp b/gfx/gl/GLContextProviderNull.cpp index 1d8f8e31553b..7183544b156e 100644 --- a/gfx/gl/GLContextProviderNull.cpp +++ b/gfx/gl/GLContextProviderNull.cpp @@ -22,6 +22,14 @@ GLContextProviderNull::CreateOffscreen(const gfxIntSize&, return nullptr; } +SharedTextureHandle +GLContextProviderNull::CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType) +{ + return 0; +} + GLContext* GLContextProviderNull::GetGlobalContext(ContextFlags) { diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp index 34c51876d081..e881b752eb09 100644 --- a/gfx/gl/GLContextProviderWGL.cpp +++ b/gfx/gl/GLContextProviderWGL.cpp @@ -687,6 +687,14 @@ GLContextProviderWGL::CreateOffscreen(const gfxIntSize& size, return glContext.forget(); } +SharedTextureHandle +GLContextProviderWGL::CreateSharedHandle(GLContext::SharedTextureShareType shareType, + void* buffer, + GLContext::SharedTextureBufferType bufferType) +{ + return 0; +} + static nsRefPtr gGlobalContext[WGLLibrary::LIBS_MAX]; GLContext * From 26c10d73faa8817b5e6f9aa997a1014100ce7070 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:06 +1200 Subject: [PATCH 087/438] Bug 860615 - Add SharedTextureHandle support to GLContextCGL. r=jgilbert --- gfx/gl/GLContext.h | 3 +++ gfx/gl/GLContextProviderCGL.mm | 44 +++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index a658b3de4413..44a27192c9be 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -439,6 +439,9 @@ public: TextureID #ifdef MOZ_WIDGET_ANDROID , SurfaceTexture +#endif +#ifdef XP_MACOSX + , IOSurface #endif }; diff --git a/gfx/gl/GLContextProviderCGL.mm b/gfx/gl/GLContextProviderCGL.mm index a2307f4d13f7..8e3a03110f03 100644 --- a/gfx/gl/GLContextProviderCGL.mm +++ b/gfx/gl/GLContextProviderCGL.mm @@ -17,6 +17,7 @@ #include "prenv.h" #include "mozilla/Preferences.h" #include "GeckoProfiler.h" +#include "mozilla/gfx/MacIOSurface.h" using namespace mozilla::gfx; @@ -177,6 +178,39 @@ public: GLContext* aContext, TextureImage::Flags aFlags = TextureImage::NoFlags); + virtual SharedTextureHandle CreateSharedHandle(SharedTextureShareType shareType, + void* buffer, + SharedTextureBufferType bufferType) + { + return GLContextProviderCGL::CreateSharedHandle(shareType, buffer, bufferType); + } + + virtual void ReleaseSharedHandle(SharedTextureShareType shareType, + SharedTextureHandle sharedHandle) + { + if (sharedHandle) { + reinterpret_cast(sharedHandle)->Release(); + } + } + + virtual bool GetSharedHandleDetails(SharedTextureShareType shareType, + SharedTextureHandle sharedHandle, + SharedHandleDetails& details) + { + details.mTarget = LOCAL_GL_TEXTURE_RECTANGLE_ARB; + details.mProgramType = RGBARectLayerProgramType; + return true; + } + + virtual bool AttachSharedHandle(SharedTextureShareType shareType, + SharedTextureHandle sharedHandle) + { + MacIOSurface* surf = reinterpret_cast(sharedHandle); + surf->CGLTexImageIOSurface2D(mContext, LOCAL_GL_RGBA, LOCAL_GL_BGRA, + LOCAL_GL_UNSIGNED_INT_8_8_8_8_REV, 0); + return true; + } + NSOpenGLContext *mContext; GLuint mTempTextureName; }; @@ -419,7 +453,15 @@ GLContextProviderCGL::CreateSharedHandle(GLContext::SharedTextureShareType share void* buffer, GLContext::SharedTextureBufferType bufferType) { - return 0; + if (shareType != GLContext::SameProcess || + bufferType != GLContext::IOSurface) { + return 0; + } + + MacIOSurface* surf = static_cast(buffer); + surf->AddRef(); + + return (SharedTextureHandle)surf; } void From 0d81d85a4b828e39681d480dfbea917fc2fefe43 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:06 +1200 Subject: [PATCH 088/438] Bug 860615 - Add SharedTextureHandle support to ImageLayerOGL. r=BenWa --- gfx/layers/opengl/ImageLayerOGL.cpp | 71 +++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/gfx/layers/opengl/ImageLayerOGL.cpp b/gfx/layers/opengl/ImageLayerOGL.cpp index 7db0aec4f6a6..7a0e06cc0911 100644 --- a/gfx/layers/opengl/ImageLayerOGL.cpp +++ b/gfx/layers/opengl/ImageLayerOGL.cpp @@ -17,6 +17,7 @@ # include "GLXLibrary.h" # include "gfxXlibSurface.h" #endif +#include "SharedTextureImage.h" #ifdef MOZ_WIDGET_ANDROID #include "nsSurfaceTexture.h" @@ -154,7 +155,7 @@ TextureRecycleBin::GetTexture(TextureType aType, const gfxIntSize& aSize, mRecycledTextures[aType].RemoveElementAt(last); } -struct THEBES_API MacIOSurfaceImageOGLBackendData : public ImageBackendData +struct THEBES_API ImageOGLBackendData : public ImageBackendData { GLTexture mTexture; }; @@ -163,8 +164,8 @@ struct THEBES_API MacIOSurfaceImageOGLBackendData : public ImageBackendData void AllocateTextureIOSurface(MacIOSurfaceImage *aIOImage, mozilla::gl::GLContext* aGL) { - nsAutoPtr backendData( - new MacIOSurfaceImageOGLBackendData); + nsAutoPtr backendData( + new ImageOGLBackendData); backendData->mTexture.Allocate(aGL); aGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, backendData->mTexture.GetTextureID()); @@ -187,6 +188,23 @@ AllocateTextureIOSurface(MacIOSurfaceImage *aIOImage, mozilla::gl::GLContext* aG } #endif +void +AllocateTextureSharedTexture(SharedTextureImage *aTexImage, mozilla::gl::GLContext* aGL, GLenum aTarget) +{ + nsAutoPtr backendData( + new ImageOGLBackendData); + + backendData->mTexture.Allocate(aGL); + + aGL->fBindTexture(aTarget, backendData->mTexture.GetTextureID()); + aGL->fTexParameteri(aTarget, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR); + aGL->fTexParameteri(aTarget, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR); + aGL->fTexParameteri(aTarget, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); + aGL->fTexParameteri(aTarget, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE); + + aTexImage->SetBackendData(LAYERS_OPENGL, backendData.forget()); +} + #ifdef MOZ_WIDGET_GONK struct THEBES_API GonkIOSurfaceImageOGLBackendData : public ImageBackendData { @@ -354,8 +372,8 @@ ImageLayerOGL::RenderLayer(int, AllocateTextureIOSurface(ioImage, gl()); } - MacIOSurfaceImageOGLBackendData *data = - static_cast(ioImage->GetBackendData(LAYERS_OPENGL)); + ImageOGLBackendData *data = + static_cast(ioImage->GetBackendData(LAYERS_OPENGL)); gl()->fActiveTexture(LOCAL_GL_TEXTURE0); gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, data->mTexture.GetTextureID()); @@ -383,6 +401,49 @@ ImageLayerOGL::RenderLayer(int, mOGLManager->BindAndDrawQuad(program); gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); #endif + } else if (image->GetFormat() == SHARED_TEXTURE) { + SharedTextureImage* texImage = + static_cast(image); + const SharedTextureImage::Data* data = texImage->GetData(); + GLContext::SharedHandleDetails handleDetails; + if (!gl()->GetSharedHandleDetails(data->mShareType, data->mHandle, handleDetails)) { + NS_ERROR("Failed to get shared handle details"); + return; + } + + ShaderProgramOGL* program = mOGLManager->GetProgram(handleDetails.mProgramType, GetMaskLayer()); + + program->Activate(); + if (handleDetails.mProgramType == gl::RGBARectLayerProgramType) { + // 2DRect case, get the multiplier right for a sampler2DRect + program->SetTexCoordMultiplier(data->mSize.width, data->mSize.height); + } + program->SetLayerTransform(GetEffectiveTransform()); + program->SetLayerOpacity(GetEffectiveOpacity()); + program->SetRenderOffset(aOffset); + program->SetTextureUnit(0); + program->SetTextureTransform(handleDetails.mTextureTransform); + program->LoadMask(GetMaskLayer()); + + if (!texImage->GetBackendData(LAYERS_OPENGL)) { + AllocateTextureSharedTexture(texImage, gl(), handleDetails.mTarget); + } + + ImageOGLBackendData *backendData = + static_cast(texImage->GetBackendData(LAYERS_OPENGL)); + gl()->fActiveTexture(LOCAL_GL_TEXTURE0); + gl()->fBindTexture(handleDetails.mTarget, backendData->mTexture.GetTextureID()); + + if (!gl()->AttachSharedHandle(data->mShareType, data->mHandle)) { + NS_ERROR("Failed to bind shared texture handle"); + return; + } + + gl()->ApplyFilterToBoundTexture(handleDetails.mTarget, mFilter); + program->SetLayerQuadRect(nsIntRect(nsIntPoint(0, 0), data->mSize)); + mOGLManager->BindAndDrawQuad(program, data->mInverted); + gl()->fBindTexture(handleDetails.mTarget, 0); + gl()->DetachSharedHandle(data->mShareType, data->mHandle); #ifdef MOZ_WIDGET_GONK } else if (image->GetFormat() == GONK_IO_SURFACE) { From a8572d46e2aed1bbae5624a52ceca56e25709fd1 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:07 +1200 Subject: [PATCH 089/438] Bug 860615 - Use SharedTextureHandle for plugins on OSX. r=BenWa --- dom/plugins/ipc/PluginInstanceParent.cpp | 26 +++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index bb7f60fbe331..0f595457123f 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -28,6 +28,9 @@ #include "gfxUtils.h" #include "nsNPAPIPluginInstance.h" #include "Layers.h" +#include "SharedTextureImage.h" +#include "GLContext.h" +#include "GLContextProvider.h" #if defined(OS_WIN) #include @@ -47,6 +50,7 @@ extern const PRUnichar* kFlashFullscreenClass; using namespace mozilla::plugins; using namespace mozilla::layers; +using namespace mozilla::gl; bool StreamNotifyParent::RecvRedirectNotifyResponse(const bool& allow) @@ -739,18 +743,26 @@ PluginInstanceParent::GetImageContainer(ImageContainer** aContainer) #ifdef XP_MACOSX if (ioSurface) { - ImageFormat format = MAC_IO_SURFACE; + ImageFormat format = SHARED_TEXTURE; nsRefPtr image = container->CreateImage(&format, 1); if (!image) { return NS_ERROR_FAILURE; } - NS_ASSERTION(image->GetFormat() == MAC_IO_SURFACE, "Wrong format?"); - MacIOSurfaceImage* ioImage = static_cast(image.get()); - MacIOSurfaceImage::Data ioData; - ioData.mIOSurface = ioSurface; - ioImage->SetData(ioData); - container->SetCurrentImageInTransaction(ioImage); + NS_ASSERTION(image->GetFormat() == SHARED_TEXTURE, "Wrong format?"); + + SharedTextureImage::Data data; + data.mShareType = GLContext::SameProcess; + data.mHandle = GLContextProviderCGL::CreateSharedHandle(data.mShareType, + ioSurface, + GLContext::IOSurface); + data.mInverted = false; + data.mSize = gfxIntSize(ioSurface->GetWidth(), ioSurface->GetHeight()); + + SharedTextureImage* pluginImage = static_cast(image.get()); + pluginImage->SetData(data); + + container->SetCurrentImageInTransaction(pluginImage); NS_IF_ADDREF(container); *aContainer = container; From 7702f1de96caabdc3b64df5879cec07829af9a98 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 17 Apr 2013 14:21:07 +1200 Subject: [PATCH 090/438] Bug 860615 - Remove MacIOSurfaceImage. r=BenWa --- gfx/layers/ImageContainer.cpp | 38 ---------------- gfx/layers/ImageContainer.h | 44 ------------------- gfx/layers/ImageTypes.h | 7 --- gfx/layers/opengl/ImageLayerOGL.cpp | 68 ----------------------------- 4 files changed, 157 deletions(-) diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index 95cd6215c2f2..9dda1a744da3 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -70,12 +70,6 @@ ImageFactory::CreateImage(const ImageFormat *aFormats, img = new SharedTextureImage(); return img.forget(); } -#ifdef XP_MACOSX - if (FormatInList(aFormats, aNumFormats, MAC_IO_SURFACE)) { - img = new MacIOSurfaceImage(); - return img.forget(); - } -#endif #ifdef MOZ_WIDGET_GONK if (FormatInList(aFormats, aNumFormats, GONK_IO_SURFACE)) { img = new GonkIOSurfaceImage(); @@ -539,38 +533,6 @@ PlanarYCbCrImage::GetAsSurface() return imageSurface.forget().get(); } -#ifdef XP_MACOSX -void -MacIOSurfaceImage::SetData(const Data& aData) -{ - mIOSurface = MacIOSurface::LookupSurface(aData.mIOSurface->GetIOSurfaceID()); - mSize = gfxIntSize(mIOSurface->GetWidth(), mIOSurface->GetHeight()); -} - -already_AddRefed -MacIOSurfaceImage::GetAsSurface() -{ - mIOSurface->Lock(); - size_t bytesPerRow = mIOSurface->GetBytesPerRow(); - size_t ioWidth = mIOSurface->GetWidth(); - size_t ioHeight = mIOSurface->GetHeight(); - - unsigned char* ioData = (unsigned char*)mIOSurface->GetBaseAddress(); - - nsRefPtr imgSurface = - new gfxImageSurface(gfxIntSize(ioWidth, ioHeight), gfxASurface::ImageFormatARGB32); - - for (int i = 0; i < ioHeight; i++) { - memcpy(imgSurface->Data() + i * imgSurface->Stride(), - ioData + i * bytesPerRow, ioWidth * 4); - } - - mIOSurface->Unlock(); - - return imgSurface.forget(); -} -#endif - already_AddRefed RemoteBitmapImage::GetAsSurface() { diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 13c77b4d23aa..0de5d3ba5eca 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -20,10 +20,6 @@ struct ID3D10Device; struct ID3D10ShaderResourceView; #endif -#ifdef XP_MACOSX -#include "mozilla/gfx/MacIOSurface.h" -#endif - #ifdef MOZ_WIDGET_GONK # include #endif @@ -796,46 +792,6 @@ public: gfxIntSize mSize; }; -#ifdef XP_MACOSX -class THEBES_API MacIOSurfaceImage : public Image { -public: - struct Data { - MacIOSurface* mIOSurface; - }; - - MacIOSurfaceImage() - : Image(NULL, MAC_IO_SURFACE) - , mSize(0, 0) - {} - - virtual ~MacIOSurfaceImage() - { } - - /** - * This can only be called on the main thread. It may add a reference - * to the surface (which will eventually be released on the main thread). - * The surface must not be modified after this call!!! - */ - virtual void SetData(const Data& aData); - - virtual gfxIntSize GetSize() - { - return mSize; - } - - MacIOSurface* GetIOSurface() - { - return mIOSurface; - } - - virtual already_AddRefed GetAsSurface(); - -private: - gfxIntSize mSize; - RefPtr mIOSurface; -}; -#endif - class RemoteBitmapImage : public Image { public: RemoteBitmapImage() : Image(NULL, REMOTE_IMAGE_BITMAP) {} diff --git a/gfx/layers/ImageTypes.h b/gfx/layers/ImageTypes.h index 4791365fe43f..b9c3006e0c78 100644 --- a/gfx/layers/ImageTypes.h +++ b/gfx/layers/ImageTypes.h @@ -45,13 +45,6 @@ enum ImageFormat { */ CAIRO_SURFACE, - /** - * The MAC_IO_SURFACE format creates a MacIOSurfaceImage. - * - * It wraps an IOSurface object and binds it directly to a GL texture. - */ - MAC_IO_SURFACE, - /** * The GONK_IO_SURFACE format creates a GonkIOSurfaceImage. * diff --git a/gfx/layers/opengl/ImageLayerOGL.cpp b/gfx/layers/opengl/ImageLayerOGL.cpp index 7a0e06cc0911..52ac148c6cd1 100644 --- a/gfx/layers/opengl/ImageLayerOGL.cpp +++ b/gfx/layers/opengl/ImageLayerOGL.cpp @@ -160,34 +160,6 @@ struct THEBES_API ImageOGLBackendData : public ImageBackendData GLTexture mTexture; }; -#ifdef XP_MACOSX -void -AllocateTextureIOSurface(MacIOSurfaceImage *aIOImage, mozilla::gl::GLContext* aGL) -{ - nsAutoPtr backendData( - new ImageOGLBackendData); - - backendData->mTexture.Allocate(aGL); - aGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, backendData->mTexture.GetTextureID()); - aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, - LOCAL_GL_TEXTURE_MIN_FILTER, - LOCAL_GL_NEAREST); - aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, - LOCAL_GL_TEXTURE_MAG_FILTER, - LOCAL_GL_NEAREST); - - void *nativeCtx = aGL->GetNativeData(GLContext::NativeGLContext); - - aIOImage->GetIOSurface()->CGLTexImageIOSurface2D(nativeCtx, - LOCAL_GL_RGBA, LOCAL_GL_BGRA, - LOCAL_GL_UNSIGNED_INT_8_8_8_8_REV, 0); - - aGL->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); - - aIOImage->SetBackendData(LAYERS_OPENGL, backendData.forget()); -} -#endif - void AllocateTextureSharedTexture(SharedTextureImage *aTexImage, mozilla::gl::GLContext* aGL, GLenum aTarget) { @@ -361,46 +333,6 @@ ImageLayerOGL::RenderLayer(int, program->LoadMask(GetMaskLayer()); mOGLManager->BindAndDrawQuad(program); -#ifdef XP_MACOSX - } else if (image->GetFormat() == MAC_IO_SURFACE) { - MacIOSurfaceImage *ioImage = - static_cast(image); - - gl()->fActiveTexture(LOCAL_GL_TEXTURE0); - - if (!ioImage->GetBackendData(LAYERS_OPENGL)) { - AllocateTextureIOSurface(ioImage, gl()); - } - - ImageOGLBackendData *data = - static_cast(ioImage->GetBackendData(LAYERS_OPENGL)); - - gl()->fActiveTexture(LOCAL_GL_TEXTURE0); - gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, data->mTexture.GetTextureID()); - - ShaderProgramOGL *program = - mOGLManager->GetProgram(gl::RGBARectLayerProgramType, GetMaskLayer()); - - program->Activate(); - if (program->GetTexCoordMultiplierUniformLocation() != -1) { - // 2DRect case, get the multiplier right for a sampler2DRect - program->SetTexCoordMultiplier(ioImage->GetSize().width, ioImage->GetSize().height); - } else { - NS_ASSERTION(0, "no rects?"); - } - - program->SetLayerQuadRect(nsIntRect(0, 0, - ioImage->GetSize().width, - ioImage->GetSize().height)); - program->SetLayerTransform(GetEffectiveTransform()); - program->SetLayerOpacity(GetEffectiveOpacity()); - program->SetRenderOffset(aOffset); - program->SetTextureUnit(0); - program->LoadMask(GetMaskLayer()); - - mOGLManager->BindAndDrawQuad(program); - gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, 0); -#endif } else if (image->GetFormat() == SHARED_TEXTURE) { SharedTextureImage* texImage = static_cast(image); From df473e9155a00bbfa0421c0e496bb3b67ad51533 Mon Sep 17 00:00:00 2001 From: EKR Date: Tue, 16 Apr 2013 19:29:23 -0700 Subject: [PATCH 091/438] Bug 856433 - Allow cancellation of nonexistent nrappkit timers off the STS thread. r=abr --- media/mtransport/nr_timer.cpp | 7 +++++-- media/mtransport/test/ice_unittest.cpp | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/media/mtransport/nr_timer.cpp b/media/mtransport/nr_timer.cpp index 4517ddb126d5..16e72633810b 100644 --- a/media/mtransport/nr_timer.cpp +++ b/media/mtransport/nr_timer.cpp @@ -155,11 +155,14 @@ int NR_async_schedule(NR_async_cb cb, void *arg, char *func, int l) { } int NR_async_timer_cancel(void *handle) { - CheckSTSThread(); - + // Check for the handle being nonzero because sometimes we get + // no-op cancels that aren't on the STS thread. This can be + // non-racy as long as the upper-level code is careful. if (!handle) return 0; + CheckSTSThread(); + nsITimer *timer = static_cast(handle); timer->Cancel(); diff --git a/media/mtransport/test/ice_unittest.cpp b/media/mtransport/test/ice_unittest.cpp index 3721c507aefe..092be8a436f1 100644 --- a/media/mtransport/test/ice_unittest.cpp +++ b/media/mtransport/test/ice_unittest.cpp @@ -44,6 +44,8 @@ const std::string kDefaultStunServerHostname( const std::string kBogusStunServerHostname( (char *)"stun-server-nonexistent.invalid"); const uint16_t kDefaultStunServerPort=3478; +const std::string kBogusIceCandidate( + (char *)"candidate:0 2 UDP 2113601790 192.168.178.20 50769 typ"); std::string g_turn_server; std::string g_turn_user; @@ -310,6 +312,14 @@ class IceTestPeer : public sigslot::has_slots<> { candidate_filter_ = filter; } + // Allow us to parse candidates directly on the current thread. + void ParseCandidate(size_t i, const std::string& candidate) { + std::vector attributes; + + attributes.push_back(candidate); + streams_[i]->ParseAttributes(attributes); + } + private: std::string name_; nsRefPtr ice_ctx_; @@ -504,6 +514,13 @@ TEST_F(IceGatherTest, TestGatherTurn) { Gather(); } +// Verify that a bogus candidate doesn't cause crashes on the +// main thread. See bug 856433. +TEST_F(IceGatherTest, TestBogusCandidate) { + Gather(); + peer_->ParseCandidate(0, kBogusIceCandidate); +} + TEST_F(IceConnectTest, TestGather) { AddStream("first", 1); ASSERT_TRUE(Gather(true)); From 94e425874b60d89cc1796f77a843469f8ab021da Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Tue, 16 Apr 2013 23:58:09 -0400 Subject: [PATCH 092/438] Bug 862302: Don't lose reference to queued DataChannels when they open r=mcmanus --- content/base/src/nsDOMDataChannel.cpp | 1 + netwerk/sctp/datachannel/DataChannel.cpp | 20 ++++++++++++++++---- netwerk/sctp/datachannel/DataChannel.h | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/content/base/src/nsDOMDataChannel.cpp b/content/base/src/nsDOMDataChannel.cpp index 4bcae7095fb2..43735d06155e 100644 --- a/content/base/src/nsDOMDataChannel.cpp +++ b/content/base/src/nsDOMDataChannel.cpp @@ -62,6 +62,7 @@ public: // Don't call us anymore! Likely isn't an issue (or maybe just less of // one) once we block GC until all the (appropriate) onXxxx handlers // are dropped. (See WebRTC spec) + LOG(("Close()ing %p", mDataChannel.get())); mDataChannel->SetListener(nullptr, nullptr); mDataChannel->Close(); } diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index 56e0c8f22f70..3bb94a915dfc 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -584,6 +584,10 @@ DataChannelConnection::CompleteConnect(TransportFlow *flow, TransportLayer::Stat void DataChannelConnection::ProcessQueuedOpens() { + // The nsDeque holds channels with an AddRef applied. Another reference + // (may) be held by the DOMDataChannel, unless it's been GC'd. No other + // references should exist. + // Can't copy nsDeque's. Move into temp array since any that fail will // go back to mPending nsDeque temp; @@ -593,11 +597,15 @@ DataChannelConnection::ProcessQueuedOpens() } nsRefPtr channel; + // All these entries have an AddRef(); make that explicit now via the dont_AddRef() while (nullptr != (channel = dont_AddRef(static_cast(temp.PopFront())))) { if (channel->mFlags & DATA_CHANNEL_FLAGS_FINISH_OPEN) { LOG(("Processing queued open for %p (%u)", channel.get(), channel->mStream)); channel->mFlags &= ~DATA_CHANNEL_FLAGS_FINISH_OPEN; - OpenFinish(channel.forget()); // may reset the flag and re-push + // OpenFinish returns a reference itself, so we need to take it can Release it + channel = OpenFinish(channel.forget()); // may reset the flag and re-push + } else { + NS_ASSERTION(false, "How did a DataChannel get queued without the FINISH_OPEN flag?"); } } @@ -1287,7 +1295,8 @@ DataChannelConnection::HandleMessage(const void *buffer, size_t length, uint32_t switch (ppid) { case DATA_CHANNEL_PPID_CONTROL: - NS_ENSURE_TRUE_VOID(length >= sizeof(*req)); + // structure includes a possibly-unused char label[1] (in a packed structure) + NS_ENSURE_TRUE_VOID(length >= sizeof(*req) - 1); req = static_cast(buffer); switch (req->msg_type) { @@ -1859,7 +1868,9 @@ DataChannelConnection::Open(const nsACString& label, const nsACString& protocol, already_AddRefed DataChannelConnection::OpenFinish(already_AddRefed aChannel) { - nsRefPtr channel(aChannel); + nsRefPtr channel(aChannel); // takes the reference passed in + // Normally 1 reference if called from ::Open(), or 2 if called from + // ProcessQueuedOpens() unless the DOMDataChannel was gc'd uint16_t stream = channel->mStream; mLock.AssertCurrentThreadOwns(); @@ -1889,7 +1900,7 @@ DataChannelConnection::OpenFinish(already_AddRefed aChannel) } if (stream != INVALID_STREAM) { // just allocated (& OPEN), or externally negotiated - mStreams[stream] = channel; + mStreams[stream] = channel; // holds a reference channel->mStream = stream; } @@ -1908,6 +1919,7 @@ DataChannelConnection::OpenFinish(already_AddRefed aChannel) } else { // OPEN and externally negotiated stream mStreams[stream] = channel; + mStreams[stream] = channel; // holds a reference } #ifdef TEST_QUEUED_DATA diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index 9ca99032b4be..07f961b1c3f5 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -174,7 +174,7 @@ public: DataChannelListener *aListener, nsISupports *aContext, bool aExternalNegotiated, - uint16_t aStream); + uint16_t aStream) NS_WARN_UNUSED_RESULT; void Close(DataChannel *aChannel); // CloseInt() must be called with mLock held @@ -238,7 +238,7 @@ private: void DeliverQueuedData(uint16_t stream); - already_AddRefed OpenFinish(already_AddRefed channel); + already_AddRefed OpenFinish(already_AddRefed channel) NS_WARN_UNUSED_RESULT; void StartDefer(); bool SendDeferredMessages(); From 23d55db958ff0b12c3ac2595e5104439bb7fb938 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Wed, 17 Apr 2013 00:35:39 -0400 Subject: [PATCH 093/438] Bug 862118 - Remove GetAttributeToModifyOnNode r=ehsan --- editor/libeditor/html/nsHTMLDataTransfer.cpp | 129 ------------------- editor/libeditor/html/nsHTMLEditor.h | 1 - 2 files changed, 130 deletions(-) diff --git a/editor/libeditor/html/nsHTMLDataTransfer.cpp b/editor/libeditor/html/nsHTMLDataTransfer.cpp index 68dd30c1a643..d449a682287e 100644 --- a/editor/libeditor/html/nsHTMLDataTransfer.cpp +++ b/editor/libeditor/html/nsHTMLDataTransfer.cpp @@ -715,135 +715,6 @@ nsHTMLEditor::DoInsertHTMLWithContext(const nsAString & aInputString, return mRules->DidDoAction(selection, &ruleInfo, rv); } -// returns empty string if nothing to modify on node -nsresult -nsHTMLEditor::GetAttributeToModifyOnNode(nsIDOMNode *aNode, nsAString &aAttr) -{ - aAttr.Truncate(); - - NS_NAMED_LITERAL_STRING(srcStr, "src"); - nsCOMPtr nodeAsImage = do_QueryInterface(aNode); - if (nodeAsImage) - { - aAttr = srcStr; - return NS_OK; - } - - nsCOMPtr nodeAsAnchor = do_QueryInterface(aNode); - if (nodeAsAnchor) - { - aAttr.AssignLiteral("href"); - return NS_OK; - } - - NS_NAMED_LITERAL_STRING(bgStr, "background"); - nsCOMPtr element = do_QueryInterface(aNode); - if (element && element->IsHTML(nsGkAtoms::body)) { - aAttr = bgStr; - return NS_OK; - } - - if (element && element->IsHTML(nsGkAtoms::table)) { - aAttr = bgStr; - return NS_OK; - } - - if (element && element->IsHTML(nsGkAtoms::tr)) { - aAttr = bgStr; - return NS_OK; - } - - if (element && - (element->IsHTML(nsGkAtoms::td) || element->IsHTML(nsGkAtoms::th))) { - aAttr = bgStr; - return NS_OK; - } - - nsCOMPtr nodeAsScript = do_QueryInterface(aNode); - if (nodeAsScript) - { - aAttr = srcStr; - return NS_OK; - } - - nsCOMPtr nodeAsEmbed = do_QueryInterface(aNode); - if (nodeAsEmbed) - { - aAttr = srcStr; - return NS_OK; - } - - nsCOMPtr nodeAsObject = do_QueryInterface(aNode); - if (nodeAsObject) - { - aAttr.AssignLiteral("data"); - return NS_OK; - } - - nsCOMPtr nodeAsLink = do_QueryInterface(aNode); - if (nodeAsLink) - { - // Test if the link has a rel value indicating it to be a stylesheet - nsAutoString linkRel; - if (NS_SUCCEEDED(nodeAsLink->GetRel(linkRel)) && !linkRel.IsEmpty()) - { - nsReadingIterator start; - nsReadingIterator end; - nsReadingIterator current; - - linkRel.BeginReading(start); - linkRel.EndReading(end); - - // Walk through space delimited string looking for "stylesheet" - for (current = start; current != end; ++current) - { - // Ignore whitespace - if (nsCRT::IsAsciiSpace(*current)) - continue; - - // Grab the next space delimited word - nsReadingIterator startWord = current; - do { - ++current; - } while (current != end && !nsCRT::IsAsciiSpace(*current)); - - // Store the link for fix up if it says "stylesheet" - if (Substring(startWord, current).LowerCaseEqualsLiteral("stylesheet")) - { - aAttr.AssignLiteral("href"); - return NS_OK; - } - if (current == end) - break; - } - } - return NS_OK; - } - - nsCOMPtr nodeAsFrame = do_QueryInterface(aNode); - if (nodeAsFrame) - { - aAttr = srcStr; - return NS_OK; - } - - nsCOMPtr nodeAsIFrame = do_QueryInterface(aNode); - if (nodeAsIFrame) - { - aAttr = srcStr; - return NS_OK; - } - - nsCOMPtr nodeAsInput = do_QueryInterface(aNode); - if (nodeAsInput) - { - aAttr = srcStr; - return NS_OK; - } - - return NS_OK; -} - nsresult nsHTMLEditor::AddInsertionListener(nsIContentFilter *aListener) { diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h index 9b46fe24432b..07841be4199a 100644 --- a/editor/libeditor/html/nsHTMLEditor.h +++ b/editor/libeditor/html/nsHTMLEditor.h @@ -565,7 +565,6 @@ protected: nsIDOMNode **aTargetNode, int32_t *aTargetOffset, bool *aDoContinue); - nsresult GetAttributeToModifyOnNode(nsIDOMNode *aNode, nsAString &aAttrib); bool IsInLink(nsIDOMNode *aNode, nsCOMPtr *outLink = nullptr); nsresult StripFormattingNodes(nsIDOMNode *aNode, bool aOnlyList = false); From 70433dc16fcbb3c9abef1a6c5dca3f792f3a97b7 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Wed, 17 Apr 2013 00:56:00 -0400 Subject: [PATCH 094/438] Bug 855866: Fire toplevel-window-ready after usePrivateBrowsing is initialized, but still before the document starts loading; r=bzbarsky --- .../windowwatcher/src/nsWindowWatcher.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index e17b0544d522..678f508ce345 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -859,15 +859,6 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, } } - if (isNewToplevelWindow) { - // Notify observers that the window is open and ready. - // The window has not yet started to load a document. - nsCOMPtr obsSvc = - mozilla::services::GetObserverService(); - if (obsSvc) - obsSvc->NotifyObservers(*_retval, "toplevel-window-ready", nullptr); - } - // Now we have to set the right opener principal on the new window. Note // that we have to do this _before_ starting any URI loads, thanks to the // sync nature of javascript: loads. Since this is the only place where we @@ -934,6 +925,7 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, } } + nsCOMPtr loadInfo; if (uriToLoad && aNavigate) { // get the script principal and pass it to docshell JSContextAutoPopper contextGuard; @@ -949,7 +941,6 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, cx = contextGuard.get(); } - nsCOMPtr loadInfo; newDocShell->CreateLoadInfo(getter_AddRefs(loadInfo)); NS_ENSURE_TRUE(loadInfo, NS_ERROR_FAILURE); @@ -983,7 +974,18 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, } } } + } + if (isNewToplevelWindow) { + // Notify observers that the window is open and ready. + // The window has not yet started to load a document. + nsCOMPtr obsSvc = + mozilla::services::GetObserverService(); + if (obsSvc) + obsSvc->NotifyObservers(*_retval, "toplevel-window-ready", nullptr); + } + + if (uriToLoad && aNavigate) { newDocShell->LoadURI(uriToLoad, loadInfo, windowIsNew From 75fefce3e146e0b1102507927fe3daea1679bfc7 Mon Sep 17 00:00:00 2001 From: Catalin Iacob Date: Mon, 15 Apr 2013 16:14:43 -0700 Subject: [PATCH 095/438] Bug 847790 - Make nsTreeContentView::mRows an nsTArray >. r=bz. --HG-- extra : rebase_source : 47255c0d85c68f638f4310126b94b27b69289f47 --- layout/xul/tree/nsTreeContentView.cpp | 34 +++++++++++++-------------- layout/xul/tree/nsTreeContentView.h | 9 +++---- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/layout/xul/tree/nsTreeContentView.cpp b/layout/xul/tree/nsTreeContentView.cpp index ec9bdfa23051..491c3ae06953 100644 --- a/layout/xul/tree/nsTreeContentView.cpp +++ b/layout/xul/tree/nsTreeContentView.cpp @@ -1034,7 +1034,7 @@ nsTreeContentView::NodeWillBeDestroyed(const nsINode* aNode) // Recursively serialize content, starting with aContent. void nsTreeContentView::Serialize(nsIContent* aContent, int32_t aParentIndex, - int32_t* aIndex, nsTArray& aRows) + int32_t* aIndex, nsTArray >& aRows) { // Don't allow non-XUL nodes. if (!aContent->IsXUL()) @@ -1058,7 +1058,7 @@ nsTreeContentView::Serialize(nsIContent* aContent, int32_t aParentIndex, void nsTreeContentView::SerializeItem(nsIContent* aContent, int32_t aParentIndex, - int32_t* aIndex, nsTArray& aRows) + int32_t* aIndex, nsTArray >& aRows) { if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true, eCaseMatters)) @@ -1094,7 +1094,7 @@ nsTreeContentView::SerializeItem(nsIContent* aContent, int32_t aParentIndex, void nsTreeContentView::SerializeSeparator(nsIContent* aContent, int32_t aParentIndex, int32_t* aIndex, - nsTArray& aRows) + nsTArray >& aRows) { if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true, eCaseMatters)) @@ -1158,10 +1158,15 @@ nsTreeContentView::EnsureSubtree(int32_t aIndex) return 0; } - nsAutoTArray rows; + nsAutoTArray, 8> rows; int32_t index = 0; Serialize(child, aIndex, &index, rows); - mRows.InsertElementsAt(aIndex + 1, rows); + // We can't use InsertElementsAt since the destination can't steal + // ownership from its const source argument. + for (nsTArray::index_type i = 0; i < rows.Length(); i++) { + nsAutoPtr* newRow = mRows.InsertElementAt(aIndex + i + 1); + *newRow = rows[i]; + } int32_t count = rows.Length(); row->mSubtreeSize += count; @@ -1180,9 +1185,6 @@ nsTreeContentView::RemoveSubtree(int32_t aIndex) Row* row = mRows[aIndex]; int32_t count = row->mSubtreeSize; - for (int32_t i = 0; i < count; i++) { - delete mRows[aIndex + i + 1]; - } mRows.RemoveElementsAt(aIndex + 1, count); row->mSubtreeSize -= count; @@ -1232,7 +1234,7 @@ nsTreeContentView::InsertRowFor(nsIContent* aParent, nsIContent* aChild) int32_t nsTreeContentView::InsertRow(int32_t aParentIndex, int32_t aIndex, nsIContent* aContent) { - nsAutoTArray rows; + nsAutoTArray, 8> rows; nsIAtom *tag = aContent->Tag(); if (aContent->IsXUL()) { if (tag == nsGkAtoms::treeitem) @@ -1241,7 +1243,12 @@ nsTreeContentView::InsertRow(int32_t aParentIndex, int32_t aIndex, nsIContent* a SerializeSeparator(aContent, aParentIndex, &aIndex, rows); } - mRows.InsertElementsAt(aParentIndex + aIndex + 1, rows); + // We can't use InsertElementsAt since the destination can't steal + // ownership from its const source argument. + for (nsTArray::index_type i = 0; i < rows.Length(); i++) { + nsAutoPtr* newRow = mRows.InsertElementAt(aParentIndex + aIndex + i + 1); + *newRow = rows[i]; + } int32_t count = rows.Length(); UpdateSubtreeSizes(aParentIndex, count); @@ -1260,10 +1267,6 @@ nsTreeContentView::RemoveRow(int32_t aIndex) int32_t count = row->mSubtreeSize + 1; int32_t parentIndex = row->mParentIndex; - delete row; - for(int32_t i = 1; i < count; i++) { - delete mRows[aIndex + i]; - } mRows.RemoveElementsAt(aIndex, count); UpdateSubtreeSizes(parentIndex, -count); @@ -1276,9 +1279,6 @@ nsTreeContentView::RemoveRow(int32_t aIndex) void nsTreeContentView::ClearRows() { - for (uint32_t i = 0; i < mRows.Length(); i++) { - delete mRows[i]; - } mRows.Clear(); mRoot = nullptr; mBody = nullptr; diff --git a/layout/xul/tree/nsTreeContentView.h b/layout/xul/tree/nsTreeContentView.h index 5137c226fa2c..70b7139565eb 100644 --- a/layout/xul/tree/nsTreeContentView.h +++ b/layout/xul/tree/nsTreeContentView.h @@ -6,6 +6,7 @@ #ifndef nsTreeContentView_h__ #define nsTreeContentView_h__ +#include "nsAutoPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsTArray.h" #include "nsStubDocumentObserver.h" @@ -52,13 +53,13 @@ class nsTreeContentView MOZ_FINAL : public nsINativeTreeView, protected: // Recursive methods which deal with serializing of nested content. void Serialize(nsIContent* aContent, int32_t aParentIndex, int32_t* aIndex, - nsTArray& aRows); + nsTArray >& aRows); void SerializeItem(nsIContent* aContent, int32_t aParentIndex, - int32_t* aIndex, nsTArray& aRows); + int32_t* aIndex, nsTArray >& aRows); void SerializeSeparator(nsIContent* aContent, int32_t aParentIndex, - int32_t* aIndex, nsTArray& aRows); + int32_t* aIndex, nsTArray >& aRows); void GetIndexInSubtree(nsIContent* aContainer, nsIContent* aContent, int32_t* aResult); @@ -94,7 +95,7 @@ class nsTreeContentView MOZ_FINAL : public nsINativeTreeView, nsCOMPtr mRoot; nsCOMPtr mBody; nsIDocument* mDocument; // WEAK - nsTArray mRows; + nsTArray > mRows; }; #endif // nsTreeContentView_h__ From f75d29a2263bff07ff066ce6610676ea815a49c4 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Wed, 17 Apr 2013 17:10:50 +1200 Subject: [PATCH 096/438] Bug 862236, check we have a compositable before using it as a mask layer. r=mattwoodrow --- gfx/layers/composite/CompositableHost.cpp | 6 ++++++ gfx/layers/composite/LayerManagerComposite.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gfx/layers/composite/CompositableHost.cpp b/gfx/layers/composite/CompositableHost.cpp index 6b126ae523d1..b469da8e8f44 100644 --- a/gfx/layers/composite/CompositableHost.cpp +++ b/gfx/layers/composite/CompositableHost.cpp @@ -34,6 +34,12 @@ CompositableHost::AddMaskEffect(EffectChain& aEffects, bool aIs3D) { RefPtr source = GetTextureHost(); + + if (!source) { + NS_WARNING("Using compositable with no texture host as mask layer"); + return false; + } + RefPtr effect = new EffectMask(source, source->GetSize(), aTransform); diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 2ee0614f4581..427ad3b5f61e 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -608,6 +608,11 @@ LayerManagerComposite::AddMaskEffect(Layer* aMaskLayer, EffectChain& aEffects, b return false; } LayerComposite* maskLayerComposite = static_cast(aMaskLayer->ImplData()); + if (!maskLayerComposite->GetCompositableHost()) { + NS_WARNING("Mask layer with no compositable host"); + return false; + } + gfx::Matrix4x4 transform; ToMatrix4x4(aMaskLayer->GetEffectiveTransform(), transform); return maskLayerComposite->GetCompositableHost()->AddMaskEffect(aEffects, transform, aIs3D); From ea35bb30d8c49fae03508b559946916142ca8668 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 27 Mar 2013 14:32:51 +1300 Subject: [PATCH 097/438] Bug 834835. Part 1: Add initial AudioStreamTrack/VideoStreamTrack/MediaStreamTrack interfaces and implementations. r=jesup --HG-- extra : rebase_source : 7d9ec16301f7ba12fb181e0b37fdcaf8455b97e4 --- content/media/AudioStreamTrack.cpp | 20 ++++++++++ content/media/AudioStreamTrack.h | 30 ++++++++++++++ content/media/Makefile.in | 11 ++++-- content/media/MediaStreamTrack.cpp | 51 ++++++++++++++++++++++++ content/media/MediaStreamTrack.h | 63 ++++++++++++++++++++++++++++++ content/media/VideoStreamTrack.cpp | 20 ++++++++++ content/media/VideoStreamTrack.h | 30 ++++++++++++++ content/media/moz.build | 6 +++ dom/bindings/Bindings.conf | 20 +++++++--- dom/webidl/AudioStreamTrack.webidl | 16 ++++++++ dom/webidl/MediaStreamTrack.webidl | 33 ++++++++++++++++ dom/webidl/VideoStreamTrack.webidl | 19 +++++++++ dom/webidl/WebIDL.mk | 3 ++ 13 files changed, 313 insertions(+), 9 deletions(-) create mode 100644 content/media/AudioStreamTrack.cpp create mode 100644 content/media/AudioStreamTrack.h create mode 100644 content/media/MediaStreamTrack.cpp create mode 100644 content/media/MediaStreamTrack.h create mode 100644 content/media/VideoStreamTrack.cpp create mode 100644 content/media/VideoStreamTrack.h create mode 100644 dom/webidl/AudioStreamTrack.webidl create mode 100644 dom/webidl/MediaStreamTrack.webidl create mode 100644 dom/webidl/VideoStreamTrack.webidl diff --git a/content/media/AudioStreamTrack.cpp b/content/media/AudioStreamTrack.cpp new file mode 100644 index 000000000000..1aa07d5f2506 --- /dev/null +++ b/content/media/AudioStreamTrack.cpp @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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 "AudioStreamTrack.h" + +#include "mozilla/dom/AudioStreamTrackBinding.h" + +namespace mozilla { +namespace dom { + +JSObject* +AudioStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope) +{ + return AudioStreamTrackBinding::Wrap(aCx, aScope, this); +} + +} +} diff --git a/content/media/AudioStreamTrack.h b/content/media/AudioStreamTrack.h new file mode 100644 index 000000000000..db99bcd92621 --- /dev/null +++ b/content/media/AudioStreamTrack.h @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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/. */ + +#ifndef AUDIOSTREAMTRACK_H_ +#define AUDIOSTREAMTRACK_H_ + +#include "MediaStreamTrack.h" + +namespace mozilla { +namespace dom { + +class AudioStreamTrack : public MediaStreamTrack { +public: + AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID) + : MediaStreamTrack(aStream, aTrackID) {} + + virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope); + + virtual AudioStreamTrack* AsAudioStreamTrack() { return this; } + + // WebIDL + virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("audio"); } +}; + +} +} + +#endif /* AUDIOSTREAMTRACK_H_ */ diff --git a/content/media/Makefile.in b/content/media/Makefile.in index 71e88e1dae73..763b1fc28e1a 100644 --- a/content/media/Makefile.in +++ b/content/media/Makefile.in @@ -16,24 +16,27 @@ FAIL_ON_WARNINGS := 1 endif # !_MSC_VER CPPSRCS = \ + AudioAvailableEventManager.cpp \ AudioChannelFormat.cpp \ AudioNodeEngine.cpp \ AudioNodeStream.cpp \ AudioSegment.cpp \ AudioStream.cpp \ + AudioStreamTrack.cpp \ DecoderTraits.cpp \ DOMMediaStream.cpp \ FileBlockCache.cpp \ - MediaResource.cpp \ - MediaStreamGraph.cpp \ - AudioAvailableEventManager.cpp \ + MediaCache.cpp \ MediaDecoder.cpp \ MediaDecoderStateMachine.cpp \ MediaDecoderReader.cpp \ - MediaCache.cpp \ + MediaResource.cpp \ + MediaStreamGraph.cpp \ + MediaStreamTrack.cpp \ StreamBuffer.cpp \ VideoFrameContainer.cpp \ VideoSegment.cpp \ + VideoStreamTrack.cpp \ VideoUtils.cpp \ $(NULL) diff --git a/content/media/MediaStreamTrack.cpp b/content/media/MediaStreamTrack.cpp new file mode 100644 index 000000000000..01b108f3bc40 --- /dev/null +++ b/content/media/MediaStreamTrack.cpp @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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 "MediaStreamTrack.h" + +#include "DOMMediaStream.h" +#include "nsIUUIDGenerator.h" +#include "nsServiceManagerUtils.h" + +namespace mozilla { +namespace dom { + +MediaStreamTrack::MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID) + : mStream(aStream), mTrackID(aTrackID), mEnded(false) +{ + SetIsDOMBinding(); + + memset(&mID, 0, sizeof(mID)); + + nsresult rv; + nsCOMPtr uuidgen = + do_GetService("@mozilla.org/uuid-generator;1", &rv); + if (uuidgen) { + uuidgen->GenerateUUIDInPlace(&mID); + } +} + +MediaStreamTrack::~MediaStreamTrack() +{ +} + +NS_IMPL_CYCLE_COLLECTION_INHERITED_1(MediaStreamTrack, nsDOMEventTargetHelper, + mStream) + +NS_IMPL_ADDREF_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper) +NS_IMPL_RELEASE_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MediaStreamTrack) +NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper) + +void +MediaStreamTrack::GetId(nsAString& aID) +{ + char chars[NSID_LENGTH]; + mID.ToProvidedString(chars); + aID = NS_ConvertASCIItoUTF16(chars); +} + +} +} diff --git a/content/media/MediaStreamTrack.h b/content/media/MediaStreamTrack.h new file mode 100644 index 000000000000..61416a988c74 --- /dev/null +++ b/content/media/MediaStreamTrack.h @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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/. */ + +#ifndef MEDIASTREAMTRACK_H_ +#define MEDIASTREAMTRACK_H_ + +#include "nsDOMEventTargetHelper.h" +#include "nsID.h" +#include "StreamBuffer.h" + +namespace mozilla { + +class DOMMediaStream; + +namespace dom { + +class AudioStreamTrack; +class VideoStreamTrack; + +/** + * Class representing a track in a DOMMediaStream. + */ +class MediaStreamTrack : public nsDOMEventTargetHelper { +public: + /** + * aTrackID is the MediaStreamGraph track ID for the track in the + * MediaStream owned by aStream. + */ + MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID); + virtual ~MediaStreamTrack(); + + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper) + + DOMMediaStream* GetParentObject() const { return mStream; } + virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) = 0; + + DOMMediaStream* GetStream() const { return mStream; } + TrackID GetTrackID() const { return mTrackID; } + virtual AudioStreamTrack* AsAudioStreamTrack() { return nullptr; } + virtual VideoStreamTrack* AsVideoStreamTrack() { return nullptr; } + + // WebIDL + virtual void GetKind(nsAString& aKind) = 0; + void GetId(nsAString& aID); + void GetLabel(nsAString& aLabel) { aLabel.Truncate(); } + + // Notifications from the MediaStreamGraph + void NotifyEnded() { mEnded = true; } + +protected: + nsRefPtr mStream; + TrackID mTrackID; + nsID mID; + bool mEnded; +}; + +} +} + +#endif /* MEDIASTREAMTRACK_H_ */ diff --git a/content/media/VideoStreamTrack.cpp b/content/media/VideoStreamTrack.cpp new file mode 100644 index 000000000000..bacbad1045a1 --- /dev/null +++ b/content/media/VideoStreamTrack.cpp @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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 "VideoStreamTrack.h" + +#include "mozilla/dom/VideoStreamTrackBinding.h" + +namespace mozilla { +namespace dom { + +JSObject* +VideoStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope) +{ + return VideoStreamTrackBinding::Wrap(aCx, aScope, this); +} + +} +} diff --git a/content/media/VideoStreamTrack.h b/content/media/VideoStreamTrack.h new file mode 100644 index 000000000000..9fcd4acad1dd --- /dev/null +++ b/content/media/VideoStreamTrack.h @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/ +/* 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/. */ + +#ifndef VIDEOSTREAMTRACK_H_ +#define VIDEOSTREAMTRACK_H_ + +#include "MediaStreamTrack.h" + +namespace mozilla { +namespace dom { + +class VideoStreamTrack : public MediaStreamTrack { +public: + VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID) + : MediaStreamTrack(aStream, aTrackID) {} + + virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope); + + virtual VideoStreamTrack* AsVideoStreamTrack() { return this; } + + // WebIDL + virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("video"); } +}; + +} +} + +#endif /* VIDEOSTREAMTRACK_H_ */ diff --git a/content/media/moz.build b/content/media/moz.build index 5f256159bd2a..464766e849de 100644 --- a/content/media/moz.build +++ b/content/media/moz.build @@ -74,3 +74,9 @@ EXPORTS += [ 'VorbisUtils.h', ] +EXPORTS.mozilla.dom += [ + 'AudioStreamTrack.h', + 'MediaStreamTrack.h', + 'VideoStreamTrack.h', +] + diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index a7b2ae1a6d2d..447ae15f5418 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -126,6 +126,9 @@ DOMInterfaces = { 'nativeType': 'nsDOMBeforeUnloadEvent', }, +'AudioStreamTrack': { +}, + 'BiquadFilterNode': { 'resultNotAddRefed': [ 'frequency', 'q', 'gain' ], }, @@ -553,6 +556,11 @@ DOMInterfaces = { 'workers': True, }], +'LocalMediaStream': { + 'headerFile': 'DOMMediaStream.h', + 'nativeType': 'mozilla::DOMLocalMediaStream' +}, + 'Location': { # NOTE: Before you turn on codegen for Location, make sure all the # Unforgeable stuff is dealt with. @@ -571,11 +579,6 @@ DOMInterfaces = { 'skipGen': True }], -'LocalMediaStream': { - 'headerFile': 'DOMMediaStream.h', - 'nativeType': 'mozilla::DOMLocalMediaStream' -}, - 'MediaStreamList': { 'headerFile': 'MediaStreamList.h', 'wrapperCache': False, @@ -584,6 +587,10 @@ DOMInterfaces = { 'binaryNames': { '__indexedGetter': 'IndexedGetter' } }, +'MediaStreamTrack': { + 'concrete': False +}, + 'MessageEvent': { 'nativeType': 'nsDOMMessageEvent', }, @@ -1022,6 +1029,9 @@ DOMInterfaces = { 'workers': True, }], +'VideoStreamTrack': { +}, + 'WebGLActiveInfo': { 'nativeType': 'mozilla::WebGLActiveInfo', 'headerFile': 'WebGLContext.h', diff --git a/dom/webidl/AudioStreamTrack.webidl b/dom/webidl/AudioStreamTrack.webidl new file mode 100644 index 000000000000..9fff71cedc36 --- /dev/null +++ b/dom/webidl/AudioStreamTrack.webidl @@ -0,0 +1,16 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. + * + * The origin of this IDL file is + * http://dev.w3.org/2011/webrtc/editor/getusermedia.html + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +// [Constructor(optional MediaTrackConstraints audioConstraints)] +interface AudioStreamTrack : MediaStreamTrack { +// static sequence getSourceIds (); +}; diff --git a/dom/webidl/MediaStreamTrack.webidl b/dom/webidl/MediaStreamTrack.webidl new file mode 100644 index 000000000000..3daaa3827681 --- /dev/null +++ b/dom/webidl/MediaStreamTrack.webidl @@ -0,0 +1,33 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. + * + * The origin of this IDL file is + * http://dev.w3.org/2011/webrtc/editor/getusermedia.html + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +interface MediaStreamTrack { + readonly attribute DOMString kind; + readonly attribute DOMString id; + readonly attribute DOMString label; +// attribute boolean enabled; +// readonly attribute MediaStreamTrackState readyState; +// readonly attribute SourceTypeEnum sourceType; +// readonly attribute DOMString sourceId; +// attribute EventHandler onstarted; +// attribute EventHandler onmute; +// attribute EventHandler onunmute; +// attribute EventHandler onended; +// any getConstraint (DOMString constraintName, optional boolean mandatory = false); +// void setConstraint (DOMString constraintName, any constraintValue, optional boolean mandatory = false); +// MediaTrackConstraints? constraints (); +// void applyConstraints (MediaTrackConstraints constraints); +// void prependConstraint (DOMString constraintName, any constraintValue); +// void appendConstraint (DOMString constraintName, any constraintValue); +// attribute EventHandler onoverconstrained; +// void stop (); +}; diff --git a/dom/webidl/VideoStreamTrack.webidl b/dom/webidl/VideoStreamTrack.webidl new file mode 100644 index 000000000000..b194d5c9fae1 --- /dev/null +++ b/dom/webidl/VideoStreamTrack.webidl @@ -0,0 +1,19 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. + * + * The origin of this IDL file is + * http://dev.w3.org/2011/webrtc/editor/getusermedia.html + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +// [Constructor(optional MediaTrackConstraints videoConstraints)] +interface VideoStreamTrack : MediaStreamTrack { +// static sequence getSourceIds (); +// void takePhoto (); +// attribute EventHandler onphoto; +// attribute EventHandler onphotoerror; +}; diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk index e3be80f1894f..ff086114c60e 100644 --- a/dom/webidl/WebIDL.mk +++ b/dom/webidl/WebIDL.mk @@ -20,6 +20,7 @@ webidl_files = \ AudioListener.webidl \ AudioNode.webidl \ AudioParam.webidl \ + AudioStreamTrack.webidl \ Attr.webidl \ BatteryManager.webidl \ BeforeUnloadEvent.webidl \ @@ -154,6 +155,7 @@ webidl_files = \ Location.webidl \ MediaError.webidl \ MediaStream.webidl \ + MediaStreamTrack.webidl \ MessageEvent.webidl \ MouseEvent.webidl \ MouseScrollEvent.webidl \ @@ -298,6 +300,7 @@ webidl_files = \ UndoManager.webidl \ URLUtils.webidl \ USSDReceivedEvent.webidl \ + VideoStreamTrack.webidl \ XMLDocument.webidl \ XMLHttpRequest.webidl \ XMLHttpRequestEventTarget.webidl \ From 34a16c0fbe1056d24cdc12577e9d1ed542792854 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 17 Apr 2013 17:18:24 +1200 Subject: [PATCH 098/438] Bug 834835. Part 2: Make DOMMediaStream maintain a list of MediaStreamTrack objects. r=jesup We use a MediaStreamListener to watch the MediaStream and maintain the list of MediaStreamTrack objects. --HG-- extra : rebase_source : 325a4069f97f716a76ff73a4edb0677e62283631 --- content/media/DOMMediaStream.cpp | 135 ++++++++++++++++++++++++++++++- content/media/DOMMediaStream.h | 22 ++++- 2 files changed, 150 insertions(+), 7 deletions(-) diff --git a/content/media/DOMMediaStream.cpp b/content/media/DOMMediaStream.cpp index fe5bb77c0415..64cf365d4b4e 100644 --- a/content/media/DOMMediaStream.cpp +++ b/content/media/DOMMediaStream.cpp @@ -9,8 +9,11 @@ #include "mozilla/dom/MediaStreamBinding.h" #include "mozilla/dom/LocalMediaStreamBinding.h" #include "MediaStreamGraph.h" +#include "AudioStreamTrack.h" +#include "VideoStreamTrack.h" using namespace mozilla; +using namespace mozilla::dom; NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMMediaStream) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY @@ -20,13 +23,95 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMMediaStream) NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMMediaStream) -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMMediaStream, mWindow) +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(DOMMediaStream, mWindow, mTracks) NS_IMPL_ISUPPORTS_INHERITED1(DOMLocalMediaStream, DOMMediaStream, nsIDOMLocalMediaStream) +class DOMMediaStream::StreamListener : public MediaStreamListener { +public: + StreamListener(DOMMediaStream* aStream) + : mStream(aStream) + {} + + // Main thread only + void Forget() { mStream = nullptr; } + DOMMediaStream* GetStream() { return mStream; } + + class TrackChange : public nsRunnable { + public: + TrackChange(StreamListener* aListener, + TrackID aID, TrackTicks aTrackOffset, + uint32_t aEvents, MediaSegment::Type aType) + : mListener(aListener), mID(aID), mEvents(aEvents), mType(aType) + { + } + + NS_IMETHOD Run() + { + NS_ASSERTION(NS_IsMainThread(), "main thread only"); + + DOMMediaStream* stream = mListener->GetStream(); + if (!stream) { + return NS_OK; + } + + nsRefPtr track; + if (mEvents & MediaStreamListener::TRACK_EVENT_CREATED) { + track = stream->CreateDOMTrack(mID, mType); + } else { + track = stream->GetDOMTrackFor(mID); + } + if (mEvents & MediaStreamListener::TRACK_EVENT_ENDED) { + track->NotifyEnded(); + } + return NS_OK; + } + + StreamTime mEndTime; + nsRefPtr mListener; + TrackID mID; + uint32_t mEvents; + MediaSegment::Type mType; + }; + + /** + * Notify that changes to one of the stream tracks have been queued. + * aTrackEvents can be any combination of TRACK_EVENT_CREATED and + * TRACK_EVENT_ENDED. aQueuedMedia is the data being added to the track + * at aTrackOffset (relative to the start of the stream). + * aQueuedMedia can be null if there is no output. + */ + virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + TrackRate aTrackRate, + TrackTicks aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia) + { + if (aTrackEvents & (TRACK_EVENT_CREATED | TRACK_EVENT_ENDED)) { + nsRefPtr runnable = + new TrackChange(this, aID, aTrackOffset, aTrackEvents, + aQueuedMedia.GetType()); + NS_DispatchToMainThread(runnable); + } + } + +private: + // These fields may only be accessed on the main thread + DOMMediaStream* mStream; +}; + +DOMMediaStream::DOMMediaStream() + : mStream(nullptr), mHintContents(0) +{ + SetIsDOMBinding(); +} + DOMMediaStream::~DOMMediaStream() { + if (mListener) { + mListener->Forget(); + } if (mStream) { mStream->Destroy(); } @@ -56,7 +141,7 @@ DOMMediaStream::InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents) mWindow = aWindow; SetHintContents(aHintContents); MediaStreamGraph* gm = MediaStreamGraph::GetInstance(); - mStream = gm->CreateSourceStream(this); + InitStreamCommon(gm->CreateSourceStream(this)); } void @@ -65,7 +150,17 @@ DOMMediaStream::InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintConten mWindow = aWindow; SetHintContents(aHintContents); MediaStreamGraph* gm = MediaStreamGraph::GetInstance(); - mStream = gm->CreateTrackUnionStream(this); + InitStreamCommon(gm->CreateTrackUnionStream(this)); +} + +void +DOMMediaStream::InitStreamCommon(MediaStream* aStream) +{ + mStream = aStream; + + // Setup track listener + mListener = new StreamListener(this); + aStream->AddListener(mListener); } already_AddRefed @@ -90,6 +185,40 @@ DOMMediaStream::CombineWithPrincipal(nsIPrincipal* aPrincipal) return nsContentUtils::CombineResourcePrincipals(&mPrincipal, aPrincipal); } +MediaStreamTrack* +DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType) +{ + MediaStreamTrack* track; + switch (aType) { + case MediaSegment::AUDIO: + track = new AudioStreamTrack(this, aTrackID); + break; + case MediaSegment::VIDEO: + track = new VideoStreamTrack(this, aTrackID); + break; + default: + MOZ_NOT_REACHED("Unhandled track type"); + return nullptr; + } + + mTracks.AppendElement(track); + return track; +} + +MediaStreamTrack* +DOMMediaStream::GetDOMTrackFor(TrackID aTrackID) +{ + for (uint32_t i = 0; i < mTracks.Length(); ++i) { + MediaStreamTrack* t = mTracks[i]; + // We may add streams to our track list that are actually owned by + // a different DOMMediaStream. Ignore those. + if (t->GetTrackID() == aTrackID && t->GetStream() == this) { + return t; + } + } + return nullptr; +} + DOMLocalMediaStream::~DOMLocalMediaStream() { if (mStream) { diff --git a/content/media/DOMMediaStream.h b/content/media/DOMMediaStream.h index ce2946cea31c..f9e65ff3c2d4 100644 --- a/content/media/DOMMediaStream.h +++ b/content/media/DOMMediaStream.h @@ -11,6 +11,7 @@ #include "nsIPrincipal.h" #include "nsWrapperCache.h" #include "nsIDOMWindow.h" +#include "StreamBuffer.h" class nsXPCClassInfo; @@ -30,6 +31,10 @@ namespace mozilla { class MediaStream; +namespace dom { +class MediaStreamTrack; +} + /** * DOM wrapper for MediaStreams. */ @@ -37,12 +42,10 @@ class DOMMediaStream : public nsIDOMMediaStream, public nsWrapperCache { friend class DOMLocalMediaStream; + typedef dom::MediaStreamTrack MediaStreamTrack; public: - DOMMediaStream() : mStream(nullptr), mHintContents(0) - { - SetIsDOMBinding(); - } + DOMMediaStream(); virtual ~DOMMediaStream(); NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMMediaStream) @@ -92,9 +95,17 @@ public: static already_AddRefed CreateTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents = 0); + // Notifications from StreamListener + MediaStreamTrack* CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType); + MediaStreamTrack* GetDOMTrackFor(TrackID aTrackID); + protected: void InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents); void InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents); + void InitStreamCommon(MediaStream* aStream); + + class StreamListener; + friend class StreamListener; // We need this to track our parent object. nsCOMPtr mWindow; @@ -106,6 +117,9 @@ protected: // If null, this stream can be used by anyone because it has no content yet. nsCOMPtr mPrincipal; + nsAutoTArray,2> mTracks; + nsRefPtr mListener; + // tells the SDP generator about whether this // MediaStream probably has audio and/or video uint32_t mHintContents; From f4fd38f1e77ea7563fe4dbd0756a8e000e1aeeaa Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 17 Apr 2013 17:18:37 +1200 Subject: [PATCH 099/438] Bug 834835. Part 3: Implement DOMMediaStream::GetAudio/VideoTracks. r=jesup --HG-- extra : rebase_source : 6e4ab9c849320ee3a3a1b516bf143f528957e57f --- content/media/DOMMediaStream.cpp | 22 ++++++++++++++++++++++ content/media/DOMMediaStream.h | 8 ++++++++ dom/webidl/MediaStream.webidl | 4 ++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/content/media/DOMMediaStream.cpp b/content/media/DOMMediaStream.cpp index 64cf365d4b4e..c69c1ce2dc6b 100644 --- a/content/media/DOMMediaStream.cpp +++ b/content/media/DOMMediaStream.cpp @@ -129,6 +129,28 @@ DOMMediaStream::CurrentTime() return mStream ? MediaTimeToSeconds(mStream->GetCurrentTime()) : 0.0; } +void +DOMMediaStream::GetAudioTracks(nsTArray >& aTracks) +{ + for (uint32_t i = 0; i < mTracks.Length(); ++i) { + AudioStreamTrack* t = mTracks[i]->AsAudioStreamTrack(); + if (t) { + aTracks.AppendElement(t); + } + } +} + +void +DOMMediaStream::GetVideoTracks(nsTArray >& aTracks) +{ + for (uint32_t i = 0; i < mTracks.Length(); ++i) { + VideoStreamTrack* t = mTracks[i]->AsVideoStreamTrack(); + if (t) { + aTracks.AppendElement(t); + } + } +} + bool DOMMediaStream::IsFinished() { diff --git a/content/media/DOMMediaStream.h b/content/media/DOMMediaStream.h index f9e65ff3c2d4..868481fb590d 100644 --- a/content/media/DOMMediaStream.h +++ b/content/media/DOMMediaStream.h @@ -33,6 +33,8 @@ class MediaStream; namespace dom { class MediaStreamTrack; +class AudioStreamTrack; +class VideoStreamTrack; } /** @@ -43,6 +45,8 @@ class DOMMediaStream : public nsIDOMMediaStream, { friend class DOMLocalMediaStream; typedef dom::MediaStreamTrack MediaStreamTrack; + typedef dom::AudioStreamTrack AudioStreamTrack; + typedef dom::VideoStreamTrack VideoStreamTrack; public: DOMMediaStream(); @@ -57,7 +61,11 @@ public: } virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) MOZ_OVERRIDE; + // WebIDL double CurrentTime(); + void GetAudioTracks(nsTArray >& aTracks); + void GetVideoTracks(nsTArray >& aTracks); + MediaStream* GetStream() { return mStream; } bool IsFinished(); /** diff --git a/dom/webidl/MediaStream.webidl b/dom/webidl/MediaStream.webidl index 632bbf569ea7..7c1cc6df8cdd 100644 --- a/dom/webidl/MediaStream.webidl +++ b/dom/webidl/MediaStream.webidl @@ -12,8 +12,8 @@ interface MediaStream { // readonly attribute DOMString id; - // sequence getAudioTracks (); - // sequence getVideoTracks (); + sequence getAudioTracks (); + sequence getVideoTracks (); // MediaStreamTrack getTrackById (DOMString trackId); // void addTrack (MediaStreamTrack track); // void removeTrack (MediaStreamTrack track); From b12da7ca94d161ea820e41fafe9a56dd46cce582 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 17 Apr 2013 17:18:53 +1200 Subject: [PATCH 100/438] Bug 834835. Part 4: Test basic MediaStreamTrack functionality. r=jesup --HG-- extra : rebase_source : 5fe7024af9ad4669f6fbdbc8149f8de00a75f13a --- content/media/test/Makefile.in | 1 + content/media/test/manifest.js | 13 ++--- content/media/test/test_mozHasAudio.html | 4 +- content/media/test/test_streams_tracks.html | 54 +++++++++++++++++++++ 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 content/media/test/test_streams_tracks.html diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index dbf727d81bf1..df2849053cba 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -135,6 +135,7 @@ MOCHITEST_FILES = \ test_streams_srcObject.html \ test_reset_src.html \ test_streams_gc.html \ + test_streams_tracks.html \ test_streams_autoplay.html \ $(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \ $(NULL) diff --git a/content/media/test/manifest.js b/content/media/test/manifest.js index e6cf4d88364b..205bebd7c87a 100644 --- a/content/media/test/manifest.js +++ b/content/media/test/manifest.js @@ -62,12 +62,13 @@ var gPausedAfterEndedTests = gSmallTests.concat([ { name:"small-shot.ogg", type:"video/ogg", duration:0.276 } ]); -// Test the mozHasAudio property -var gMozHasAudioTests = [ - { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:undefined }, - { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false }, - { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true }, - { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false }, +// Test the mozHasAudio property, and APIs that detect different kinds of +// tracks +var gTrackTests = [ + { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:true, hasVideo:false }, + { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false, hasVideo:true }, + { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true, hasVideo:true }, + { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false, hasVideo:true }, { name:"bogus.duh", type:"bogus/duh" } ]; diff --git a/content/media/test/test_mozHasAudio.html b/content/media/test/test_mozHasAudio.html index fff84baaad44..2a0bb341fbec 100644 --- a/content/media/test/test_mozHasAudio.html +++ b/content/media/test/test_mozHasAudio.html @@ -27,13 +27,13 @@ function startTest(test, token) { element.src = test.name; element.name = test.name; - element.hasAudio = test.hasAudio; + element.hasAudio = elemType == "video" ? test.hasAudio : undefined; element.addEventListener("loadedmetadata", onloadedmetadata, false); element.load(); } -manager.runTests(gMozHasAudioTests, startTest); +manager.runTests(gTrackTests, startTest); diff --git a/content/media/test/test_streams_tracks.html b/content/media/test/test_streams_tracks.html new file mode 100644 index 000000000000..3ece1d4f26ba --- /dev/null +++ b/content/media/test/test_streams_tracks.html @@ -0,0 +1,54 @@ + + + + Test MediaStreamTrack interfaces + + + + + +
+
+
+ + From 84a5ab4471fa1dde81b135130189dc7de5ca75ba Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 16 Apr 2013 19:23:07 -0400 Subject: [PATCH 101/438] Bug 857765: Log errors thrown by user-defined PeerConnection callbacks r=msucan --- dom/media/PeerConnection.js | 227 ++++++++---------- dom/media/tests/mochitest/Makefile.in | 1 + .../test_peerConnection_throwInCallbacks.html | 83 +++++++ 3 files changed, 188 insertions(+), 123 deletions(-) create mode 100644 dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 7862d28dc1fb..476f066d55a5 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -727,14 +727,12 @@ PeerConnection.prototype = { } }; -// This is a separate object because we don't want to expose it to DOM. -function PeerConnectionObserver(dompc) { - this._dompc = dompc; +function RTCError(code, message) { + this.name = this.reasonName[Math.min(code, this.reasonName.length - 1)]; + this.message = (typeof message === "string")? message : this.name; + this.__exposedProps__ = { name: "rw", message: "rw" }; } -PeerConnectionObserver.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.IPeerConnectionObserver, - Ci.nsISupportsWeakReference]), - +RTCError.prototype = { // These strings must match those defined in the WebRTC spec. reasonName: [ "NO_ERROR", // Should never happen -- only used for testing @@ -747,69 +745,106 @@ PeerConnectionObserver.prototype = { "INCOMPATIBLE_CONSTRAINTS", "INCOMPATIBLE_MEDIASTREAMTRACK", "INTERNAL_ERROR" - ], + ] +}; - callErrorCallback: function(callback, code, message) { - if (code > Ci.IPeerConnection.kMaxErrorType) { - code = Ci.IPeerConnection.kInternalError; - } - - if (typeof message !== "string") { - message = this.reasonName[code]; - } +// This is a separate object because we don't want to expose it to DOM. +function PeerConnectionObserver(dompc) { + this._dompc = dompc; +} +PeerConnectionObserver.prototype = { + QueryInterface: XPCOMUtils.generateQI([Ci.IPeerConnectionObserver, + Ci.nsISupportsWeakReference]), + callCB: function(callback, arg) { if (callback) { try { - callback.onCallback({ - name: this.reasonName[code], message: message, - __exposedProps__: { name: "rw", message: "rw" } - }); - } catch(e) {} + callback.onCallback(arg); + } catch(e) { + // A content script (user-provided) callback threw an error. We don't + // want this to take down peerconnection, but we still want the user + // to see it, so we catch it, report it, and move on. + // + // We do stack parsing in two different places for different reasons: + + var msg; + if (e.result == Cr.NS_ERROR_XPC_JS_THREW_JS_OBJECT) { + // TODO(jib@mozilla.com): Revisit once bug 862153 is fixed. + // + // The actual content script frame is unavailable due to bug 862153, + // so users see file and line # into this file, which is not helpful. + // + // 1) Fix up the error message itself to differentiate between the + // 22 places we call callCB() in this file, using plain JS stack. + // + // Tweak the existing NS_ERROR_XPC_JS_THREW_JS_OBJECT message: + // -'Error: x' when calling method: [RTCPeerConCallback::onCallback] + // +'Error: x' when calling method: [RTCPeerConCallback::onCreateOfferError] + + let caller = Error().stack.split("\n")[1].split("@")[0]; + // caller ~= "PeerConnectionObserver.prototype.onCreateOfferError" + + msg = e.message.replace("::onCallback", "::" + caller.split(".")[2]); + } else { + msg = e.message; + } + + // Log error message to web console and window.onerror, if present. + // + // 2) nsIScriptError doesn't understand the nsIStackFrame format, so + // do the translation by extracting file and line from XPCOM stack: + // + // e.location ~= "JS frame :: file://.js :: RTCPCCb::onCallback :: line 1" + + let stack = e.location.toString().split(" :: "); + let file = stack[1]; + let line = parseInt(stack[3].split(" ")[1]); + + let scriptError = Cc["@mozilla.org/scripterror;1"]. + createInstance(Ci.nsIScriptError); + scriptError.initWithWindowID(msg, file, null, line, 0, + Ci.nsIScriptError.exceptionFlag, + "content javascript", + this._dompc._winID); + Cc["@mozilla.org/consoleservice;1"]. + getService(Ci.nsIConsoleService).logMessage(scriptError); + + // Call onerror directly if present (necessary for testing) + if (typeof this._dompc._win.onerror === "function") { + this._dompc._win.onerror(msg, file, line); + } + } } }, onCreateOfferSuccess: function(offer) { - if (this._dompc._onCreateOfferSuccess) { - try { - this._dompc._onCreateOfferSuccess.onCallback({ - type: "offer", sdp: offer, - __exposedProps__: { type: "rw", sdp: "rw" } - }); - } catch(e) {} - } + this.callCB(this._dompc._onCreateOfferSuccess, + { type: "offer", sdp: offer, + __exposedProps__: { type: "rw", sdp: "rw" } }); this._dompc._executeNext(); }, onCreateOfferError: function(code, message) { - this.callErrorCallback (this._dompc._onCreateOfferFailure, code, message); + this.callCB(this._dompc._onCreateOfferFailure, new RTCError(code, message)); this._dompc._executeNext(); }, onCreateAnswerSuccess: function(answer) { - if (this._dompc._onCreateAnswerSuccess) { - try { - this._dompc._onCreateAnswerSuccess.onCallback({ - type: "answer", sdp: answer, - __exposedProps__: { type: "rw", sdp: "rw" } - }); - } catch(e) {} - } + this.callCB (this._dompc._onCreateAnswerSuccess, + { type: "answer", sdp: answer, + __exposedProps__: { type: "rw", sdp: "rw" } }); this._dompc._executeNext(); }, onCreateAnswerError: function(code, message) { - this.callErrorCallback (this._dompc._onCreateAnswerFailure, code, message); + this.callCB(this._dompc._onCreateAnswerFailure, new RTCError(code, message)); this._dompc._executeNext(); }, onSetLocalDescriptionSuccess: function() { this._dompc._localType = this._dompc._pendingType; this._dompc._pendingType = null; - if (this._dompc._onSetLocalDescriptionSuccess) { - try { - this._dompc._onSetLocalDescriptionSuccess.onCallback(); - } catch(e) {} - } + this.callCB(this._dompc._onSetLocalDescriptionSuccess); // Until we support generating trickle ICE candidates, // we go ahead and trigger a call of onicecandidate here. @@ -825,39 +860,33 @@ PeerConnectionObserver.prototype = { onSetRemoteDescriptionSuccess: function() { this._dompc._remoteType = this._dompc._pendingType; this._dompc._pendingType = null; - if (this._dompc._onSetRemoteDescriptionSuccess) { - try { - this._dompc._onSetRemoteDescriptionSuccess.onCallback(); - } catch(e) {} - } + this.callCB(this._dompc._onSetRemoteDescriptionSuccess); this._dompc._executeNext(); }, onSetLocalDescriptionError: function(code, message) { this._dompc._pendingType = null; - this.callErrorCallback (this._dompc._onSetLocalDescriptionFailure, code, - message); + this.callCB(this._dompc._onSetLocalDescriptionFailure, + new RTCError(code, message)); this._dompc._executeNext(); }, onSetRemoteDescriptionError: function(code, message) { this._dompc._pendingType = null; - this.callErrorCallback (this._dompc._onSetRemoteDescriptionFailure, code, - message); + this.callCB(this._dompc._onSetRemoteDescriptionFailure, + new RTCError(code, message)); this._dompc._executeNext(); }, onAddIceCandidateSuccess: function() { this._dompc._pendingType = null; - if (this._dompc._onAddIceCandidateSuccess) { - this._dompc._onAddIceCandidateSuccess.onCallback(); - } + this.callCB(this._dompc._onAddIceCandidateSuccess); this._dompc._executeNext(); }, onAddIceCandidateError: function(code, message) { this._dompc._pendingType = null; - this.callErrorCallback (this._dompc._onAddIceCandidateError, code, message); + this.callCB(this._dompc._onAddIceCandidateError, new RTCError(code, message)); this._dompc._executeNext(); }, @@ -866,42 +895,24 @@ PeerConnectionObserver.prototype = { return; } - let self = this; - let iceCb = function() {}; - let iceGatherCb = function() {}; - if (this._dompc.onicechange) { - iceCb = function(args) { - try { - self._dompc.onicechange(args); - } catch(e) {} - }; - } - if (this._dompc.ongatheringchange) { - iceGatherCb = function(args) { - try { - self._dompc.ongatheringchange(args); - } catch(e) {} - }; - } - switch (this._dompc._pc.iceState) { case Ci.IPeerConnection.kIceGathering: - iceGatherCb("gathering"); + this.callCB(this._dompc.ongatheringchange, "gathering"); break; case Ci.IPeerConnection.kIceWaiting: - iceCb("starting"); + this.callCB(this._dompc.onicechange, "starting"); this._dompc._executeNext(); break; case Ci.IPeerConnection.kIceChecking: - iceCb("checking"); + this.callCB(this._dompc.onicechange, "checking"); break; case Ci.IPeerConnection.kIceConnected: // ICE gathering complete. - iceCb("connected"); - iceGatherCb("complete"); + this.callCB(this._dompc.onicechange, "connected"); + this.callCB(this._dompc.ongatheringchange, "complete"); break; case Ci.IPeerConnection.kIceFailed: - iceCb("failed"); + this.callCB(this._dompc.onicechange, "failed"); break; default: // Unknown state! @@ -910,63 +921,33 @@ PeerConnectionObserver.prototype = { }, onAddStream: function(stream, type) { - if (this._dompc.onaddstream) { - try { - this._dompc.onaddstream.onCallback({ - stream: stream, type: type, - __exposedProps__: { stream: "r", type: "r" } - }); - } catch(e) {} - } + this.callCB(this._dompc.onaddstream, + { stream: stream, type: type, + __exposedProps__: { stream: "r", type: "r" } }); }, onRemoveStream: function(stream, type) { - if (this._dompc.onremovestream) { - try { - this._dompc.onremovestream.onCallback({ - stream: stream, type: type, - __exposedProps__: { stream: "r", type: "r" } - }); - } catch(e) {} - } + this.callCB(this._dompc.onremovestream, + { stream: stream, type: type, + __exposedProps__: { stream: "r", type: "r" } }); }, foundIceCandidate: function(cand) { - if (this._dompc.onicecandidate) { - try { - this._dompc.onicecandidate.onCallback({ - candidate: cand, - __exposedProps__: { candidate: "rw" } - }); - } catch(e) {} - } + this.callCB(this._dompc.onicecandidate, + {candidate: cand, __exposedProps__: { candidate: "rw" } }); }, notifyDataChannel: function(channel) { - if (this._dompc.ondatachannel) { - try { - this._dompc.ondatachannel.onCallback({ - channel: channel, - __exposedProps__: { channel: "r" } - }); - } catch(e) {} - } + this.callCB(this._dompc.ondatachannel, + { channel: channel, __exposedProps__: { channel: "r" } }); }, notifyConnection: function() { - if (this._dompc.onconnection) { - try { - this._dompc.onconnection.onCallback(); - } catch(e) {} - } + this.callCB (this._dompc.onconnection); }, notifyClosedConnection: function() { - if (this._dompc.onclosedconnection) { - try { - this._dompc.onclosedconnection.onCallback(); - } catch(e) {} - } + this.callCB (this._dompc.onclosedconnection); } }; diff --git a/dom/media/tests/mochitest/Makefile.in b/dom/media/tests/mochitest/Makefile.in index 76ab887273d1..ab6454c64853 100644 --- a/dom/media/tests/mochitest/Makefile.in +++ b/dom/media/tests/mochitest/Makefile.in @@ -33,6 +33,7 @@ MOCHITEST_FILES = \ test_peerConnection_offerRequiresReceiveAudio.html \ test_peerConnection_offerRequiresReceiveVideo.html \ test_peerConnection_offerRequiresReceiveVideoAudio.html \ + test_peerConnection_throwInCallbacks.html \ test_peerConnection_bug822674.html \ test_peerConnection_bug825703.html \ test_peerConnection_bug827843.html \ diff --git a/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html b/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html new file mode 100644 index 000000000000..dcc22e55dfff --- /dev/null +++ b/dom/media/tests/mochitest/test_peerConnection_throwInCallbacks.html @@ -0,0 +1,83 @@ + + + + + + + + + +
+
+
+ + From 345660552aa4a0af67f29a2bd3f1329d4bf17817 Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Wed, 17 Apr 2013 00:42:10 -0700 Subject: [PATCH 102/438] Bug 862053 - Use getBoundingClientRect instead of offsetParents, r=mdas --- testing/marionette/marionette-listener.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/testing/marionette/marionette-listener.js b/testing/marionette/marionette-listener.js index c5b61a380234..8181478a3ed8 100644 --- a/testing/marionette/marionette-listener.js +++ b/testing/marionette/marionette-listener.js @@ -719,19 +719,11 @@ function coordinates(target, x0, y0, x1, y1) { * This function returns if the element is in viewport */ function elementInViewport(el) { - let top = el.offsetTop; - let left = el.offsetLeft; - let width = el.offsetWidth; - let height = el.offsetHeight; - while(el.offsetParent) { - el = el.offsetParent; - top += el.offsetTop; - left += el.offsetLeft; - } - return (top >= curWindow.pageYOffset && - left >= curWindow.pageXOffset && - (top + height) <= (curWindow.pageYOffset + curWindow.innerHeight) && - (left + width) <= (curWindow.pageXOffset + curWindow.innerWidth) + let rect = el.getBoundingClientRect(); + return (rect.top >= curWindow.pageYOffset && + rect.left >= curWindow.pageXOffset && + rect.bottom <= (curWindow.pageYOffset + curWindow.innerHeight) && + rect.right <= (curWindow.pageXOffset + curWindow.innerWidth) ); } From 66e6c6755e765a9649d748ed64324699b078eb84 Mon Sep 17 00:00:00 2001 From: Gabor Krizsanits Date: Wed, 17 Apr 2013 10:11:53 +0200 Subject: [PATCH 103/438] Bug 820170 - Wrapping nodes into documents compartment. r=bholley --- content/base/src/nsDocument.cpp | 7 ++++ content/xul/document/src/XULDocument.cpp | 29 +++++++++++++- dom/base/nsDOMClassInfo.cpp | 39 +++++-------------- .../tests/unit/test_allowedDomainsXHR.js | 39 ++++++++++++++----- 4 files changed, 73 insertions(+), 41 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 9e5e77800733..f0e2f999e31d 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1852,6 +1852,13 @@ nsDocument::Init() mRadioGroups.Init(); mCustomPrototypes.Init(); + // If after creation the owner js global is not set for a document + // we use the default compartment for this document, instead of creating + // wrapper in some random compartment when the document is exposed to js + // via some events. + mScopeObject = do_GetWeakReference(xpc::GetNativeForGlobal(xpc::GetJunkScope())); + MOZ_ASSERT(mScopeObject); + // Force initialization. nsINode::nsSlots* slots = Slots(); diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp index 14dcfdc6ac0b..3ef4668d898b 100644 --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -1517,6 +1517,29 @@ XULDocument::GetHeight(ErrorResult& aRv) return height; } +JSObject* +GetScopeObjectOfNode(nsIDOMNode* node) +{ + MOZ_ASSERT(node, "Must not be called with null."); + + // Window root occasionally keeps alive a node of a document whose + // window is already dead. If in this brief period someone calls + // GetPopupNode and we return that node, nsNodeSH::PreCreate will throw, + // because it will not know which scope this node belongs to. Returning + // an orphan node like that to JS would be a bug anyway, so to avoid + // this, let's do the same check as nsNodeSH::PreCreate does to + // determine the scope and if it fails let's just return null in + // XULDocument::GetPopupNode. + nsCOMPtr inode = do_QueryInterface(node); + MOZ_ASSERT(inode, "How can this happen?"); + + nsIDocument* doc = inode->OwnerDoc(); + MOZ_ASSERT(inode, "This should never happen."); + + nsIGlobalObject* global = doc->GetScopeObject(); + return global ? global->GetGlobalJSObject() : nullptr; +} + //---------------------------------------------------------------------- // // nsIDOMXULDocument interface @@ -1539,8 +1562,10 @@ XULDocument::GetPopupNode(nsIDOMNode** aNode) } } - if (node && nsContentUtils::CanCallerAccess(node)) - node.swap(*aNode); + if (node && nsContentUtils::CanCallerAccess(node) + && GetScopeObjectOfNode(node)) { + node.swap(*aNode); + } return NS_OK; } diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 3a7a3c3cf3fb..ee9dfc7fa9d0 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -5550,18 +5550,6 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, // See http://bugzilla.mozilla.org/show_bug.cgi?id=227417 nsIDocument* doc = node->OwnerDoc(); - // If we have a document, make sure one of these is true - // (1) it has a script handling object, - // (2) has had one, or has been marked to have had one, - // (3) we are running a privileged script. - // Event handling is possible only if (1). If (2) event handling is prevented. - // If document has never had a script handling object, - // untrusted scripts (3) shouldn't touch it! - bool hasHadScriptHandlingObject = false; - NS_ENSURE_STATE(doc->GetScriptHandlingObject(hasHadScriptHandlingObject) || - hasHadScriptHandlingObject || - nsContentUtils::IsCallerChrome()); - nsINode *native_parent; bool nodeIsElement = node->IsElement(); @@ -5610,26 +5598,17 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, } } else { // We're called for a document object; set the parent to be the - // document's global object, if there is one + // document's global object - // Get the scope object from the document. - nsISupports *scope = doc->GetScopeObject(); + // Document should know its global but if the owner window of the + // document is already dead at this point, then just throw. + nsIGlobalObject* scope = doc->GetScopeObject(); + NS_ENSURE_TRUE(scope, NS_ERROR_UNEXPECTED); - if (scope) { - jsval v; - nsCOMPtr holder; - nsresult rv = WrapNative(cx, globalObj, scope, false, &v, - getter_AddRefs(holder)); - NS_ENSURE_SUCCESS(rv, rv); - - holder->GetJSObject(parentObj); - } - else { - // No global object reachable from this document, use the - // global object that was passed to this method. - - *parentObj = globalObj; - } + *parentObj = scope->GetGlobalJSObject(); + // Guarding against the case when the native global is still alive + // but the JS global is not. + NS_ENSURE_TRUE(*parentObj, NS_ERROR_UNEXPECTED); // No slim wrappers for a document's scope object. return node->ChromeOnlyAccess() ? diff --git a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js index 20e82224b766..183484737ab5 100644 --- a/js/xpconnect/tests/unit/test_allowedDomainsXHR.js +++ b/js/xpconnect/tests/unit/test_allowedDomainsXHR.js @@ -32,8 +32,17 @@ function checkResults(xhr) return true; } +var httpServersClosed = 0; +function finishIfDone() +{ + if (++httpServersClosed == 2) + do_test_finished(); +} + function run_test() { + do_test_pending(); + httpserver.registerPathHandler(testpath, serverHandler); httpserver.start(4444); @@ -45,14 +54,6 @@ function run_test() var res = cu.evalInSandbox('var sync = createXHR("4444/simple"); sync.send(null); sync', sb); checkResults(res); - // Test async XHR sending - var async = cu.evalInSandbox('var async = createXHR("4444/simple", true); async', sb); - async.addEventListener("readystatechange", function(event) { - if (checkResults(async)) - httpserver.stop(do_test_finished); - }, false); - async.send(null); - // negative test sync XHR sending (to ensure that the xhr do not have chrome caps, see bug 779821) try { cu.evalInSandbox('var createXHR = ' + createXHR.toString(), sb); @@ -61,8 +62,28 @@ function run_test() } catch (e) { do_check_true(true); } + + httpserver2.stop(finishIfDone); + + // Test async XHR sending + sb.finish = function(){ + httpserver.stop(finishIfDone); + } + + sb.checkResults = checkResults; - do_test_pending(); + sb.do_check_eq = do_check_eq; + + function changeListener(event) { + if (checkResults(async)) + finish(); + } + + var async = cu.evalInSandbox('var async = createXHR("4444/simple", true);' + + 'async.addEventListener("readystatechange", ' + + changeListener.toString() + ', false);' + + 'async', sb); + async.send(null); } function serverHandler(metadata, response) From 02ae98ba2fc8cd7a956a02114e6a2bb78d25152e Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Wed, 17 Apr 2013 09:22:55 +0100 Subject: [PATCH 104/438] Bug 862693 - Stop the :-moz-focusring pseudo-class from matching if an element is themed and the theme will display a visual indication of focus for the element. r=roc --- dom/base/nsFocusManager.cpp | 21 ++++++++++++++++++- dom/base/nsFocusManager.h | 2 ++ dom/base/nsGlobalWindow.cpp | 3 ++- .../mochitest/general/test_focusrings.xul | 3 ++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 2df8b97582cd..44ce2e474717 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1018,6 +1018,23 @@ nsFocusManager::FocusPlugin(nsIContent* aContent) return NS_OK; } +/* static */ bool +nsFocusManager::ThemeDisplaysFocusForContent(nsIContent* aContent) +{ + // We don't want to draw the focusring if the element is themed and + // the theme displays an indication of focus for the element. + nsIFrame* frame = aContent->GetPrimaryFrame(); + if (frame) { + nsPresContext *presContext = frame->PresContext(); + const nsStyleDisplay *disp = frame->StyleDisplay(); + if (frame->IsThemed(disp) && + presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, frame, disp->mAppearance)) { + return true; + } + } + return false; +} + /* static */ void nsFocusManager::NotifyFocusStateChange(nsIContent* aContent, @@ -1028,7 +1045,9 @@ nsFocusManager::NotifyFocusStateChange(nsIContent* aContent, return; } nsEventStates eventState = NS_EVENT_STATE_FOCUS; - if (aWindowShouldShowFocusRing) { + if (!aGettingFocus || + (aWindowShouldShowFocusRing && + !ThemeDisplaysFocusForContent(aContent))) { eventState |= NS_EVENT_STATE_FOCUSRING; } if (aGettingFocus) { diff --git a/dom/base/nsFocusManager.h b/dom/base/nsFocusManager.h index 4259de41a3f4..a4f5356e8ba5 100644 --- a/dom/base/nsFocusManager.h +++ b/dom/base/nsFocusManager.h @@ -116,6 +116,8 @@ public: static bool sMouseFocusesFormControl; + static bool ThemeDisplaysFocusForContent(nsIContent* aContent); + protected: nsFocusManager(); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 62f8e589752b..f925943d60e7 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8463,7 +8463,8 @@ nsGlobalWindow::SetKeyboardIndicators(UIStateChangeType aShowAccelerators, oldShouldShowFocusRing != newShouldShowFocusRing && mFocusedNode->IsElement()) { // Update mFocusedNode's state. - if (newShouldShowFocusRing) { + if (newShouldShowFocusRing && + !nsFocusManager::ThemeDisplaysFocusForContent(mFocusedNode.get())) { mFocusedNode->AsElement()->AddStates(NS_EVENT_STATE_FOCUSRING); } else { mFocusedNode->AsElement()->RemoveStates(NS_EVENT_STATE_FOCUSRING); diff --git a/dom/tests/mochitest/general/test_focusrings.xul b/dom/tests/mochitest/general/test_focusrings.xul index 3fe267b60c27..87e2250ee6b2 100644 --- a/dom/tests/mochitest/general/test_focusrings.xul +++ b/dom/tests/mochitest/general/test_focusrings.xul @@ -49,6 +49,7 @@ function runTest() var isMac = (navigator.platform.indexOf("Mac") >= 0); var isWin = (navigator.platform.indexOf("Win") >= 0); + var isLinux = (navigator.platform.indexOf("Linux") >= 0); function checkFocus(element, visible, testid) { @@ -100,7 +101,7 @@ function runTest() checkFocus($("l2"), true, "appearance on list after mouse focus with :focus"); synthesizeMouse($("b1"), 4, 4, { }); - checkFocus($("b1"), !isMac && expectedVisible, "appearance on button after mouse focus with :moz-focusring"); + checkFocus($("b1"), !isMac && !isLinux && expectedVisible, "appearance on button after mouse focus with :moz-focusring"); if (navigator.platform.indexOf("Mac") >= 0) { ok(compareSnapshots(snapShot($("b1")), snapShot($("b2")), false)[0], "focus after mouse shows no ring"); } From 0f64c0b43f8557ec558cb7316c8ae2b5bc511cf4 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Wed, 17 Apr 2013 09:24:46 +0100 Subject: [PATCH 105/438] Bug 851777 - Don't display a CSS focus ring on when OS X native theming is being used. r=roc --- widget/cocoa/nsNativeThemeCocoa.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 57e2b709d614..cba01e5a5bb8 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -3021,6 +3021,7 @@ nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFra aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD || aWidgetType == NS_THEME_BUTTON || aWidgetType == NS_THEME_RADIO || + aWidgetType == NS_THEME_RANGE || aWidgetType == NS_THEME_CHECKBOX) return true; From 67157be6780d39a2bddc254d7eacfb200ee95616 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Wed, 17 Apr 2013 04:29:35 -0400 Subject: [PATCH 106/438] bug 733712 - don't call atk_object_set_name() r=tbsaunde --- accessible/src/atk/AccessibleWrap.cpp | 44 +++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/accessible/src/atk/AccessibleWrap.cpp b/accessible/src/atk/AccessibleWrap.cpp index 916c739d0f9e..8048abca128a 100644 --- a/accessible/src/atk/AccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -141,6 +141,8 @@ struct MaiAtkObjectClass static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, }; +static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName); + G_BEGIN_DECLS /* callbacks for MaiAtkObject */ static void classInitCB(AtkObjectClass *aClass); @@ -600,16 +602,41 @@ getNameCB(AtkObject* aAtkObj) if (!accWrap) return nullptr; - nsAutoString uniName; - accWrap->Name(uniName); + nsAutoString name; + accWrap->Name(name); - NS_ConvertUTF8toUTF16 objName(aAtkObj->name); - if (!uniName.Equals(objName)) - atk_object_set_name(aAtkObj, NS_ConvertUTF16toUTF8(uniName).get()); + // XXX Firing an event from here does not seem right + MaybeFireNameChange(aAtkObj, name); return aAtkObj->name; } +static void +MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName) +{ + NS_ConvertUTF16toUTF8 newNameUTF8(aNewName); + if (aAtkObj->name && newNameUTF8.Equals(aAtkObj->name)) + return; + + // Below we duplicate the functionality of atk_object_set_name(), + // but without calling atk_object_get_name(). Instead of + // atk_object_get_name() we directly access aAtkObj->name. This is because + // atk_object_get_name() would call getNameCB() which would call + // MaybeFireNameChange() (or atk_object_set_name() before this problem was + // fixed) and we would get an infinite recursion. + // See http://bugzilla.mozilla.org/733712 + + // Do not notify for initial name setting. + // See bug http://bugzilla.gnome.org/665870 + bool notify = !!aAtkObj->name; + + free(aAtkObj->name); + aAtkObj->name = strdup(newNameUTF8.get()); + + if (notify) + g_object_notify(G_OBJECT(aAtkObj), "accessible-name"); +} + const gchar * getDescriptionCB(AtkObject *aAtkObj) { @@ -617,7 +644,7 @@ getDescriptionCB(AtkObject *aAtkObj) if (!accWrap || accWrap->IsDefunct()) return nullptr; - /* nsIAccessible is responsible for the non-nullptr description */ + /* nsIAccessible is responsible for the nonnull description */ nsAutoString uniDesc; accWrap->Description(uniDesc); @@ -975,9 +1002,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent) { nsAutoString newName; accessible->Name(newName); - NS_ConvertUTF16toUTF8 utf8Name(newName); - if (!atkObj->name || !utf8Name.Equals(atkObj->name)) - atk_object_set_name(atkObj, utf8Name.get()); + + MaybeFireNameChange(atkObj, newName); break; } From 25d88cbf1fbf961cd26c4e80df57276e6be7461e Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:44 +0200 Subject: [PATCH 107/438] Bug 858617: Add testcase, r=testcase --- js/src/jit-test/tests/ion/bug858617.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 js/src/jit-test/tests/ion/bug858617.js diff --git a/js/src/jit-test/tests/ion/bug858617.js b/js/src/jit-test/tests/ion/bug858617.js new file mode 100644 index 000000000000..b322e72bf464 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug858617.js @@ -0,0 +1,18 @@ +function TestCase(e, a) { + getTestCaseResult(e, a); +}; +function reportCompare (expected, actual) { + new TestCase(expected, actual); +} +function enterFunc() {} +function getTestCaseResult(expected, actual) { + return actual == expected; +} +reportCompare('', ''); +evaluate("\ +test();\ +function test() {\ + enterFunc();\ + reportCompare();\ +}\ +"); From f1e2a2c37b9085a8bdaf3baeffb5de016e7ec5f3 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:45 +0200 Subject: [PATCH 108/438] Bug 861165: IonMonkey: Correct behaviour for JSOP_IN on dense native with negative index, r=bhackett --- js/src/ion/CodeGenerator.cpp | 59 +++++++++++++++--- js/src/ion/IonBuilder.cpp | 2 +- js/src/ion/LIR-Common.h | 10 ++- js/src/ion/Lowering.cpp | 10 ++- js/src/ion/MIR.cpp | 6 ++ js/src/ion/MIR.h | 73 ++++++++++++++++++++-- js/src/ion/TypePolicy.cpp | 2 + js/src/ion/VMFunctions.cpp | 7 +++ js/src/ion/VMFunctions.h | 1 + js/src/jit-test/tests/ion/bug861165.js | 85 ++++++++++++++++++++++++++ 10 files changed, 237 insertions(+), 18 deletions(-) create mode 100644 js/src/jit-test/tests/ion/bug861165.js diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 5106493af101..fd71f60dd11e 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -5561,35 +5561,76 @@ CodeGenerator::visitIn(LIn *ins) return callVM(OperatorInInfo, ins); } +typedef bool (*OperatorInIFn)(JSContext *, uint32_t, HandleObject, JSBool *); +static const VMFunction OperatorInIInfo = FunctionInfo(OperatorInI); + bool CodeGenerator::visitInArray(LInArray *lir) { + const MInArray *mir = lir->mir(); Register elements = ToRegister(lir->elements()); Register initLength = ToRegister(lir->initLength()); Register output = ToRegister(lir->output()); // When the array is not packed we need to do a hole check in addition to the bounds check. - Label falseBranch, done; + Label falseBranch, done, trueBranch; + + OutOfLineCode *ool = NULL; + Label* failedInitLength = &falseBranch; + if (lir->index()->isConstant()) { - masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(ToInt32(lir->index())), &falseBranch); - if (lir->mir()->needsHoleCheck()) { - masm.branchTestMagic(Assembler::Equal, Address(elements, ToInt32(lir->index()) * sizeof(Value)), - &falseBranch); + int32_t index = ToInt32(lir->index()); + + JS_ASSERT_IF(index < 0, mir->needsNegativeIntCheck()); + if (mir->needsNegativeIntCheck()) { + ool = oolCallVM(OperatorInIInfo, lir, + (ArgList(), Imm32(index), ToRegister(lir->object())), + StoreRegisterTo(output)); + failedInitLength = ool->entry(); + } + + masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(index), failedInitLength); + if (mir->needsHoleCheck()) { + Address address = Address(elements, index * sizeof(Value)); + masm.branchTestMagic(Assembler::Equal, address, &falseBranch); } } else { - masm.branch32(Assembler::BelowOrEqual, initLength, ToRegister(lir->index()), &falseBranch); - if (lir->mir()->needsHoleCheck()) { - masm.branchTestMagic(Assembler::Equal, BaseIndex(elements, ToRegister(lir->index()), TimesEight), - &falseBranch); + Label negativeIntCheck; + Register index = ToRegister(lir->index()); + + if (mir->needsNegativeIntCheck()) + failedInitLength = &negativeIntCheck; + + masm.branch32(Assembler::BelowOrEqual, initLength, index, failedInitLength); + if (mir->needsHoleCheck()) { + BaseIndex address = BaseIndex(elements, ToRegister(lir->index()), TimesEight); + masm.branchTestMagic(Assembler::Equal, address, &falseBranch); + } + masm.jump(&trueBranch); + + if (mir->needsNegativeIntCheck()) { + masm.bind(&negativeIntCheck); + ool = oolCallVM(OperatorInIInfo, lir, + (ArgList(), index, ToRegister(lir->object())), + StoreRegisterTo(output)); + + masm.testl(index, index); + masm.j(Assembler::Signed, ool->entry()); + masm.jump(&falseBranch); } } + masm.bind(&trueBranch); masm.move32(Imm32(1), output); masm.jump(&done); masm.bind(&falseBranch); masm.move32(Imm32(0), output); masm.bind(&done); + + if (ool) + masm.bind(ool->rejoin()); + return true; } diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 8a4b4f8f8974..b3b43753e4be 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -7394,7 +7394,7 @@ IonBuilder::jsop_in_dense() current->add(initLength); // Check if id < initLength and elem[id] not a hole. - MInArray *ins = MInArray::New(elements, id, initLength, needsHoleCheck); + MInArray *ins = MInArray::New(elements, id, initLength, obj, needsHoleCheck); current->add(ins); current->push(ins); diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 5d6ef835e6bf..c37d3cd7dfe0 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -2718,15 +2718,18 @@ class LLoadElementV : public LInstructionHelper } }; -class LInArray : public LInstructionHelper<1, 3, 0> +class LInArray : public LInstructionHelper<1, 4, 0> { public: LIR_HEADER(InArray) - LInArray(const LAllocation &elements, const LAllocation &index, const LAllocation &initLength) { + LInArray(const LAllocation &elements, const LAllocation &index, + const LAllocation &initLength, const LAllocation &object) + { setOperand(0, elements); setOperand(1, index); setOperand(2, initLength); + setOperand(3, object); } const MInArray *mir() const { return mir_->toInArray(); @@ -2740,6 +2743,9 @@ class LInArray : public LInstructionHelper<1, 3, 0> const LAllocation *initLength() { return getOperand(2); } + const LAllocation *object() { + return getOperand(3); + } }; diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 75de254f6577..8a1c220d16f2 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1819,11 +1819,19 @@ LIRGenerator::visitInArray(MInArray *ins) JS_ASSERT(ins->elements()->type() == MIRType_Elements); JS_ASSERT(ins->index()->type() == MIRType_Int32); JS_ASSERT(ins->initLength()->type() == MIRType_Int32); + JS_ASSERT(ins->object()->type() == MIRType_Object); JS_ASSERT(ins->type() == MIRType_Boolean); + LAllocation object; + if (ins->needsNegativeIntCheck()) + object = useRegister(ins->object()); + else + object = LConstantIndex::Bogus(); + LInArray *lir = new LInArray(useRegister(ins->elements()), useRegisterOrConstant(ins->index()), - useRegister(ins->initLength())); + useRegister(ins->initLength()), + object); return define(lir, ins) && assignSafepoint(lir, ins); } diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 7b94d6c7419f..2914423b66b1 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -2007,6 +2007,12 @@ InlinePropertyTable::hasFunction(JSFunction *func) const return false; } +bool +MInArray::needsNegativeIntCheck() const +{ + return !index()->range() || index()->range()->lower() < 0; +} + MDefinition * MAsmJSUnsignedToDouble::foldsTo(bool useValueNumbers) { diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index faa0d1ed38fa..55e740c3c467 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1654,6 +1654,57 @@ class MTernaryInstruction : public MAryInstruction<3> } }; +class MQuaternaryInstruction : public MAryInstruction<4> +{ + protected: + MQuaternaryInstruction(MDefinition *first, MDefinition *second, + MDefinition *third, MDefinition *fourth) + { + setOperand(0, first); + setOperand(1, second); + setOperand(2, third); + setOperand(3, fourth); + } + + protected: + HashNumber valueHash() const + { + MDefinition *first = getOperand(0); + MDefinition *second = getOperand(1); + MDefinition *third = getOperand(2); + MDefinition *fourth = getOperand(3); + + return op() ^ first->valueNumber() ^ second->valueNumber() ^ + third->valueNumber() ^ fourth->valueNumber(); + } + + bool congruentTo(MDefinition *const &ins) const + { + if (op() != ins->op()) + return false; + + if (type() != ins->type()) + return false; + + if (isEffectful() || ins->isEffectful()) + return false; + + MDefinition *first = getOperand(0); + MDefinition *second = getOperand(1); + MDefinition *third = getOperand(2); + MDefinition *fourth = getOperand(3); + MDefinition *insFirst = ins->getOperand(0); + MDefinition *insSecond = ins->getOperand(1); + MDefinition *insThird = ins->getOperand(2); + MDefinition *insFourth = ins->getOperand(3); + + return first->valueNumber() == insFirst->valueNumber() && + second->valueNumber() == insSecond->valueNumber() && + third->valueNumber() == insThird->valueNumber() && + fourth->valueNumber() == insFourth->valueNumber(); + } +}; + class MCompare : public MBinaryInstruction, public ComparePolicy @@ -6295,12 +6346,15 @@ class MIn // Test whether the index is in the array bounds or a hole. class MInArray - : public MTernaryInstruction + : public MQuaternaryInstruction, + public ObjectPolicy<3> { bool needsHoleCheck_; - MInArray(MDefinition *elements, MDefinition *index, MDefinition *initLength, bool needsHoleCheck) - : MTernaryInstruction(elements, index, initLength), + MInArray(MDefinition *elements, MDefinition *index, + MDefinition *initLength, MDefinition *object, + bool needsHoleCheck) + : MQuaternaryInstruction(elements, index, initLength, object), needsHoleCheck_(needsHoleCheck) { setResultType(MIRType_Boolean); @@ -6314,8 +6368,10 @@ class MInArray INSTRUCTION_HEADER(InArray) static MInArray *New(MDefinition *elements, MDefinition *index, - MDefinition *initLength, bool needsHoleCheck) { - return new MInArray(elements, index, initLength, needsHoleCheck); + MDefinition *initLength, MDefinition *object, + bool needsHoleCheck) + { + return new MInArray(elements, index, initLength, object, needsHoleCheck); } MDefinition *elements() const { @@ -6327,12 +6383,19 @@ class MInArray MDefinition *initLength() const { return getOperand(2); } + MDefinition *object() const { + return getOperand(3); + } bool needsHoleCheck() const { return needsHoleCheck_; } + bool needsNegativeIntCheck() const; AliasSet getAliasSet() const { return AliasSet::Load(AliasSet::Element); } + TypePolicy *typePolicy() { + return this; + } }; // Implementation for instanceof operator with specific rhs. diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index ce60a3528c03..fc44e5d5f0c6 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -396,6 +396,8 @@ ObjectPolicy::staticAdjustInputs(MInstruction *ins) template bool ObjectPolicy<0>::staticAdjustInputs(MInstruction *ins); template bool ObjectPolicy<1>::staticAdjustInputs(MInstruction *ins); +template bool ObjectPolicy<2>::staticAdjustInputs(MInstruction *ins); +template bool ObjectPolicy<3>::staticAdjustInputs(MInstruction *ins); bool CallPolicy::adjustInputs(MInstruction *ins) diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index c9f2f8dda262..b1dd826206a0 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -507,6 +507,13 @@ OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out) return true; } +bool +OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out) +{ + RootedValue key(cx, Int32Value(index)); + return OperatorIn(cx, key, obj, out); +} + bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval) { diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index c7477ddd2b0f..13be91aea586 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -521,6 +521,7 @@ bool SPSEnter(JSContext *cx, HandleScript script); bool SPSExit(JSContext *cx, HandleScript script); bool OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out); +bool OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out); bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval); diff --git a/js/src/jit-test/tests/ion/bug861165.js b/js/src/jit-test/tests/ion/bug861165.js new file mode 100644 index 000000000000..924dcbaaef86 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug861165.js @@ -0,0 +1,85 @@ +// |jit-test| no-jm + +// IM has the following fastpaths: +// - constant index (constant) +// - need negative int check (neg) +// - needs hole check (hole) +// So to test everything we have to do: +// constant | neg | hole +// test 1: 0 0 0 +// test 2: 1 0 0 +// test 3: 0 1 0 +// test 4: 1 1 0 +// test 5: 0 0 1 +// test 6: 1 0 1 +// test 7: 0 1 1 +// test 8: 1 1 1 + +function test1(index, a) { + if (index < 0) + index = -index + return index in a; +} +assertEq(test1(1, [1,2]), true); + +function test2(a) { + return 0 in a; +} +assertEq(test2([1,2]), true); + +function test3(index, a) { + return index in a; +} + +var arr3 = []; +arr3["-1073741828"] = 17; +assertEq(test3(-1073741828, arr3), true); + +function test4(a) { + return -1073741828 in a; +} +assertEq(test4(arr3), true); + + +function test5(index, a) { + if (index < 0) + index = -index + return index in a; +} +var arr5 = []; +arr5[0] = 1 +arr5[1] = 1 +arr5[2] = 1 +arr5[4] = 1 +assertEq(test5(1, arr5), true); +assertEq(test5(3, arr5), false); + +function test7a(a) { + return 3 in a; +} +function test7b(a) { + return 4 in a; +} +assertEq(test7a(arr5), false); +assertEq(test7b(arr5), true); + +function test8(index, a) { + return index in a; +} +arr5["-1073741828"] = 17; +assertEq(test8(-1073741828, arr5), true); +assertEq(test8(3, arr5), false); +assertEq(test8(0, arr5), true); + +function test9a(a) { + return 0 in a; +} +function test9b(a) { + return 3 in a; +} +function test9c(a) { + return -1073741828 in a; +} +assertEq(test9a(arr5), true); +assertEq(test9b(arr5), false); +assertEq(test9c(arr5), true); From 1fe67d203cc03983b0be404fd09d80f039cb874e Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:48 +0200 Subject: [PATCH 109/438] Bug 862357: IonMonkey: Box undefined inputs in the compare policy, r=nbp --- js/src/ion/TypePolicy.cpp | 5 ++++- js/src/jit-test/tests/ion/bug862357.js | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/ion/bug862357.js diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index fc44e5d5f0c6..f26e28caecd9 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -178,8 +178,11 @@ ComparePolicy::adjustInputs(MInstruction *def) MInstruction *replace; // See BinaryArithPolicy::adjustInputs for an explanation of the following - if (in->type() == MIRType_Object || in->type() == MIRType_String) + if (in->type() == MIRType_Object || in->type() == MIRType_String || + in->type() == MIRType_Undefined) + { in = boxAt(def, in); + } switch (type) { case MIRType_Double: diff --git a/js/src/jit-test/tests/ion/bug862357.js b/js/src/jit-test/tests/ion/bug862357.js new file mode 100644 index 000000000000..df96dc83b08b --- /dev/null +++ b/js/src/jit-test/tests/ion/bug862357.js @@ -0,0 +1,21 @@ +// |jit-test| error: ReferenceError +function TestCase(e, a) + this.passed = (e == a); +function reportCompare (expected, actual) { + var expected_t = typeof expected; + var actual_t = typeof actual; + if (expected_t != actual_t) + printStatus(); + new TestCase(expected, actual); +} +var expect = ''; +reportCompare(expect, ''); +try { + test(); +} catch(exc1) {} +function test() { + var { expect } = ''; + for (var a = 1; a < 2; ++a) + reportCompare(expect, ''); +} +test(); From 88bf6beafab4cb3f1c664a0a42595d76e4f47b5d Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:50 +0200 Subject: [PATCH 110/438] Bug 862100: IonMonkey: AddTypeBarrier shouldn't unbox, when type is already double, r=nbp --- js/src/ion/IonBuilder.cpp | 18 +++++++++--------- js/src/jit-test/tests/ion/bug862100.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 js/src/jit-test/tests/ion/bug862100.js diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index b3b43753e4be..7cebe3ac3c62 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -3088,23 +3088,23 @@ IonBuilder::addTypeBarrier(uint32_t i, CallInfo &callinfo, types::StackTypeSet * // types should remain. JSValueType callerType = callerObs->getKnownTypeTag(); - if (callerType == JSVAL_TYPE_DOUBLE) { - MInstruction *bailType = MToInt32::New(ins); - current->add(bailType); - ins = bailType; - } else { + if (callerType != JSVAL_TYPE_DOUBLE && ins->type() != MIRType_Double) { // We expect either an Int or a Value, this variant is not // optimized and favor the int variant by filtering out all // other inputs. JS_ASSERT(callerType == JSVAL_TYPE_UNKNOWN); + JS_ASSERT(ins->type() == MIRType_Value); // Bail if the input is not a number. MInstruction *toDouble = MUnbox::New(ins, MIRType_Double, MUnbox::Fallible); - // Bail if the double does not fit in an int. - MInstruction *toInt = MToInt32::New(ins); current->add(toDouble); - current->add(toInt); - ins = toInt; + ins = toDouble; } + JS_ASSERT(ins->type() == MIRType_Double || + ins->type() == MIRType_Value); + // Bail if the double does not fit in an int. + MInstruction *toInt = MToInt32::New(ins); + current->add(toInt); + ins = toInt; needsBarrier = false; break; diff --git a/js/src/jit-test/tests/ion/bug862100.js b/js/src/jit-test/tests/ion/bug862100.js new file mode 100644 index 000000000000..d50b28abda83 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug862100.js @@ -0,0 +1,14 @@ + +function TestCase(n, d, e, a) {} +function reportCompare (expected, actual, description) { + new TestCase("", description, expected, actual); +} +new TestCase( "", "", 0, Number(new Number()) ); +reportCompare(true, true); +evaluate("\ +function TestCase(n, d, e, a) {}\ +test_negation(-2147483648, 2147483648);\ +test_negation(2147483647, -2147483647);\ +function test_negation(value, expected)\ + reportCompare(expected, '', '-(' + value + ') == ' + expected);\ +"); From 49a17fabe54dd3a9621d473f5c2e96bd1f48c262 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:53 +0200 Subject: [PATCH 111/438] Bug 861116: IonBuilder: Add support for JSOP_INITELEM, r=jandem --- js/src/ion/CodeGenerator.cpp | 27 ++++++++++++++++++----- js/src/ion/CodeGenerator.h | 1 + js/src/ion/IonBuilder.cpp | 16 ++++++++++++++ js/src/ion/IonBuilder.h | 1 + js/src/ion/LIR-Common.h | 20 +++++++++++++++++ js/src/ion/LOpcodes.h | 1 + js/src/ion/Lowering.cpp | 12 ++++++++++ js/src/ion/Lowering.h | 1 + js/src/ion/MIR.h | 33 ++++++++++++++++++++++++++++ js/src/ion/MOpcodes.h | 1 + js/src/ion/ParallelArrayAnalysis.cpp | 1 + js/src/ion/TypePolicy.h | 14 ++++++++++++ 12 files changed, 123 insertions(+), 5 deletions(-) diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index fd71f60dd11e..67bc9ef15aca 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -2648,11 +2648,6 @@ CodeGenerator::visitNewStringObject(LNewStringObject *lir) return true; } -typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, - HandlePropertyName name, HandleValue value); -static const VMFunction InitPropInfo = - FunctionInfo(InitProp); - bool CodeGenerator::visitParNew(LParNew *lir) { @@ -2747,6 +2742,28 @@ CodeGenerator::visitParBailout(LParBailout *lir) return true; } +typedef bool(*InitElemFn)(JSContext *cx, HandleObject obj, + HandleValue id, HandleValue value); +static const VMFunction InitElemInfo = + FunctionInfo(InitElemOperation); + +bool +CodeGenerator::visitInitElem(LInitElem *lir) +{ + Register objReg = ToRegister(lir->getObject()); + + pushArg(ToValue(lir, LInitElem::ValueIndex)); + pushArg(ToValue(lir, LInitElem::IdIndex)); + pushArg(objReg); + + return callVM(InitElemInfo, lir); +} + +typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, + HandlePropertyName name, HandleValue value); +static const VMFunction InitPropInfo = + FunctionInfo(InitProp); + bool CodeGenerator::visitInitProp(LInitProp *lir) { diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index 4130a3611ebc..b48e613a9490 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -116,6 +116,7 @@ class CodeGenerator : public CodeGeneratorSpecific bool visitParNew(LParNew *lir); bool visitParNewDenseArray(LParNewDenseArray *lir); bool visitParBailout(LParBailout *lir); + bool visitInitElem(LInitElem *lir); bool visitInitProp(LInitProp *lir); bool visitCreateThis(LCreateThis *lir); bool visitCreateThisWithProto(LCreateThisWithProto *lir); diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 7cebe3ac3c62..f4e080bdd360 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -952,6 +952,9 @@ IonBuilder::inspectOpcode(JSOp op) return jsop_newobject(baseObj); } + case JSOP_INITELEM: + return jsop_initelem(); + case JSOP_INITELEM_ARRAY: return jsop_initelem_array(); @@ -4779,6 +4782,19 @@ IonBuilder::jsop_newobject(HandleObject baseObj) return resumeAfter(ins); } +bool +IonBuilder::jsop_initelem() +{ + MDefinition *value = current->pop(); + MDefinition *id = current->pop(); + MDefinition *obj = current->peek(-1); + + MInitElem *initElem = MInitElem::New(obj, id, value); + current->add(initElem); + + return resumeAfter(initElem); +} + bool IonBuilder::jsop_initelem_array() { diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 8f8f2a486734..91fdee673034 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -375,6 +375,7 @@ class IonBuilder : public MIRGenerator bool jsop_delprop(HandlePropertyName name); bool jsop_newarray(uint32_t count); bool jsop_newobject(HandleObject baseObj); + bool jsop_initelem(); bool jsop_initelem_array(); bool jsop_initprop(HandlePropertyName name); bool jsop_regexp(RegExpObject *reobj); diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index c37d3cd7dfe0..56eaa8d0d19a 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -478,6 +478,26 @@ class LParBailout : public LInstructionHelper<0, 0, 0> LIR_HEADER(ParBailout); }; +class LInitElem : public LCallInstructionHelper<0, 1 + 2*BOX_PIECES, 0> +{ + public: + LIR_HEADER(InitElem) + + LInitElem(const LAllocation &object) { + setOperand(0, object); + } + + static const size_t IdIndex = 1; + static const size_t ValueIndex = 1 + BOX_PIECES; + + const LAllocation *getObject() { + return getOperand(0); + } + MInitElem *mir() const { + return mir_->toInitElem(); + } +}; + // Takes in an Object and a Value. class LInitProp : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0> { diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index b7bf009b266c..88142926f1c5 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -32,6 +32,7 @@ _(ParNewDenseArray) \ _(ParNewCallObject) \ _(ParBailout) \ + _(InitElem) \ _(InitProp) \ _(CheckOverRecursed) \ _(ParCheckOverRecursed) \ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 8a1c220d16f2..f36d0984a4d1 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -237,6 +237,18 @@ LIRGenerator::visitParBailout(MParBailout *ins) return add(lir, ins); } +bool +LIRGenerator::visitInitElem(MInitElem *ins) +{ + LInitElem *lir = new LInitElem(useRegisterAtStart(ins->getObject())); + if (!useBoxAtStart(lir, LInitElem::IdIndex, ins->getId())) + return false; + if (!useBoxAtStart(lir, LInitElem::ValueIndex, ins->getValue())) + return false; + + return add(lir, ins) && assignSafepoint(lir, ins); +} + bool LIRGenerator::visitInitProp(MInitProp *ins) { diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index cc8cd249df8b..6e11bcdbf050 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -94,6 +94,7 @@ class LIRGenerator : public LIRGeneratorSpecific bool visitParNewCallObject(MParNewCallObject *ins); bool visitParNewDenseArray(MParNewDenseArray *ins); bool visitParBailout(MParBailout *ins); + bool visitInitElem(MInitElem *ins); bool visitInitProp(MInitProp *ins); bool visitCheckOverRecursed(MCheckOverRecursed *ins); bool visitParCheckOverRecursed(MParCheckOverRecursed *ins); diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 55e740c3c467..58437d641a54 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1243,6 +1243,39 @@ class MInitProp } }; +class MInitElem + : public MAryInstruction<3>, + public Mix3Policy, BoxPolicy<1>, BoxPolicy<2> > +{ + MInitElem(MDefinition *obj, MDefinition *id, MDefinition *value) + { + setOperand(0, obj); + setOperand(1, id); + setOperand(2, value); + setResultType(MIRType_None); + } + + public: + INSTRUCTION_HEADER(InitElem) + + static MInitElem *New(MDefinition *obj, MDefinition *id, MDefinition *value) { + return new MInitElem(obj, id, value); + } + + MDefinition *getObject() const { + return getOperand(0); + } + MDefinition *getId() const { + return getOperand(1); + } + MDefinition *getValue() const { + return getOperand(2); + } + TypePolicy *typePolicy() { + return this; + } +}; + // Designates the start of call frame construction. // Generates code to adjust the stack pointer for the argument vector. // Argc is inferred by checking the use chain during lowering. diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index a5123a627ccd..06630fd7ae24 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -81,6 +81,7 @@ namespace ion { _(NewDeclEnvObject) \ _(NewCallObject) \ _(NewStringObject) \ + _(InitElem) \ _(InitProp) \ _(Start) \ _(OsrEntry) \ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 364df7b0902d..3fe70a523437 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -172,6 +172,7 @@ class ParallelArrayVisitor : public MInstructionVisitor CUSTOM_OP(NewObject) CUSTOM_OP(NewCallObject) CUSTOM_OP(NewParallelArray) + UNSAFE_OP(InitElem) UNSAFE_OP(InitProp) SAFE_OP(Start) UNSAFE_OP(OsrEntry) diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 3f209e53c857..3dd5812581b9 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -186,6 +186,20 @@ class MixPolicy : public TypePolicy } }; +// Combine three policies. +template +class Mix3Policy : public TypePolicy +{ + public: + static bool staticAdjustInputs(MInstruction *ins) { + return Policy1::staticAdjustInputs(ins) && Policy2::staticAdjustInputs(ins) && + Policy3::staticAdjustInputs(ins); + } + virtual bool adjustInputs(MInstruction *ins) { + return staticAdjustInputs(ins); + } +}; + class CallSetElementPolicy : public SingleObjectPolicy { public: From 4489ff4345cbd0b5533e8d9ddd721945e0293049 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 12:03:17 +0200 Subject: [PATCH 112/438] Backout a0016de79bf9 and 862431c42e72 for breakage, r=red --- js/src/ion/CodeGenerator.cpp | 86 ++++---------------- js/src/ion/CodeGenerator.h | 1 - js/src/ion/IonBuilder.cpp | 18 +---- js/src/ion/IonBuilder.h | 1 - js/src/ion/LIR-Common.h | 30 +------ js/src/ion/LOpcodes.h | 1 - js/src/ion/Lowering.cpp | 22 +---- js/src/ion/Lowering.h | 1 - js/src/ion/MIR.cpp | 6 -- js/src/ion/MIR.h | 106 ++----------------------- js/src/ion/MOpcodes.h | 1 - js/src/ion/ParallelArrayAnalysis.cpp | 1 - js/src/ion/TypePolicy.cpp | 2 - js/src/ion/TypePolicy.h | 14 ---- js/src/ion/VMFunctions.cpp | 7 -- js/src/ion/VMFunctions.h | 1 - js/src/jit-test/tests/ion/bug861165.js | 85 -------------------- 17 files changed, 23 insertions(+), 360 deletions(-) delete mode 100644 js/src/jit-test/tests/ion/bug861165.js diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 67bc9ef15aca..5106493af101 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -2648,6 +2648,11 @@ CodeGenerator::visitNewStringObject(LNewStringObject *lir) return true; } +typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, + HandlePropertyName name, HandleValue value); +static const VMFunction InitPropInfo = + FunctionInfo(InitProp); + bool CodeGenerator::visitParNew(LParNew *lir) { @@ -2742,28 +2747,6 @@ CodeGenerator::visitParBailout(LParBailout *lir) return true; } -typedef bool(*InitElemFn)(JSContext *cx, HandleObject obj, - HandleValue id, HandleValue value); -static const VMFunction InitElemInfo = - FunctionInfo(InitElemOperation); - -bool -CodeGenerator::visitInitElem(LInitElem *lir) -{ - Register objReg = ToRegister(lir->getObject()); - - pushArg(ToValue(lir, LInitElem::ValueIndex)); - pushArg(ToValue(lir, LInitElem::IdIndex)); - pushArg(objReg); - - return callVM(InitElemInfo, lir); -} - -typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, - HandlePropertyName name, HandleValue value); -static const VMFunction InitPropInfo = - FunctionInfo(InitProp); - bool CodeGenerator::visitInitProp(LInitProp *lir) { @@ -5578,76 +5561,35 @@ CodeGenerator::visitIn(LIn *ins) return callVM(OperatorInInfo, ins); } -typedef bool (*OperatorInIFn)(JSContext *, uint32_t, HandleObject, JSBool *); -static const VMFunction OperatorInIInfo = FunctionInfo(OperatorInI); - bool CodeGenerator::visitInArray(LInArray *lir) { - const MInArray *mir = lir->mir(); Register elements = ToRegister(lir->elements()); Register initLength = ToRegister(lir->initLength()); Register output = ToRegister(lir->output()); // When the array is not packed we need to do a hole check in addition to the bounds check. - Label falseBranch, done, trueBranch; - - OutOfLineCode *ool = NULL; - Label* failedInitLength = &falseBranch; - + Label falseBranch, done; if (lir->index()->isConstant()) { - int32_t index = ToInt32(lir->index()); - - JS_ASSERT_IF(index < 0, mir->needsNegativeIntCheck()); - if (mir->needsNegativeIntCheck()) { - ool = oolCallVM(OperatorInIInfo, lir, - (ArgList(), Imm32(index), ToRegister(lir->object())), - StoreRegisterTo(output)); - failedInitLength = ool->entry(); - } - - masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(index), failedInitLength); - if (mir->needsHoleCheck()) { - Address address = Address(elements, index * sizeof(Value)); - masm.branchTestMagic(Assembler::Equal, address, &falseBranch); + masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(ToInt32(lir->index())), &falseBranch); + if (lir->mir()->needsHoleCheck()) { + masm.branchTestMagic(Assembler::Equal, Address(elements, ToInt32(lir->index()) * sizeof(Value)), + &falseBranch); } } else { - Label negativeIntCheck; - Register index = ToRegister(lir->index()); - - if (mir->needsNegativeIntCheck()) - failedInitLength = &negativeIntCheck; - - masm.branch32(Assembler::BelowOrEqual, initLength, index, failedInitLength); - if (mir->needsHoleCheck()) { - BaseIndex address = BaseIndex(elements, ToRegister(lir->index()), TimesEight); - masm.branchTestMagic(Assembler::Equal, address, &falseBranch); - } - masm.jump(&trueBranch); - - if (mir->needsNegativeIntCheck()) { - masm.bind(&negativeIntCheck); - ool = oolCallVM(OperatorInIInfo, lir, - (ArgList(), index, ToRegister(lir->object())), - StoreRegisterTo(output)); - - masm.testl(index, index); - masm.j(Assembler::Signed, ool->entry()); - masm.jump(&falseBranch); + masm.branch32(Assembler::BelowOrEqual, initLength, ToRegister(lir->index()), &falseBranch); + if (lir->mir()->needsHoleCheck()) { + masm.branchTestMagic(Assembler::Equal, BaseIndex(elements, ToRegister(lir->index()), TimesEight), + &falseBranch); } } - masm.bind(&trueBranch); masm.move32(Imm32(1), output); masm.jump(&done); masm.bind(&falseBranch); masm.move32(Imm32(0), output); masm.bind(&done); - - if (ool) - masm.bind(ool->rejoin()); - return true; } diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index b48e613a9490..4130a3611ebc 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -116,7 +116,6 @@ class CodeGenerator : public CodeGeneratorSpecific bool visitParNew(LParNew *lir); bool visitParNewDenseArray(LParNewDenseArray *lir); bool visitParBailout(LParBailout *lir); - bool visitInitElem(LInitElem *lir); bool visitInitProp(LInitProp *lir); bool visitCreateThis(LCreateThis *lir); bool visitCreateThisWithProto(LCreateThisWithProto *lir); diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index f4e080bdd360..0aa2d376f401 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -952,9 +952,6 @@ IonBuilder::inspectOpcode(JSOp op) return jsop_newobject(baseObj); } - case JSOP_INITELEM: - return jsop_initelem(); - case JSOP_INITELEM_ARRAY: return jsop_initelem_array(); @@ -4782,19 +4779,6 @@ IonBuilder::jsop_newobject(HandleObject baseObj) return resumeAfter(ins); } -bool -IonBuilder::jsop_initelem() -{ - MDefinition *value = current->pop(); - MDefinition *id = current->pop(); - MDefinition *obj = current->peek(-1); - - MInitElem *initElem = MInitElem::New(obj, id, value); - current->add(initElem); - - return resumeAfter(initElem); -} - bool IonBuilder::jsop_initelem_array() { @@ -7410,7 +7394,7 @@ IonBuilder::jsop_in_dense() current->add(initLength); // Check if id < initLength and elem[id] not a hole. - MInArray *ins = MInArray::New(elements, id, initLength, obj, needsHoleCheck); + MInArray *ins = MInArray::New(elements, id, initLength, needsHoleCheck); current->add(ins); current->push(ins); diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 91fdee673034..8f8f2a486734 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -375,7 +375,6 @@ class IonBuilder : public MIRGenerator bool jsop_delprop(HandlePropertyName name); bool jsop_newarray(uint32_t count); bool jsop_newobject(HandleObject baseObj); - bool jsop_initelem(); bool jsop_initelem_array(); bool jsop_initprop(HandlePropertyName name); bool jsop_regexp(RegExpObject *reobj); diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 56eaa8d0d19a..5d6ef835e6bf 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -478,26 +478,6 @@ class LParBailout : public LInstructionHelper<0, 0, 0> LIR_HEADER(ParBailout); }; -class LInitElem : public LCallInstructionHelper<0, 1 + 2*BOX_PIECES, 0> -{ - public: - LIR_HEADER(InitElem) - - LInitElem(const LAllocation &object) { - setOperand(0, object); - } - - static const size_t IdIndex = 1; - static const size_t ValueIndex = 1 + BOX_PIECES; - - const LAllocation *getObject() { - return getOperand(0); - } - MInitElem *mir() const { - return mir_->toInitElem(); - } -}; - // Takes in an Object and a Value. class LInitProp : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0> { @@ -2738,18 +2718,15 @@ class LLoadElementV : public LInstructionHelper } }; -class LInArray : public LInstructionHelper<1, 4, 0> +class LInArray : public LInstructionHelper<1, 3, 0> { public: LIR_HEADER(InArray) - LInArray(const LAllocation &elements, const LAllocation &index, - const LAllocation &initLength, const LAllocation &object) - { + LInArray(const LAllocation &elements, const LAllocation &index, const LAllocation &initLength) { setOperand(0, elements); setOperand(1, index); setOperand(2, initLength); - setOperand(3, object); } const MInArray *mir() const { return mir_->toInArray(); @@ -2763,9 +2740,6 @@ class LInArray : public LInstructionHelper<1, 4, 0> const LAllocation *initLength() { return getOperand(2); } - const LAllocation *object() { - return getOperand(3); - } }; diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index 88142926f1c5..b7bf009b266c 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -32,7 +32,6 @@ _(ParNewDenseArray) \ _(ParNewCallObject) \ _(ParBailout) \ - _(InitElem) \ _(InitProp) \ _(CheckOverRecursed) \ _(ParCheckOverRecursed) \ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index f36d0984a4d1..75de254f6577 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -237,18 +237,6 @@ LIRGenerator::visitParBailout(MParBailout *ins) return add(lir, ins); } -bool -LIRGenerator::visitInitElem(MInitElem *ins) -{ - LInitElem *lir = new LInitElem(useRegisterAtStart(ins->getObject())); - if (!useBoxAtStart(lir, LInitElem::IdIndex, ins->getId())) - return false; - if (!useBoxAtStart(lir, LInitElem::ValueIndex, ins->getValue())) - return false; - - return add(lir, ins) && assignSafepoint(lir, ins); -} - bool LIRGenerator::visitInitProp(MInitProp *ins) { @@ -1831,19 +1819,11 @@ LIRGenerator::visitInArray(MInArray *ins) JS_ASSERT(ins->elements()->type() == MIRType_Elements); JS_ASSERT(ins->index()->type() == MIRType_Int32); JS_ASSERT(ins->initLength()->type() == MIRType_Int32); - JS_ASSERT(ins->object()->type() == MIRType_Object); JS_ASSERT(ins->type() == MIRType_Boolean); - LAllocation object; - if (ins->needsNegativeIntCheck()) - object = useRegister(ins->object()); - else - object = LConstantIndex::Bogus(); - LInArray *lir = new LInArray(useRegister(ins->elements()), useRegisterOrConstant(ins->index()), - useRegister(ins->initLength()), - object); + useRegister(ins->initLength())); return define(lir, ins) && assignSafepoint(lir, ins); } diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index 6e11bcdbf050..cc8cd249df8b 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -94,7 +94,6 @@ class LIRGenerator : public LIRGeneratorSpecific bool visitParNewCallObject(MParNewCallObject *ins); bool visitParNewDenseArray(MParNewDenseArray *ins); bool visitParBailout(MParBailout *ins); - bool visitInitElem(MInitElem *ins); bool visitInitProp(MInitProp *ins); bool visitCheckOverRecursed(MCheckOverRecursed *ins); bool visitParCheckOverRecursed(MParCheckOverRecursed *ins); diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 2914423b66b1..7b94d6c7419f 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -2007,12 +2007,6 @@ InlinePropertyTable::hasFunction(JSFunction *func) const return false; } -bool -MInArray::needsNegativeIntCheck() const -{ - return !index()->range() || index()->range()->lower() < 0; -} - MDefinition * MAsmJSUnsignedToDouble::foldsTo(bool useValueNumbers) { diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 58437d641a54..faa0d1ed38fa 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1243,39 +1243,6 @@ class MInitProp } }; -class MInitElem - : public MAryInstruction<3>, - public Mix3Policy, BoxPolicy<1>, BoxPolicy<2> > -{ - MInitElem(MDefinition *obj, MDefinition *id, MDefinition *value) - { - setOperand(0, obj); - setOperand(1, id); - setOperand(2, value); - setResultType(MIRType_None); - } - - public: - INSTRUCTION_HEADER(InitElem) - - static MInitElem *New(MDefinition *obj, MDefinition *id, MDefinition *value) { - return new MInitElem(obj, id, value); - } - - MDefinition *getObject() const { - return getOperand(0); - } - MDefinition *getId() const { - return getOperand(1); - } - MDefinition *getValue() const { - return getOperand(2); - } - TypePolicy *typePolicy() { - return this; - } -}; - // Designates the start of call frame construction. // Generates code to adjust the stack pointer for the argument vector. // Argc is inferred by checking the use chain during lowering. @@ -1687,57 +1654,6 @@ class MTernaryInstruction : public MAryInstruction<3> } }; -class MQuaternaryInstruction : public MAryInstruction<4> -{ - protected: - MQuaternaryInstruction(MDefinition *first, MDefinition *second, - MDefinition *third, MDefinition *fourth) - { - setOperand(0, first); - setOperand(1, second); - setOperand(2, third); - setOperand(3, fourth); - } - - protected: - HashNumber valueHash() const - { - MDefinition *first = getOperand(0); - MDefinition *second = getOperand(1); - MDefinition *third = getOperand(2); - MDefinition *fourth = getOperand(3); - - return op() ^ first->valueNumber() ^ second->valueNumber() ^ - third->valueNumber() ^ fourth->valueNumber(); - } - - bool congruentTo(MDefinition *const &ins) const - { - if (op() != ins->op()) - return false; - - if (type() != ins->type()) - return false; - - if (isEffectful() || ins->isEffectful()) - return false; - - MDefinition *first = getOperand(0); - MDefinition *second = getOperand(1); - MDefinition *third = getOperand(2); - MDefinition *fourth = getOperand(3); - MDefinition *insFirst = ins->getOperand(0); - MDefinition *insSecond = ins->getOperand(1); - MDefinition *insThird = ins->getOperand(2); - MDefinition *insFourth = ins->getOperand(3); - - return first->valueNumber() == insFirst->valueNumber() && - second->valueNumber() == insSecond->valueNumber() && - third->valueNumber() == insThird->valueNumber() && - fourth->valueNumber() == insFourth->valueNumber(); - } -}; - class MCompare : public MBinaryInstruction, public ComparePolicy @@ -6379,15 +6295,12 @@ class MIn // Test whether the index is in the array bounds or a hole. class MInArray - : public MQuaternaryInstruction, - public ObjectPolicy<3> + : public MTernaryInstruction { bool needsHoleCheck_; - MInArray(MDefinition *elements, MDefinition *index, - MDefinition *initLength, MDefinition *object, - bool needsHoleCheck) - : MQuaternaryInstruction(elements, index, initLength, object), + MInArray(MDefinition *elements, MDefinition *index, MDefinition *initLength, bool needsHoleCheck) + : MTernaryInstruction(elements, index, initLength), needsHoleCheck_(needsHoleCheck) { setResultType(MIRType_Boolean); @@ -6401,10 +6314,8 @@ class MInArray INSTRUCTION_HEADER(InArray) static MInArray *New(MDefinition *elements, MDefinition *index, - MDefinition *initLength, MDefinition *object, - bool needsHoleCheck) - { - return new MInArray(elements, index, initLength, object, needsHoleCheck); + MDefinition *initLength, bool needsHoleCheck) { + return new MInArray(elements, index, initLength, needsHoleCheck); } MDefinition *elements() const { @@ -6416,19 +6327,12 @@ class MInArray MDefinition *initLength() const { return getOperand(2); } - MDefinition *object() const { - return getOperand(3); - } bool needsHoleCheck() const { return needsHoleCheck_; } - bool needsNegativeIntCheck() const; AliasSet getAliasSet() const { return AliasSet::Load(AliasSet::Element); } - TypePolicy *typePolicy() { - return this; - } }; // Implementation for instanceof operator with specific rhs. diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index 06630fd7ae24..a5123a627ccd 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -81,7 +81,6 @@ namespace ion { _(NewDeclEnvObject) \ _(NewCallObject) \ _(NewStringObject) \ - _(InitElem) \ _(InitProp) \ _(Start) \ _(OsrEntry) \ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 3fe70a523437..364df7b0902d 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -172,7 +172,6 @@ class ParallelArrayVisitor : public MInstructionVisitor CUSTOM_OP(NewObject) CUSTOM_OP(NewCallObject) CUSTOM_OP(NewParallelArray) - UNSAFE_OP(InitElem) UNSAFE_OP(InitProp) SAFE_OP(Start) UNSAFE_OP(OsrEntry) diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index f26e28caecd9..9cec5d4a8f52 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -399,8 +399,6 @@ ObjectPolicy::staticAdjustInputs(MInstruction *ins) template bool ObjectPolicy<0>::staticAdjustInputs(MInstruction *ins); template bool ObjectPolicy<1>::staticAdjustInputs(MInstruction *ins); -template bool ObjectPolicy<2>::staticAdjustInputs(MInstruction *ins); -template bool ObjectPolicy<3>::staticAdjustInputs(MInstruction *ins); bool CallPolicy::adjustInputs(MInstruction *ins) diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 3dd5812581b9..3f209e53c857 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -186,20 +186,6 @@ class MixPolicy : public TypePolicy } }; -// Combine three policies. -template -class Mix3Policy : public TypePolicy -{ - public: - static bool staticAdjustInputs(MInstruction *ins) { - return Policy1::staticAdjustInputs(ins) && Policy2::staticAdjustInputs(ins) && - Policy3::staticAdjustInputs(ins); - } - virtual bool adjustInputs(MInstruction *ins) { - return staticAdjustInputs(ins); - } -}; - class CallSetElementPolicy : public SingleObjectPolicy { public: diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index b1dd826206a0..c9f2f8dda262 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -507,13 +507,6 @@ OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out) return true; } -bool -OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out) -{ - RootedValue key(cx, Int32Value(index)); - return OperatorIn(cx, key, obj, out); -} - bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval) { diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index 13be91aea586..c7477ddd2b0f 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -521,7 +521,6 @@ bool SPSEnter(JSContext *cx, HandleScript script); bool SPSExit(JSContext *cx, HandleScript script); bool OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out); -bool OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out); bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval); diff --git a/js/src/jit-test/tests/ion/bug861165.js b/js/src/jit-test/tests/ion/bug861165.js deleted file mode 100644 index 924dcbaaef86..000000000000 --- a/js/src/jit-test/tests/ion/bug861165.js +++ /dev/null @@ -1,85 +0,0 @@ -// |jit-test| no-jm - -// IM has the following fastpaths: -// - constant index (constant) -// - need negative int check (neg) -// - needs hole check (hole) -// So to test everything we have to do: -// constant | neg | hole -// test 1: 0 0 0 -// test 2: 1 0 0 -// test 3: 0 1 0 -// test 4: 1 1 0 -// test 5: 0 0 1 -// test 6: 1 0 1 -// test 7: 0 1 1 -// test 8: 1 1 1 - -function test1(index, a) { - if (index < 0) - index = -index - return index in a; -} -assertEq(test1(1, [1,2]), true); - -function test2(a) { - return 0 in a; -} -assertEq(test2([1,2]), true); - -function test3(index, a) { - return index in a; -} - -var arr3 = []; -arr3["-1073741828"] = 17; -assertEq(test3(-1073741828, arr3), true); - -function test4(a) { - return -1073741828 in a; -} -assertEq(test4(arr3), true); - - -function test5(index, a) { - if (index < 0) - index = -index - return index in a; -} -var arr5 = []; -arr5[0] = 1 -arr5[1] = 1 -arr5[2] = 1 -arr5[4] = 1 -assertEq(test5(1, arr5), true); -assertEq(test5(3, arr5), false); - -function test7a(a) { - return 3 in a; -} -function test7b(a) { - return 4 in a; -} -assertEq(test7a(arr5), false); -assertEq(test7b(arr5), true); - -function test8(index, a) { - return index in a; -} -arr5["-1073741828"] = 17; -assertEq(test8(-1073741828, arr5), true); -assertEq(test8(3, arr5), false); -assertEq(test8(0, arr5), true); - -function test9a(a) { - return 0 in a; -} -function test9b(a) { - return 3 in a; -} -function test9c(a) { - return -1073741828 in a; -} -assertEq(test9a(arr5), true); -assertEq(test9b(arr5), false); -assertEq(test9c(arr5), true); From ad42e347f99f9916ef10aa7c662a35fc301e07e9 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Wed, 17 Apr 2013 12:23:17 +0200 Subject: [PATCH 113/438] Bug 861251 - Inline string concatenation in IonMonkey. r=luke --- js/src/ion/CodeGenerator.cpp | 51 ++++++++++++++++++++++++++++++-- js/src/ion/IonMacroAssembler.cpp | 25 +++++++++++----- js/src/ion/IonMacroAssembler.h | 3 ++ js/src/ion/LIR-Common.h | 8 +++-- js/src/ion/Lowering.cpp | 5 ++-- js/src/vm/String.cpp | 18 ----------- js/src/vm/String.h | 7 +++++ 7 files changed, 85 insertions(+), 32 deletions(-) diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 5106493af101..02af8bcaad3e 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -3470,10 +3470,55 @@ CodeGenerator::visitEmulatesUndefinedAndBranch(LEmulatesUndefinedAndBranch *lir) bool CodeGenerator::visitConcat(LConcat *lir) { - pushArg(ToRegister(lir->rhs())); - pushArg(ToRegister(lir->lhs())); - if (!callVM(ConcatStringsInfo, lir)) + Register lhs = ToRegister(lir->lhs()); + Register rhs = ToRegister(lir->rhs()); + + Register output = ToRegister(lir->output()); + Register temp = ToRegister(lir->temp()); + + OutOfLineCode *ool = oolCallVM(ConcatStringsInfo, lir, (ArgList(), lhs, rhs), + StoreRegisterTo(output)); + if (!ool) return false; + + Label done; + + // If lhs is empty, return rhs. + Label leftEmpty; + masm.loadStringLength(lhs, temp); + masm.branchTest32(Assembler::Zero, temp, temp, &leftEmpty); + + // If rhs is empty, return lhs. + Label rightEmpty; + masm.loadStringLength(rhs, output); + masm.branchTest32(Assembler::Zero, output, output, &rightEmpty); + + // Ensure total length <= JSString::MAX_LENGTH. + masm.add32(output, temp); + masm.branch32(Assembler::Above, temp, Imm32(JSString::MAX_LENGTH), ool->entry()); + + // Allocate a new rope. + masm.newGCString(output, ool->entry()); + + // Store lengthAndFlags. + JS_STATIC_ASSERT(JSString::ROPE_FLAGS == 0); + masm.lshiftPtr(Imm32(JSString::LENGTH_SHIFT), temp); + masm.storePtr(temp, Address(output, JSString::offsetOfLengthAndFlags())); + + // Store left and right nodes. + masm.storePtr(lhs, Address(output, JSRope::offsetOfLeft())); + masm.storePtr(rhs, Address(output, JSRope::offsetOfRight())); + masm.jump(&done); + + masm.bind(&leftEmpty); + masm.mov(rhs, output); + masm.jump(&done); + + masm.bind(&rightEmpty); + masm.mov(lhs, output); + + masm.bind(&done); + masm.bind(ool->rejoin()); return true; } diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index bcf85af67d84..c0488428a90d 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -418,16 +418,11 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output) } void -MacroAssembler::newGCThing(const Register &result, - JSObject *templateObject, Label *fail) +MacroAssembler::newGCThing(const Register &result, gc::AllocKind allocKind, Label *fail) { // Inlined equivalent of js::gc::NewGCThing() without failure case handling. - gc::AllocKind allocKind = templateObject->tenuredGetAllocKind(); - JS_ASSERT(allocKind >= gc::FINALIZE_OBJECT0 && allocKind <= gc::FINALIZE_OBJECT_LAST); - int thingSize = (int)gc::Arena::thingSize(allocKind); - - JS_ASSERT(!templateObject->hasDynamicElements()); + int thingSize = int(gc::Arena::thingSize(allocKind)); Zone *zone = GetIonContext()->compartment->zone(); @@ -452,6 +447,22 @@ MacroAssembler::newGCThing(const Register &result, subPtr(Imm32(thingSize), result); } +void +MacroAssembler::newGCThing(const Register &result, JSObject *templateObject, Label *fail) +{ + gc::AllocKind allocKind = templateObject->tenuredGetAllocKind(); + JS_ASSERT(allocKind >= gc::FINALIZE_OBJECT0 && allocKind <= gc::FINALIZE_OBJECT_LAST); + JS_ASSERT(!templateObject->hasDynamicElements()); + + newGCThing(result, allocKind, fail); +} + +void +MacroAssembler::newGCString(const Register &result, Label *fail) +{ + newGCThing(result, js::gc::FINALIZE_STRING, fail); +} + void MacroAssembler::parNewGCThing(const Register &result, const Register &threadContextReg, diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index 9b4571354eb8..6f0a583cf79c 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -553,7 +553,10 @@ class MacroAssembler : public MacroAssemblerSpecific } // Inline allocation. + void newGCThing(const Register &result, gc::AllocKind allocKind, Label *fail); void newGCThing(const Register &result, JSObject *templateObject, Label *fail); + void newGCString(const Register &result, Label *fail); + void parNewGCThing(const Register &result, const Register &threadContextReg, const Register &tempReg1, diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 5d6ef835e6bf..8a94858a9545 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -2158,14 +2158,15 @@ class LBinaryV : public LCallInstructionHelper }; // Adds two string, returning a string. -class LConcat : public LCallInstructionHelper<1, 2, 0> +class LConcat : public LInstructionHelper<1, 2, 1> { public: LIR_HEADER(Concat) - LConcat(const LAllocation &lhs, const LAllocation &rhs) { + LConcat(const LAllocation &lhs, const LAllocation &rhs, const LDefinition &temp) { setOperand(0, lhs); setOperand(1, rhs); + setTemp(0, temp); } const LAllocation *lhs() { @@ -2174,6 +2175,9 @@ class LConcat : public LCallInstructionHelper<1, 2, 0> const LAllocation *rhs() { return this->getOperand(1); } + const LDefinition *temp() { + return this->getTemp(0); + } }; // Get uint16 character code from a string. diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 75de254f6577..e7d861784051 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1265,9 +1265,10 @@ LIRGenerator::visitConcat(MConcat *ins) JS_ASSERT(lhs->type() == MIRType_String); JS_ASSERT(rhs->type() == MIRType_String); + JS_ASSERT(ins->type() == MIRType_String); - LConcat *lir = new LConcat(useRegisterAtStart(lhs), useRegisterAtStart(rhs)); - if (!defineReturn(lir, ins)) + LConcat *lir = new LConcat(useRegister(lhs), useRegister(rhs), temp()); + if (!define(lir, ins)) return false; return assignSafepoint(lir, ins); } diff --git a/js/src/vm/String.cpp b/js/src/vm/String.cpp index 1bb9b86c641f..dc62d96247ef 100644 --- a/js/src/vm/String.cpp +++ b/js/src/vm/String.cpp @@ -319,24 +319,6 @@ js::ConcatStrings(JSContext *cx, if (!JSString::validateLength(cxIfCanGC, wholeLength)) return NULL; - if (JSShortString::lengthFits(wholeLength)) { - JSShortString *str = js_NewGCShortString(cx); - if (!str) - return NULL; - const jschar *leftChars = left->getChars(cx); - if (!leftChars) - return NULL; - const jschar *rightChars = right->getChars(cx); - if (!rightChars) - return NULL; - - jschar *buf = str->init(wholeLength); - PodCopy(buf, leftChars, leftLen); - PodCopy(buf + leftLen, rightChars, rightLen); - buf[wholeLength] = 0; - return str; - } - return JSRope::new_(cx, left, right, wholeLength); } diff --git a/js/src/vm/String.h b/js/src/vm/String.h index e7769c0e4ec9..a0c8514509c4 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -465,6 +465,13 @@ class JSRope : public JSString } inline void markChildren(JSTracer *trc); + + inline static size_t offsetOfLeft() { + return offsetof(JSRope, d.u1.left); + } + inline static size_t offsetOfRight() { + return offsetof(JSRope, d.s.u2.right); + } }; JS_STATIC_ASSERT(sizeof(JSRope) == sizeof(JSString)); From 0bbd21d3cb14ff323d68c1618d2e99090e0f237d Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 9 Apr 2013 12:05:12 +1200 Subject: [PATCH 114/438] Bug 841363. Ensure padding-rect edges are included in scrollable area used to compute scrollWidth/scrollHeight for overflow:visible elements. r=matspal --HG-- extra : rebase_source : 067c9577f797350274783d3c7cc682b5f74b998a --- content/base/src/Element.cpp | 10 ++++- layout/generic/test/Makefile.in | 1 + layout/generic/test/test_bug841361.html | 56 +++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 layout/generic/test/test_bug841361.html diff --git a/content/base/src/Element.cpp b/content/base/src/Element.cpp index eb77095fc392..109cdcabb30b 100644 --- a/content/base/src/Element.cpp +++ b/content/base/src/Element.cpp @@ -591,9 +591,17 @@ static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame) nsRect paddingRect = aFrame->GetPaddingRectRelativeToSelf(); nsOverflowAreas overflowAreas(paddingRect, paddingRect); + // Add the scrollable overflow areas of children (if any) to the paddingRect. + // It's important to start with the paddingRect, otherwise if there are no + // children the overflow rect will be 0,0,0,0 which will force the point 0,0 + // to be included in the final rect. nsLayoutUtils::UnionChildOverflow(aFrame, overflowAreas); + // Make sure that an empty padding-rect's edges are included, by adding + // the padding-rect in again with UnionEdges. + nsRect overflowRect = + overflowAreas.ScrollableOverflow().UnionEdges(paddingRect); return nsLayoutUtils::GetScrolledRect(aFrame, - overflowAreas.ScrollableOverflow(), paddingRect.Size(), + overflowRect, paddingRect.Size(), aFrame->StyleVisibility()->mDirection).Size(); } diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index 7f1a70ba81d0..e9659287b3aa 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -105,6 +105,7 @@ MOCHITEST_FILES = \ test_bug785324.html \ test_bug791616.html \ test_bug831780.html \ + test_bug841361.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/layout/generic/test/test_bug841361.html b/layout/generic/test/test_bug841361.html new file mode 100644 index 000000000000..cc7a23dbf457 --- /dev/null +++ b/layout/generic/test/test_bug841361.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 841361 + + + + +Mozilla Bug 841361 +

+ +

+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +

+ +
+
+
+ + From 2b6af30e8f41d3024466cb2b61bb8bb6133934c9 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 15 Apr 2013 19:10:19 +1200 Subject: [PATCH 115/438] Bug 860253. Clear clip state on children of an nsDisplayTransform because they're in a different coordinate system, and we'll clip the nsDisplayTransform itself. r=mattwoodrow --HG-- extra : rebase_source : 731dfa20fa0fda1feb7ab582deced011ff9c25fc --- layout/generic/nsSimplePageSequence.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsSimplePageSequence.cpp b/layout/generic/nsSimplePageSequence.cpp index 0e73b688bf05..6ff5f6808e67 100644 --- a/layout/generic/nsSimplePageSequence.cpp +++ b/layout/generic/nsSimplePageSequence.cpp @@ -807,11 +807,19 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DisplayBorderBackgroundOutline(aBuilder, aLists); nsDisplayList content; - nsIFrame* child = GetFirstPrincipalChild(); - while (child) { - child->BuildDisplayListForStackingContext(aBuilder, - child->GetVisualOverflowRectRelativeToSelf(), &content); - child = child->GetNextSibling(); + + { + // Clear clip state while we construct the children of the + // nsDisplayTransform, since they'll be in a different coordinate system. + DisplayListClipState::AutoSaveRestore clipState(aBuilder); + clipState.Clear(); + + nsIFrame* child = GetFirstPrincipalChild(); + while (child) { + child->BuildDisplayListForStackingContext(aBuilder, + child->GetVisualOverflowRectRelativeToSelf(), &content); + child = child->GetNextSibling(); + } } content.AppendNewToTop(new (aBuilder) From 520f871d999fca21f1a0529b58b63b65263267b7 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 16 Apr 2013 18:14:56 +1200 Subject: [PATCH 116/438] Bug 860579. Make FindContentInDocument use the frame tree as much as possible. r=mattwoodrow --HG-- extra : rebase_source : c4d05d33fdc6b2bcc99437808f78ada8770f9263 --- layout/base/crashtests/860579-1.html | 21 ++++++++++++++++++++ layout/base/crashtests/crashtests.list | 1 + layout/base/nsDisplayList.cpp | 27 +++++++------------------- 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 layout/base/crashtests/860579-1.html diff --git a/layout/base/crashtests/860579-1.html b/layout/base/crashtests/860579-1.html new file mode 100644 index 000000000000..3f7ef558b2e2 --- /dev/null +++ b/layout/base/crashtests/860579-1.html @@ -0,0 +1,21 @@ + + + + + + + diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index b3deafebf51e..392fac8a084b 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -391,5 +391,6 @@ load 770381-1.html load 795646.html load 813372-1.html load 836990-1.html +load 860579-1.html pref(layers.force-active,true) load 859526-1.html pref(layers.force-active,true) load 859630-1.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index a01878d57b0e..a87409917665 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1396,28 +1396,15 @@ static void Sort(nsDisplayList* aList, int32_t aCount, nsDisplayList::SortLEQ aC } static nsIContent* FindContentInDocument(nsDisplayItem* aItem, nsIDocument* aDoc) { - nsIFrame* frame = aItem->GetUnderlyingFrame(); - nsIContent* c = frame->GetContent(); - for (;;) { - nsIDocument* d; - if (c) { - d = c->OwnerDoc(); - } else { - d = frame->PresContext()->Document(); - } - if (d == aDoc) { - return c; - } - nsIDocument* parentDoc = d->GetParentDocument(); - if (!parentDoc) { - return nullptr; - } - c = parentDoc->FindContentForSubDocument(d); - if (!c) { - NS_ERROR("No content for subdocument?"); - return nullptr; + nsIFrame* f = aItem->GetUnderlyingFrame(); + while (f) { + nsPresContext* pc = f->PresContext(); + if (pc->Document() == aDoc) { + return f->GetContent(); } + f = nsLayoutUtils::GetCrossDocParentFrame(pc->PresShell()->GetRootFrame()); } + return nullptr; } static bool IsContentLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2, From 88b40306f675744a938314c19e05a31a5b8f2bd5 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Wed, 17 Apr 2013 11:43:22 +0100 Subject: [PATCH 117/438] Bug 784387 - Handle duplicate reading list item case (r=bnicholson) --- mobile/android/base/BrowserApp.java | 19 ++++++++--- .../base/locales/en-US/android_strings.dtd | 1 + mobile/android/base/strings.xml.in | 1 + mobile/android/chrome/content/browser.js | 32 +++++++++++++------ 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 955e5fa6b843..891143c12052 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -73,6 +73,10 @@ abstract public class BrowserApp extends GeckoApp private static final int TABS_ANIMATION_DURATION = 450; + private static final int READER_ADD_SUCCESS = 0; + private static final int READER_ADD_FAILED = 1; + private static final int READER_ADD_DUPLICATE = 2; + public static BrowserToolbar mBrowserToolbar; private AboutHome mAboutHome; protected Telemetry.Timer mAboutHomeStartupTimer = null; @@ -431,9 +435,14 @@ abstract public class BrowserApp extends GeckoApp return super.onKeyDown(keyCode, event); } - void handleReaderAdded(boolean success, final String title, final String url) { - if (!success) { - showToast(R.string.reading_list_failed, Toast.LENGTH_SHORT); + void handleReaderAdded(int result, final String title, final String url) { + if (result != READER_ADD_SUCCESS) { + if (result == READER_ADD_FAILED) { + showToast(R.string.reading_list_failed, Toast.LENGTH_SHORT); + } else if (result == READER_ADD_DUPLICATE) { + showToast(R.string.reading_list_duplicate, Toast.LENGTH_SHORT); + } + return; } @@ -988,10 +997,10 @@ abstract public class BrowserApp extends GeckoApp Telemetry.HistogramAdd("FENNEC_FAVICONS_COUNT", BrowserDB.getCount(getContentResolver(), "favicons")); Telemetry.HistogramAdd("FENNEC_THUMBNAILS_COUNT", BrowserDB.getCount(getContentResolver(), "thumbnails")); } else if (event.equals("Reader:Added")) { - final boolean success = message.getBoolean("success"); + final int result = message.getInt("result"); final String title = message.getString("title"); final String url = message.getString("url"); - handleReaderAdded(success, title, url); + handleReaderAdded(result, title, url); } else if (event.equals("Reader:Removed")) { final String url = message.getString("url"); handleReaderRemoved(url); diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index 2aab6e913012..7b3af510c47b 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -182,6 +182,7 @@ size. --> + diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 641f57d94015..c349145c71cc 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -158,6 +158,7 @@ &reading_list_added; &reading_list_removed; &reading_list_failed; + &reading_list_duplicate; &reader; &contextmenu_open_new_tab; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 46f8c47fc54a..d7153f912b74 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6512,6 +6512,10 @@ let Reader = { DEBUG: 0, + READER_ADD_SUCCESS: 0, + READER_ADD_FAILED: 1, + READER_ADD_DUPLICATE: 2, + // Don't try to parse the page if it has too many elements (for memory and // performance reasons) MAX_ELEMS_TO_PARSE: 3000, @@ -6531,26 +6535,36 @@ let Reader = { let currentURI = tab.browser.currentURI; let url = currentURI.spec; - let sendResult = function(success, title) { - this.log("Reader:Add success=" + success + ", url=" + url + ", title=" + title); + let sendResult = function(result, title) { + this.log("Reader:Add success=" + result + ", url=" + url + ", title=" + title); sendMessageToJava({ type: "Reader:Added", - success: success, + result: result, title: title, url: url, }); }.bind(this); - this.getArticleForTab(aData, currentURI.specIgnoringRef, function (article) { - if (!article) { - sendResult(false, ""); + this.getArticleFromCache(currentURI.specIgnoringRef, function (article) { + // If the article is already in reading list, bail + if (article) { + sendResult(this.READER_ADD_DUPLICATE, ""); return; } - this.storeArticleInCache(article, function(success) { - sendResult(success, article.title); - }); + this.getArticleForTab(aData, currentURI.specIgnoringRef, function (article) { + if (!article) { + sendResult(this.READER_ADD_FAILED, ""); + return; + } + + this.storeArticleInCache(article, function(success) { + let result = (success ? this.READER_ADD_SUCCESS : + this.READER_ADD_FAILED); + sendResult(result, article.title); + }.bind(this)); + }.bind(this)); }.bind(this)); break; } From ed847aa5b66e362144308bf232d5ef40b2b36bc7 Mon Sep 17 00:00:00 2001 From: Aditya Bhardwaj Date: Wed, 17 Apr 2013 11:43:30 +0100 Subject: [PATCH 118/438] Bug 784387 - Long press on reader button to add to reading list (r=lucasr) --- mobile/android/base/BrowserToolbar.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mobile/android/base/BrowserToolbar.java b/mobile/android/base/BrowserToolbar.java index 71504e2d38d3..fc3f8114b1bb 100644 --- a/mobile/android/base/BrowserToolbar.java +++ b/mobile/android/base/BrowserToolbar.java @@ -321,6 +321,18 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory, } }); + mReader.setOnLongClickListener(new Button.OnLongClickListener() { + public boolean onLongClick(View v) { + Tab tab = Tabs.getInstance().getSelectedTab(); + if (tab != null) { + tab.addToReadingList(); + return true; + } + + return false; + } + }); + mShadow = (ImageView) mLayout.findViewById(R.id.shadow); mHandler = new Handler(); From d4e2debdd5e209436bfef367d12b55e6d5c3f9f2 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:45 +0200 Subject: [PATCH 119/438] Bug 861165: IonMonkey: Correct behaviour for JSOP_IN on dense native with negative index, r=bhackett --- js/src/ion/CodeGenerator.cpp | 58 +++++++++++++++--- js/src/ion/IonBuilder.cpp | 2 +- js/src/ion/LIR-Common.h | 10 ++- js/src/ion/Lowering.cpp | 10 ++- js/src/ion/MIR.cpp | 6 ++ js/src/ion/MIR.h | 73 ++++++++++++++++++++-- js/src/ion/TypePolicy.cpp | 2 + js/src/ion/VMFunctions.cpp | 7 +++ js/src/ion/VMFunctions.h | 1 + js/src/jit-test/tests/ion/bug861165.js | 85 ++++++++++++++++++++++++++ 10 files changed, 236 insertions(+), 18 deletions(-) create mode 100644 js/src/jit-test/tests/ion/bug861165.js diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 02af8bcaad3e..1fa342456e9f 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -5606,35 +5606,75 @@ CodeGenerator::visitIn(LIn *ins) return callVM(OperatorInInfo, ins); } +typedef bool (*OperatorInIFn)(JSContext *, uint32_t, HandleObject, JSBool *); +static const VMFunction OperatorInIInfo = FunctionInfo(OperatorInI); + bool CodeGenerator::visitInArray(LInArray *lir) { + const MInArray *mir = lir->mir(); Register elements = ToRegister(lir->elements()); Register initLength = ToRegister(lir->initLength()); Register output = ToRegister(lir->output()); // When the array is not packed we need to do a hole check in addition to the bounds check. - Label falseBranch, done; + Label falseBranch, done, trueBranch; + + OutOfLineCode *ool = NULL; + Label* failedInitLength = &falseBranch; + if (lir->index()->isConstant()) { - masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(ToInt32(lir->index())), &falseBranch); - if (lir->mir()->needsHoleCheck()) { - masm.branchTestMagic(Assembler::Equal, Address(elements, ToInt32(lir->index()) * sizeof(Value)), - &falseBranch); + int32_t index = ToInt32(lir->index()); + + JS_ASSERT_IF(index < 0, mir->needsNegativeIntCheck()); + if (mir->needsNegativeIntCheck()) { + ool = oolCallVM(OperatorInIInfo, lir, + (ArgList(), Imm32(index), ToRegister(lir->object())), + StoreRegisterTo(output)); + failedInitLength = ool->entry(); + } + + masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(index), failedInitLength); + if (mir->needsHoleCheck()) { + Address address = Address(elements, index * sizeof(Value)); + masm.branchTestMagic(Assembler::Equal, address, &falseBranch); } } else { - masm.branch32(Assembler::BelowOrEqual, initLength, ToRegister(lir->index()), &falseBranch); - if (lir->mir()->needsHoleCheck()) { - masm.branchTestMagic(Assembler::Equal, BaseIndex(elements, ToRegister(lir->index()), TimesEight), - &falseBranch); + Label negativeIntCheck; + Register index = ToRegister(lir->index()); + + if (mir->needsNegativeIntCheck()) + failedInitLength = &negativeIntCheck; + + masm.branch32(Assembler::BelowOrEqual, initLength, index, failedInitLength); + if (mir->needsHoleCheck()) { + BaseIndex address = BaseIndex(elements, ToRegister(lir->index()), TimesEight); + masm.branchTestMagic(Assembler::Equal, address, &falseBranch); + } + masm.jump(&trueBranch); + + if (mir->needsNegativeIntCheck()) { + masm.bind(&negativeIntCheck); + ool = oolCallVM(OperatorInIInfo, lir, + (ArgList(), index, ToRegister(lir->object())), + StoreRegisterTo(output)); + + masm.branch32(Assembler::LessThan, index, Imm32(0), ool->entry()); + masm.jump(&falseBranch); } } + masm.bind(&trueBranch); masm.move32(Imm32(1), output); masm.jump(&done); masm.bind(&falseBranch); masm.move32(Imm32(0), output); masm.bind(&done); + + if (ool) + masm.bind(ool->rejoin()); + return true; } diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 0aa2d376f401..7cebe3ac3c62 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -7394,7 +7394,7 @@ IonBuilder::jsop_in_dense() current->add(initLength); // Check if id < initLength and elem[id] not a hole. - MInArray *ins = MInArray::New(elements, id, initLength, needsHoleCheck); + MInArray *ins = MInArray::New(elements, id, initLength, obj, needsHoleCheck); current->add(ins); current->push(ins); diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 8a94858a9545..270ce61a9019 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -2722,15 +2722,18 @@ class LLoadElementV : public LInstructionHelper } }; -class LInArray : public LInstructionHelper<1, 3, 0> +class LInArray : public LInstructionHelper<1, 4, 0> { public: LIR_HEADER(InArray) - LInArray(const LAllocation &elements, const LAllocation &index, const LAllocation &initLength) { + LInArray(const LAllocation &elements, const LAllocation &index, + const LAllocation &initLength, const LAllocation &object) + { setOperand(0, elements); setOperand(1, index); setOperand(2, initLength); + setOperand(3, object); } const MInArray *mir() const { return mir_->toInArray(); @@ -2744,6 +2747,9 @@ class LInArray : public LInstructionHelper<1, 3, 0> const LAllocation *initLength() { return getOperand(2); } + const LAllocation *object() { + return getOperand(3); + } }; diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index e7d861784051..956adb261733 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1820,11 +1820,19 @@ LIRGenerator::visitInArray(MInArray *ins) JS_ASSERT(ins->elements()->type() == MIRType_Elements); JS_ASSERT(ins->index()->type() == MIRType_Int32); JS_ASSERT(ins->initLength()->type() == MIRType_Int32); + JS_ASSERT(ins->object()->type() == MIRType_Object); JS_ASSERT(ins->type() == MIRType_Boolean); + LAllocation object; + if (ins->needsNegativeIntCheck()) + object = useRegister(ins->object()); + else + object = LConstantIndex::Bogus(); + LInArray *lir = new LInArray(useRegister(ins->elements()), useRegisterOrConstant(ins->index()), - useRegister(ins->initLength())); + useRegister(ins->initLength()), + object); return define(lir, ins) && assignSafepoint(lir, ins); } diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 7b94d6c7419f..2914423b66b1 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -2007,6 +2007,12 @@ InlinePropertyTable::hasFunction(JSFunction *func) const return false; } +bool +MInArray::needsNegativeIntCheck() const +{ + return !index()->range() || index()->range()->lower() < 0; +} + MDefinition * MAsmJSUnsignedToDouble::foldsTo(bool useValueNumbers) { diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index faa0d1ed38fa..55e740c3c467 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1654,6 +1654,57 @@ class MTernaryInstruction : public MAryInstruction<3> } }; +class MQuaternaryInstruction : public MAryInstruction<4> +{ + protected: + MQuaternaryInstruction(MDefinition *first, MDefinition *second, + MDefinition *third, MDefinition *fourth) + { + setOperand(0, first); + setOperand(1, second); + setOperand(2, third); + setOperand(3, fourth); + } + + protected: + HashNumber valueHash() const + { + MDefinition *first = getOperand(0); + MDefinition *second = getOperand(1); + MDefinition *third = getOperand(2); + MDefinition *fourth = getOperand(3); + + return op() ^ first->valueNumber() ^ second->valueNumber() ^ + third->valueNumber() ^ fourth->valueNumber(); + } + + bool congruentTo(MDefinition *const &ins) const + { + if (op() != ins->op()) + return false; + + if (type() != ins->type()) + return false; + + if (isEffectful() || ins->isEffectful()) + return false; + + MDefinition *first = getOperand(0); + MDefinition *second = getOperand(1); + MDefinition *third = getOperand(2); + MDefinition *fourth = getOperand(3); + MDefinition *insFirst = ins->getOperand(0); + MDefinition *insSecond = ins->getOperand(1); + MDefinition *insThird = ins->getOperand(2); + MDefinition *insFourth = ins->getOperand(3); + + return first->valueNumber() == insFirst->valueNumber() && + second->valueNumber() == insSecond->valueNumber() && + third->valueNumber() == insThird->valueNumber() && + fourth->valueNumber() == insFourth->valueNumber(); + } +}; + class MCompare : public MBinaryInstruction, public ComparePolicy @@ -6295,12 +6346,15 @@ class MIn // Test whether the index is in the array bounds or a hole. class MInArray - : public MTernaryInstruction + : public MQuaternaryInstruction, + public ObjectPolicy<3> { bool needsHoleCheck_; - MInArray(MDefinition *elements, MDefinition *index, MDefinition *initLength, bool needsHoleCheck) - : MTernaryInstruction(elements, index, initLength), + MInArray(MDefinition *elements, MDefinition *index, + MDefinition *initLength, MDefinition *object, + bool needsHoleCheck) + : MQuaternaryInstruction(elements, index, initLength, object), needsHoleCheck_(needsHoleCheck) { setResultType(MIRType_Boolean); @@ -6314,8 +6368,10 @@ class MInArray INSTRUCTION_HEADER(InArray) static MInArray *New(MDefinition *elements, MDefinition *index, - MDefinition *initLength, bool needsHoleCheck) { - return new MInArray(elements, index, initLength, needsHoleCheck); + MDefinition *initLength, MDefinition *object, + bool needsHoleCheck) + { + return new MInArray(elements, index, initLength, object, needsHoleCheck); } MDefinition *elements() const { @@ -6327,12 +6383,19 @@ class MInArray MDefinition *initLength() const { return getOperand(2); } + MDefinition *object() const { + return getOperand(3); + } bool needsHoleCheck() const { return needsHoleCheck_; } + bool needsNegativeIntCheck() const; AliasSet getAliasSet() const { return AliasSet::Load(AliasSet::Element); } + TypePolicy *typePolicy() { + return this; + } }; // Implementation for instanceof operator with specific rhs. diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index 9cec5d4a8f52..f26e28caecd9 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -399,6 +399,8 @@ ObjectPolicy::staticAdjustInputs(MInstruction *ins) template bool ObjectPolicy<0>::staticAdjustInputs(MInstruction *ins); template bool ObjectPolicy<1>::staticAdjustInputs(MInstruction *ins); +template bool ObjectPolicy<2>::staticAdjustInputs(MInstruction *ins); +template bool ObjectPolicy<3>::staticAdjustInputs(MInstruction *ins); bool CallPolicy::adjustInputs(MInstruction *ins) diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index c9f2f8dda262..b1dd826206a0 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -507,6 +507,13 @@ OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out) return true; } +bool +OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out) +{ + RootedValue key(cx, Int32Value(index)); + return OperatorIn(cx, key, obj, out); +} + bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval) { diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index c7477ddd2b0f..13be91aea586 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -521,6 +521,7 @@ bool SPSEnter(JSContext *cx, HandleScript script); bool SPSExit(JSContext *cx, HandleScript script); bool OperatorIn(JSContext *cx, HandleValue key, HandleObject obj, JSBool *out); +bool OperatorInI(JSContext *cx, uint32_t index, HandleObject obj, JSBool *out); bool GetIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue rval); diff --git a/js/src/jit-test/tests/ion/bug861165.js b/js/src/jit-test/tests/ion/bug861165.js new file mode 100644 index 000000000000..924dcbaaef86 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug861165.js @@ -0,0 +1,85 @@ +// |jit-test| no-jm + +// IM has the following fastpaths: +// - constant index (constant) +// - need negative int check (neg) +// - needs hole check (hole) +// So to test everything we have to do: +// constant | neg | hole +// test 1: 0 0 0 +// test 2: 1 0 0 +// test 3: 0 1 0 +// test 4: 1 1 0 +// test 5: 0 0 1 +// test 6: 1 0 1 +// test 7: 0 1 1 +// test 8: 1 1 1 + +function test1(index, a) { + if (index < 0) + index = -index + return index in a; +} +assertEq(test1(1, [1,2]), true); + +function test2(a) { + return 0 in a; +} +assertEq(test2([1,2]), true); + +function test3(index, a) { + return index in a; +} + +var arr3 = []; +arr3["-1073741828"] = 17; +assertEq(test3(-1073741828, arr3), true); + +function test4(a) { + return -1073741828 in a; +} +assertEq(test4(arr3), true); + + +function test5(index, a) { + if (index < 0) + index = -index + return index in a; +} +var arr5 = []; +arr5[0] = 1 +arr5[1] = 1 +arr5[2] = 1 +arr5[4] = 1 +assertEq(test5(1, arr5), true); +assertEq(test5(3, arr5), false); + +function test7a(a) { + return 3 in a; +} +function test7b(a) { + return 4 in a; +} +assertEq(test7a(arr5), false); +assertEq(test7b(arr5), true); + +function test8(index, a) { + return index in a; +} +arr5["-1073741828"] = 17; +assertEq(test8(-1073741828, arr5), true); +assertEq(test8(3, arr5), false); +assertEq(test8(0, arr5), true); + +function test9a(a) { + return 0 in a; +} +function test9b(a) { + return 3 in a; +} +function test9c(a) { + return -1073741828 in a; +} +assertEq(test9a(arr5), true); +assertEq(test9b(arr5), false); +assertEq(test9c(arr5), true); From 22436b036a2b8980c882533d3462213b586d2b6c Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 17 Apr 2013 11:31:53 +0200 Subject: [PATCH 120/438] Bug 861116: IonBuilder: Add support for JSOP_INITELEM, r=jandem --- js/src/ion/CodeGenerator.cpp | 27 ++++++++++++++++++----- js/src/ion/CodeGenerator.h | 1 + js/src/ion/IonBuilder.cpp | 16 ++++++++++++++ js/src/ion/IonBuilder.h | 1 + js/src/ion/LIR-Common.h | 20 +++++++++++++++++ js/src/ion/LOpcodes.h | 1 + js/src/ion/Lowering.cpp | 12 ++++++++++ js/src/ion/Lowering.h | 1 + js/src/ion/MIR.h | 33 ++++++++++++++++++++++++++++ js/src/ion/MOpcodes.h | 1 + js/src/ion/ParallelArrayAnalysis.cpp | 1 + js/src/ion/TypePolicy.h | 14 ++++++++++++ 12 files changed, 123 insertions(+), 5 deletions(-) diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 1fa342456e9f..506db97a3863 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -2648,11 +2648,6 @@ CodeGenerator::visitNewStringObject(LNewStringObject *lir) return true; } -typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, - HandlePropertyName name, HandleValue value); -static const VMFunction InitPropInfo = - FunctionInfo(InitProp); - bool CodeGenerator::visitParNew(LParNew *lir) { @@ -2747,6 +2742,28 @@ CodeGenerator::visitParBailout(LParBailout *lir) return true; } +typedef bool(*InitElemFn)(JSContext *cx, HandleObject obj, + HandleValue id, HandleValue value); +static const VMFunction InitElemInfo = + FunctionInfo(InitElemOperation); + +bool +CodeGenerator::visitInitElem(LInitElem *lir) +{ + Register objReg = ToRegister(lir->getObject()); + + pushArg(ToValue(lir, LInitElem::ValueIndex)); + pushArg(ToValue(lir, LInitElem::IdIndex)); + pushArg(objReg); + + return callVM(InitElemInfo, lir); +} + +typedef bool(*InitPropFn)(JSContext *cx, HandleObject obj, + HandlePropertyName name, HandleValue value); +static const VMFunction InitPropInfo = + FunctionInfo(InitProp); + bool CodeGenerator::visitInitProp(LInitProp *lir) { diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index 4130a3611ebc..b48e613a9490 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -116,6 +116,7 @@ class CodeGenerator : public CodeGeneratorSpecific bool visitParNew(LParNew *lir); bool visitParNewDenseArray(LParNewDenseArray *lir); bool visitParBailout(LParBailout *lir); + bool visitInitElem(LInitElem *lir); bool visitInitProp(LInitProp *lir); bool visitCreateThis(LCreateThis *lir); bool visitCreateThisWithProto(LCreateThisWithProto *lir); diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 7cebe3ac3c62..f4e080bdd360 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -952,6 +952,9 @@ IonBuilder::inspectOpcode(JSOp op) return jsop_newobject(baseObj); } + case JSOP_INITELEM: + return jsop_initelem(); + case JSOP_INITELEM_ARRAY: return jsop_initelem_array(); @@ -4779,6 +4782,19 @@ IonBuilder::jsop_newobject(HandleObject baseObj) return resumeAfter(ins); } +bool +IonBuilder::jsop_initelem() +{ + MDefinition *value = current->pop(); + MDefinition *id = current->pop(); + MDefinition *obj = current->peek(-1); + + MInitElem *initElem = MInitElem::New(obj, id, value); + current->add(initElem); + + return resumeAfter(initElem); +} + bool IonBuilder::jsop_initelem_array() { diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 8f8f2a486734..91fdee673034 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -375,6 +375,7 @@ class IonBuilder : public MIRGenerator bool jsop_delprop(HandlePropertyName name); bool jsop_newarray(uint32_t count); bool jsop_newobject(HandleObject baseObj); + bool jsop_initelem(); bool jsop_initelem_array(); bool jsop_initprop(HandlePropertyName name); bool jsop_regexp(RegExpObject *reobj); diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 270ce61a9019..a758e6a00d28 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -478,6 +478,26 @@ class LParBailout : public LInstructionHelper<0, 0, 0> LIR_HEADER(ParBailout); }; +class LInitElem : public LCallInstructionHelper<0, 1 + 2*BOX_PIECES, 0> +{ + public: + LIR_HEADER(InitElem) + + LInitElem(const LAllocation &object) { + setOperand(0, object); + } + + static const size_t IdIndex = 1; + static const size_t ValueIndex = 1 + BOX_PIECES; + + const LAllocation *getObject() { + return getOperand(0); + } + MInitElem *mir() const { + return mir_->toInitElem(); + } +}; + // Takes in an Object and a Value. class LInitProp : public LCallInstructionHelper<0, 1 + BOX_PIECES, 0> { diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index b7bf009b266c..88142926f1c5 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -32,6 +32,7 @@ _(ParNewDenseArray) \ _(ParNewCallObject) \ _(ParBailout) \ + _(InitElem) \ _(InitProp) \ _(CheckOverRecursed) \ _(ParCheckOverRecursed) \ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 956adb261733..748d9ae84c06 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -237,6 +237,18 @@ LIRGenerator::visitParBailout(MParBailout *ins) return add(lir, ins); } +bool +LIRGenerator::visitInitElem(MInitElem *ins) +{ + LInitElem *lir = new LInitElem(useRegisterAtStart(ins->getObject())); + if (!useBoxAtStart(lir, LInitElem::IdIndex, ins->getId())) + return false; + if (!useBoxAtStart(lir, LInitElem::ValueIndex, ins->getValue())) + return false; + + return add(lir, ins) && assignSafepoint(lir, ins); +} + bool LIRGenerator::visitInitProp(MInitProp *ins) { diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index cc8cd249df8b..6e11bcdbf050 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -94,6 +94,7 @@ class LIRGenerator : public LIRGeneratorSpecific bool visitParNewCallObject(MParNewCallObject *ins); bool visitParNewDenseArray(MParNewDenseArray *ins); bool visitParBailout(MParBailout *ins); + bool visitInitElem(MInitElem *ins); bool visitInitProp(MInitProp *ins); bool visitCheckOverRecursed(MCheckOverRecursed *ins); bool visitParCheckOverRecursed(MParCheckOverRecursed *ins); diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 55e740c3c467..58437d641a54 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1243,6 +1243,39 @@ class MInitProp } }; +class MInitElem + : public MAryInstruction<3>, + public Mix3Policy, BoxPolicy<1>, BoxPolicy<2> > +{ + MInitElem(MDefinition *obj, MDefinition *id, MDefinition *value) + { + setOperand(0, obj); + setOperand(1, id); + setOperand(2, value); + setResultType(MIRType_None); + } + + public: + INSTRUCTION_HEADER(InitElem) + + static MInitElem *New(MDefinition *obj, MDefinition *id, MDefinition *value) { + return new MInitElem(obj, id, value); + } + + MDefinition *getObject() const { + return getOperand(0); + } + MDefinition *getId() const { + return getOperand(1); + } + MDefinition *getValue() const { + return getOperand(2); + } + TypePolicy *typePolicy() { + return this; + } +}; + // Designates the start of call frame construction. // Generates code to adjust the stack pointer for the argument vector. // Argc is inferred by checking the use chain during lowering. diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index a5123a627ccd..06630fd7ae24 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -81,6 +81,7 @@ namespace ion { _(NewDeclEnvObject) \ _(NewCallObject) \ _(NewStringObject) \ + _(InitElem) \ _(InitProp) \ _(Start) \ _(OsrEntry) \ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 364df7b0902d..3fe70a523437 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -172,6 +172,7 @@ class ParallelArrayVisitor : public MInstructionVisitor CUSTOM_OP(NewObject) CUSTOM_OP(NewCallObject) CUSTOM_OP(NewParallelArray) + UNSAFE_OP(InitElem) UNSAFE_OP(InitProp) SAFE_OP(Start) UNSAFE_OP(OsrEntry) diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 3f209e53c857..3dd5812581b9 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -186,6 +186,20 @@ class MixPolicy : public TypePolicy } }; +// Combine three policies. +template +class Mix3Policy : public TypePolicy +{ + public: + static bool staticAdjustInputs(MInstruction *ins) { + return Policy1::staticAdjustInputs(ins) && Policy2::staticAdjustInputs(ins) && + Policy3::staticAdjustInputs(ins); + } + virtual bool adjustInputs(MInstruction *ins) { + return staticAdjustInputs(ins); + } +}; + class CallSetElementPolicy : public SingleObjectPolicy { public: From efae06a65b8c5253ed2f10f5e444b08e8167fe31 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Wed, 17 Apr 2013 11:49:33 +0100 Subject: [PATCH 121/438] Bug 841941 - Add a mochitest to check that the order in which @value/@min/@max/@step are specified in markup makes no difference to the value that will be given. r=mounir --- content/html/content/test/forms/Makefile.in | 1 + .../forms/test_input_range_attr_order.html | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 content/html/content/test/forms/test_input_range_attr_order.html diff --git a/content/html/content/test/forms/Makefile.in b/content/html/content/test/forms/Makefile.in index b51f387f2e05..bd692c436912 100644 --- a/content/html/content/test/forms/Makefile.in +++ b/content/html/content/test/forms/Makefile.in @@ -18,6 +18,7 @@ MOCHITEST_FILES = \ test_input_attributes_reflection.html \ test_input_list_attribute.html \ test_input_email.html \ + test_input_range_attr_order.html \ test_input_range_key_events.html \ test_input_range_mouse_and_touch_events.html \ test_input_url.html \ diff --git a/content/html/content/test/forms/test_input_range_attr_order.html b/content/html/content/test/forms/test_input_range_attr_order.html new file mode 100644 index 000000000000..3d3d6d6f7684 --- /dev/null +++ b/content/html/content/test/forms/test_input_range_attr_order.html @@ -0,0 +1,48 @@ + + + + + Test @min/@max/@step order for range + + + + + + +Mozilla Bug 841941 +

+
+ + + + +
+
+
+
+ + From 86ee6c8245c353089a80823edb5e7de377c70d5c Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Sat, 16 Mar 2013 01:40:06 +0530 Subject: [PATCH 122/438] Bug 814587 - Change Reader:Add to handle tabID and URL as input (r=bnicholson) --- mobile/android/base/Tab.java | 10 ++++- mobile/android/chrome/content/browser.js | 54 +++++++++++++++++------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 1fd10649111b..98ace2a72c5e 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -399,7 +399,15 @@ public class Tab { if (!mReaderEnabled) return; - GeckoEvent e = GeckoEvent.createBroadcastEvent("Reader:Add", String.valueOf(getId())); + JSONObject json = new JSONObject(); + try { + json.put("tabID", String.valueOf(getId())); + } catch (JSONException e) { + Log.e(LOGTAG, "JSON error - failing to add to reading list", e); + return; + } + + GeckoEvent e = GeckoEvent.createBroadcastEvent("Reader:Add", json.toString()); GeckoAppShell.sendEventToGecko(e); } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index d7153f912b74..eee668e8b8ef 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -6531,9 +6531,26 @@ let Reader = { observe: function(aMessage, aTopic, aData) { switch(aTopic) { case "Reader:Add": { - let tab = BrowserApp.getTabForId(aData); - let currentURI = tab.browser.currentURI; - let url = currentURI.spec; + let args = JSON.parse(aData); + + let tabID = null; + let url, urlWithoutRef; + + if ('tabID' in args) { + tabID = args.tabID; + + let tab = BrowserApp.getTabForId(tabID); + let currentURI = tab.browser.currentURI; + + url = currentURI.spec; + urlWithoutRef = currentURI.specIgnoringRef; + } else if ('url' in args) { + let uri = Services.io.newURI(args.url, null, null); + url = uri.spec; + urlWithoutRef = uri.specIgnoringRef; + } else { + throw new Error("Reader:Add requires a tabID or an URL as argument"); + } let sendResult = function(result, title) { this.log("Reader:Add success=" + result + ", url=" + url + ", title=" + title); @@ -6546,25 +6563,30 @@ let Reader = { }); }.bind(this); - this.getArticleFromCache(currentURI.specIgnoringRef, function (article) { + let handleArticle = function(article) { + if (!article) { + sendResult(this.READER_ADD_FAILED, ""); + return; + } + + this.storeArticleInCache(article, function(success) { + let result = (success ? this.READER_ADD_SUCCESS : this.READER_ADD_FAILED); + sendResult(result, article.title); + }.bind(this)); + }.bind(this); + + this.getArticleFromCache(urlWithoutRef, function (article) { // If the article is already in reading list, bail if (article) { sendResult(this.READER_ADD_DUPLICATE, ""); return; } - this.getArticleForTab(aData, currentURI.specIgnoringRef, function (article) { - if (!article) { - sendResult(this.READER_ADD_FAILED, ""); - return; - } - - this.storeArticleInCache(article, function(success) { - let result = (success ? this.READER_ADD_SUCCESS : - this.READER_ADD_FAILED); - sendResult(result, article.title); - }.bind(this)); - }.bind(this)); + if (tabID != null) { + this.getArticleForTab(tabID, urlWithoutRef, handleArticle); + } else { + this.parseDocumentFromURL(urlWithoutRef, handleArticle); + } }.bind(this)); break; } From 2bbbd26f99fd7cd564be51047b6fdb93ddf5a6b1 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Tue, 9 Apr 2013 16:00:21 -0400 Subject: [PATCH 123/438] bug 860027 - remove XPTIInterfaceInfoManager::EnumerateInterfaces() r=bsmedberg, bholley --- js/xpconnect/src/XPCComponents.cpp | 144 +++++------------- .../public/nsIInterfaceInfoManager.idl | 4 +- .../xptinfo/src/xptiInterfaceInfoManager.cpp | 22 ++- 3 files changed, 53 insertions(+), 117 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 69bc225c1e8d..9fc4e3148208 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -34,6 +34,7 @@ #include "nsJSEnvironment.h" #include "nsXMLHttpRequest.h" #include "mozilla/Telemetry.h" +#include "mozilla/XPTInterfaceInfoManager.h" #include "nsDOMClassInfoID.h" using namespace mozilla; @@ -120,7 +121,7 @@ public: virtual ~nsXPCComponents_Interfaces(); private: - nsCOMPtr mManager; + nsCOMArray mInterfaces; }; /* void getInterfaces (out uint32_t count, [array, size_is (count), retval] @@ -215,9 +216,9 @@ nsXPCComponents_Interfaces::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) return NS_ERROR_NOT_AVAILABLE; } -nsXPCComponents_Interfaces::nsXPCComponents_Interfaces() : - mManager(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)) +nsXPCComponents_Interfaces::nsXPCComponents_Interfaces() { + XPTInterfaceInfoManager::GetSingleton()->GetScriptableInterfaces(mInterfaces); } nsXPCComponents_Interfaces::~nsXPCComponents_Interfaces() @@ -254,64 +255,36 @@ nsXPCComponents_Interfaces::NewEnumerate(nsIXPConnectWrappedNative *wrapper, uint32_t enum_op, jsval * statep, jsid * idp, bool *_retval) { - nsIEnumerator* e; - switch (enum_op) { case JSENUMERATE_INIT: case JSENUMERATE_INIT_ALL: { - if (!mManager || - NS_FAILED(mManager->EnumerateInterfaces(&e)) || !e || - NS_FAILED(e->First())) - - { - *statep = JSVAL_NULL; - return NS_ERROR_UNEXPECTED; - } - - *statep = PRIVATE_TO_JSVAL(e); + *statep = JSVAL_ZERO; if (idp) - *idp = INT_TO_JSID(0); // indicate that we don't know the count + *idp = INT_TO_JSID(mInterfaces.Length()); return NS_OK; } case JSENUMERATE_NEXT: { - nsCOMPtr isup; + uint32_t idx = JSVAL_TO_INT(*statep); + nsIInterfaceInfo* interface = mInterfaces.SafeElementAt(idx); + *statep = UINT_TO_JSVAL(idx + 1); - e = (nsIEnumerator*) JSVAL_TO_PRIVATE(*statep); + if (interface) { + JSString* idstr; + const char* name; - while (1) { - if (static_cast(NS_ENUMERATOR_FALSE) == e->IsDone() && - NS_SUCCEEDED(e->CurrentItem(getter_AddRefs(isup))) && isup) { - e->Next(); - nsCOMPtr iface(do_QueryInterface(isup)); - if (iface) { - JSString* idstr; - const char* name; - bool scriptable; - - if (NS_SUCCEEDED(iface->IsScriptable(&scriptable)) && - !scriptable) { - continue; - } - - if (NS_SUCCEEDED(iface->GetNameShared(&name)) && name && - nullptr != (idstr = JS_NewStringCopyZ(cx, name)) && - JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp)) { - return NS_OK; - } - } + if (NS_SUCCEEDED(interface->GetNameShared(&name)) && name && + nullptr != (idstr = JS_NewStringCopyZ(cx, name)) && + JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp)) { + return NS_OK; } - // else... - break; } - // FALL THROUGH + // fall through } case JSENUMERATE_DESTROY: default: - e = (nsIEnumerator*) JSVAL_TO_PRIVATE(*statep); - NS_IF_RELEASE(e); *statep = JSVAL_NULL; return NS_OK; } @@ -326,17 +299,16 @@ nsXPCComponents_Interfaces::NewResolve(nsIXPConnectWrappedNative *wrapper, { RootedObject obj(cx, objArg); RootedId id(cx, idArg); - - if (!mManager || !JSID_IS_STRING(id)) - return NS_OK; - JSAutoByteString name; RootedString str(cx, JSID_TO_STRING(id)); - // we only allow interfaces by name here - if (name.encodeLatin1(cx, JSID_TO_STRING(id)) && name.ptr()[0] != '{') { + if (JSID_IS_STRING(id) && name.encodeLatin1(cx, JSID_TO_STRING(id)) && + name.ptr()[0] != '{') + { + // we only allow interfaces by name here nsCOMPtr info; - mManager->GetInfoForName(name.ptr(), getter_AddRefs(info)); + XPTInterfaceInfoManager::GetSingleton()-> + GetInfoForName(name.ptr(), getter_AddRefs(info)); if (!info) return NS_OK; @@ -428,7 +400,7 @@ public: virtual ~nsXPCComponents_InterfacesByID(); private: - nsCOMPtr mManager; + nsCOMArray mInterfaces; }; /***************************************************************************/ @@ -524,9 +496,9 @@ nsXPCComponents_InterfacesByID::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) return NS_ERROR_NOT_AVAILABLE; } -nsXPCComponents_InterfacesByID::nsXPCComponents_InterfacesByID() : - mManager(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID)) +nsXPCComponents_InterfacesByID::nsXPCComponents_InterfacesByID() { + XPTInterfaceInfoManager::GetSingleton()->GetScriptableInterfaces(mInterfaces); } nsXPCComponents_InterfacesByID::~nsXPCComponents_InterfacesByID() @@ -561,68 +533,38 @@ nsXPCComponents_InterfacesByID::NewEnumerate(nsIXPConnectWrappedNative *wrapper, uint32_t enum_op, jsval * statep, jsid * idp, bool *_retval) { - nsIEnumerator* e; - switch (enum_op) { case JSENUMERATE_INIT: case JSENUMERATE_INIT_ALL: { - if (!mManager || - NS_FAILED(mManager->EnumerateInterfaces(&e)) || !e || - NS_FAILED(e->First())) - - { - *statep = JSVAL_NULL; - return NS_ERROR_UNEXPECTED; - } - - *statep = PRIVATE_TO_JSVAL(e); + *statep = JSVAL_ZERO; if (idp) - *idp = INT_TO_JSID(0); // indicate that we don't know the count + *idp = INT_TO_JSID(mInterfaces.Length()); return NS_OK; } case JSENUMERATE_NEXT: { - nsCOMPtr isup; + uint32_t idx = JSVAL_TO_INT(*statep); + nsIInterfaceInfo* interface = mInterfaces.SafeElementAt(idx); + *statep = UINT_TO_JSVAL(idx + 1); + if (interface) { + nsIID const *iid; + char idstr[NSID_LENGTH]; + JSString* jsstr; - e = (nsIEnumerator*) JSVAL_TO_PRIVATE(*statep); - - while (1) { - if (static_cast(NS_ENUMERATOR_FALSE) == e->IsDone() && - NS_SUCCEEDED(e->CurrentItem(getter_AddRefs(isup))) && isup) { - e->Next(); - nsCOMPtr iface(do_QueryInterface(isup)); - if (iface) { - nsIID const *iid; - char idstr[NSID_LENGTH]; - JSString* jsstr; - bool scriptable; - - if (NS_SUCCEEDED(iface->IsScriptable(&scriptable)) && - !scriptable) { - continue; - } - - if (NS_SUCCEEDED(iface->GetIIDShared(&iid))) { - iid->ToProvidedString(idstr); - jsstr = JS_NewStringCopyZ(cx, idstr); - if (jsstr && - JS_ValueToId(cx, STRING_TO_JSVAL(jsstr), idp)) { - return NS_OK; - } - } + if (NS_SUCCEEDED(interface->GetIIDShared(&iid))) { + iid->ToProvidedString(idstr); + jsstr = JS_NewStringCopyZ(cx, idstr); + if (jsstr && JS_ValueToId(cx, STRING_TO_JSVAL(jsstr), idp)) { + return NS_OK; } } - // else... - break; } // FALL THROUGH } case JSENUMERATE_DESTROY: default: - e = (nsIEnumerator*) JSVAL_TO_PRIVATE(*statep); - NS_IF_RELEASE(e); *statep = JSVAL_NULL; return NS_OK; } @@ -639,9 +581,6 @@ nsXPCComponents_InterfacesByID::NewResolve(nsIXPConnectWrappedNative *wrapper, RootedId id(cx, idArg); RootedString str(cx, JSID_TO_STRING(id)); - if (!mManager || !JSID_IS_STRING(id)) - return NS_OK; - if (38 != JS_GetStringLength(str)) return NS_OK; @@ -651,7 +590,8 @@ nsXPCComponents_InterfacesByID::NewResolve(nsIXPConnectWrappedNative *wrapper, return NS_OK; nsCOMPtr info; - mManager->GetInfoForIID(&iid, getter_AddRefs(info)); + XPTInterfaceInfoManager::GetSingleton()-> + GetInfoForIID(&iid, getter_AddRefs(info)); if (!info) return NS_OK; diff --git a/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl b/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl index 72fb5f2f8a01..f0db98a2f6e1 100644 --- a/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl +++ b/xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl @@ -12,7 +12,7 @@ #include "nsISimpleEnumerator.idl" /* this is NOT intended to be scriptable */ -[uuid(8B161900-BE2B-11d2-9831-006008962422)] +[uuid(1d53d8d9-1d92-428f-b5cc-198b55e897d7)] interface nsIInterfaceInfoManager : nsISupports { nsIInterfaceInfo getInfoForIID(in nsIIDPtr iid); @@ -21,8 +21,6 @@ interface nsIInterfaceInfoManager : nsISupports nsIIDPtr getIIDForName(in string name); string getNameForIID(in nsIIDPtr iid); - nsIEnumerator enumerateInterfaces(); - void autoRegisterInterfaces(); nsIEnumerator enumerateInterfacesWhoseNamesStartWith(in string prefix); diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index e1b7c874b55c..650c51dfb41e 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -268,32 +268,30 @@ XPTInterfaceInfoManager::GetNameForIID(const nsIID * iid, char **_retval) static PLDHashOperator xpti_ArrayAppender(const char* name, xptiInterfaceEntry* entry, void* arg) { - nsISupportsArray* array = (nsISupportsArray*) arg; + nsCOMArray* array = static_cast*>(arg); nsCOMPtr ii; - if (NS_SUCCEEDED(EntryToInfo(entry, getter_AddRefs(ii)))) + if (NS_SUCCEEDED(EntryToInfo(entry, getter_AddRefs(ii)))) { + bool scriptable = false; + ii->IsScriptable(&scriptable); + if (scriptable) { array->AppendElement(ii); + } + } return PL_DHASH_NEXT; } /* nsIEnumerator enumerateInterfaces (); */ -NS_IMETHODIMP -XPTInterfaceInfoManager::EnumerateInterfaces(nsIEnumerator **_retval) +void +XPTInterfaceInfoManager::GetScriptableInterfaces(nsCOMArray& aInterfaces) { // I didn't want to incur the size overhead of using nsHashtable just to // make building an enumerator easier. So, this code makes a snapshot of // the table using an nsISupportsArray and builds an enumerator for that. // We can afford this transient cost. - nsCOMPtr array; - NS_NewISupportsArray(getter_AddRefs(array)); - if (!array) - return NS_ERROR_UNEXPECTED; - ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor); - mWorkingSet.mNameTable.EnumerateRead(xpti_ArrayAppender, array); - - return array->Enumerate(_retval); + mWorkingSet.mNameTable.EnumerateRead(xpti_ArrayAppender, &aInterfaces); } struct ArrayAndPrefix From 7e00febe1e9ebb05d3638118ca1097a27fd5434f Mon Sep 17 00:00:00 2001 From: Norbert Lindenberg Date: Mon, 15 Apr 2013 14:35:27 -0700 Subject: [PATCH 124/438] Bug 837950 - Import test402 source files. r=jwalden --HG-- extra : rebase_source : 7de0eedbac0476fcc2a91fa8cce60a7437e56d2d --- js/src/tests/test402/HG-INFO | 7 + js/src/tests/test402/LICENSE | 28 + js/src/tests/test402/ch06/6.2/6.2.2_a.js | 40 + js/src/tests/test402/ch06/6.2/6.2.2_b.js | 41 + js/src/tests/test402/ch06/6.2/6.2.2_c.js | 47 + js/src/tests/test402/ch06/6.2/6.2.3.js | 69 + js/src/tests/test402/ch06/6.2/6.2.4.js | 19 + js/src/tests/test402/ch06/6.2/browser.js | 0 js/src/tests/test402/ch06/6.2/shell.js | 0 js/src/tests/test402/ch06/6.3/6.3.1_a.js | 25 + js/src/tests/test402/ch06/6.3/6.3.1_b.js | 35 + js/src/tests/test402/ch06/6.3/browser.js | 0 js/src/tests/test402/ch06/6.3/shell.js | 0 js/src/tests/test402/ch06/6.4/6.4_a.js | 22 + js/src/tests/test402/ch06/6.4/6.4_b.js | 34 + js/src/tests/test402/ch06/6.4/6.4_c.js | 36 + js/src/tests/test402/ch06/6.4/browser.js | 0 js/src/tests/test402/ch06/6.4/shell.js | 0 js/src/tests/test402/ch06/browser.js | 0 js/src/tests/test402/ch06/shell.js | 0 js/src/tests/test402/ch08/8.0/8.0.js | 12 + js/src/tests/test402/ch08/8.0/8.0_L15.js | 15 + js/src/tests/test402/ch08/8.0/browser.js | 0 js/src/tests/test402/ch08/8.0/shell.js | 0 js/src/tests/test402/ch08/browser.js | 0 js/src/tests/test402/ch08/shell.js | 0 js/src/tests/test402/ch09/9.1/9.1_a.js | 18 + js/src/tests/test402/ch09/9.1/9.1_b.js | 32 + js/src/tests/test402/ch09/9.1/browser.js | 0 js/src/tests/test402/ch09/9.1/shell.js | 0 js/src/tests/test402/ch09/9.2/9.2.1_1.js | 23 + js/src/tests/test402/ch09/9.2/9.2.1_2.js | 21 + js/src/tests/test402/ch09/9.2/9.2.1_3.js | 87 ++ js/src/tests/test402/ch09/9.2/9.2.1_4.js | 46 + js/src/tests/test402/ch09/9.2/9.2.1_8_c_ii.js | 30 + js/src/tests/test402/ch09/9.2/9.2.1_8_c_vi.js | 18 + js/src/tests/test402/ch09/9.2/9.2.2.js | 45 + js/src/tests/test402/ch09/9.2/9.2.3_5.js | 22 + .../tests/test402/ch09/9.2/9.2.5_11_g_ii_2.js | 26 + js/src/tests/test402/ch09/9.2/9.2.5_6.js | 22 + js/src/tests/test402/ch09/9.2/9.2.6_2.js | 27 + js/src/tests/test402/ch09/9.2/9.2.6_4.js | 23 + js/src/tests/test402/ch09/9.2/9.2.6_4_b.js | 47 + js/src/tests/test402/ch09/9.2/9.2.6_4_c.js | 32 + js/src/tests/test402/ch09/9.2/9.2.8_1_c.js | 36 + js/src/tests/test402/ch09/9.2/9.2.8_4.js | 35 + js/src/tests/test402/ch09/9.2/browser.js | 0 js/src/tests/test402/ch09/9.2/shell.js | 0 js/src/tests/test402/ch09/browser.js | 0 js/src/tests/test402/ch09/shell.js | 0 js/src/tests/test402/ch10/10.1/10.1.1_1.js | 43 + js/src/tests/test402/ch10/10.1/10.1.1_10.js | 18 + js/src/tests/test402/ch10/10.1/10.1.1_11.js | 12 + js/src/tests/test402/ch10/10.1/10.1.1_13.js | 13 + js/src/tests/test402/ch10/10.1/10.1.1_19_b.js | 44 + js/src/tests/test402/ch10/10.1/10.1.1_19_c.js | 63 + js/src/tests/test402/ch10/10.1/10.1.1_20.js | 13 + js/src/tests/test402/ch10/10.1/10.1.1_23.js | 13 + js/src/tests/test402/ch10/10.1/10.1.1_6.js | 12 + js/src/tests/test402/ch10/10.1/10.1.1_a.js | 14 + js/src/tests/test402/ch10/10.1/10.1.2.1_4.js | 21 + js/src/tests/test402/ch10/10.1/10.1.2_a.js | 30 + js/src/tests/test402/ch10/10.1/10.1.3.js | 19 + js/src/tests/test402/ch10/10.1/10.1_L15.js | 14 + js/src/tests/test402/ch10/10.1/browser.js | 0 js/src/tests/test402/ch10/10.1/shell.js | 0 js/src/tests/test402/ch10/10.2/10.2.1.js | 22 + js/src/tests/test402/ch10/10.2/10.2.2_L15.js | 14 + js/src/tests/test402/ch10/10.2/10.2.2_a.js | 27 + js/src/tests/test402/ch10/10.2/10.2.2_b.js | 13 + js/src/tests/test402/ch10/10.2/10.2.3_b.js | 52 + js/src/tests/test402/ch10/10.2/browser.js | 0 js/src/tests/test402/ch10/10.2/shell.js | 0 js/src/tests/test402/ch10/10.3/10.3.1.js | 13 + .../tests/test402/ch10/10.3/10.3.2_1_a_L15.js | 14 + js/src/tests/test402/ch10/10.3/10.3.2_1_c.js | 36 + js/src/tests/test402/ch10/10.3/10.3.2_CS_a.js | 68 + .../tests/test402/ch10/10.3/10.3.2_CS_b_NN.js | 22 + .../tests/test402/ch10/10.3/10.3.2_CS_c_NN.js | 22 + .../tests/test402/ch10/10.3/10.3.2_CS_d_NN.js | 34 + js/src/tests/test402/ch10/10.3/10.3.2_L15.js | 14 + js/src/tests/test402/ch10/10.3/10.3.3.js | 47 + js/src/tests/test402/ch10/10.3/10.3.3_L15.js | 14 + js/src/tests/test402/ch10/10.3/10.3_L15.js | 14 + js/src/tests/test402/ch10/10.3/10.3_a.js | 15 + js/src/tests/test402/ch10/10.3/10.3_b.js | 33 + js/src/tests/test402/ch10/10.3/browser.js | 0 js/src/tests/test402/ch10/10.3/shell.js | 0 js/src/tests/test402/ch10/10.4/10.4_a.js | 15 + js/src/tests/test402/ch10/10.4/browser.js | 0 js/src/tests/test402/ch10/10.4/shell.js | 0 js/src/tests/test402/ch10/browser.js | 0 js/src/tests/test402/ch10/shell.js | 0 js/src/tests/test402/ch11/11.1/11.1.1_1.js | 43 + js/src/tests/test402/ch11/11.1/11.1.1_15.js | 13 + js/src/tests/test402/ch11/11.1/11.1.1_17.js | 81 ++ js/src/tests/test402/ch11/11.1/11.1.1_19.js | 31 + js/src/tests/test402/ch11/11.1/11.1.1_20_c.js | 196 +++ js/src/tests/test402/ch11/11.1/11.1.1_21.js | 15 + js/src/tests/test402/ch11/11.1/11.1.1_32.js | 44 + js/src/tests/test402/ch11/11.1/11.1.1_34.js | 12 + js/src/tests/test402/ch11/11.1/11.1.1_6.js | 18 + js/src/tests/test402/ch11/11.1/11.1.1_7.js | 12 + js/src/tests/test402/ch11/11.1/11.1.1_a.js | 18 + js/src/tests/test402/ch11/11.1/11.1.2.1_4.js | 21 + js/src/tests/test402/ch11/11.1/11.1.2.js | 30 + js/src/tests/test402/ch11/11.1/11.1.3.js | 19 + js/src/tests/test402/ch11/11.1/11.1_L15.js | 14 + js/src/tests/test402/ch11/11.1/browser.js | 0 js/src/tests/test402/ch11/11.1/shell.js | 0 js/src/tests/test402/ch11/11.2/11.2.1.js | 22 + js/src/tests/test402/ch11/11.2/11.2.2_L15.js | 14 + js/src/tests/test402/ch11/11.2/11.2.2_a.js | 28 + js/src/tests/test402/ch11/11.2/11.2.2_b.js | 13 + js/src/tests/test402/ch11/11.2/11.2.3_b.js | 46 + js/src/tests/test402/ch11/11.2/browser.js | 0 js/src/tests/test402/ch11/11.2/shell.js | 0 js/src/tests/test402/ch11/11.3/11.3.1.js | 14 + .../tests/test402/ch11/11.3/11.3.2_1_a_L15.js | 14 + .../tests/test402/ch11/11.3/11.3.2_1_a_ii.js | 27 + js/src/tests/test402/ch11/11.3/11.3.2_1_c.js | 41 + js/src/tests/test402/ch11/11.3/11.3.2_FN_1.js | 19 + js/src/tests/test402/ch11/11.3/11.3.2_FN_2.js | 59 + .../tests/test402/ch11/11.3/11.3.2_FN_3_b.js | 27 + .../tests/test402/ch11/11.3/11.3.2_FN_3_e.js | 47 + js/src/tests/test402/ch11/11.3/11.3.2_L15.js | 14 + js/src/tests/test402/ch11/11.3/11.3.2_TRF.js | 52 + js/src/tests/test402/ch11/11.3/11.3.2_TRP.js | 52 + js/src/tests/test402/ch11/11.3/11.3.3.js | 31 + js/src/tests/test402/ch11/11.3/11.3.3_L15.js | 14 + js/src/tests/test402/ch11/11.3/11.3_L15.js | 14 + js/src/tests/test402/ch11/11.3/11.3_a.js | 16 + js/src/tests/test402/ch11/11.3/11.3_b.js | 33 + js/src/tests/test402/ch11/11.3/browser.js | 0 js/src/tests/test402/ch11/11.3/shell.js | 0 js/src/tests/test402/ch11/11.4/11.4_a.js | 15 + js/src/tests/test402/ch11/11.4/browser.js | 0 js/src/tests/test402/ch11/11.4/shell.js | 0 js/src/tests/test402/ch11/browser.js | 0 js/src/tests/test402/ch11/shell.js | 0 js/src/tests/test402/ch12/12.1/12.1.1_1.js | 43 + js/src/tests/test402/ch12/12.1/12.1.1_18.js | 15 + js/src/tests/test402/ch12/12.1/12.1.1_22.js | 18 + js/src/tests/test402/ch12/12.1/12.1.1_23.js | 14 + js/src/tests/test402/ch12/12.1/12.1.1_25.js | 12 + js/src/tests/test402/ch12/12.1/12.1.1_5.js | 18 + js/src/tests/test402/ch12/12.1/12.1.1_6.js | 12 + js/src/tests/test402/ch12/12.1/12.1.1_TDTO.js | 107 ++ js/src/tests/test402/ch12/12.1/12.1.1_a.js | 18 + js/src/tests/test402/ch12/12.1/12.1.2.1_4.js | 21 + js/src/tests/test402/ch12/12.1/12.1.2.js | 30 + js/src/tests/test402/ch12/12.1/12.1.3.js | 19 + js/src/tests/test402/ch12/12.1/12.1_L15.js | 14 + js/src/tests/test402/ch12/12.1/browser.js | 0 js/src/tests/test402/ch12/12.1/shell.js | 0 js/src/tests/test402/ch12/12.2/12.2.1.js | 22 + js/src/tests/test402/ch12/12.2/12.2.2_L15.js | 14 + js/src/tests/test402/ch12/12.2/12.2.2_a.js | 28 + js/src/tests/test402/ch12/12.2/12.2.2_b.js | 13 + js/src/tests/test402/ch12/12.2/12.2.3_b.js | 47 + js/src/tests/test402/ch12/12.2/12.2.3_c.js | 52 + js/src/tests/test402/ch12/12.2/browser.js | 0 js/src/tests/test402/ch12/12.2/shell.js | 0 js/src/tests/test402/ch12/12.3/12.3.1.js | 14 + .../tests/test402/ch12/12.3/12.3.2_1_a_L15.js | 14 + js/src/tests/test402/ch12/12.3/12.3.2_1_c.js | 34 + .../tests/test402/ch12/12.3/12.3.2_FDT_1.js | 26 + .../test402/ch12/12.3/12.3.2_FDT_7_a_iv.js | 32 + js/src/tests/test402/ch12/12.3/12.3.2_L15.js | 14 + .../tests/test402/ch12/12.3/12.3.2_TLT_2.js | 16 + js/src/tests/test402/ch12/12.3/12.3.3.js | 52 + js/src/tests/test402/ch12/12.3/12.3.3_L15.js | 14 + js/src/tests/test402/ch12/12.3/12.3_L15.js | 14 + js/src/tests/test402/ch12/12.3/12.3_a.js | 16 + js/src/tests/test402/ch12/12.3/12.3_b.js | 33 + js/src/tests/test402/ch12/12.3/browser.js | 0 js/src/tests/test402/ch12/12.3/shell.js | 0 js/src/tests/test402/ch12/12.4/12.4_a.js | 15 + js/src/tests/test402/ch12/12.4/browser.js | 0 js/src/tests/test402/ch12/12.4/shell.js | 0 js/src/tests/test402/ch12/browser.js | 0 js/src/tests/test402/ch12/shell.js | 0 js/src/tests/test402/ch13/13.1/13.1.1_1.js | 24 + js/src/tests/test402/ch13/13.1/13.1.1_2.js | 26 + js/src/tests/test402/ch13/13.1/13.1.1_3_1.js | 26 + js/src/tests/test402/ch13/13.1/13.1.1_3_2.js | 22 + js/src/tests/test402/ch13/13.1/13.1.1_6_1.js | 65 + js/src/tests/test402/ch13/13.1/13.1.1_6_2.js | 13 + js/src/tests/test402/ch13/13.1/13.1.1_7.js | 33 + js/src/tests/test402/ch13/13.1/13.1.1_L15.js | 14 + js/src/tests/test402/ch13/13.1/browser.js | 0 js/src/tests/test402/ch13/13.1/shell.js | 0 js/src/tests/test402/ch13/13.2/13.2.1_1.js | 37 + js/src/tests/test402/ch13/13.2/13.2.1_4_1.js | 67 + js/src/tests/test402/ch13/13.2/13.2.1_4_2.js | 13 + js/src/tests/test402/ch13/13.2/13.2.1_5.js | 41 + js/src/tests/test402/ch13/13.2/13.2.1_L15.js | 14 + js/src/tests/test402/ch13/13.2/browser.js | 0 js/src/tests/test402/ch13/13.2/shell.js | 0 js/src/tests/test402/ch13/13.3/13.3.0_1.js | 32 + js/src/tests/test402/ch13/13.3/13.3.0_2.js | 26 + js/src/tests/test402/ch13/13.3/13.3.0_6_1.js | 74 ++ js/src/tests/test402/ch13/13.3/13.3.0_6_2.js | 15 + js/src/tests/test402/ch13/13.3/13.3.0_7.js | 58 + js/src/tests/test402/ch13/13.3/13.3.1_L15.js | 14 + js/src/tests/test402/ch13/13.3/13.3.2_L15.js | 14 + js/src/tests/test402/ch13/13.3/13.3.3_L15.js | 14 + js/src/tests/test402/ch13/13.3/browser.js | 0 js/src/tests/test402/ch13/13.3/shell.js | 0 js/src/tests/test402/ch13/browser.js | 0 js/src/tests/test402/ch13/shell.js | 0 js/src/tests/test402/lib/testBuiltInObject.js | 124 ++ js/src/tests/test402/lib/testIntl.js | 1167 +++++++++++++++++ 213 files changed, 5761 insertions(+) create mode 100644 js/src/tests/test402/HG-INFO create mode 100644 js/src/tests/test402/LICENSE create mode 100644 js/src/tests/test402/ch06/6.2/6.2.2_a.js create mode 100644 js/src/tests/test402/ch06/6.2/6.2.2_b.js create mode 100644 js/src/tests/test402/ch06/6.2/6.2.2_c.js create mode 100644 js/src/tests/test402/ch06/6.2/6.2.3.js create mode 100644 js/src/tests/test402/ch06/6.2/6.2.4.js create mode 100644 js/src/tests/test402/ch06/6.2/browser.js create mode 100644 js/src/tests/test402/ch06/6.2/shell.js create mode 100644 js/src/tests/test402/ch06/6.3/6.3.1_a.js create mode 100644 js/src/tests/test402/ch06/6.3/6.3.1_b.js create mode 100644 js/src/tests/test402/ch06/6.3/browser.js create mode 100644 js/src/tests/test402/ch06/6.3/shell.js create mode 100644 js/src/tests/test402/ch06/6.4/6.4_a.js create mode 100644 js/src/tests/test402/ch06/6.4/6.4_b.js create mode 100644 js/src/tests/test402/ch06/6.4/6.4_c.js create mode 100644 js/src/tests/test402/ch06/6.4/browser.js create mode 100644 js/src/tests/test402/ch06/6.4/shell.js create mode 100644 js/src/tests/test402/ch06/browser.js create mode 100644 js/src/tests/test402/ch06/shell.js create mode 100644 js/src/tests/test402/ch08/8.0/8.0.js create mode 100644 js/src/tests/test402/ch08/8.0/8.0_L15.js create mode 100644 js/src/tests/test402/ch08/8.0/browser.js create mode 100644 js/src/tests/test402/ch08/8.0/shell.js create mode 100644 js/src/tests/test402/ch08/browser.js create mode 100644 js/src/tests/test402/ch08/shell.js create mode 100644 js/src/tests/test402/ch09/9.1/9.1_a.js create mode 100644 js/src/tests/test402/ch09/9.1/9.1_b.js create mode 100644 js/src/tests/test402/ch09/9.1/browser.js create mode 100644 js/src/tests/test402/ch09/9.1/shell.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_1.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_2.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_3.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_4.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_8_c_ii.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.1_8_c_vi.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.2.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.3_5.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.5_11_g_ii_2.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.5_6.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.6_2.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.6_4.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.6_4_b.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.6_4_c.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.8_1_c.js create mode 100644 js/src/tests/test402/ch09/9.2/9.2.8_4.js create mode 100644 js/src/tests/test402/ch09/9.2/browser.js create mode 100644 js/src/tests/test402/ch09/9.2/shell.js create mode 100644 js/src/tests/test402/ch09/browser.js create mode 100644 js/src/tests/test402/ch09/shell.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_1.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_10.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_11.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_13.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_19_b.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_19_c.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_20.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_23.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_6.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.1_a.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.2.1_4.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.2_a.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1.3.js create mode 100644 js/src/tests/test402/ch10/10.1/10.1_L15.js create mode 100644 js/src/tests/test402/ch10/10.1/browser.js create mode 100644 js/src/tests/test402/ch10/10.1/shell.js create mode 100644 js/src/tests/test402/ch10/10.2/10.2.1.js create mode 100644 js/src/tests/test402/ch10/10.2/10.2.2_L15.js create mode 100644 js/src/tests/test402/ch10/10.2/10.2.2_a.js create mode 100644 js/src/tests/test402/ch10/10.2/10.2.2_b.js create mode 100644 js/src/tests/test402/ch10/10.2/10.2.3_b.js create mode 100644 js/src/tests/test402/ch10/10.2/browser.js create mode 100644 js/src/tests/test402/ch10/10.2/shell.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.1.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_1_a_L15.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_1_c.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_CS_a.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_CS_b_NN.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_CS_c_NN.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_CS_d_NN.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.2_L15.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.3.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3.3_L15.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3_L15.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3_a.js create mode 100644 js/src/tests/test402/ch10/10.3/10.3_b.js create mode 100644 js/src/tests/test402/ch10/10.3/browser.js create mode 100644 js/src/tests/test402/ch10/10.3/shell.js create mode 100644 js/src/tests/test402/ch10/10.4/10.4_a.js create mode 100644 js/src/tests/test402/ch10/10.4/browser.js create mode 100644 js/src/tests/test402/ch10/10.4/shell.js create mode 100644 js/src/tests/test402/ch10/browser.js create mode 100644 js/src/tests/test402/ch10/shell.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_1.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_15.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_17.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_19.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_20_c.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_21.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_32.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_34.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_6.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_7.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.1_a.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.2.1_4.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.2.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1.3.js create mode 100644 js/src/tests/test402/ch11/11.1/11.1_L15.js create mode 100644 js/src/tests/test402/ch11/11.1/browser.js create mode 100644 js/src/tests/test402/ch11/11.1/shell.js create mode 100644 js/src/tests/test402/ch11/11.2/11.2.1.js create mode 100644 js/src/tests/test402/ch11/11.2/11.2.2_L15.js create mode 100644 js/src/tests/test402/ch11/11.2/11.2.2_a.js create mode 100644 js/src/tests/test402/ch11/11.2/11.2.2_b.js create mode 100644 js/src/tests/test402/ch11/11.2/11.2.3_b.js create mode 100644 js/src/tests/test402/ch11/11.2/browser.js create mode 100644 js/src/tests/test402/ch11/11.2/shell.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.1.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_1_a_L15.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_1_a_ii.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_1_c.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_FN_1.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_FN_2.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_FN_3_b.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_FN_3_e.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_L15.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_TRF.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.2_TRP.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.3.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3.3_L15.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3_L15.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3_a.js create mode 100644 js/src/tests/test402/ch11/11.3/11.3_b.js create mode 100644 js/src/tests/test402/ch11/11.3/browser.js create mode 100644 js/src/tests/test402/ch11/11.3/shell.js create mode 100644 js/src/tests/test402/ch11/11.4/11.4_a.js create mode 100644 js/src/tests/test402/ch11/11.4/browser.js create mode 100644 js/src/tests/test402/ch11/11.4/shell.js create mode 100644 js/src/tests/test402/ch11/browser.js create mode 100644 js/src/tests/test402/ch11/shell.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_1.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_18.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_22.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_23.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_25.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_5.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_6.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_TDTO.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.1_a.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.2.1_4.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.2.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1.3.js create mode 100644 js/src/tests/test402/ch12/12.1/12.1_L15.js create mode 100644 js/src/tests/test402/ch12/12.1/browser.js create mode 100644 js/src/tests/test402/ch12/12.1/shell.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.1.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.2_L15.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.2_a.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.2_b.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.3_b.js create mode 100644 js/src/tests/test402/ch12/12.2/12.2.3_c.js create mode 100644 js/src/tests/test402/ch12/12.2/browser.js create mode 100644 js/src/tests/test402/ch12/12.2/shell.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.1.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_1_a_L15.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_1_c.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_FDT_1.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_FDT_7_a_iv.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_L15.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.2_TLT_2.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.3.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3.3_L15.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3_L15.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3_a.js create mode 100644 js/src/tests/test402/ch12/12.3/12.3_b.js create mode 100644 js/src/tests/test402/ch12/12.3/browser.js create mode 100644 js/src/tests/test402/ch12/12.3/shell.js create mode 100644 js/src/tests/test402/ch12/12.4/12.4_a.js create mode 100644 js/src/tests/test402/ch12/12.4/browser.js create mode 100644 js/src/tests/test402/ch12/12.4/shell.js create mode 100644 js/src/tests/test402/ch12/browser.js create mode 100644 js/src/tests/test402/ch12/shell.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_1.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_2.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_3_1.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_3_2.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_6_1.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_6_2.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_7.js create mode 100644 js/src/tests/test402/ch13/13.1/13.1.1_L15.js create mode 100644 js/src/tests/test402/ch13/13.1/browser.js create mode 100644 js/src/tests/test402/ch13/13.1/shell.js create mode 100644 js/src/tests/test402/ch13/13.2/13.2.1_1.js create mode 100644 js/src/tests/test402/ch13/13.2/13.2.1_4_1.js create mode 100644 js/src/tests/test402/ch13/13.2/13.2.1_4_2.js create mode 100644 js/src/tests/test402/ch13/13.2/13.2.1_5.js create mode 100644 js/src/tests/test402/ch13/13.2/13.2.1_L15.js create mode 100644 js/src/tests/test402/ch13/13.2/browser.js create mode 100644 js/src/tests/test402/ch13/13.2/shell.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.0_1.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.0_2.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.0_6_1.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.0_6_2.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.0_7.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.1_L15.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.2_L15.js create mode 100644 js/src/tests/test402/ch13/13.3/13.3.3_L15.js create mode 100644 js/src/tests/test402/ch13/13.3/browser.js create mode 100644 js/src/tests/test402/ch13/13.3/shell.js create mode 100644 js/src/tests/test402/ch13/browser.js create mode 100644 js/src/tests/test402/ch13/shell.js create mode 100644 js/src/tests/test402/lib/testBuiltInObject.js create mode 100644 js/src/tests/test402/lib/testIntl.js diff --git a/js/src/tests/test402/HG-INFO b/js/src/tests/test402/HG-INFO new file mode 100644 index 000000000000..50ef8efc055b --- /dev/null +++ b/js/src/tests/test402/HG-INFO @@ -0,0 +1,7 @@ +URL: http://hg.ecmascript.org/tests/test262 +changeset: 363:4f586032baec +tag: tip +user: Norbert Lindenberg +date: Sun Mar 24 23:48:59 2013 -0700 +summary: New tests and test fixes for ECMAScript Internationalization API. + diff --git a/js/src/tests/test402/LICENSE b/js/src/tests/test402/LICENSE new file mode 100644 index 000000000000..46b55a37b3e4 --- /dev/null +++ b/js/src/tests/test402/LICENSE @@ -0,0 +1,28 @@ +The << Software identified by reference to the Ecma Standard* ("Software)">> is protected by copyright and is being +made available under the "BSD License", included below. This Software may be subject to third party rights (rights +from parties other than Ecma International), including patent rights, and no licenses under such third party rights +are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA +CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR +INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS*. + +Copyright (C) 2012-2013 Ecma International +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +* Ecma International Standards hereafter means Ecma International Standards as well as Ecma Technical Reports \ No newline at end of file diff --git a/js/src/tests/test402/ch06/6.2/6.2.2_a.js b/js/src/tests/test402/ch06/6.2/6.2.2_a.js new file mode 100644 index 000000000000..a56894570b2c --- /dev/null +++ b/js/src/tests/test402/ch06/6.2/6.2.2_a.js @@ -0,0 +1,40 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that structurally valid language tags are accepted. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var validLanguageTags = [ + "de", // ISO 639 language code + "de-DE", // + ISO 3166-1 country code + "DE-de", // tags are case-insensitive + "cmn", // ISO 639 language code + "cmn-Hans", // + script code + "CMN-hANS", // tags are case-insensitive + "cmn-hans-cn", // + ISO 3166-1 country code + "es-419", // + UN M.49 region code + "es-419-u-nu-latn-cu-bob", // + Unicode locale extension sequence + "i-klingon", // grandfathered tag + "cmn-hans-cn-t-ca-u-ca-x-t-u", // singleton subtags can also be used as private use subtags + "enochian-enochian", // language and variant subtags may be the same + "de-gregory-u-ca-gregory", // variant and extension subtags may be the same + "aa-a-foo-x-a-foo-bar", // variant subtags can also be used as private use subtags + "x-en-US-12345", // anything goes in private use tags + "x-12345-12345-en-US", + "x-en-US-12345-12345", + "x-en-u-foo", + "x-en-u-foo-u-bar" +]; + +testWithIntlConstructors(function (Constructor) { + validLanguageTags.forEach(function (tag) { + // this must not throw an exception for a valid language tag + var obj = new Constructor([tag]); + }); + return true; +}); + diff --git a/js/src/tests/test402/ch06/6.2/6.2.2_b.js b/js/src/tests/test402/ch06/6.2/6.2.2_b.js new file mode 100644 index 000000000000..42d69e7c2e0f --- /dev/null +++ b/js/src/tests/test402/ch06/6.2/6.2.2_b.js @@ -0,0 +1,41 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that language tags with "_" are not accepted. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var invalidLanguageTags = [ + "de_DE", + "DE_de", + "cmn_Hans", + "cmn-hans_cn", + "es_419", + "es-419-u-nu-latn-cu_bob", + "i_klingon", + "cmn-hans-cn-t-ca-u-ca-x_t-u", + "enochian_enochian", + "de-gregory_u-ca-gregory" +]; + +testWithIntlConstructors(function (Constructor) { + invalidLanguageTags.forEach(function (tag) { + var error; + try { + // this must throw an exception for an invalid language tag + var obj = new Constructor([tag]); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid language tag " + tag + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid language tag " + tag + " was rejected with wrong error " + error.name + "."); + } + }); + return true; +}); + diff --git a/js/src/tests/test402/ch06/6.2/6.2.2_c.js b/js/src/tests/test402/ch06/6.2/6.2.2_c.js new file mode 100644 index 000000000000..6d669ebefdff --- /dev/null +++ b/js/src/tests/test402/ch06/6.2/6.2.2_c.js @@ -0,0 +1,47 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that language tags with invalid subtag sequences are not accepted. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var invalidLanguageTags = [ + "", // empty tag + "i", // singleton alone + "x", // private use without subtag + "u", // extension singleton in first place + "419", // region code in first place + "u-nu-latn-cu-bob", // extension sequence without language + "hans-cmn-cn", // "hans" could theoretically be a 4-letter language code, + // but those can't be followed by extlang codes. + "cmn-hans-cn-u-u", // duplicate singleton + "cmn-hans-cn-t-u-ca-u", // duplicate singleton + "de-gregory-gregory", // duplicate variant + "*", // language range + "de-*", // language range + "中文", // non-ASCII letters + "en-ß", // non-ASCII letters + "ıd" // non-ASCII letters +]; + +testWithIntlConstructors(function (Constructor) { + invalidLanguageTags.forEach(function (tag) { + var error; + try { + // this must throw an exception for an invalid language tag + var obj = new Constructor([tag]); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid language tag " + tag + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid language tag " + tag + " was rejected with wrong error " + error.name + "."); + } + }); + return true; +}); + diff --git a/js/src/tests/test402/ch06/6.2/6.2.3.js b/js/src/tests/test402/ch06/6.2/6.2.3.js new file mode 100644 index 000000000000..4ae15ab271c1 --- /dev/null +++ b/js/src/tests/test402/ch06/6.2/6.2.3.js @@ -0,0 +1,69 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that language tags are canonicalized in return values. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var canonicalizedTags = { + "de": ["de"], + "de-DE": ["de-DE", "de"], + "DE-de": ["de-DE", "de"], + "cmn": ["cmn"], + "CMN-hANS": ["cmn-Hans", "cmn"], + "cmn-hans-cn": ["cmn-Hans-CN", "cmn-Hans", "cmn"], + "es-419": ["es-419", "es"], + "es-419-u-nu-latn": ["es-419-u-nu-latn", "es-419", "es", "es-u-nu-latn"], + // -u-ca is incomplete, so it will not show up in resolvedOptions().locale + "cmn-hans-cn-u-ca-t-ca-x-t-u": ["cmn-Hans-CN-t-ca-u-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t", "cmn-Hans-CN-t-ca", "cmn-Hans-CN", "cmn-Hans", "cmn"], + "enochian-enochian": ["enochian-enochian", "enochian"], + "de-gregory-u-ca-gregory": ["de-gregory-u-ca-gregory", "de-gregory", "de-u-ca-gregory", "de"], + "no-nyn": ["nn"], + "i-klingon": ["tlh"], + "sgn-GR": ["gss"], + "ji": ["yi"], + "de-DD": ["de-DE", "de"], + "zh-hak-CN": ["hak-CN", "hak"], + "sgn-ils": ["ils"], + "in": ["id"], + "x-foo": ["x-foo"] +}; + +// make sure the data above is correct +Object.getOwnPropertyNames(canonicalizedTags).forEach(function (tag) { + canonicalizedTags[tag].forEach(function (canonicalTag) { + if (!isCanonicalizedStructurallyValidLanguageTag(canonicalTag)) { + $ERROR("Test data \"" + canonicalTag + "\" is not canonicalized and structurally valid language tag."); + } + }); +}); + +// now the actual test +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + Object.getOwnPropertyNames(canonicalizedTags).forEach(function (tag) { + // use lookup locale matcher to keep the set of possible return values predictable + + // Variant 1: construct an object and see whether its locale is canonicalized. + // In this variant, shortened forms or the default locale may be returned + var object = new Constructor([tag], {localeMatcher: "lookup"}); + var locale = object.resolvedOptions().locale; + if (canonicalizedTags[tag].indexOf(locale) === -1 && locale !== defaultLocale) { + $ERROR("For " + tag + " got " + locale + "; expected one of " + + canonicalizedTags[tag].join(", ") + "."); + } + + // Variant 2: get the supported locales. If the tag is supported, it should be returned canonicalized but unshortened + var supported = Constructor.supportedLocalesOf([tag]); + if (supported.length > 0 && supported[0] !== canonicalizedTags[tag][0]) { + $ERROR("For " + tag + " got " + supported[0] + "; expected " + + canonicalizedTags[tag][0] + "."); + } + }); + return true; +}); + diff --git a/js/src/tests/test402/ch06/6.2/6.2.4.js b/js/src/tests/test402/ch06/6.2/6.2.4.js new file mode 100644 index 000000000000..6ca47af14265 --- /dev/null +++ b/js/src/tests/test402/ch06/6.2/6.2.4.js @@ -0,0 +1,19 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the default locale is a String value representing the + * structurally valid and canonicalized BCP 47 language tag. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + if (!isCanonicalizedStructurallyValidLanguageTag(defaultLocale)) { + $ERROR("Default locale \"" + defaultLocale + "\" is not canonicalized and structurally valid language tag."); + } + return true; +}); + diff --git a/js/src/tests/test402/ch06/6.2/browser.js b/js/src/tests/test402/ch06/6.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/6.2/shell.js b/js/src/tests/test402/ch06/6.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/6.3/6.3.1_a.js b/js/src/tests/test402/ch06/6.3/6.3.1_a.js new file mode 100644 index 000000000000..01cc18b0306b --- /dev/null +++ b/js/src/tests/test402/ch06/6.3/6.3.1_a.js @@ -0,0 +1,25 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that well-formed currency codes are accepted. + * @author Norbert Lindenberg + */ + +var wellFormedCurrencyCodes = [ + "BOB", + "EUR", + "usd", // currency codes are case-insensitive + "XdR", + "xTs" +]; + +wellFormedCurrencyCodes.forEach(function (code) { + // this must not throw an exception for a valid currency code + var format = new Intl.NumberFormat(["de-de"], {style: "currency", currency: code}); + if (format.resolvedOptions().currency !== code.toUpperCase()) { + $ERROR("Currency " + code + " was not correctly accepted; turned into " + + format.resolvedOptions().currency + "."); + } +}); + diff --git a/js/src/tests/test402/ch06/6.3/6.3.1_b.js b/js/src/tests/test402/ch06/6.3/6.3.1_b.js new file mode 100644 index 000000000000..038dd1fc4a6c --- /dev/null +++ b/js/src/tests/test402/ch06/6.3/6.3.1_b.js @@ -0,0 +1,35 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that invalid currency codes are not accepted. + * @author Norbert Lindenberg + */ + +var invalidCurrencyCodes = [ + "", + "€", + "$", + "SFr.", + "DM", + "KR₩", + "702", + "ßP", + "ınr" +]; + +invalidCurrencyCodes.forEach(function (code) { + var error; + try { + // this must throw an exception for an invalid currency code + var format = new Intl.NumberFormat(["de-de"], {style: "currency", currency: code}); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid currency code '" + code + "' was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid currency code '" + code + "' was rejected with wrong error " + error.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch06/6.3/browser.js b/js/src/tests/test402/ch06/6.3/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/6.3/shell.js b/js/src/tests/test402/ch06/6.3/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/6.4/6.4_a.js b/js/src/tests/test402/ch06/6.4/6.4_a.js new file mode 100644 index 000000000000..05202353c05d --- /dev/null +++ b/js/src/tests/test402/ch06/6.4/6.4_a.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that valid time zone names are accepted. + * @author Norbert Lindenberg + */ + +var validTimeZoneNames = [ + "UTC", + "utc" // time zone names are case-insensitive +]; + +validTimeZoneNames.forEach(function (name) { + // this must not throw an exception for a valid time zone name + var format = new Intl.DateTimeFormat(["de-de"], {timeZone: name}); + if (format.resolvedOptions().timeZone !== name.toUpperCase()) { + $ERROR("Time zone name " + name + " was not correctly accepted; turned into " + + format.resolvedOptions().timeZone + "."); + } +}); + diff --git a/js/src/tests/test402/ch06/6.4/6.4_b.js b/js/src/tests/test402/ch06/6.4/6.4_b.js new file mode 100644 index 000000000000..847d804e3c8b --- /dev/null +++ b/js/src/tests/test402/ch06/6.4/6.4_b.js @@ -0,0 +1,34 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that invalid time zone names are not accepted. + * @author Norbert Lindenberg + */ + +var invalidTimeZoneNames = [ + "", + "MEZ", // localized abbreviation + "Pacific Time", // localized long form + "cnsha", // BCP 47 time zone code + "invalid", // as the name says + "Europe/İstanbul", // non-ASCII letter + "asıa/baku", // non-ASCII letter + "europe/brußels" // non-ASCII letter +]; + +invalidTimeZoneNames.forEach(function (name) { + var error; + try { + // this must throw an exception for an invalid time zone name + var format = new Intl.DateTimeFormat(["de-de"], {timeZone: name}); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid time zone name " + name + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid time zone name " + name + " was rejected with wrong error " + error.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch06/6.4/6.4_c.js b/js/src/tests/test402/ch06/6.4/6.4_c.js new file mode 100644 index 000000000000..a9969b648598 --- /dev/null +++ b/js/src/tests/test402/ch06/6.4/6.4_c.js @@ -0,0 +1,36 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that additional time zone names, if accepted, are handled correctly. + * @author Norbert Lindenberg + */ + +// canonicalization specified in conformance clause +var additionalTimeZoneNames = { + "Etc/GMT": "UTC", + "Greenwich": "UTC", + "PRC": "Asia/Shanghai", + "AmErIcA/LoS_aNgElEs": "America/Los_Angeles", + "etc/gmt+7": "Etc/GMT+7" +}; + +Object.getOwnPropertyNames(additionalTimeZoneNames).forEach(function (name) { + var format, error; + try { + format = new Intl.DateTimeFormat([], {timeZone: name}); + } catch (e) { + error = e; + } + if (error === undefined) { + var actual = format.resolvedOptions().timeZone; + var expected = additionalTimeZoneNames[name]; + if (actual !== expected) { + $ERROR("Time zone name " + name + " was accepted, but incorrectly canonicalized to " + + actual + "; expected " + expected + "."); + } + } else if (error.name !== "RangeError") { + $ERROR("Time zone name " + name + " was rejected with wrong error " + error.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch06/6.4/browser.js b/js/src/tests/test402/ch06/6.4/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/6.4/shell.js b/js/src/tests/test402/ch06/6.4/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/browser.js b/js/src/tests/test402/ch06/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch06/shell.js b/js/src/tests/test402/ch06/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch08/8.0/8.0.js b/js/src/tests/test402/ch08/8.0/8.0.js new file mode 100644 index 000000000000..dedda973b206 --- /dev/null +++ b/js/src/tests/test402/ch08/8.0/8.0.js @@ -0,0 +1,12 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl has Object.prototype as its prototype. + * @author Norbert Lindenberg + */ + +if (Object.getPrototypeOf(Intl) !== Object.prototype) { + $ERROR("Intl doesn't have Object.prototype as its prototype."); +} + diff --git a/js/src/tests/test402/ch08/8.0/8.0_L15.js b/js/src/tests/test402/ch08/8.0/8.0_L15.js new file mode 100644 index 000000000000..0174bef54e57 --- /dev/null +++ b/js/src/tests/test402/ch08/8.0/8.0_L15.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(fnGlobalObject().Intl, false, false, []); +testBuiltInObject(Intl, false, false, ["Collator", "NumberFormat", "DateTimeFormat"]); + diff --git a/js/src/tests/test402/ch08/8.0/browser.js b/js/src/tests/test402/ch08/8.0/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch08/8.0/shell.js b/js/src/tests/test402/ch08/8.0/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch08/browser.js b/js/src/tests/test402/ch08/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch08/shell.js b/js/src/tests/test402/ch08/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/9.1/9.1_a.js b/js/src/tests/test402/ch09/9.1/9.1_a.js new file mode 100644 index 000000000000..b7358304bb63 --- /dev/null +++ b/js/src/tests/test402/ch09/9.1/9.1_a.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that default locale is available. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var supportedLocales = Constructor.supportedLocalesOf([defaultLocale]); + if (supportedLocales.indexOf(defaultLocale) === -1) { + $ERROR("Default locale is not reported as available."); + } +}); + diff --git a/js/src/tests/test402/ch09/9.1/9.1_b.js b/js/src/tests/test402/ch09/9.1/9.1_b.js new file mode 100644 index 000000000000..a0abc7fc1400 --- /dev/null +++ b/js/src/tests/test402/ch09/9.1/9.1_b.js @@ -0,0 +1,32 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that appropriate fallback locales are provided for + * supported locales. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var info = getLocaleSupportInfo(Constructor); + var fallback; + info.supported.forEach(function (locale) { + var pos = locale.lastIndexOf("-"); + if (pos !== -1) { + fallback = locale.substring(0, pos); + if (info.supported.indexOf(fallback) === -1) { + $ERROR("Locale " + locale + " is supported, but fallback " + fallback + " isn't."); + } + } + var match = /([a-z]{2,3})(-[A-Z][a-z]{3})(-[A-Z]{2})/.exec(locale); + if (match !== null) { + fallback = match[1] + match[3]; + if (info.supported.indexOf(fallback) === -1) { + $ERROR("Locale " + locale + " is supported, but fallback " + fallback + " isn't."); + } + } + }); +}); + diff --git a/js/src/tests/test402/ch09/9.1/browser.js b/js/src/tests/test402/ch09/9.1/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/9.1/shell.js b/js/src/tests/test402/ch09/9.1/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_1.js b/js/src/tests/test402/ch09/9.2/9.2.1_1.js new file mode 100644 index 000000000000..7386fdeda0dc --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_1.js @@ -0,0 +1,23 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that canonicalization of locale lists treats undefined and empty lists the same. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var supportedForUndefined = Constructor.supportedLocalesOf(undefined); + var supportedForEmptyList = Constructor.supportedLocalesOf([]); + if (supportedForUndefined.length !== supportedForEmptyList.length) { + $ERROR("Supported locales differ between undefined and empty list input."); + } + // we don't compare the elements because length should be 0 - let's just verify that + if (supportedForUndefined.length !== 0) { + $ERROR("Internal test error: Assumption about length being 0 is invalid."); + } + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_2.js b/js/src/tests/test402/ch09/9.2/9.2.1_2.js new file mode 100644 index 000000000000..e4fb3756dbb7 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_2.js @@ -0,0 +1,21 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a List is not affected by adversarial + * changes to Array.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintArray(); + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var canonicalized = Constructor.supportedLocalesOf([defaultLocale, defaultLocale]); + if (canonicalized.length > 1) { + $ERROR("Canonicalization didn't remove duplicate language tags from locale list."); + } +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_3.js b/js/src/tests/test402/ch09/9.2/9.2.1_3.js new file mode 100644 index 000000000000..e403b17653eb --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_3.js @@ -0,0 +1,87 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that a single string instead of a locale list is treated + * as the locale list containing that string. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var validAndInvalidLanguageTags = [ + "de", // ISO 639 language code + "de-DE", // + ISO 3166-1 country code + "DE-de", // tags are case-insensitive + "cmn", // ISO 639 language code + "cmn-Hans", // + script code + "CMN-hANS", // tags are case-insensitive + "cmn-hans-cn", // + ISO 3166-1 country code + "es-419", // + UN M.49 region code + "es-419-u-nu-latn-cu-bob", // + Unicode locale extension sequence + "i-klingon", // grandfathered tag + "cmn-hans-cn-t-ca-u-ca-x-t-u", // singleton subtags can also be used as private use subtags + "enochian-enochian", // language and variant subtags may be the same + "de-gregory-u-ca-gregory", // variant and extension subtags may be the same + "de_DE", + "DE_de", + "cmn_Hans", + "cmn-hans_cn", + "es_419", + "es-419-u-nu-latn-cu_bob", + "i_klingon", + "cmn-hans-cn-t-ca-u-ca-x_t-u", + "enochian_enochian", + "de-gregory_u-ca-gregory", + "i", // singleton alone + "x", // private use without subtag + "u", // extension singleton in first place + "419", // region code in first place + "u-nu-latn-cu-bob", // extension sequence without language + "hans-cmn-cn", // "hans" could theoretically be a 4-letter language code, + // but those can't be followed by extlang codes. + "cmn-hans-cn-u-u", // duplicate singleton + "cmn-hans-cn-t-u-ca-u", // duplicate singleton + "de-gregory-gregory" // duplicate variant +]; + +testWithIntlConstructors(function (Constructor) { + validAndInvalidLanguageTags.forEach(function (locale) { + var obj1, obj2, locale1, locale2, error1, error2; + try { + obj1 = new Constructor(locale); + locale1 = obj1.resolvedOptions().locale; + } catch (e) { + error1 = e; + } + try { + obj2 = new Constructor([locale]); + locale2 = obj2.resolvedOptions().locale; + } catch (e) { + error2 = e; + } + + if ((error1 === undefined) !== (error2 === undefined)) { + if (error1 === undefined) { + $ERROR("Single locale string " + locale + + " was accepted, but locale list containing that string wasn't."); + } else { + $ERROR("Single locale string " + locale + + " was rejected, but locale list containing that string wasn't."); + } + } else if (error1 === undefined) { + if (locale1 !== locale2) { + $ERROR("Single locale string " + locale + " results in " + locale1 + + ", but locale list [" + locale + "] results in " + locale2 + "."); + } + } else { + if (error1.name !== error2.name) { + $ERROR("Single locale string " + locale + " results in error " + error1.name + + ", but locale list [" + locale + "] results in error " + error2.name + "."); + } + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_4.js b/js/src/tests/test402/ch09/9.2/9.2.1_4.js new file mode 100644 index 000000000000..b9bb9db79d47 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_4.js @@ -0,0 +1,46 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that non-objects are converted to objects before canonicalization. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + // undefined is handled separately + + // null should result in a TypeError + var error; + try { + var supportedForNull = Constructor.supportedLocalesOf(null); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Null as locale list was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Null as locale list was rejected with wrong error " + error.name + "."); + } + + // let's use an empty list for comparison + var supportedForEmptyList = Constructor.supportedLocalesOf([]); + // we don't compare the elements because length should be 0 - let's just verify that + if (supportedForEmptyList.length !== 0) { + $ERROR("Internal test error: Assumption about length being 0 is invalid."); + } + + // most non-objects will be interpreted as empty lists because a missing length property is interpreted as 0 + var supportedForNumber = Constructor.supportedLocalesOf(5); + if (supportedForNumber.length !== supportedForEmptyList.length) { + $ERROR("Supported locales differ between numeric and empty list input."); + } + var supportedForBoolean = Constructor.supportedLocalesOf(true); + if (supportedForBoolean.length !== supportedForEmptyList.length) { + $ERROR("Supported locales differ between boolean and empty list input."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_8_c_ii.js b/js/src/tests/test402/ch09/9.2/9.2.1_8_c_ii.js new file mode 100644 index 000000000000..8dfb9b7b377f --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_8_c_ii.js @@ -0,0 +1,30 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that values other than strings are not accepted as locales. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var notStringOrObject = [undefined, null, true, false, 0, 5, -5, NaN]; + +testWithIntlConstructors(function (Constructor) { + notStringOrObject.forEach(function (value) { + var error; + try { + var supported = Constructor.supportedLocalesOf([value]); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("" + value + " as locale was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("" + value + " as locale was rejected with wrong error " + error.name + "."); + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.1_8_c_vi.js b/js/src/tests/test402/ch09/9.2/9.2.1_8_c_vi.js new file mode 100644 index 000000000000..ef78fa97b0c1 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.1_8_c_vi.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that canonicalization of locale lists removes duplicate language tags. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var canonicalized = Constructor.supportedLocalesOf([defaultLocale, defaultLocale]); + if (canonicalized.length > 1) { + $ERROR("Canonicalization didn't remove duplicate language tags from locale list."); + } +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.2.js b/js/src/tests/test402/ch09/9.2/9.2.2.js new file mode 100644 index 000000000000..cb74eaad2a53 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.2.js @@ -0,0 +1,45 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that locales that are reported by resolvedOptions + * are also reported by supportedLocalesOf. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var info = getLocaleSupportInfo(Constructor); + // this test should work equally for both matching algorithms + ["lookup", "best fit"].forEach(function (matcher) { + var supportedByConstructor = info.supported.concat(info.byFallback); + var supported = Constructor.supportedLocalesOf(supportedByConstructor, + {localeMatcher: matcher}); + // we could check the length first, but it's probably more interesting which locales are missing + var i = 0; + var limit = Math.min(supportedByConstructor.length, supported.length); + while (i < limit && supportedByConstructor[i] === supported[i]) { + i++; + } + if (i < supportedByConstructor.length) { + $ERROR("Locale " + supportedByConstructor[i] + + " is returned by resolvedOptions but not by supportedLocalesOf."); + } else if (i < supported.length) { + $ERROR("Locale " + supported[i] + + " is returned by supportedLocalesOf but not by resolvedOptions."); + } + }); + + // this test is only valid for lookup - best fit may find additional locales supported + var unsupportedByConstructor = info.unsupported; + var supported = Constructor.supportedLocalesOf(unsupportedByConstructor, + {localeMatcher: "lookup"}); + if (supported.length > 0) { + $ERROR("Locale " + supported[0] + + " is returned by supportedLocalesOf but not by resolvedOptions."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.3_5.js b/js/src/tests/test402/ch09/9.2/9.2.3_5.js new file mode 100644 index 000000000000..8ae8a216b630 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.3_5.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["locale", "extension", "extensionIndex"]); + +testWithIntlConstructors(function (Constructor) { + var locale = new Constructor(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; + if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("Constructor returns invalid locale " + locale + "."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.5_11_g_ii_2.js b/js/src/tests/test402/ch09/9.2/9.2.5_11_g_ii_2.js new file mode 100644 index 000000000000..d4213d2dae4f --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.5_11_g_ii_2.js @@ -0,0 +1,26 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that missing Unicode extension values default to true for + * boolean keys. + * @author Norbert Lindenberg + */ + +var extensions = ["-u-co-phonebk-kn", "-u-kn-co-phonebk"]; +extensions.forEach(function (extension) { + var defaultLocale = new Intl.Collator().resolvedOptions().locale; + var collator = new Intl.Collator([defaultLocale + extension], {usage: "sort"}); + var locale = collator.resolvedOptions().locale; + var numeric = collator.resolvedOptions().numeric; + if (numeric !== undefined) { + if (numeric !== true) { + $ERROR("Default value for \"kn\" should be true, but is " + numeric + "."); + } + if (locale.indexOf("-kn") !== -1) { + $ERROR("\"kn\" is returned in locale, but shouldn't be."); + } + } +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.5_6.js b/js/src/tests/test402/ch09/9.2/9.2.5_6.js new file mode 100644 index 000000000000..4bc904ee1700 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.5_6.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["dataLocale", "nu", "ca", "co", "locale"]); + +testWithIntlConstructors(function (Constructor) { + var locale = new Constructor(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; + if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("Constructor returns invalid locale " + locale + "."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.6_2.js b/js/src/tests/test402/ch09/9.2/9.2.6_2.js new file mode 100644 index 000000000000..8d4f7efa9b80 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.6_2.js @@ -0,0 +1,27 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a List is not affected by adversarial + * changes to Array.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintArray(); + +testWithIntlConstructors(function (Constructor) { + // this test should work equally for both matching algorithms + ["lookup", "best fit"].forEach(function (matcher) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var canonicalized = Constructor.supportedLocalesOf([defaultLocale, defaultLocale], + {localeMatcher: matcher}); + if (canonicalized.length > 1) { + $ERROR("Canonicalization with matcher " + matcher + " didn't remove duplicate language tags from locale list."); + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.6_4.js b/js/src/tests/test402/ch09/9.2/9.2.6_4.js new file mode 100644 index 000000000000..7c053a381db4 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.6_4.js @@ -0,0 +1,23 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that LookupSupportedLocales returns an empty list when + * given an empty list. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + // this test should work equally for both matching algorithms + ["lookup", "best fit"].forEach(function (matcher) { + var supported = Constructor.supportedLocalesOf([], {localeMatcher: matcher}); + if (supported.length !== 0) { + $ERROR("SupportedLocales with matcher " + matcher + " returned a non-empty list for an empty list."); + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.6_4_b.js b/js/src/tests/test402/ch09/9.2/9.2.6_4_b.js new file mode 100644 index 000000000000..5b9a43157afa --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.6_4_b.js @@ -0,0 +1,47 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Unicode locale extension sequences do not affect + * whether a locale is considered supported, but are reported back. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + // this test should work equally for both matching algorithms + ["lookup", "best fit"].forEach(function (matcher) { + var info = getLocaleSupportInfo(Constructor); + var allLocales = info.supported.concat(info.byFallback, info.unsupported); + allLocales.forEach(function (locale) { + var validExtension = "-u-co-phonebk-nu-latn"; + var invalidExtension = "-u-nu-invalid"; + var supported1 = Constructor.supportedLocalesOf([locale], + {localeMatcher: matcher}); + var supported2 = Constructor.supportedLocalesOf([locale + validExtension], + {localeMatcher: matcher}); + var supported3 = Constructor.supportedLocalesOf([locale + invalidExtension], + {localeMatcher: matcher}); + if (supported1.length === 1) { + if (supported2.length !== 1 || supported3.length !== 1) { + $ERROR("Presence of Unicode locale extension sequence affects whether locale " + + locale + " is considered supported with matcher " + matcher + "."); + } + if (supported2[0] !== locale + validExtension || supported3[0] !== locale + invalidExtension) { + alert(locale + "; " + supported2[0] + "; " + supported3[0]); + $ERROR("Unicode locale extension sequence is not correctly returned for locale " + + locale + " with matcher " + matcher + "."); + } + } else { + if (supported2.length !== 0 || supported3.length !== 0) { + $ERROR("Presence of Unicode locale extension sequence affects whether locale " + + locale + " is considered supported with matcher " + matcher + "."); + } + } + }); + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.6_4_c.js b/js/src/tests/test402/ch09/9.2/9.2.6_4_c.js new file mode 100644 index 000000000000..de68a9b6643d --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.6_4_c.js @@ -0,0 +1,32 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that LookupSupportedLocales includes the default locale + * and doesn't include the "no linguistic content" locale. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + // this test should work equally for both matching algorithms + ["lookup", "best fit"].forEach(function (matcher) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var noLinguisticContent = "zxx"; + var supported = Constructor.supportedLocalesOf([defaultLocale, noLinguisticContent], + {localeMatcher: matcher}); + if (supported.indexOf(defaultLocale) === -1) { + $ERROR("SupportedLocales didn't return default locale with matcher " + matcher + "."); + } + if (supported.indexOf(noLinguisticContent) !== -1) { + $ERROR("SupportedLocales returned the \"no linguistic content\" locale with matcher " + matcher + "."); + } + if (supported.length > 1) { + $ERROR("SupportedLocales returned stray locales: " + supported.join(", ") + " with matcher " + matcher + "."); + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.8_1_c.js b/js/src/tests/test402/ch09/9.2/9.2.8_1_c.js new file mode 100644 index 000000000000..724db1edd18d --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.8_1_c.js @@ -0,0 +1,36 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option localeMatcher is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + + var validValues = [undefined, "lookup", "best fit", {toString: function () { return "lookup"; }}]; + validValues.forEach(function (value) { + var supported = Constructor.supportedLocalesOf([defaultLocale], {localeMatcher: value}); + }); + + var invalidValues = [null, 0, 5, NaN, true, false, "invalid"]; + invalidValues.forEach(function (value) { + var error; + try { + var supported = Constructor.supportedLocalesOf([defaultLocale], {localeMatcher: value}); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid localeMatcher value " + value + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid localeMatcher value " + value + " was rejected with wrong error " + error.name + "."); + } + }); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/9.2.8_4.js b/js/src/tests/test402/ch09/9.2/9.2.8_4.js new file mode 100644 index 000000000000..79c362f62125 --- /dev/null +++ b/js/src/tests/test402/ch09/9.2/9.2.8_4.js @@ -0,0 +1,35 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the array returned by SupportedLocales is extensible, + * but its properties are non-writable/non-configurable. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +function testFrozenProperty(obj, property) { + var desc = Object.getOwnPropertyDescriptor(obj, property); + if (desc.writable) { + $ERROR("Property " + property + " of object returned by SupportedLocales is writable."); + } + if (desc.configurable) { + $ERROR("Property " + property + " of object returned by SupportedLocales is configurable."); + } +} + +testWithIntlConstructors(function (Constructor) { + var defaultLocale = new Constructor().resolvedOptions().locale; + var supported = Constructor.supportedLocalesOf([defaultLocale]); + if (!Object.isExtensible(supported)) { + $ERROR("Object returned by SupportedLocales is not extensible."); + } + for (var i = 0; i < supported.length; i++) { + testFrozenProperty(supported, i); + } + testFrozenProperty(supported, "length"); + + return true; +}); + diff --git a/js/src/tests/test402/ch09/9.2/browser.js b/js/src/tests/test402/ch09/9.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/9.2/shell.js b/js/src/tests/test402/ch09/9.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/browser.js b/js/src/tests/test402/ch09/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch09/shell.js b/js/src/tests/test402/ch09/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_1.js b/js/src/tests/test402/ch10/10.1/10.1.1_1.js new file mode 100644 index 000000000000..432e073fc5d2 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_1.js @@ -0,0 +1,43 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that an object can't be re-initialized as a Collator. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var obj, error; + + // variant 1: use constructor in a "new" expression + obj = new Constructor(); + try { + Intl.Collator.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with \"new\" as Collator was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with \"new\" as Collator was rejected with wrong error " + error.name + "."); + } + + // variant 2: use constructor as a function + obj = Constructor.call({}); + error = undefined; + try { + Intl.Collator.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with constructor as function as Collator was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with constructor as function as Collator was rejected with wrong error " + error.name + "."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_10.js b/js/src/tests/test402/ch10/10.1/10.1.1_10.js new file mode 100644 index 000000000000..5c6b657b5977 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_10.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["localeMatcher", "kn", "kf"]); + +var locale = new Intl.Collator(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; +if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("Collator returns invalid locale " + locale + "."); +} + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_11.js b/js/src/tests/test402/ch10/10.1/10.1.1_11.js new file mode 100644 index 000000000000..447fd8b2854a --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_11.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option localeMatcher is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.Collator, "localeMatcher", "string", ["lookup", "best fit"], "best fit", {noReturn: true}); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_13.js b/js/src/tests/test402/ch10/10.1/10.1.1_13.js new file mode 100644 index 000000000000..4129eebd2e44 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_13.js @@ -0,0 +1,13 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the options numeric and caseFirst are processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.Collator, "numeric", "boolean", undefined, undefined, {isOptional: true}); +testOption(Intl.Collator, "caseFirst", "string", ["upper", "lower", "false"], undefined, {isOptional: true}); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_19_b.js b/js/src/tests/test402/ch10/10.1/10.1.1_19_b.js new file mode 100644 index 000000000000..f1fef270440b --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_19_b.js @@ -0,0 +1,44 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests the special handling of the "co" key in Intl.Collator. + * @author Norbert Lindenberg + */ + +function checkCollation(extensionCoValue, usageValue, expectedCollations, expectedUsage) { + var requestLocale = extensionCoValue !== undefined ? "de-DE-u-co-" + extensionCoValue : "de-DE"; + var options = usageValue !== undefined ? { usage: usageValue } : undefined; + var collator = new Intl.Collator([requestLocale], options); + + var collation = collator.resolvedOptions().collation; + if (expectedCollations.indexOf(collation) === -1) { + $ERROR((extensionCoValue === undefined ? "Default collation" : "Collation for \"" + extensionCoValue) + + "\" should be " + expectedCollations.join(" or ") + ", but is " + collation + "."); + } + + var usage = collator.resolvedOptions().usage; + if (expectedUsage !== usage) { + $ERROR((usageValue === undefined ? "Default usage" : "Usage") + + " should be " + expectedUsage + ", but is " + usage + "."); + } +} + +checkCollation(undefined, undefined, ["default"], "sort"); + +checkCollation("phonebk", undefined, ["phonebk", "default"], "sort"); + +checkCollation("invalid", undefined, ["default"], "sort"); + +checkCollation("standard", undefined, ["default"], "sort"); + +checkCollation("standard", "search", ["default"], "search"); + +checkCollation("standard", "sort", ["default"], "sort"); + +checkCollation("search", undefined, ["default"], "sort"); + +checkCollation("search", "search", ["default"], "search"); + +checkCollation("search", "sort", ["default"], "sort"); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_19_c.js b/js/src/tests/test402/ch10/10.1/10.1.1_19_c.js new file mode 100644 index 000000000000..4ad76d45bf7a --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_19_c.js @@ -0,0 +1,63 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the options numeric and caseFirst can be + * set through either the locale or the options. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var options = [ + {key: "kn", property: "numeric", type: "boolean", values: [true, false]}, + {key: "kf", property: "caseFirst", type: "string", values: ["upper", "lower", "false"]} +]; + +options.forEach(function (option) { + var defaultLocale = new Intl.Collator().resolvedOptions().locale; + var collator, opt, result; + + // find out which values are supported for a property in the default locale + var supportedValues = []; + option.values.forEach(function (value) { + opt = {}; + opt[option.property] = value; + collator = new Intl.Collator([defaultLocale], opt); + result = collator.resolvedOptions()[option.property]; + if (result !== undefined && supportedValues.indexOf(result) === -1) { + supportedValues.push(result); + } + }); + + // verify that the supported values can also be set through the locale + supportedValues.forEach(function (value) { + collator = new Intl.Collator([defaultLocale + "-u-" + option.key + "-" + value]); + result = collator.resolvedOptions()[option.property]; + if (result !== value) { + $ERROR("Property " + option.property + " couldn't be set through locale extension key " + + option.key + "; requested value: " + value + "; actual value: " + result + "."); + } + }); + + // verify that the options setting overrides the locale setting + supportedValues.forEach(function (value) { + var otherValue; + option.values.forEach(function (possibleValue) { + if (possibleValue !== value) { + otherValue = possibleValue; + } + }); + if (otherValue !== undefined) { + opt = {}; + opt[option.property] = value; + collator = new Intl.Collator([defaultLocale + "-u-" + option.key + "-" + otherValue], opt); + result = collator.resolvedOptions()[option.property]; + if (result !== value) { + $ERROR("Options value for property " + option.property + " doesn't override locale extension key " + + option.key + "; requested value: " + value + "; actual value: " + result + "."); + } + } + }); +}); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_20.js b/js/src/tests/test402/ch10/10.1/10.1.1_20.js new file mode 100644 index 000000000000..97d70c0f957f --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_20.js @@ -0,0 +1,13 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option sensitivity is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// the fallback is variant only for usage === sort, but that happens to be the fallback for usage +testOption(Intl.Collator, "sensitivity", "string", ["base", "accent", "case", "variant"], "variant"); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_23.js b/js/src/tests/test402/ch10/10.1/10.1.1_23.js new file mode 100644 index 000000000000..0b5261509f22 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_23.js @@ -0,0 +1,13 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option ignorePunctuation is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// the fallback is variant only for usage === sort, but that happens to be the fallback for usage +testOption(Intl.Collator, "ignorePunctuation", "boolean", undefined, false); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_6.js b/js/src/tests/test402/ch10/10.1/10.1.1_6.js new file mode 100644 index 000000000000..bc13436d76cc --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_6.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option usage is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.Collator, "usage", "string", ["sort", "search"], "sort"); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.1_a.js b/js/src/tests/test402/ch10/10.1/10.1.1_a.js new file mode 100644 index 000000000000..56d4b9789574 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.1_a.js @@ -0,0 +1,14 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a Collator doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.Collator("de-DE-u-co-phonebk"); +}); diff --git a/js/src/tests/test402/ch10/10.1/10.1.2.1_4.js b/js/src/tests/test402/ch10/10.1/10.1.2.1_4.js new file mode 100644 index 000000000000..22e69065e609 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.2.1_4.js @@ -0,0 +1,21 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that for non-object values passed as this to Collator a + * wrapper object will be initialized and returned. + * @author Norbert Lindenberg + */ + +var thisValues = [true, 42, "国際化"]; + +thisValues.forEach(function (value) { + var collator = Intl.Collator.call(value); + // check that the returned object functions as a collator + var referenceCollator = new Intl.Collator(); + if (Intl.Collator.prototype.compare.call(collator, "a", "b") !== referenceCollator.compare("a", "b")) { + $ERROR("Collator initialized from " + value + " doesn't behave like normal collator."); + } + return true; +}); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.2_a.js b/js/src/tests/test402/ch10/10.1/10.1.2_a.js new file mode 100644 index 000000000000..de69a48093f5 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.2_a.js @@ -0,0 +1,30 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator can be subclassed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// get a collator and have it sort an array for comparison with the subclass +var locales = ["tlh", "id", "en"]; +var a = ["A", "C", "E", "B", "D", "F"]; +var referenceCollator = new Intl.Collator(locales); +var referenceSorted = a.slice().sort(referenceCollator.compare); + +function MyCollator(locales, options) { + Intl.Collator.call(this, locales, options); + // could initialize MyCollator properties +} + +MyCollator.prototype = Object.create(Intl.Collator.prototype); +MyCollator.prototype.constructor = MyCollator; +// could add methods to MyCollator.prototype + +var collator = new MyCollator(locales); +a.sort(collator.compare); +testArraysAreSame(referenceSorted, a); + diff --git a/js/src/tests/test402/ch10/10.1/10.1.3.js b/js/src/tests/test402/ch10/10.1/10.1.3.js new file mode 100644 index 000000000000..7459d98d6b2b --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1.3.js @@ -0,0 +1,19 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that objects constructed by Intl.Collator have the specified internal properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.Collator(); + +var actualPrototype = Object.getPrototypeOf(obj); +if (actualPrototype !== Intl.Collator.prototype) { + $ERROR("Prototype of object constructed by Intl.Collator isn't Intl.Collator.prototype; got " + actualPrototype); +} + +if (!Object.isExtensible(obj)) { + $ERROR("Object constructed by Intl.Collator must be extensible."); +} + diff --git a/js/src/tests/test402/ch10/10.1/10.1_L15.js b/js/src/tests/test402/ch10/10.1/10.1_L15.js new file mode 100644 index 000000000000..4dbabfd64637 --- /dev/null +++ b/js/src/tests/test402/ch10/10.1/10.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.Collator, true, true, ["supportedLocalesOf"], 0); + diff --git a/js/src/tests/test402/ch10/10.1/browser.js b/js/src/tests/test402/ch10/10.1/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.1/shell.js b/js/src/tests/test402/ch10/10.1/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.2/10.2.1.js b/js/src/tests/test402/ch10/10.2/10.2.1.js new file mode 100644 index 000000000000..9eccb073c45f --- /dev/null +++ b/js/src/tests/test402/ch10/10.2/10.2.1.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype has the required attributes. + * @author Norbert Lindenberg + */ + +var desc = Object.getOwnPropertyDescriptor(Intl.Collator, "prototype"); +if (desc === undefined) { + $ERROR("Intl.Collator.prototype is not defined."); +} +if (desc.writable) { + $ERROR("Intl.Collator.prototype must not be writable."); +} +if (desc.enumerable) { + $ERROR("Intl.Collator.prototype must not be enumerable."); +} +if (desc.configurable) { + $ERROR("Intl.Collator.prototype must not be configurable."); +} + diff --git a/js/src/tests/test402/ch10/10.2/10.2.2_L15.js b/js/src/tests/test402/ch10/10.2/10.2.2_L15.js new file mode 100644 index 000000000000..6ffcdde84da8 --- /dev/null +++ b/js/src/tests/test402/ch10/10.2/10.2.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.supportedLocalesOf + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.Collator.supportedLocalesOf, true, false, [], 1); + diff --git a/js/src/tests/test402/ch10/10.2/10.2.2_a.js b/js/src/tests/test402/ch10/10.2/10.2.2_a.js new file mode 100644 index 000000000000..5cf953ce820e --- /dev/null +++ b/js/src/tests/test402/ch10/10.2/10.2.2_a.js @@ -0,0 +1,27 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator has a supportedLocalesOf + * property, and it works as planned. + */ + +var defaultLocale = new Intl.Collator().resolvedOptions().locale; +var notSupported = 'zxx'; // "no linguistic content" +var requestedLocales = [defaultLocale, notSupported]; + +var supportedLocales; + +if (!Intl.Collator.hasOwnProperty('supportedLocalesOf')) { + $ERROR("Intl.Collator doesn't have a supportedLocalesOf property."); +} + +supportedLocales = Intl.Collator.supportedLocalesOf(requestedLocales); +if (supportedLocales.length !== 1) { + $ERROR('The length of supported locales list is not 1.'); +} + +if (supportedLocales[0] !== defaultLocale) { + $ERROR('The default locale is not returned in the supported list.'); +} + diff --git a/js/src/tests/test402/ch10/10.2/10.2.2_b.js b/js/src/tests/test402/ch10/10.2/10.2.2_b.js new file mode 100644 index 000000000000..1b99fd8c5a3c --- /dev/null +++ b/js/src/tests/test402/ch10/10.2/10.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.Collator("und"); diff --git a/js/src/tests/test402/ch10/10.2/10.2.3_b.js b/js/src/tests/test402/ch10/10.2/10.2.3_b.js new file mode 100644 index 000000000000..aef1e746a138 --- /dev/null +++ b/js/src/tests/test402/ch10/10.2/10.2.3_b.js @@ -0,0 +1,52 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator does not accept Unicode locale + * extension keys and values that are not allowed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var testArray = [ + "hello", "你好", "こんにちは", + "pêche", "peché", "1", "9", "10", + "ụ\u031B", "u\u031B\u0323", "ư\u0323", "u\u0323\u031B", + "Å", "Å", "A\u030A" +]; + +var defaultCollator = new Intl.Collator(); +var defaultOptions = defaultCollator.resolvedOptions(); +var defaultOptionsJSON = JSON.stringify(defaultOptions); +var defaultLocale = defaultOptions.locale; +var defaultSortedArray = testArray.slice(0).sort(defaultCollator.compare); + +var keyValues = { + "co": ["standard", "search", "invalid"], + "ka": ["noignore", "shifted", "invalid"], + "kb": ["true", "false", "invalid"], + "kc": ["true", "false", "invalid"], + "kh": ["true", "false", "invalid"], + "kk": ["true", "false", "invalid"], + "kr": ["latn-hira-hani", "hani-hira-latn", "invalid"], + "ks": ["level1", "level2", "level3", "level4", "identic", "invalid"], + "vt": ["1234-5678-9abc-edf0", "invalid"] +}; + +Object.getOwnPropertyNames(keyValues).forEach(function (key) { + keyValues[key].forEach(function (value) { + var collator = new Intl.Collator([defaultLocale + "-u-" + key + "-" + value]); + var options = collator.resolvedOptions(); + if (options.locale !== defaultLocale) { + $ERROR("Locale " + options.locale + " is affected by key " + + key + "; value " + value + "."); + } + if (JSON.stringify(options) !== defaultOptionsJSON) { + $ERROR("Resolved options " + JSON.stringify(options) + " are affected by key " + + key + "; value " + value + "."); + } + testArraysAreSame(defaultSortedArray, testArray.sort(collator.compare)); + }); +}); + diff --git a/js/src/tests/test402/ch10/10.2/browser.js b/js/src/tests/test402/ch10/10.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.2/shell.js b/js/src/tests/test402/ch10/10.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.3/10.3.1.js b/js/src/tests/test402/ch10/10.3/10.3.1.js new file mode 100644 index 000000000000..699949e18fa9 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.1.js @@ -0,0 +1,13 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype.constructor is the + * Intl.Collator. + */ + +if (Intl.Collator.prototype.constructor !== Intl.Collator) { + $ERROR("Intl.Collator.prototype.constructor is not the same as " + + "Intl.Collator"); +} + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_1_a_L15.js b/js/src/tests/test402/ch10/10.3/10.3.2_1_a_L15.js new file mode 100644 index 000000000000..3d49601db802 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_1_a_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the function returned by Intl.Collator.prototype.compare + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(new Intl.Collator().compare, true, false, [], 2); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_1_c.js b/js/src/tests/test402/ch10/10.3/10.3.2_1_c.js new file mode 100644 index 000000000000..73f2bcf098c3 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_1_c.js @@ -0,0 +1,36 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that compare function is bound to its Intl.Collator. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var strings = ["d", "O", "od", "oe", "of", "ö", "o\u0308", "X", "y", "Z", "Z.", "𠮷野家", "吉野家", "!A", "A", "b", "C"]; +var locales = [undefined, ["de"], ["de-u-co-phonebk"], ["en"], ["ja"], ["sv"]]; +var options = [ + undefined, + {usage: "search"}, + {sensitivity: "base", ignorePunctuation: true} +]; + +locales.forEach(function (locales) { + options.forEach(function (options) { + var collatorObj = new Intl.Collator(locales, options); + var compareFunc = collatorObj.compare; + var referenceSorted = strings.slice(); + referenceSorted.sort(function (a, b) { return collatorObj.compare(a, b); }); + var sorted = strings; + sorted.sort(compareFunc); + try { + testArraysAreSame(referenceSorted, sorted); + } catch (e) { + e.message += " (Testing with locales " + locales + "; options " + + (options ? JSON.stringify(options) : options) + ".)"; + throw e; + } + }); +}); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_CS_a.js b/js/src/tests/test402/ch10/10.3/10.3.2_CS_a.js new file mode 100644 index 000000000000..a946245b403a --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_CS_a.js @@ -0,0 +1,68 @@ +// Copyright 2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the function returned by Intl.Collator.prototype.compare + * returns 0 when comparing Strings that are considered canonically equivalent + * by the Unicode standard. + * @author Norbert Lindenberg + */ + +var collator = new Intl.Collator(); +var pairs = [ + // example from Unicode 5.0, section 3.7, definition D70 + ["o\u0308", "ö"], + // examples from Unicode 5.0, chapter 3.11 + ["ä\u0323", "a\u0323\u0308"], + ["a\u0308\u0323", "a\u0323\u0308"], + ["ạ\u0308", "a\u0323\u0308"], + ["ä\u0306", "a\u0308\u0306"], + ["ă\u0308", "a\u0306\u0308"], + // example from Unicode 5.0, chapter 3.12 + ["\u1111\u1171\u11B6", "퓛"], + // examples from UTS 10, Unicode Collation Algorithm + ["Å", "Å"], + ["Å", "A\u030A"], + ["x\u031B\u0323", "x\u0323\u031B"], + ["ự", "ụ\u031B"], + ["ự", "u\u031B\u0323"], + ["ự", "ư\u0323"], + ["ự", "u\u0323\u031B"], + // examples from UAX 15, Unicode Normalization Forms + ["Ç", "C\u0327"], + ["q\u0307\u0323", "q\u0323\u0307"], + ["가", "\u1100\u1161"], + ["Å", "A\u030A"], + ["Ω", "Ω"], + ["Å", "A\u030A"], + ["ô", "o\u0302"], + ["ṩ", "s\u0323\u0307"], + ["ḋ\u0323", "d\u0323\u0307"], + ["ḋ\u0323", "ḍ\u0307"], + ["q\u0307\u0323", "q\u0323\u0307"], + // examples involving supplementary characters from UCD NormalizationTest.txt + ["\uD834\uDD5E", "\uD834\uDD57\uD834\uDD65"], + ["\uD87E\uDC2B", "北"] + +]; +var i; +for (i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + if (collator.compare(pair[0], pair[1]) !== 0) { + $ERROR("Collator.compare considers " + pair[0] + " (" + toU(pair[0]) + + ") ≠ " + pair[1] + " (" + toU(pair[1]) + ")."); + } +} + +function toU(s) { + var result = ""; + var escape = "\\u0000"; + var i; + for (i = 0; i < s.length; i++) { + var hex = s.charCodeAt(i).toString(16); + result += escape.substring(0, escape.length - hex.length) + hex; + } + return result; +} + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_CS_b_NN.js b/js/src/tests/test402/ch10/10.3/10.3.2_CS_b_NN.js new file mode 100644 index 000000000000..c417d2b8a3c1 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_CS_b_NN.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the compare function isn't entirely unreasonable. + * This test is not normative. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// this test should be valid at least for the following locales +var locales = ["de", "en", "es", "fr", "it"]; +locales = Intl.Collator.supportedLocalesOf(locales, {localeMatcher: "lookup"}); +locales.forEach(function (locale) { + var collator = new Intl.Collator([locale], {sensitivity: "variant", localeMatcher: "lookup"}); + var a = ["L", "X", "C", "k", "Z", "H", "d", "m", "w", "A", "i", "f", "y", "E", "N", "V", "g", "J", "b"]; + a.sort(collator.compare); + var expected = ["A", "b", "C", "d", "E", "f", "g", "H", "i", "J", "k", "L", "m", "N", "V", "w", "X", "y", "Z"]; + testArraysAreSame(expected, a); +}); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_CS_c_NN.js b/js/src/tests/test402/ch10/10.3/10.3.2_CS_c_NN.js new file mode 100644 index 000000000000..5d5060be5acd --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_CS_c_NN.js @@ -0,0 +1,22 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the compare function supports phonebook sorting if it says it does. + * This test is not normative. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// this test should be valid at least for the following locales +var locales = ["de-DE-u-co-phonebk", "de-u-co-phonebk"]; +var collator = new Intl.Collator(locales, {localeMatcher: "lookup"}); +if (locales.indexOf(collator.resolvedOptions().locale) !== -1) { + var a = ["A", "b", "Af", "Ab", "od", "off", "Ä", "ö"]; + a.sort(collator.compare); + var expected = ["A", "Ab", "Ä", "Af", "b", "od", "ö", "off"]; + testArraysAreSame(expected, a); +} + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_CS_d_NN.js b/js/src/tests/test402/ch10/10.3/10.3.2_CS_d_NN.js new file mode 100644 index 000000000000..be5f1aa338df --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_CS_d_NN.js @@ -0,0 +1,34 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the compare function supports different sensitivity settings. + * This test is not normative. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// this test should be valid at least for the following locales +var locales = ["de", "en", "es", "it"]; +locales = Intl.Collator.supportedLocalesOf(locales, {localeMatcher: "lookup"}); +locales.forEach(function (locale) { + var target = "Aa"; + var input = ["Aa", "bA", "E", "b", "aA", "fC", "áÁ", "Aã"]; + var expected = { + "base": ["Aa", "aA", "áÁ", "Aã"], + "accent": ["Aa", "aA"], + "case": ["Aa", "Aã"], + "variant": ["Aa"] + }; + Object.getOwnPropertyNames(expected).forEach(function (sensitivity) { + var collator = new Intl.Collator([locale], {usage: "search", + sensitivity: sensitivity, localeMatcher: "lookup"}); + var matches = input.filter(function (v) { + return collator.compare(v, target) === 0; + }); + testArraysAreSame(expected[sensitivity], matches); + }); +}); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.2_L15.js b/js/src/tests/test402/ch10/10.3/10.3.2_L15.js new file mode 100644 index 000000000000..5845ea3ca177 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the getter for Intl.Collator.prototype.compare + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get , true, false, [], 0); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.3.js b/js/src/tests/test402/ch10/10.3/10.3.3.js new file mode 100644 index 000000000000..bc6b4fabb976 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.3.js @@ -0,0 +1,47 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the object returned by Intl.Collator.prototype.resolvedOptions + * has the right properties. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var actual = new Intl.Collator().resolvedOptions(); + +var actual2 = new Intl.Collator().resolvedOptions(); +if (actual2 === actual) { + $ERROR("resolvedOptions returned the same object twice."); +} + +// source: CLDR file common/bcp47/collation.xml; version CLDR 21. +var collations = [ + "default", // added + "big5han", + "dict", + "direct", + "ducet", + "gb2312", + "phonebk", + "phonetic", + "pinyin", + "reformed", + // "search", // excluded + "searchjl", + // "standard", // excluded + "stroke", + "trad", + "unihan" +]; + +// this assumes the default values where the specification provides them +mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); +mustHaveProperty(actual, "usage", ["sort"]); +mustHaveProperty(actual, "sensitivity", ["variant"]); +mustHaveProperty(actual, "ignorePunctuation", [false]); +mustHaveProperty(actual, "collation", collations); +mayHaveProperty(actual, "numeric", [true, false]); +mayHaveProperty(actual, "caseFirst", ["upper", "lower", "false"]); + diff --git a/js/src/tests/test402/ch10/10.3/10.3.3_L15.js b/js/src/tests/test402/ch10/10.3/10.3.3_L15.js new file mode 100644 index 000000000000..718cc9fea6f5 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype.resolvedOptions + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.Collator.prototype.resolvedOptions, true, false, [], 0); + diff --git a/js/src/tests/test402/ch10/10.3/10.3_L15.js b/js/src/tests/test402/ch10/10.3/10.3_L15.js new file mode 100644 index 000000000000..60719736c1e6 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.Collator.prototype, false, false, ["constructor", "compare", "resolvedOptions"]); + diff --git a/js/src/tests/test402/ch10/10.3/10.3_a.js b/js/src/tests/test402/ch10/10.3/10.3_a.js new file mode 100644 index 000000000000..aa2e52845967 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3_a.js @@ -0,0 +1,15 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype is an object that + * has been initialized as an Intl.Collator. + */ + +// test by calling a function that would fail if "this" were not an object +// initialized as an Intl.Collator +if (Intl.Collator.prototype.compare("aаあ아", "aаあ아") !== 0) { + $ERROR("Intl.Collator.prototype is not an object that has been " + + "initialized as an Intl.Collator."); +} + diff --git a/js/src/tests/test402/ch10/10.3/10.3_b.js b/js/src/tests/test402/ch10/10.3/10.3_b.js new file mode 100644 index 000000000000..9c3c2db32e23 --- /dev/null +++ b/js/src/tests/test402/ch10/10.3/10.3_b.js @@ -0,0 +1,33 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.prototype functions throw a + * TypeError if called on a non-object value or an object that hasn't been + * initialized as a Collator. + * @author Norbert Lindenberg + */ + +var functions = { + "compare getter": Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get, + resolvedOptions: Intl.Collator.prototype.resolvedOptions +}; +var invalidTargets = [undefined, null, true, 0, "Collator", [], {}]; + +Object.getOwnPropertyNames(functions).forEach(function (functionName) { + var f = functions[functionName]; + invalidTargets.forEach(function (target) { + var error; + try { + f.call(target); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Calling " + functionName + " on " + target + " was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Calling " + functionName + " on " + target + " was rejected with wrong error " + error.name + "."); + } + }); +}); + diff --git a/js/src/tests/test402/ch10/10.3/browser.js b/js/src/tests/test402/ch10/10.3/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.3/shell.js b/js/src/tests/test402/ch10/10.3/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.4/10.4_a.js b/js/src/tests/test402/ch10/10.4/10.4_a.js new file mode 100644 index 000000000000..7527f65eb617 --- /dev/null +++ b/js/src/tests/test402/ch10/10.4/10.4_a.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator instances have the specified properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.Collator(); + +var toStringValue = Object.prototype.toString.call(obj); +if (toStringValue !== "[object Object]") { + $ERROR("Intl.Collator instance produces wrong [[Class]] - toString returns " + toStringValue + "."); +} + diff --git a/js/src/tests/test402/ch10/10.4/browser.js b/js/src/tests/test402/ch10/10.4/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/10.4/shell.js b/js/src/tests/test402/ch10/10.4/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/browser.js b/js/src/tests/test402/ch10/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch10/shell.js b/js/src/tests/test402/ch10/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_1.js b/js/src/tests/test402/ch11/11.1/11.1.1_1.js new file mode 100644 index 000000000000..33af1697512d --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_1.js @@ -0,0 +1,43 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that an object can't be re-initialized as a NumberFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var obj, error; + + // variant 1: use constructor in a "new" expression + obj = new Constructor(); + try { + Intl.NumberFormat.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with \"new\" as NumberFormat was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with \"new\" as NumberFormat was rejected with wrong error " + error.name + "."); + } + + // variant 2: use constructor as a function + obj = Constructor.call({}); + error = undefined; + try { + Intl.NumberFormat.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with constructor as function as NumberFormat was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with constructor as function as NumberFormat was rejected with wrong error " + error.name + "."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_15.js b/js/src/tests/test402/ch11/11.1/11.1.1_15.js new file mode 100644 index 000000000000..4d0467428c17 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_15.js @@ -0,0 +1,13 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option style is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.NumberFormat, "style", "string", ["decimal", "percent", "currency"], "decimal", + {extra: {"currency": {currency: "CNY"}}}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_17.js b/js/src/tests/test402/ch11/11.1/11.1.1_17.js new file mode 100644 index 000000000000..08c0e8e5c510 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_17.js @@ -0,0 +1,81 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option currency is processed correctly. + * @author Norbert Lindenberg + */ + +var validValues = ["CNY", "USD", "EUR", "IDR", "jpy", {toString: function () {return "INR";}}]; +var invalidValues = ["$", "SFr.", "US$", "ßP", {toString: function () {return;}}]; + +var defaultLocale = new Intl.NumberFormat().resolvedOptions().locale; + +validValues.forEach(function (value) { + var format, actual, expected; + + // with currency style, we should get the upper case form back + format = new Intl.NumberFormat([defaultLocale], {style: "currency", currency: value}); + actual = format.resolvedOptions().currency; + expected = value.toString().toUpperCase(); + if (actual !== expected) { + $ERROR("Incorrect resolved currency with currency style - expected " + + expected + "; got " + actual + "."); + } + + // without currency style, we shouldn't get any currency back + format = new Intl.NumberFormat([defaultLocale], {currency: value}); + actual = format.resolvedOptions().currency; + expected = undefined; + if (actual !== expected) { + $ERROR("Incorrect resolved currency with non-currency style - expected " + + expected + "; got " + actual + "."); + } + + // currencies specified through the locale must be ignored + format = new Intl.NumberFormat([defaultLocale + "-u-cu-krw"], {style: "currency", currency: value}); + actual = format.resolvedOptions().currency; + expected = value.toString().toUpperCase(); + if (actual !== expected) { + $ERROR("Incorrect resolved currency with -u-cu- and currency style - expected " + + expected + "; got " + actual + "."); + } + + format = new Intl.NumberFormat([defaultLocale + "-u-cu-krw"], {currency: value}); + actual = format.resolvedOptions().currency; + expected = undefined; + if (actual !== expected) { + $ERROR("Incorrect resolved currency with -u-cu- and non-currency style - expected " + + expected + "; got " + actual + "."); + } +}); + +invalidValues.forEach(function (value) { + function expectError(f) { + var error; + try { + f(); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid currency value " + value + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid currency value " + value + " was rejected with wrong error " + error.name + "."); + } + } + + expectError(function () { + return new Intl.NumberFormat([defaultLocale], {style: "currency", currency: value}); + }); + expectError(function () { + return new Intl.NumberFormat([defaultLocale], {currency: value}); + }); + expectError(function () { + return new Intl.NumberFormat([defaultLocale + "-u-cu-krw"], {style: "currency", currency: value}); + }); + expectError(function () { + return new Intl.NumberFormat([defaultLocale + "-u-cu-krw"], {currency: value}); + }); +}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_19.js b/js/src/tests/test402/ch11/11.1/11.1.1_19.js new file mode 100644 index 000000000000..e41ca5bec9bf --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_19.js @@ -0,0 +1,31 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the currency style can not be used without a specified currency. + * @author Norbert Lindenberg + */ + +var defaultLocale = new Intl.NumberFormat().resolvedOptions().locale; + +function expectError(f) { + var error; + try { + f(); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid currency value " + value + " was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Invalid currency value " + value + " was rejected with wrong error " + error.name + "."); + } +} + +expectError(function () { + return new Intl.NumberFormat([defaultLocale], {style: "currency"}); +}); +expectError(function () { + return new Intl.NumberFormat([defaultLocale + "-u-cu-krw"], {style: "currency"}); +}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_20_c.js b/js/src/tests/test402/ch11/11.1/11.1.1_20_c.js new file mode 100644 index 000000000000..20b7910b02ee --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_20_c.js @@ -0,0 +1,196 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the number of fractional digits is determined correctly for currencies. + * @author Norbert Lindenberg + */ + +// data from http://www.currency-iso.org/dl_iso_table_a1.xml, 2013-02-25 +var currencyDigits = { + AED: 2, + AFN: 2, + ALL: 2, + AMD: 2, + ANG: 2, + AOA: 2, + ARS: 2, + AUD: 2, + AWG: 2, + AZN: 2, + BAM: 2, + BBD: 2, + BDT: 2, + BGN: 2, + BHD: 3, + BIF: 0, + BMD: 2, + BND: 2, + BOB: 2, + BOV: 2, + BRL: 2, + BSD: 2, + BTN: 2, + BWP: 2, + BYR: 0, + BZD: 2, + CAD: 2, + CDF: 2, + CHE: 2, + CHF: 2, + CHW: 2, + CLF: 0, + CLP: 0, + CNY: 2, + COP: 2, + COU: 2, + CRC: 2, + CUC: 2, + CUP: 2, + CVE: 2, + CZK: 2, + DJF: 0, + DKK: 2, + DOP: 2, + DZD: 2, + EGP: 2, + ERN: 2, + ETB: 2, + EUR: 2, + FJD: 2, + FKP: 2, + GBP: 2, + GEL: 2, + GHS: 2, + GIP: 2, + GMD: 2, + GNF: 0, + GTQ: 2, + GYD: 2, + HKD: 2, + HNL: 2, + HRK: 2, + HTG: 2, + HUF: 2, + IDR: 2, + ILS: 2, + INR: 2, + IQD: 3, + IRR: 2, + ISK: 0, + JMD: 2, + JOD: 3, + JPY: 0, + KES: 2, + KGS: 2, + KHR: 2, + KMF: 0, + KPW: 2, + KRW: 0, + KWD: 3, + KYD: 2, + KZT: 2, + LAK: 2, + LBP: 2, + LKR: 2, + LRD: 2, + LSL: 2, + LTL: 2, + LVL: 2, + LYD: 3, + MAD: 2, + MDL: 2, + MGA: 2, + MKD: 2, + MMK: 2, + MNT: 2, + MOP: 2, + MRO: 2, + MUR: 2, + MVR: 2, + MWK: 2, + MXN: 2, + MXV: 2, + MYR: 2, + MZN: 2, + NAD: 2, + NGN: 2, + NIO: 2, + NOK: 2, + NPR: 2, + NZD: 2, + OMR: 3, + PAB: 2, + PEN: 2, + PGK: 2, + PHP: 2, + PKR: 2, + PLN: 2, + PYG: 0, + QAR: 2, + RON: 2, + RSD: 2, + RUB: 2, + RWF: 0, + SAR: 2, + SBD: 2, + SCR: 2, + SDG: 2, + SEK: 2, + SGD: 2, + SHP: 2, + SLL: 2, + SOS: 2, + SRD: 2, + SSP: 2, + STD: 2, + SVC: 2, + SYP: 2, + SZL: 2, + THB: 2, + TJS: 2, + TMT: 2, + TND: 3, + TOP: 2, + TRY: 2, + TTD: 2, + TWD: 2, + TZS: 2, + UAH: 2, +// UGX: 2, will be changed to 0 when maintenance agency releases updated table + USD: 2, + USN: 2, + USS: 2, + UYI: 0, + UYU: 2, + UZS: 2, + VEF: 2, + VND: 0, + VUV: 0, + WST: 2, + XAF: 0, + XCD: 2, + XOF: 0, + XPF: 0, + YER: 2, + ZAR: 2, + ZMW: 2, + ZWL: 2 +}; + +Object.getOwnPropertyNames(currencyDigits).forEach(function (currency) { + var digits = currencyDigits[currency]; + format = Intl.NumberFormat([], {style: "currency", currency: currency}); + var min = format.resolvedOptions().minimumFractionDigits; + var max = format.resolvedOptions().maximumFractionDigits; + if (min !== digits) { + $ERROR("Didn't get correct minimumFractionDigits for currency " + + currency + "; expected " + digits + ", got " + min + "."); + } + if (max !== digits) { + $ERROR("Didn't get correct maximumFractionDigits for currency " + + currency + "; expected " + digits + ", got " + max + "."); + } +}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_21.js b/js/src/tests/test402/ch11/11.1/11.1.1_21.js new file mode 100644 index 000000000000..1751b8b5745f --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_21.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option currencyDisplay is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.NumberFormat, "currencyDisplay", "string", ["code", "symbol", "name"], + "symbol", {extra: {any: {style: "currency", currency: "XDR"}}}); +testOption(Intl.NumberFormat, "currencyDisplay", "string", ["code", "symbol", "name"], + undefined, {noReturn: true}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_32.js b/js/src/tests/test402/ch11/11.1/11.1.1_32.js new file mode 100644 index 000000000000..9196318efbf2 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_32.js @@ -0,0 +1,44 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the options minimumSignificantDigits and + * maximumSignificantDigits are read in the right sequence. + * @author Norbert Lindenberg + */ + +var read = 0; + +function readMinimumSignificantDigits() { + ++read; + if (read === 1) { + return 0; // invalid value, but on first read that's OK + } else if (read === 3) { + return 1; // valid value + } else { + $ERROR("minimumSignificantDigits read out of sequence: " + read + "."); + } +} + +function readMaximumSignificantDigits() { + ++read; + if (read === 2) { + return 0; // invalid value, but on first read that's OK + } else if (read === 4) { + return 1; // valid value + } else { + $ERROR("maximumSignificantDigits read out of sequence: " + read + "."); + } +} + +var options = {}; +Object.defineProperty(options, "minimumSignificantDigits", + { get: readMinimumSignificantDigits }); +Object.defineProperty(options, "maximumSignificantDigits", + { get: readMaximumSignificantDigits }); + +new Intl.NumberFormat("de", options); + +if (read !== 4) { + $ERROR("insuffient number of property reads: " + read + "."); +} diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_34.js b/js/src/tests/test402/ch11/11.1/11.1.1_34.js new file mode 100644 index 000000000000..98ba9a06207a --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_34.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option useGrouping is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.NumberFormat, "useGrouping", "boolean", undefined, true); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_6.js b/js/src/tests/test402/ch11/11.1/11.1.1_6.js new file mode 100644 index 000000000000..5b9d342ebf75 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_6.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["localeMatcher"]); + +var locale = new Intl.NumberFormat(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; +if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("NumberFormat returns invalid locale " + locale + "."); +} + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_7.js b/js/src/tests/test402/ch11/11.1/11.1.1_7.js new file mode 100644 index 000000000000..4b13b245b74c --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_7.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option localeMatcher is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.NumberFormat, "localeMatcher", "string", ["lookup", "best fit"], "best fit", {noReturn: true}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.1_a.js b/js/src/tests/test402/ch11/11.1/11.1.1_a.js new file mode 100644 index 000000000000..611816b61c16 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.1_a.js @@ -0,0 +1,18 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a NumberFormat doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.NumberFormat("de-DE-u-nu-latn"); +}); + +testForUnwantedRegExpChanges(function () { + new Intl.NumberFormat("de-DE-u-nu-latn", {style: "currency", currency: "EUR"}); +}); diff --git a/js/src/tests/test402/ch11/11.1/11.1.2.1_4.js b/js/src/tests/test402/ch11/11.1/11.1.2.1_4.js new file mode 100644 index 000000000000..18b5b98faf34 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.2.1_4.js @@ -0,0 +1,21 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that for non-object values passed as this to NumberFormat a + * wrapper object will be initialized and returned. + * @author Norbert Lindenberg + */ + +var thisValues = [true, 42, "国際化"]; + +thisValues.forEach(function (value) { + var format = Intl.NumberFormat.call(value); + // check that the returned object functions as a number format + var referenceFormat = new Intl.NumberFormat(); + if (Intl.NumberFormat.prototype.format.call(format, 12.3456) !== referenceFormat.format(12.3456)) { + $ERROR("NumberFormat initialized from " + value + " doesn't behave like normal number format."); + } + return true; +}); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.2.js b/js/src/tests/test402/ch11/11.1/11.1.2.js new file mode 100644 index 000000000000..0ca8cbbdaef0 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.2.js @@ -0,0 +1,30 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat can be subclassed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// get a number format and have it format an array of numbers for comparison with the subclass +var locales = ["tlh", "id", "en"]; +var a = [0, 1, -1, -123456.789, -Infinity, NaN]; +var referenceNumberFormat = new Intl.NumberFormat(locales); +var referenceFormatted = a.map(referenceNumberFormat.format); + +function MyNumberFormat(locales, options) { + Intl.NumberFormat.call(this, locales, options); + // could initialize MyNumberFormat properties +} + +MyNumberFormat.prototype = Object.create(Intl.NumberFormat.prototype); +MyNumberFormat.prototype.constructor = MyNumberFormat; +// could add methods to MyNumberFormat.prototype + +var format = new MyNumberFormat(locales); +var actual = a.map(format.format); +testArraysAreSame(referenceFormatted, actual); + diff --git a/js/src/tests/test402/ch11/11.1/11.1.3.js b/js/src/tests/test402/ch11/11.1/11.1.3.js new file mode 100644 index 000000000000..f0bfb5552d8b --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1.3.js @@ -0,0 +1,19 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that objects constructed by Intl.NumberFormat have the specified internal properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.NumberFormat(); + +var actualPrototype = Object.getPrototypeOf(obj); +if (actualPrototype !== Intl.NumberFormat.prototype) { + $ERROR("Prototype of object constructed by Intl.NumberFormat isn't Intl.NumberFormat.prototype; got " + actualPrototype); +} + +if (!Object.isExtensible(obj)) { + $ERROR("Object constructed by Intl.NumberFormat must be extensible."); +} + diff --git a/js/src/tests/test402/ch11/11.1/11.1_L15.js b/js/src/tests/test402/ch11/11.1/11.1_L15.js new file mode 100644 index 000000000000..e40ffc53e195 --- /dev/null +++ b/js/src/tests/test402/ch11/11.1/11.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.NumberFormat, true, true, ["supportedLocalesOf"], 0); + diff --git a/js/src/tests/test402/ch11/11.1/browser.js b/js/src/tests/test402/ch11/11.1/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.1/shell.js b/js/src/tests/test402/ch11/11.1/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.2/11.2.1.js b/js/src/tests/test402/ch11/11.2/11.2.1.js new file mode 100644 index 000000000000..83bebb283575 --- /dev/null +++ b/js/src/tests/test402/ch11/11.2/11.2.1.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype has the required attributes. + * @author Norbert Lindenberg + */ + +var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat, "prototype"); +if (desc === undefined) { + $ERROR("Intl.NumberFormat.prototype is not defined."); +} +if (desc.writable) { + $ERROR("Intl.NumberFormat.prototype must not be writable."); +} +if (desc.enumerable) { + $ERROR("Intl.NumberFormat.prototype must not be enumerable."); +} +if (desc.configurable) { + $ERROR("Intl.NumberFormat.prototype must not be configurable."); +} + diff --git a/js/src/tests/test402/ch11/11.2/11.2.2_L15.js b/js/src/tests/test402/ch11/11.2/11.2.2_L15.js new file mode 100644 index 000000000000..49dce3bae91a --- /dev/null +++ b/js/src/tests/test402/ch11/11.2/11.2.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.supportedLocalesOf + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.NumberFormat.supportedLocalesOf, true, false, [], 1); + diff --git a/js/src/tests/test402/ch11/11.2/11.2.2_a.js b/js/src/tests/test402/ch11/11.2/11.2.2_a.js new file mode 100644 index 000000000000..c6c9f9a46dc6 --- /dev/null +++ b/js/src/tests/test402/ch11/11.2/11.2.2_a.js @@ -0,0 +1,28 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat has a supportedLocalesOf + * property, and it works as planned. + * @author: Roozbeh Pournader + */ + +var defaultLocale = new Intl.NumberFormat().resolvedOptions().locale; +var notSupported = 'zxx'; // "no linguistic content" +var requestedLocales = [defaultLocale, notSupported]; + +var supportedLocales; + +if (!Intl.NumberFormat.hasOwnProperty('supportedLocalesOf')) { + $ERROR("Intl.NumberFormat doesn't have a supportedLocalesOf property."); +} + +supportedLocales = Intl.NumberFormat.supportedLocalesOf(requestedLocales); +if (supportedLocales.length !== 1) { + $ERROR('The length of supported locales list is not 1.'); +} + +if (supportedLocales[0] !== defaultLocale) { + $ERROR('The default locale is not returned in the supported list.'); +} + diff --git a/js/src/tests/test402/ch11/11.2/11.2.2_b.js b/js/src/tests/test402/ch11/11.2/11.2.2_b.js new file mode 100644 index 000000000000..6b4d77e7737a --- /dev/null +++ b/js/src/tests/test402/ch11/11.2/11.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.NumberFormat("und"); diff --git a/js/src/tests/test402/ch11/11.2/11.2.3_b.js b/js/src/tests/test402/ch11/11.2/11.2.3_b.js new file mode 100644 index 000000000000..70fe7cf119a2 --- /dev/null +++ b/js/src/tests/test402/ch11/11.2/11.2.3_b.js @@ -0,0 +1,46 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat does not accept Unicode locale + * extension keys and values that are not allowed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = ["ja-JP", "zh-Hans-CN", "zh-Hant-TW"]; +var input = 1234567.89; + +locales.forEach(function (locale) { + var defaultNumberFormat = new Intl.NumberFormat([locale]); + var defaultOptions = defaultNumberFormat.resolvedOptions(); + var defaultOptionsJSON = JSON.stringify(defaultOptions); + var defaultLocale = defaultOptions.locale; + var defaultFormatted = defaultNumberFormat.format(input); + + var keyValues = { + "cu": ["USD", "EUR", "JPY", "CNY", "TWD", "invalid"], + "nu": ["native", "traditio", "finance", "invalid"] + }; + + Object.getOwnPropertyNames(keyValues).forEach(function (key) { + keyValues[key].forEach(function (value) { + var numberFormat = new Intl.NumberFormat([locale + "-u-" + key + "-" + value]); + var options = numberFormat.resolvedOptions(); + if (options.locale !== defaultLocale) { + $ERROR("Locale " + options.locale + " is affected by key " + + key + "; value " + value + "."); + } + if (JSON.stringify(options) !== defaultOptionsJSON) { + $ERROR("Resolved options " + JSON.stringify(options) + " are affected by key " + + key + "; value " + value + "."); + } + if (defaultFormatted !== numberFormat.format(input)) { + $ERROR("Formatted value " + numberFormat.format(input) + " is affected by key " + + key + "; value " + value + "."); + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch11/11.2/browser.js b/js/src/tests/test402/ch11/11.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.2/shell.js b/js/src/tests/test402/ch11/11.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.3/11.3.1.js b/js/src/tests/test402/ch11/11.3/11.3.1.js new file mode 100644 index 000000000000..46c7fc519388 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.1.js @@ -0,0 +1,14 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.constructor is the + * Intl.NumberFormat. + * @author: Roozbeh Pournader + */ + +if (Intl.NumberFormat.prototype.constructor !== Intl.NumberFormat) { + $ERROR("Intl.NumberFormat.prototype.constructor is not the same as " + + "Intl.NumberFormat"); +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_1_a_L15.js b/js/src/tests/test402/ch11/11.3/11.3.2_1_a_L15.js new file mode 100644 index 000000000000..8e1c9583505c --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_1_a_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the function returned by Intl.NumberFormat.prototype.format + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(new Intl.NumberFormat().format, true, false, [], 1); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_1_a_ii.js b/js/src/tests/test402/ch11/11.3/11.3.2_1_a_ii.js new file mode 100644 index 000000000000..cb284f43ef05 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_1_a_ii.js @@ -0,0 +1,27 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.format + * converts other types to numbers. + * @author: Roozbeh Pournader + */ + +var formatter = new Intl.NumberFormat(); +var testData = [undefined, null, true, '0.6666666', {valueOf: function () { return '0.1234567';}}]; +var number; +var i, input, correctResult, result; + +for (i in testData) { + input = testData[i]; + number = +input; + correctResult = formatter.format(number); + + result = formatter.format(input); + if (result !== correctResult) { + $ERROR('Intl.NumberFormat does not convert other ' + + 'types to numbers. Input: "'+input+'" Output: "'+result+'" '+ + 'Expected output: "'+correctResult+'"'); + } +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_1_c.js b/js/src/tests/test402/ch11/11.3/11.3.2_1_c.js new file mode 100644 index 000000000000..3fc877b310b5 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_1_c.js @@ -0,0 +1,41 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that format function is bound to its Intl.NumberFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var numbers = [0, -0, 1, -1, 5.5, 123, -123, -123.45, 123.44501, 0.001234, + -0.00000000123, 0.00000000000000000000000000000123, 1.2, 0.0000000012344501, + 123445.01, 12344501000000000000000000000000000, -12344501000000000000000000000000000, + Infinity, -Infinity, NaN]; +var locales = [undefined, ["de"], ["th-u-nu-thai"], ["en"], ["ja-u-nu-jpanfin"], ["ar-u-nu-arab"]]; +var options = [ + undefined, + {style: "percent"}, + {style: "currency", currency: "EUR", currencyDisplay: "symbol"}, + {style: "currency", currency: "IQD", currencyDisplay: "symbol"}, + {style: "currency", currency: "KMF", currencyDisplay: "symbol"}, + {style: "currency", currency: "CLF", currencyDisplay: "symbol"}, + {useGrouping: false, minimumIntegerDigits: 3, minimumFractionDigits: 1, maximumFractionDigits: 3} +]; + +locales.forEach(function (locales) { + options.forEach(function (options) { + var formatObj = new Intl.NumberFormat(locales, options); + var formatFunc = formatObj.format; + numbers.forEach(function (number) { + var referenceFormatted = formatObj.format(number); + var formatted = formatFunc(number); + if (referenceFormatted !== formatted) { + $ERROR("format function produces different result than format method for locales " + + locales + "; options: " + (options ? JSON.stringify(options) : options) + + " : " + formatted + " vs. " + referenceFormatted + "."); + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_FN_1.js b/js/src/tests/test402/ch11/11.3/11.3.2_FN_1.js new file mode 100644 index 000000000000..5f14e7772d03 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_FN_1.js @@ -0,0 +1,19 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.format + * doesn't treat all numbers as negative. + * @author: Roozbeh Pournader + */ + +var formatter = new Intl.NumberFormat(); + +if (formatter.format(1) === formatter.format(-1)) { + $ERROR('Intl.NumberFormat is formatting 1 and -1 the same way.'); +} + +if (formatter.format(-0) !== formatter.format(0)) { + $ERROR('Intl.NumberFormat is formatting signed zeros differently.'); +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_FN_2.js b/js/src/tests/test402/ch11/11.3/11.3.2_FN_2.js new file mode 100644 index 000000000000..ec11a679d0e6 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_FN_2.js @@ -0,0 +1,59 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.format + * handles NaN, Infinity, and -Infinity properly. + * @author: Roozbeh Pournader + */ + +// FIXME: We are only listing Numeric_Type=Decimal. May need to add more +// when the spec clarifies. Current as of Unicode 6.1. +var hasUnicodeDigits = new RegExp('.*([' + + '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F' + + '\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF' + + '\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9' + + '\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819' + + '\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59' + + '\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9' + + '\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19' + + ']|' + + '\uD801[\uDCA0-\uDCA9]|' + + '\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9]|' + + '\uD805[\uDEC0-\uDEC9]|' + + '\uD835[\uDFCE-\uDFFF])'); + +var formatter = new Intl.NumberFormat(); +var formattedNaN = formatter.format(NaN); +var formattedInfinity = formatter.format(Infinity); +var formattedNegativeInfinity = formatter.format(-Infinity); + +if (formattedNaN === formattedInfinity) { + $ERROR('Intl.NumberFormat formats NaN and Infinity the ' + + 'same way.'); +} + +if (formattedNaN === formattedNegativeInfinity) { + $ERROR('Intl.NumberFormat formats NaN and negative ' + + 'Infinity the same way.'); +} + +if (formattedInfinity === formattedNegativeInfinity) { + $ERROR('Intl.NumberFormat formats Infinity and ' + + 'negative Infinity the same way.'); +} + +if (hasUnicodeDigits.test(formattedNaN)) { + $ERROR('Intl.NumberFormat formats NaN using a digit.'); +} + +if (hasUnicodeDigits.test(formattedInfinity)) { + $ERROR('Intl.NumberFormat formats Infinity using a ' + + 'digit.'); +} + +if (hasUnicodeDigits.test(formattedNegativeInfinity)) { + $ERROR('Intl.NumberFormat formats negative Infinity ' + + 'using a digit.'); +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_b.js b/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_b.js new file mode 100644 index 000000000000..efe15575d9aa --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_b.js @@ -0,0 +1,27 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.format + * formats percent values properly. + * @author: Roozbeh Pournader + */ + +var numberFormatter = new Intl.NumberFormat(); +var percentFormatter = new Intl.NumberFormat(undefined, {style: 'percent'}); + +var formattedTwenty = numberFormatter.format(20); +var formattedTwentyPercent = percentFormatter.format(0.20); + +// FIXME: May not work for some theoretical locales where percents and +// normal numbers are formatted using different numbering systems. +if (formattedTwentyPercent.indexOf(formattedTwenty) === -1) { + $ERROR("Intl.NumberFormat's formatting of 20% does not include a " + + "formatting of 20 as a substring."); +} + +// FIXME: Move this to somewhere appropriate +if (percentFormatter.format(0.011) === percentFormatter.format(0.02)) { + $ERROR('Intl.NumberFormat is formatting 1.1% and 2% the same way.'); +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_e.js b/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_e.js new file mode 100644 index 000000000000..234ae63254cf --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_FN_3_e.js @@ -0,0 +1,47 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.format + * supports all alternative numbering systems. + * @author: Roozbeh Pournader + */ + +var numberingSystems = { + arab: 0x0660, + arabext: 0x06F0, + beng: 0x09E6, + deva: 0x0966, + fullwide: 0xFF10, + gujr: 0x0AE6, + guru: 0x0A66, + hanidec: [0x3007, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, + 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D], + khmr: 0x17E0, + knda: 0x0CE6, + laoo: 0x0ED0, + latn: 0x0030, + mlym: 0x0D66, + mong: 0x1810, + mymr: 0x1040, + orya: 0x0B66, + tamldec: 0x0BE6, + telu: 0x0C66, + thai: 0x0E50, + tibt: 0x0F20 +}; + +var options, formatter; +var s, zeroCode, digitList; + +for (s in numberingSystems) { + zeroCode = numberingSystems[s]; + if (typeof zeroCode === 'number') { + digitList = [zeroCode, zeroCode+1, zeroCode+2, zeroCode+3, zeroCode+4, + zeroCode+5, zeroCode+6, zeroCode+7, zeroCode+8, zeroCode+9]; + numberingSystems[s] = digitList; + } +} + +// FIXME: Unfinished + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_L15.js b/js/src/tests/test402/ch11/11.3/11.3.2_L15.js new file mode 100644 index 000000000000..17b688b7a9d1 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the getter for Intl.NumberFormat.prototype.format + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get , true, false, [], 0); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_TRF.js b/js/src/tests/test402/ch11/11.3/11.3.2_TRF.js new file mode 100644 index 000000000000..32ee5cd9aab4 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_TRF.js @@ -0,0 +1,52 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the digits are determined correctly when specifying pre/post decimal digits. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = [ + new Intl.NumberFormat().resolvedOptions().locale, + "ar", "de", "th", "ja" +]; +var numberingSystems = [ + "arab", + "latn", + "thai", + "hanidec" +]; +var testData = { + "0": "000.0", + "-0": "000.0", + "123": "123.0", + "-123": "-123.0", + "12345": "12345.0", + "-12345": "-12345.0", + "123.45": "123.45", + "-123.45": "-123.45", + "123.44501": "123.445", + "-123.44501": "-123.445", + "0.001234": "000.001", + "-0.001234": "-000.001", + "0.00000000123": "000.0", + "-0.00000000123": "-000.0", + "0.00000000000000000000000000000123": "000.0", + "-0.00000000000000000000000000000123": "-000.0", + "1.2": "001.2", + "-1.2": "-001.2", + "0.0000000012344501": "000.0", + "-0.0000000012344501": "-000.0", + "123445.01": "123445.01", + "-123445.01": "-123445.01", + "12344501000000000000000000000000000": "12344501000000000000000000000000000.0", + "-12344501000000000000000000000000000": "-12344501000000000000000000000000000.0" +}; + +testNumberFormat(locales, numberingSystems, + {useGrouping: false, minimumIntegerDigits: 3, minimumFractionDigits: 1, maximumFractionDigits: 3}, + testData); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.2_TRP.js b/js/src/tests/test402/ch11/11.3/11.3.2_TRP.js new file mode 100644 index 000000000000..9409e258d14b --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.2_TRP.js @@ -0,0 +1,52 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the digits are determined correctly when specifying significant digits. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = [ + new Intl.NumberFormat().resolvedOptions().locale, + "ar", "de", "th", "ja" +]; +var numberingSystems = [ + "arab", + "latn", + "thai", + "hanidec" +]; +var testData = { + "0": "0.00", + "-0": "0.00", + "123": "123", + "-123": "-123", + "12345": "12345", + "-12345": "-12345", + "123.45": "123.45", + "-123.45": "-123.45", + "123.44501": "123.45", + "-123.44501": "-123.45", + "0.001234": "0.001234", + "-0.001234": "-0.001234", + "0.00000000123": "0.00000000123", + "-0.00000000123": "-0.00000000123", + "0.00000000000000000000000000000123": "0.00000000000000000000000000000123", + "-0.00000000000000000000000000000123": "-0.00000000000000000000000000000123", + "1.2": "1.20", + "-1.2": "-1.20", + "0.0000000012344501": "0.0000000012345", + "-0.0000000012344501": "-0.0000000012345", + "123445.01": "123450", + "-123445.01": "-123450", + "12344501000000000000000000000000000": "12345000000000000000000000000000000", + "-12344501000000000000000000000000000": "-12345000000000000000000000000000000" +}; + +testNumberFormat(locales, numberingSystems, + {useGrouping: false, minimumSignificantDigits: 3, maximumSignificantDigits: 5}, + testData); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.3.js b/js/src/tests/test402/ch11/11.3/11.3.3.js new file mode 100644 index 000000000000..5a220ccc9b7a --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.3.js @@ -0,0 +1,31 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the object returned by Intl.NumberFormat.prototype.resolvedOptions + * has the right properties. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var actual = new Intl.NumberFormat().resolvedOptions(); + +var actual2 = new Intl.NumberFormat().resolvedOptions(); +if (actual2 === actual) { + $ERROR("resolvedOptions returned the same object twice."); +} + +// this assumes the default values where the specification provides them +mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); +mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem); +mustHaveProperty(actual, "style", ["decimal"]); +mustNotHaveProperty(actual, "currency"); +mustNotHaveProperty(actual, "currencyDisplay"); +mustHaveProperty(actual, "minimumIntegerDigits", [1]); +mustHaveProperty(actual, "minimumFractionDigits", [0]); +mustHaveProperty(actual, "maximumFractionDigits", [3]); +mustNotHaveProperty(actual, "minimumSignificantDigits"); +mustNotHaveProperty(actual, "maximumSignificantDigits"); +mustHaveProperty(actual, "useGrouping", [true]); + diff --git a/js/src/tests/test402/ch11/11.3/11.3.3_L15.js b/js/src/tests/test402/ch11/11.3/11.3.3_L15.js new file mode 100644 index 000000000000..b9f95866d1af --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype.resolvedOptions + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.NumberFormat.prototype.resolvedOptions, true, false, [], 0); + diff --git a/js/src/tests/test402/ch11/11.3/11.3_L15.js b/js/src/tests/test402/ch11/11.3/11.3_L15.js new file mode 100644 index 000000000000..ac1f0c05dfe8 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.NumberFormat.prototype, false, false, ["constructor", "format", "resolvedOptions"]); + diff --git a/js/src/tests/test402/ch11/11.3/11.3_a.js b/js/src/tests/test402/ch11/11.3/11.3_a.js new file mode 100644 index 000000000000..282a10bf6ee7 --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3_a.js @@ -0,0 +1,16 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype is an object that + * has been initialized as an Intl.NumberFormat. + * @author: Roozbeh Pournader + */ + +// test by calling a function that would fail if "this" were not an object +// initialized as an Intl.NumberFormat +if (typeof Intl.NumberFormat.prototype.format(0) !== "string") { + $ERROR("Intl.NumberFormat's prototype is not an object that has been " + + "initialized as an Intl.NumberFormat"); +} + diff --git a/js/src/tests/test402/ch11/11.3/11.3_b.js b/js/src/tests/test402/ch11/11.3/11.3_b.js new file mode 100644 index 000000000000..6d0162b1d91e --- /dev/null +++ b/js/src/tests/test402/ch11/11.3/11.3_b.js @@ -0,0 +1,33 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.prototype functions throw a + * TypeError if called on a non-object value or an object that hasn't been + * initialized as a NumberFormat. + * @author Norbert Lindenberg + */ + +var functions = { + "format getter": Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get, + resolvedOptions: Intl.NumberFormat.prototype.resolvedOptions +}; +var invalidTargets = [undefined, null, true, 0, "NumberFormat", [], {}]; + +Object.getOwnPropertyNames(functions).forEach(function (functionName) { + var f = functions[functionName]; + invalidTargets.forEach(function (target) { + var error; + try { + f.call(target); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Calling " + functionName + " on " + target + " was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Calling " + functionName + " on " + target + " was rejected with wrong error " + error.name + "."); + } + }); +}); + diff --git a/js/src/tests/test402/ch11/11.3/browser.js b/js/src/tests/test402/ch11/11.3/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.3/shell.js b/js/src/tests/test402/ch11/11.3/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.4/11.4_a.js b/js/src/tests/test402/ch11/11.4/11.4_a.js new file mode 100644 index 000000000000..a562879ece36 --- /dev/null +++ b/js/src/tests/test402/ch11/11.4/11.4_a.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat instances have the specified properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.NumberFormat(); + +var toStringValue = Object.prototype.toString.call(obj); +if (toStringValue !== "[object Object]") { + $ERROR("Intl.NumberFormat instance produces wrong [[Class]] - toString returns " + toStringValue + "."); +} + diff --git a/js/src/tests/test402/ch11/11.4/browser.js b/js/src/tests/test402/ch11/11.4/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/11.4/shell.js b/js/src/tests/test402/ch11/11.4/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/browser.js b/js/src/tests/test402/ch11/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch11/shell.js b/js/src/tests/test402/ch11/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_1.js b/js/src/tests/test402/ch12/12.1/12.1.1_1.js new file mode 100644 index 000000000000..8136fb421001 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_1.js @@ -0,0 +1,43 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that an object can't be re-initialized as a DateTimeFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testWithIntlConstructors(function (Constructor) { + var obj, error; + + // variant 1: use constructor in a "new" expression + obj = new Constructor(); + try { + Intl.DateTimeFormat.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with \"new\" as DateTimeFormat was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with \"new\" as DateTimeFormat was rejected with wrong error " + error.name + "."); + } + + // variant 2: use constructor as a function + obj = Constructor.call({}); + error = undefined; + try { + Intl.DateTimeFormat.call(obj); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Re-initializing object created with constructor as function as DateTimeFormat was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Re-initializing object created with constructor as function as DateTimeFormat was rejected with wrong error " + error.name + "."); + } + + return true; +}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_18.js b/js/src/tests/test402/ch12/12.1/12.1.1_18.js new file mode 100644 index 000000000000..f75ea1e32749 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_18.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option hour12 is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.DateTimeFormat, "hour12", "boolean", undefined, undefined, + {extra: {any: {hour: "numeric", minute: "numeric"}}}); +testOption(Intl.DateTimeFormat, "hour12", "boolean", undefined, undefined, + {noReturn: true}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_22.js b/js/src/tests/test402/ch12/12.1/12.1.1_22.js new file mode 100644 index 000000000000..5c317c6b9292 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_22.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZone"]); + +var locale = new Intl.DateTimeFormat(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; +if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("DateTimeFormat returns invalid locale " + locale + "."); +} + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_23.js b/js/src/tests/test402/ch12/12.1/12.1.1_23.js new file mode 100644 index 000000000000..d26e1d28c82e --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_23.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the options for the date and time components are processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +getDateTimeComponents().forEach(function (component) { + testOption(Intl.DateTimeFormat, component, "string", getDateTimeComponentValues(component), undefined, {isILD: true}); +}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_25.js b/js/src/tests/test402/ch12/12.1/12.1.1_25.js new file mode 100644 index 000000000000..ccaf7be035e0 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_25.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option formatMatcher is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.DateTimeFormat, "formatMatcher", "string", ["basic", "best fit"], "best fit", {noReturn: true}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_5.js b/js/src/tests/test402/ch12/12.1/12.1.1_5.js new file mode 100644 index 000000000000..c6b166814c6d --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_5.js @@ -0,0 +1,18 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["localeMatcher"]); + +var locale = new Intl.DateTimeFormat(undefined, {localeMatcher: "lookup"}).resolvedOptions().locale; +if (!isCanonicalizedStructurallyValidLanguageTag(locale)) { + $ERROR("DateTimeFormat returns invalid locale " + locale + "."); +} + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_6.js b/js/src/tests/test402/ch12/12.1/12.1.1_6.js new file mode 100644 index 000000000000..148ca02f6547 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_6.js @@ -0,0 +1,12 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the option localeMatcher is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testOption(Intl.DateTimeFormat, "localeMatcher", "string", ["lookup", "best fit"], "best fit", {noReturn: true}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_TDTO.js b/js/src/tests/test402/ch12/12.1/12.1.1_TDTO.js new file mode 100644 index 000000000000..5df6a1cf2bef --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_TDTO.js @@ -0,0 +1,107 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the set of options for the date and time components is processed correctly. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = [[], ["zh-Hans-CN"], ["hi-IN"], ["en-US"], ["id-ID"]]; +var dates = [new Date(), new Date(0), new Date(Date.parse("1989-11-09T17:57:00Z"))]; + +function testWithDateTimeFormat(options, expected) { + locales.forEach(function (locales) { + var format = new Intl.DateTimeFormat(locales, options); + var resolvedOptions = format.resolvedOptions(); + getDateTimeComponents().forEach(function (component) { + if (resolvedOptions.hasOwnProperty(component)) { + if (!expected.hasOwnProperty(component)) { + $ERROR("Unrequested component " + component + + " added to expected subset " + JSON.stringify(expected) + + "; locales " + locales + ", options " + + (options ? JSON.stringify(options) : options) + "."); + } + } else { + if (expected.hasOwnProperty(component)) { + $ERROR("Missing component " + component + + " from expected subset " + JSON.stringify(expected) + + "; locales " + locales + ", options " + + (options ? JSON.stringify(options) : options) + "."); + } + } + }); + }); +} + +function testWithToLocale(f, options, expected) { + // expected can be either one subset or an array of possible subsets + if (expected.length === undefined) { + expected = [expected]; + } + locales.forEach(function (locales) { + dates.forEach(function (date) { + var formatted = Date.prototype[f].call(date, locales, options); + var expectedStrings = []; + expected.forEach(function (expected) { + var referenceFormat = new Intl.DateTimeFormat(locales, expected); + expectedStrings.push(referenceFormat.format(date)); + }); + if (expectedStrings.indexOf(formatted) === -1) { + $ERROR("Function " + f + " did not return expected string for locales " + + locales + ", options " + (options? JSON.stringify(options) : options) + + "; expected " + + (expectedStrings.length === 1 ? expectedStrings[0] : "one of " + expectedStrings) + + ", got " + formatted + "."); + } + }); + }); +} + +// any/date: steps 5a, 6a, 7a +testWithDateTimeFormat(undefined, {year: "numeric", month: "numeric", day: "numeric"}); + +// any/date: steps 5a, 6a +testWithDateTimeFormat({year: "numeric", month: "numeric"}, {year: "numeric", month: "numeric"}); + +// any/date: steps 5a, 6a +testWithDateTimeFormat({hour: "numeric", minute: "numeric"}, {hour: "numeric", minute: "numeric"}); + +// any/all: steps 5a, 6a, 7a, 8a +testWithToLocale("toLocaleString", undefined, [ + // the first one is not guaranteed to be supported; the second one is + {year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"}, + {weekday: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"} +]); + +// any/all: steps 5a, 6a +testWithToLocale("toLocaleString", {year: "numeric", month: "numeric"}, {year: "numeric", month: "numeric"}); + +// any/all: steps 5a, 6a +testWithToLocale("toLocaleString", {hour: "numeric", minute: "numeric"}, {hour: "numeric", minute: "numeric"}); + +// date/date: steps 5a, 7a +testWithToLocale("toLocaleDateString", undefined, {year: "numeric", month: "numeric", day: "numeric"}); + +// date/date: steps 5a +testWithToLocale("toLocaleDateString", {year: "numeric", month: "numeric"}, {year: "numeric", month: "numeric"}); + +// date/date: steps 5a, 7a +testWithToLocale("toLocaleDateString", {hour: "numeric", minute: "numeric", second: "numeric"}, [ + // the first one is not guaranteed to be supported; the second one is + {year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"}, + {weekday: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"} +]); + +// time/time: steps 6a, 8a +testWithToLocale("toLocaleTimeString", undefined, {hour: "numeric", minute: "numeric", second: "numeric"}); + +// time/time: steps 6a, 8a +testWithToLocale("toLocaleTimeString", {weekday: "short", year: "numeric", month: "numeric", day: "numeric"}, + {weekday: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"}); + +// time/time: steps 6a +testWithToLocale("toLocaleTimeString", {hour: "numeric", minute: "numeric"}, {hour: "numeric", minute: "numeric"}); + + diff --git a/js/src/tests/test402/ch12/12.1/12.1.1_a.js b/js/src/tests/test402/ch12/12.1/12.1.1_a.js new file mode 100644 index 000000000000..4f5f3dbf5ee8 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.1_a.js @@ -0,0 +1,18 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a DateTimeFormat doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.DateTimeFormat("de-DE-u-ca-gregory"); +}); + +testForUnwantedRegExpChanges(function () { + new Intl.DateTimeFormat("de-DE-u-ca-gregory", {timeZone: "UTC"}); +}); diff --git a/js/src/tests/test402/ch12/12.1/12.1.2.1_4.js b/js/src/tests/test402/ch12/12.1/12.1.2.1_4.js new file mode 100644 index 000000000000..cb22be8f9986 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.2.1_4.js @@ -0,0 +1,21 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that for non-object values passed as this to DateTimeFormat a + * wrapper object will be initialized and returned. + * @author Norbert Lindenberg + */ + +var thisValues = [true, 42, "国際化"]; + +thisValues.forEach(function (value) { + var format = Intl.DateTimeFormat.call(value); + // check that the returned object functions as a date-time format + var referenceFormat = new Intl.DateTimeFormat(); + if (Intl.DateTimeFormat.prototype.format.call(format, new Date(111111111)) !== referenceFormat.format(new Date(111111111))) { + $ERROR("DateTimeFormat initialized from " + value + " doesn't behave like normal date-time format."); + } + return true; +}); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.2.js b/js/src/tests/test402/ch12/12.1/12.1.2.js new file mode 100644 index 000000000000..3ffed2ec82ad --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.2.js @@ -0,0 +1,30 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat can be subclassed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +// get a date-time format and have it format an array of dates for comparison with the subclass +var locales = ["tlh", "id", "en"]; +var a = [new Date(0), Date.now(), new Date(Date.parse("1989-11-09T17:57:00Z"))]; +var referenceDateTimeFormat = new Intl.DateTimeFormat(locales); +var referenceFormatted = a.map(referenceDateTimeFormat.format); + +function MyDateTimeFormat(locales, options) { + Intl.DateTimeFormat.call(this, locales, options); + // could initialize MyDateTimeFormat properties +} + +MyDateTimeFormat.prototype = Object.create(Intl.DateTimeFormat.prototype); +MyDateTimeFormat.prototype.constructor = MyDateTimeFormat; +// could add methods to MyDateTimeFormat.prototype + +var format = new MyDateTimeFormat(locales); +var actual = a.map(format.format); +testArraysAreSame(referenceFormatted, actual); + diff --git a/js/src/tests/test402/ch12/12.1/12.1.3.js b/js/src/tests/test402/ch12/12.1/12.1.3.js new file mode 100644 index 000000000000..5e70bbb8f3d8 --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1.3.js @@ -0,0 +1,19 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that objects constructed by Intl.DateTimeFormat have the specified internal properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.DateTimeFormat(); + +var actualPrototype = Object.getPrototypeOf(obj); +if (actualPrototype !== Intl.DateTimeFormat.prototype) { + $ERROR("Prototype of object constructed by Intl.DateTimeFormat isn't Intl.DateTimeFormat.prototype; got " + actualPrototype); +} + +if (!Object.isExtensible(obj)) { + $ERROR("Object constructed by Intl.DateTimeFormat must be extensible."); +} + diff --git a/js/src/tests/test402/ch12/12.1/12.1_L15.js b/js/src/tests/test402/ch12/12.1/12.1_L15.js new file mode 100644 index 000000000000..46c4f5f50b8a --- /dev/null +++ b/js/src/tests/test402/ch12/12.1/12.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.DateTimeFormat, true, true, ["supportedLocalesOf"], 0); + diff --git a/js/src/tests/test402/ch12/12.1/browser.js b/js/src/tests/test402/ch12/12.1/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.1/shell.js b/js/src/tests/test402/ch12/12.1/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.2/12.2.1.js b/js/src/tests/test402/ch12/12.2/12.2.1.js new file mode 100644 index 000000000000..3590c0a9d2aa --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.1.js @@ -0,0 +1,22 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype has the required attributes. + * @author Norbert Lindenberg + */ + +var desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat, "prototype"); +if (desc === undefined) { + $ERROR("Intl.DateTimeFormat.prototype is not defined."); +} +if (desc.writable) { + $ERROR("Intl.DateTimeFormat.prototype must not be writable."); +} +if (desc.enumerable) { + $ERROR("Intl.DateTimeFormat.prototype must not be enumerable."); +} +if (desc.configurable) { + $ERROR("Intl.DateTimeFormat.prototype must not be configurable."); +} + diff --git a/js/src/tests/test402/ch12/12.2/12.2.2_L15.js b/js/src/tests/test402/ch12/12.2/12.2.2_L15.js new file mode 100644 index 000000000000..8b21df1fd3a3 --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.supportedLocalesOf + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.DateTimeFormat.supportedLocalesOf, true, false, [], 1); + diff --git a/js/src/tests/test402/ch12/12.2/12.2.2_a.js b/js/src/tests/test402/ch12/12.2/12.2.2_a.js new file mode 100644 index 000000000000..42eedc0a1a30 --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.2_a.js @@ -0,0 +1,28 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat has a supportedLocalesOf + * property, and it works as planned. + * @author: Roozbeh Pournader + */ + +var defaultLocale = new Intl.DateTimeFormat().resolvedOptions().locale; +var notSupported = 'zxx'; // "no linguistic content" +var requestedLocales = [defaultLocale, notSupported]; + +var supportedLocales; + +if (!Intl.DateTimeFormat.hasOwnProperty('supportedLocalesOf')) { + $ERROR("Intl.DateTimeFormat doesn't have a supportedLocalesOf property."); +} + +supportedLocales = Intl.DateTimeFormat.supportedLocalesOf(requestedLocales); +if (supportedLocales.length !== 1) { + $ERROR('The length of supported locales list is not 1.'); +} + +if (supportedLocales[0] !== defaultLocale) { + $ERROR('The default locale is not returned in the supported list.'); +} + diff --git a/js/src/tests/test402/ch12/12.2/12.2.2_b.js b/js/src/tests/test402/ch12/12.2/12.2.2_b.js new file mode 100644 index 000000000000..06bc8027e7e8 --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.DateTimeFormat("und"); diff --git a/js/src/tests/test402/ch12/12.2/12.2.3_b.js b/js/src/tests/test402/ch12/12.2/12.2.3_b.js new file mode 100644 index 000000000000..65fd9dc5fb82 --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.3_b.js @@ -0,0 +1,47 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat does not accept Unicode locale + * extension keys and values that are not allowed. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = ["ja-JP", "zh-Hans-CN", "zh-Hant-TW"]; +var input = new Date(Date.parse("1989-11-09T17:57:00Z")); + +locales.forEach(function (locale) { + var defaultDateTimeFormat = new Intl.DateTimeFormat([locale]); + var defaultOptions = defaultDateTimeFormat.resolvedOptions(); + var defaultOptionsJSON = JSON.stringify(defaultOptions); + var defaultLocale = defaultOptions.locale; + var defaultFormatted = defaultDateTimeFormat.format(input); + + var keyValues = { + "cu": ["USD", "EUR", "JPY", "CNY", "TWD", "invalid"], // DateTimeFormat internally uses NumberFormat + "nu": ["native", "traditio", "finance", "invalid"], + "tz": ["usnavajo", "utcw01", "aumel", "uslax", "usnyc", "deber", "invalid"] + }; + + Object.getOwnPropertyNames(keyValues).forEach(function (key) { + keyValues[key].forEach(function (value) { + var dateTimeFormat = new Intl.DateTimeFormat([locale + "-u-" + key + "-" + value]); + var options = dateTimeFormat.resolvedOptions(); + if (options.locale !== defaultLocale) { + $ERROR("Locale " + options.locale + " is affected by key " + + key + "; value " + value + "."); + } + if (JSON.stringify(options) !== defaultOptionsJSON) { + $ERROR("Resolved options " + JSON.stringify(options) + " are affected by key " + + key + "; value " + value + "."); + } + if (defaultFormatted !== dateTimeFormat.format(input)) { + $ERROR("Formatted value " + dateTimeFormat.format(input) + " is affected by key " + + key + "; value " + value + "."); + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch12/12.2/12.2.3_c.js b/js/src/tests/test402/ch12/12.2/12.2.3_c.js new file mode 100644 index 000000000000..0aced6ca91a5 --- /dev/null +++ b/js/src/tests/test402/ch12/12.2/12.2.3_c.js @@ -0,0 +1,52 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat provides the required date-time + * format component subsets. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = ["de-DE", "en-US", "hi-IN", "id-ID", "ja-JP", "th-TH", "zh-Hans-CN", "zh-Hant-TW", "zxx"]; +var subsets = [ + {weekday: "long", year: "numeric", month: "numeric", day: "numeric", + hour: "numeric", minute: "numeric", second: "numeric"}, + {weekday: "long", year: "numeric", month: "numeric", day: "numeric"}, + {year: "numeric", month: "numeric", day: "numeric"}, + {year: "numeric", month: "numeric"}, + {month: "numeric", day: "numeric"}, + {hour: "numeric", minute: "numeric", second: "numeric"}, + {hour: "numeric", minute: "numeric"} +]; + +locales.forEach(function (locale) { + subsets.forEach(function (subset) { + var format = new Intl.DateTimeFormat([locale], subset); + var actual = format.resolvedOptions(); + getDateTimeComponents().forEach(function (component) { + if (actual.hasOwnProperty(component)) { + if (!subset.hasOwnProperty(component)) { + $ERROR("Unrequested component " + component + + " added to requested subset " + JSON.stringify(subset) + + "; locale " + locale + "."); + } + try { + testValidDateTimeComponentValue(component, actual[component]); + } catch (e) { + e.message += " (Testing locale " + locale + "; subset " + + JSON.stringify(subset) + ")"; + throw e; + } + } else { + if (subset.hasOwnProperty(component)) { + $ERROR("Missing component " + component + + " from requested subset " + JSON.stringify(subset) + + "; locale " + locale + "."); + } + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch12/12.2/browser.js b/js/src/tests/test402/ch12/12.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.2/shell.js b/js/src/tests/test402/ch12/12.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.3/12.3.1.js b/js/src/tests/test402/ch12/12.3/12.3.1.js new file mode 100644 index 000000000000..1755dd64bc1f --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.1.js @@ -0,0 +1,14 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype.constructor is the + * Intl.DateTimeFormat. + * @author: Roozbeh Pournader + */ + +if (Intl.DateTimeFormat.prototype.constructor !== Intl.DateTimeFormat) { + $ERROR("Intl.DateTimeFormat.prototype.constructor is not the same as " + + "Intl.DateTimeFormat"); +} + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_1_a_L15.js b/js/src/tests/test402/ch12/12.3/12.3.2_1_a_L15.js new file mode 100644 index 000000000000..2fb768d09c2d --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_1_a_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the function returned by Intl.DateTimeFormat.prototype.format + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(new Intl.DateTimeFormat().format, true, false, [], 0); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_1_c.js b/js/src/tests/test402/ch12/12.3/12.3.2_1_c.js new file mode 100644 index 000000000000..d4b9f891fe47 --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_1_c.js @@ -0,0 +1,34 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that format function is bound to its Intl.DateTimeFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var dates = [new Date(), new Date(0), new Date(Date.parse("1989-11-09T17:57:00Z"))]; +var locales = [undefined, ["de"], ["th-u-ca-gregory-nu-thai"], ["en"], ["ja-u-ca-japanese"], ["ar-u-ca-islamicc-nu-arab"]]; +var options = [ + undefined, + {hour12: false}, + {month: "long", day: "numeric", hour: "2-digit", minute: "2-digit"} +]; + +locales.forEach(function (locales) { + options.forEach(function (options) { + var formatObj = new Intl.DateTimeFormat(locales, options); + var formatFunc = formatObj.format; + dates.forEach(function (date) { + var referenceFormatted = formatObj.format(date); + var formatted = formatFunc(date); + if (referenceFormatted !== formatted) { + $ERROR("format function produces different result than format method for locales " + + locales + "; options: " + (options ? JSON.stringify(options) : options) + + " : " + formatted + " vs. " + referenceFormatted + "."); + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_FDT_1.js b/js/src/tests/test402/ch12/12.3/12.3.2_FDT_1.js new file mode 100644 index 000000000000..d643d7928b2f --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_FDT_1.js @@ -0,0 +1,26 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that format handles non-finite values correctly. + * @author Norbert Lindenberg + */ + +var invalidValues = [NaN, Infinity, -Infinity]; + +var format = new Intl.DateTimeFormat(); + +invalidValues.forEach(function (value) { + var error; + try { + var result = format.format(value); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid value " + value + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid value " + value + " was rejected with wrong error " + error.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_FDT_7_a_iv.js b/js/src/tests/test402/ch12/12.3/12.3.2_FDT_7_a_iv.js new file mode 100644 index 000000000000..f13878403954 --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_FDT_7_a_iv.js @@ -0,0 +1,32 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that format uses a proleptic Gregorian calendar with no year 0. + * @author Norbert Lindenberg + */ + +var dates = [ + 0, // January 1, 1970 + -62151602400000, // in June 1 BC + -8640000000000000 // beginning of ECMAScript time +]; + +var format = new Intl.DateTimeFormat(["en-US"], {year: "numeric", month: "long", timeZone: "UTC"}); + +// this test requires a Gregorian calendar, which we usually find in the US +if (format.resolvedOptions().calendar !== "gregory") { + $ERROR("Internal error: Didn't find Gregorian calendar"); +} + +dates.forEach(function (date) { + var year = new Date(date).getUTCFullYear(); + var expectedYear = year <= 0 ? 1 - year : year; + var expectedYearString = expectedYear.toLocaleString(["en-US"], {useGrouping: false}); + var dateString = format.format(date); + if (dateString.indexOf(expectedYearString) === -1) { + $ERROR("Formatted year doesn't contain expected year – expected " + + expectedYearString + ", got " + dateString + "."); + } +}); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_L15.js b/js/src/tests/test402/ch12/12.3/12.3.2_L15.js new file mode 100644 index 000000000000..73d309e26abc --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the getter for Intl.DateTimeFormat.prototype.format + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get , true, false, [], 0); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.2_TLT_2.js b/js/src/tests/test402/ch12/12.3/12.3.2_TLT_2.js new file mode 100644 index 000000000000..bf0a8ed36fd6 --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.2_TLT_2.js @@ -0,0 +1,16 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the behavior of a Record is not affected by adversarial + * changes to Object.prototype. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintProperties(["weekday", "era", "year", "month", "day", "hour", "minute", "second", "inDST"]); + +var format = new Intl.DateTimeFormat(); +var time = format.format(); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.3.js b/js/src/tests/test402/ch12/12.3/12.3.3.js new file mode 100644 index 000000000000..b5735c3500e1 --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.3.js @@ -0,0 +1,52 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the object returned by Intl.DateTimeFormat.prototype.resolvedOptions + * has the right properties. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var actual = new Intl.DateTimeFormat().resolvedOptions(); + +var actual2 = new Intl.DateTimeFormat().resolvedOptions(); +if (actual2 === actual) { + $ERROR("resolvedOptions returned the same object twice."); +} + +// source: CLDR file common/bcp47/calendar.xml; version CLDR 21. +var calendars = [ + "buddhist", + "chinese", + "coptic", + "ethioaa", + "ethiopic", + "gregory", + "hebrew", + "indian", + "islamic", + "islamicc", + "iso8601", + "japanese", + "persian", + "roc" +]; + +// this assumes the default values where the specification provides them +mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); +mustHaveProperty(actual, "calendar", calendars); +mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem); +mustHaveProperty(actual, "timeZone", [undefined]); +mustNotHaveProperty(actual, "weekday"); +mustNotHaveProperty(actual, "era"); +mustHaveProperty(actual, "year", ["2-digit", "numeric"]); +mustHaveProperty(actual, "month", ["2-digit", "numeric", "narrow", "short", "long"]); +mustHaveProperty(actual, "day", ["2-digit", "numeric"]); +mustNotHaveProperty(actual, "hour"); +mustNotHaveProperty(actual, "minute"); +mustNotHaveProperty(actual, "second"); +mustNotHaveProperty(actual, "timeZoneName"); +mustNotHaveProperty(actual, "hour12"); + diff --git a/js/src/tests/test402/ch12/12.3/12.3.3_L15.js b/js/src/tests/test402/ch12/12.3/12.3.3_L15.js new file mode 100644 index 000000000000..1b4079ebec8f --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype.resolvedOptions + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.DateTimeFormat.prototype.resolvedOptions, true, false, [], 0); + diff --git a/js/src/tests/test402/ch12/12.3/12.3_L15.js b/js/src/tests/test402/ch12/12.3/12.3_L15.js new file mode 100644 index 000000000000..55f1c16ca1e7 --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Intl.DateTimeFormat.prototype, false, false, ["constructor", "format", "resolvedOptions"]); + diff --git a/js/src/tests/test402/ch12/12.3/12.3_a.js b/js/src/tests/test402/ch12/12.3/12.3_a.js new file mode 100644 index 000000000000..e1d795b910de --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3_a.js @@ -0,0 +1,16 @@ +// Copyright 2012 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype is an object that + * has been initialized as an Intl.DateTimeFormat. + * @author: Roozbeh Pournader + */ + +// test by calling a function that would fail if "this" were not an object +// initialized as an Intl.DateTimeFormat +if (typeof Intl.DateTimeFormat.prototype.format(0) !== "string") { + $ERROR("Intl.DateTimeFormat's prototype is not an object that has been " + + "initialized as an Intl.DateTimeFormat"); +} + diff --git a/js/src/tests/test402/ch12/12.3/12.3_b.js b/js/src/tests/test402/ch12/12.3/12.3_b.js new file mode 100644 index 000000000000..d905bf5712ab --- /dev/null +++ b/js/src/tests/test402/ch12/12.3/12.3_b.js @@ -0,0 +1,33 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.prototype functions throw a + * TypeError if called on a non-object value or an object that hasn't been + * initialized as a DateTimeFormat. + * @author Norbert Lindenberg + */ + +var functions = { + "format getter": Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get, + resolvedOptions: Intl.DateTimeFormat.prototype.resolvedOptions +}; +var invalidTargets = [undefined, null, true, 0, "DateTimeFormat", [], {}]; + +Object.getOwnPropertyNames(functions).forEach(function (functionName) { + var f = functions[functionName]; + invalidTargets.forEach(function (target) { + var error; + try { + f.call(target); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Calling " + functionName + " on " + target + " was not rejected."); + } else if (error.name !== "TypeError") { + $ERROR("Calling " + functionName + " on " + target + " was rejected with wrong error " + error.name + "."); + } + }); +}); + diff --git a/js/src/tests/test402/ch12/12.3/browser.js b/js/src/tests/test402/ch12/12.3/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.3/shell.js b/js/src/tests/test402/ch12/12.3/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.4/12.4_a.js b/js/src/tests/test402/ch12/12.4/12.4_a.js new file mode 100644 index 000000000000..8e8d5954c0ba --- /dev/null +++ b/js/src/tests/test402/ch12/12.4/12.4_a.js @@ -0,0 +1,15 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat instances have the specified properties. + * @author Norbert Lindenberg + */ + +var obj = new Intl.DateTimeFormat(); + +var toStringValue = Object.prototype.toString.call(obj); +if (toStringValue !== "[object Object]") { + $ERROR("Intl.DateTimeFormat instance produces wrong [[Class]] - toString returns " + toStringValue + "."); +} + diff --git a/js/src/tests/test402/ch12/12.4/browser.js b/js/src/tests/test402/ch12/12.4/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/12.4/shell.js b/js/src/tests/test402/ch12/12.4/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/browser.js b/js/src/tests/test402/ch12/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch12/shell.js b/js/src/tests/test402/ch12/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_1.js b/js/src/tests/test402/ch13/13.1/13.1.1_1.js new file mode 100644 index 000000000000..37be9711b34f --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_1.js @@ -0,0 +1,24 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that localeCompare rejects values that can't be coerced to an object. + * @author Norbert Lindenberg + */ + +var invalidValues = [undefined, null]; + +invalidValues.forEach(function (value) { + var error; + try { + var result = String.prototype.localeCompare.call(value, ""); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("String.prototype.localeCompare did not reject this = " + value + "."); + } else if (error.name !== "TypeError") { + $ERROR("String.prototype.localeCompare rejected this = " + value + " with wrong error " + error.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_2.js b/js/src/tests/test402/ch13/13.1/13.1.1_2.js new file mode 100644 index 000000000000..bad7c0fdd847 --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_2.js @@ -0,0 +1,26 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that localeCompare coerces this to a string. + * @author Norbert Lindenberg + */ + +var thisValues = [true, 5, "hello", {toString: function () { return "good bye"; }}]; +var thatValues = ["true", "5", "hello", "good bye"]; + +var i; +for (i = 0; i < thisValues.length; i++) { + var j; + for (j = 0; j < thatValues.length; j++) { + var result = String.prototype.localeCompare.call(thisValues[i], thatValues[j]); + if ((result === 0) !== (i === j)) { + if (result === 0) { + $ERROR("localeCompare treats " + thisValues[i] + " and " + thatValues[j] + " as equal."); + } else { + $ERROR("localeCompare treats " + thisValues[i] + " and " + thatValues[j] + " as different."); + } + } + } +} + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_3_1.js b/js/src/tests/test402/ch13/13.1/13.1.1_3_1.js new file mode 100644 index 000000000000..113a2d9aa872 --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_3_1.js @@ -0,0 +1,26 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that localeCompare coerces that to a string. + * @author Norbert Lindenberg + */ + +var thisValues = ["true", "5", "hello", "good bye"]; +var thatValues = [true, 5, "hello", {toString: function () { return "good bye"; }}]; + +var i; +for (i = 0; i < thisValues.length; i++) { + var j; + for (j = 0; j < thatValues.length; j++) { + var result = String.prototype.localeCompare.call(thisValues[i], thatValues[j]); + if ((result === 0) !== (i === j)) { + if (result === 0) { + $ERROR("localeCompare treats " + thisValues[i] + " and " + thatValues[j] + " as equal."); + } else { + $ERROR("localeCompare treats " + thisValues[i] + " and " + thatValues[j] + " as different."); + } + } + } +} + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_3_2.js b/js/src/tests/test402/ch13/13.1/13.1.1_3_2.js new file mode 100644 index 000000000000..441166c9fb03 --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_3_2.js @@ -0,0 +1,22 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that String.prototype.localeCompare treats a missing + * "that" argument, undefined, and "undefined" as equivalent. + * @author Norbert Lindenberg + */ + +var thisValues = ["a", "t", "u", "undefined", "UNDEFINED", "nicht definiert", "xyz", "未定义"]; + +var i; +for (i = 0; i < thisValues.length; i++) { + var thisValue = thisValues[i]; + if (thisValue.localeCompare() !== thisValue.localeCompare(undefined)) { + $ERROR("String.prototype.localeCompare does not treat missing 'that' argument as undefined."); + } + if (thisValue.localeCompare(undefined) !== thisValue.localeCompare("undefined")) { + $ERROR("String.prototype.localeCompare does not treat undefined 'that' argument as \"undefined\"."); + } +} + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_6_1.js b/js/src/tests/test402/ch13/13.1/13.1.1_6_1.js new file mode 100644 index 000000000000..30607d317164 --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_6_1.js @@ -0,0 +1,65 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that String.prototype.localeCompare throws the same exceptions as Intl.Collator. + * @author Norbert Lindenberg + */ + +var locales = [null, [NaN], ["i"], ["de_DE"]]; +var options = [ + {localeMatcher: null}, + {usage: "invalid"}, + {sensitivity: "invalid"} +]; + +locales.forEach(function (locales) { + var referenceError, error; + try { + var collator = new Intl.Collator(locales); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.Collator for locales " + locales + "."); + } + + try { + var result = "".localeCompare("", locales); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("String.prototype.localeCompare didn't throw exception for locales " + locales + "."); + } else if (error.name !== referenceError.name) { + $ERROR("String.prototype.localeCompare threw exception " + error.name + + " for locales " + locales + "; expected " + referenceError.name + "."); + } +}); + +options.forEach(function (options) { + var referenceError, error; + try { + var collator = new Intl.Collator([], options); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.Collator for options " + + JSON.stringify(options) + "."); + } + + try { + var result = "".localeCompare("", [], options); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("String.prototype.localeCompare didn't throw exception for options " + + JSON.stringify(options) + "."); + } else if (error.name !== referenceError.name) { + $ERROR("String.prototype.localeCompare threw exception " + error.name + + " for options " + JSON.stringify(options) + "; expected " + referenceError.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_6_2.js b/js/src/tests/test402/ch13/13.1/13.1.1_6_2.js new file mode 100644 index 000000000000..481a7803b2fa --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_6_2.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that String.prototype.localeCompare uses the standard + * built-in Intl.Collator constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "Collator"); +"a".localeCompare("b"); diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_7.js b/js/src/tests/test402/ch13/13.1/13.1.1_7.js new file mode 100644 index 000000000000..f0c588f64c3d --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_7.js @@ -0,0 +1,33 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that localeCompare produces the same results as Intl.Collator. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var strings = ["d", "O", "od", "oe", "of", "ö", "o\u0308", "X", "y", "Z", "Z.", "𠮷野家", "吉野家", "!A", "A", "b", "C"]; +var locales = [undefined, ["de"], ["de-u-co-phonebk"], ["en"], ["ja"], ["sv"]]; +var options = [ + undefined, + {usage: "search"}, + {sensitivity: "base", ignorePunctuation: true} +]; + +locales.forEach(function (locales) { + options.forEach(function (options) { + var referenceCollator = new Intl.Collator(locales, options); + var referenceSorted = strings.slice().sort(referenceCollator.compare); + + strings.sort(function (a, b) { return a.localeCompare(b, locales, options); }); + try { + testArraysAreSame(referenceSorted, strings); + } catch (e) { + e.message += " (Testing with locales " + locales + "; options " + JSON.stringify(options) + ".)"; + throw e; + } + }); +}); + diff --git a/js/src/tests/test402/ch13/13.1/13.1.1_L15.js b/js/src/tests/test402/ch13/13.1/13.1.1_L15.js new file mode 100644 index 000000000000..d921de00052a --- /dev/null +++ b/js/src/tests/test402/ch13/13.1/13.1.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that String.prototype.localeCompare + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(String.prototype.localeCompare, true, false, [], 1); + diff --git a/js/src/tests/test402/ch13/13.1/browser.js b/js/src/tests/test402/ch13/13.1/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.1/shell.js b/js/src/tests/test402/ch13/13.1/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.2/13.2.1_1.js b/js/src/tests/test402/ch13/13.2/13.2.1_1.js new file mode 100644 index 000000000000..da1ee8fe58f4 --- /dev/null +++ b/js/src/tests/test402/ch13/13.2/13.2.1_1.js @@ -0,0 +1,37 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that toLocaleString handles "this Number value" correctly. + * @author Norbert Lindenberg + */ + +var invalidValues = [undefined, null, "5", false, {valueOf: function () { return 5; }}]; +var validValues = [5, NaN, -1234567.89, -Infinity]; + +invalidValues.forEach(function (value) { + var error; + try { + var result = Number.prototype.toLocaleString.call(value); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Number.prototype.toLocaleString did not reject this = " + value + "."); + } else if (error.name !== "TypeError") { + $ERROR("Number.prototype.toLocaleString rejected this = " + value + " with wrong error " + error.name + "."); + } +}); + +// for valid values, just check that a Number value and the corresponding +// Number object get the same result. +validValues.forEach(function (value) { + var Constructor = Number; // to keep jshint happy + var valueResult = Number.prototype.toLocaleString.call(value); + var objectResult = Number.prototype.toLocaleString.call(new Constructor(value)); + if (valueResult !== objectResult) { + $ERROR("Number.prototype.toLocaleString produces different results for Number value " + + value + " and corresponding Number object: " + valueResult + " vs. " + objectResult + "."); + } +}); + diff --git a/js/src/tests/test402/ch13/13.2/13.2.1_4_1.js b/js/src/tests/test402/ch13/13.2/13.2.1_4_1.js new file mode 100644 index 000000000000..e6e0b11638a3 --- /dev/null +++ b/js/src/tests/test402/ch13/13.2/13.2.1_4_1.js @@ -0,0 +1,67 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Number.prototype.toLocaleString throws the same exceptions as Intl.NumberFormat. + * @author Norbert Lindenberg + */ + +var locales = [null, [NaN], ["i"], ["de_DE"]]; +var options = [ + {localeMatcher: null}, + {style: "invalid"}, + {style: "currency"}, + {style: "currency", currency: "ßP"}, + {maximumSignificantDigits: -Infinity} +]; + +locales.forEach(function (locales) { + var referenceError, error; + try { + var format = new Intl.NumberFormat(locales); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.NumberFormat for locales " + locales + "."); + } + + try { + var result = (0).toLocaleString(locales); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Number.prototype.toLocaleString didn't throw exception for locales " + locales + "."); + } else if (error.name !== referenceError.name) { + $ERROR("Number.prototype.toLocaleString threw exception " + error.name + + " for locales " + locales + "; expected " + referenceError.name + "."); + } +}); + +options.forEach(function (options) { + var referenceError, error; + try { + var format = new Intl.NumberFormat([], options); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.NumberFormat for options " + + JSON.stringify(options) + "."); + } + + try { + var result = (0).toLocaleString([], options); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Number.prototype.toLocaleString didn't throw exception for options " + + JSON.stringify(options) + "."); + } else if (error.name !== referenceError.name) { + $ERROR("Number.prototype.toLocaleString threw exception " + error.name + + " for options " + JSON.stringify(options) + "; expected " + referenceError.name + "."); + } +}); + diff --git a/js/src/tests/test402/ch13/13.2/13.2.1_4_2.js b/js/src/tests/test402/ch13/13.2/13.2.1_4_2.js new file mode 100644 index 000000000000..a79cfffde782 --- /dev/null +++ b/js/src/tests/test402/ch13/13.2/13.2.1_4_2.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Number.prototype.toLocaleString uses the standard + * built-in Intl.NumberFormat constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "NumberFormat"); +(0.0).toLocaleString(); diff --git a/js/src/tests/test402/ch13/13.2/13.2.1_5.js b/js/src/tests/test402/ch13/13.2/13.2.1_5.js new file mode 100644 index 000000000000..eb953b64d4c4 --- /dev/null +++ b/js/src/tests/test402/ch13/13.2/13.2.1_5.js @@ -0,0 +1,41 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Number.prototype.toLocaleString produces the same results as Intl.NumberFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var numbers = [0, -0, 1, -1, 5.5, 123, -123, -123.45, 123.44501, 0.001234, + -0.00000000123, 0.00000000000000000000000000000123, 1.2, 0.0000000012344501, + 123445.01, 12344501000000000000000000000000000, -12344501000000000000000000000000000, + Infinity, -Infinity, NaN]; +var locales = [undefined, ["de"], ["th-u-nu-thai"], ["en"], ["ja-u-nu-jpanfin"], ["ar-u-nu-arab"]]; +var options = [ + undefined, + {style: "percent"}, + {style: "currency", currency: "EUR", currencyDisplay: "symbol"}, + {style: "currency", currency: "IQD", currencyDisplay: "symbol"}, + {style: "currency", currency: "KMF", currencyDisplay: "symbol"}, + {style: "currency", currency: "CLF", currencyDisplay: "symbol"}, + {useGrouping: false, minimumIntegerDigits: 3, minimumFractionDigits: 1, maximumFractionDigits: 3} +]; + +locales.forEach(function (locales) { + options.forEach(function (options) { + var referenceNumberFormat = new Intl.NumberFormat(locales, options); + var referenceFormatted = numbers.map(referenceNumberFormat.format); + + var formatted = numbers.map(function (a) { return a.toLocaleString(locales, options); }); + try { + testArraysAreSame(referenceFormatted, formatted); + } catch (e) { + e.message += " (Testing with locales " + locales + "; options " + + (options ? JSON.stringify(options) : options) + ".)"; + throw e; + } + }); +}); + diff --git a/js/src/tests/test402/ch13/13.2/13.2.1_L15.js b/js/src/tests/test402/ch13/13.2/13.2.1_L15.js new file mode 100644 index 000000000000..8b53f749635b --- /dev/null +++ b/js/src/tests/test402/ch13/13.2/13.2.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Number.prototype.toLocaleString + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Number.prototype.toLocaleString, true, false, [], 0); + diff --git a/js/src/tests/test402/ch13/13.2/browser.js b/js/src/tests/test402/ch13/13.2/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.2/shell.js b/js/src/tests/test402/ch13/13.2/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.3/13.3.0_1.js b/js/src/tests/test402/ch13/13.3/13.3.0_1.js new file mode 100644 index 000000000000..0f2902162e42 --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.0_1.js @@ -0,0 +1,32 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. handle "this time value" correctly. + * @author Norbert Lindenberg + */ + +var functions = { + toLocaleString: Date.prototype.toLocaleString, + toLocaleDateString: Date.prototype.toLocaleDateString, + toLocaleTimeString: Date.prototype.toLocaleTimeString +}; +var invalidValues = [undefined, null, 5, "5", false, {valueOf: function () { return 5; }}]; + +Object.getOwnPropertyNames(functions).forEach(function (p) { + var f = functions[p]; + invalidValues.forEach(function (value) { + var error; + try { + var result = f.call(value); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Date.prototype." + p + " did not reject this = " + value + "."); + } else if (error.name !== "TypeError") { + $ERROR("Date.prototype." + p + " rejected this = " + value + " with wrong error " + error.name + "."); + } + }); +}); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.0_2.js b/js/src/tests/test402/ch13/13.3/13.3.0_2.js new file mode 100644 index 000000000000..7d5f32fa6866 --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.0_2.js @@ -0,0 +1,26 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. handle non-finite values correctly. + * @author Norbert Lindenberg + */ + +var functions = { + toLocaleString: Date.prototype.toLocaleString, + toLocaleDateString: Date.prototype.toLocaleDateString, + toLocaleTimeString: Date.prototype.toLocaleTimeString +}; +var invalidValues = [NaN, Infinity, -Infinity]; + +Object.getOwnPropertyNames(functions).forEach(function (p) { + var f = functions[p]; + invalidValues.forEach(function (value) { + var result = f.call(new Date(value)); + if (result !== "Invalid Date") { + $ERROR("Date.prototype." + p + " did not return \"Invalid Date\" for " + + value + " – got " + result + " instead."); + } + }); +}); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.0_6_1.js b/js/src/tests/test402/ch13/13.3/13.3.0_6_1.js new file mode 100644 index 000000000000..c97b240b478d --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.0_6_1.js @@ -0,0 +1,74 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. throws the same exceptions as Intl.DateTimeFormat. + * @author Norbert Lindenberg + */ + +var functions = { + toLocaleString: Date.prototype.toLocaleString, + toLocaleDateString: Date.prototype.toLocaleDateString, + toLocaleTimeString: Date.prototype.toLocaleTimeString +}; +var locales = [null, [NaN], ["i"], ["de_DE"]]; +var options = [ + {localeMatcher: null}, + {timeZone: "invalid"}, + {hour: "long"}, + {formatMatcher: "invalid"} +]; + +Object.getOwnPropertyNames(functions).forEach(function (p) { + var f = functions[p]; + locales.forEach(function (locales) { + var referenceError, error; + try { + var format = new Intl.DateTimeFormat(locales); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.DateTimeFormat for locales " + locales + "."); + } + + try { + var result = f.call(new Date(), locales); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Date.prototype." + p + " didn't throw exception for locales " + locales + "."); + } else if (error.name !== referenceError.name) { + $ERROR("Date.prototype." + p + " threw exception " + error.name + + " for locales " + locales + "; expected " + referenceError.name + "."); + } + }); + + options.forEach(function (options) { + var referenceError, error; + try { + var format = new Intl.DateTimeFormat([], options); + } catch (e) { + referenceError = e; + } + if (referenceError === undefined) { + $ERROR("Internal error: Expected exception was not thrown by Intl.DateTimeFormat for options " + + JSON.stringify(options) + "."); + } + + try { + var result = f.call(new Date(), [], options); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Date.prototype." + p + " didn't throw exception for options " + + JSON.stringify(options) + "."); + } else if (error.name !== referenceError.name) { + $ERROR("Date.prototype." + p + " threw exception " + error.name + + " for options " + JSON.stringify(options) + "; expected " + referenceError.name + "."); + } + }); +}); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.0_6_2.js b/js/src/tests/test402/ch13/13.3/13.3.0_6_2.js new file mode 100644 index 000000000000..dcce05906649 --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.0_6_2.js @@ -0,0 +1,15 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. use the standard + * built-in Intl.DateTimeFormat constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "DateTimeFormat"); +new Date().toLocaleString(); +new Date().toLocaleDateString(); +new Date().toLocaleTimeString(); diff --git a/js/src/tests/test402/ch13/13.3/13.3.0_7.js b/js/src/tests/test402/ch13/13.3/13.3.0_7.js new file mode 100644 index 000000000000..fe7c9271d0cf --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.0_7.js @@ -0,0 +1,58 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. produces the same results as Intl.DateTimeFormat. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var functions = { + toLocaleString: [Date.prototype.toLocaleString, + {year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric"}], + toLocaleDateString: [Date.prototype.toLocaleDateString, + {year: "numeric", month: "numeric", day: "numeric"}], + toLocaleTimeString: [Date.prototype.toLocaleTimeString, + {hour: "numeric", minute: "numeric", second: "numeric"}] +}; +var dates = [new Date(), new Date(0), new Date(Date.parse("1989-11-09T17:57:00Z"))]; +var locales = [undefined, ["de"], ["th-u-ca-gregory-nu-thai"], ["en"], ["ja-u-ca-japanese"], ["ar-u-ca-islamicc-nu-arab"]]; +var options = [ + undefined, + {hour12: false}, + {month: "long", day: "numeric", hour: "2-digit", minute: "2-digit"} +]; + +Object.getOwnPropertyNames(functions).forEach(function (p) { + var f = functions[p][0]; + var defaults = functions[p][1]; + locales.forEach(function (locales) { + options.forEach(function (options) { + var constructorOptions = options; + if (options === undefined) { + constructorOptions = defaults; + } else if (options.day === undefined) { + // for simplicity, our options above have either both date and time or neither + constructorOptions = Object.create(defaults); + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + constructorOptions[prop] = options[prop]; + } + } + } + var referenceDateTimeFormat = new Intl.DateTimeFormat(locales, constructorOptions); + var referenceFormatted = dates.map(referenceDateTimeFormat.format); + + var formatted = dates.map(function (a) { return f.call(a, locales, options); }); + try { + testArraysAreSame(referenceFormatted, formatted); + } catch (e) { + e.message += " (Testing with locales " + locales + "; options " + + (options ? JSON.stringify(options) : options) + ".)"; + throw e; + } + }); + }); +}); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.1_L15.js b/js/src/tests/test402/ch13/13.3/13.3.1_L15.js new file mode 100644 index 000000000000..a8c697c077df --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.1_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Date.prototype.toLocaleString, true, false, [], 0); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.2_L15.js b/js/src/tests/test402/ch13/13.3/13.3.2_L15.js new file mode 100644 index 000000000000..5eeed944ea45 --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.2_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleDateString + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Date.prototype.toLocaleDateString, true, false, [], 0); + diff --git a/js/src/tests/test402/ch13/13.3/13.3.3_L15.js b/js/src/tests/test402/ch13/13.3/13.3.3_L15.js new file mode 100644 index 000000000000..dac7c3513116 --- /dev/null +++ b/js/src/tests/test402/ch13/13.3/13.3.3_L15.js @@ -0,0 +1,14 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleTimeString + * meets the requirements for built-in objects defined by the introduction of + * chapter 15 of the ECMAScript Language Specification. + * @author Norbert Lindenberg + */ + +$INCLUDE("testBuiltInObject.js"); + +testBuiltInObject(Date.prototype.toLocaleTimeString, true, false, [], 0); + diff --git a/js/src/tests/test402/ch13/13.3/browser.js b/js/src/tests/test402/ch13/13.3/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/13.3/shell.js b/js/src/tests/test402/ch13/13.3/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/browser.js b/js/src/tests/test402/ch13/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/ch13/shell.js b/js/src/tests/test402/ch13/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test402/lib/testBuiltInObject.js b/js/src/tests/test402/lib/testBuiltInObject.js new file mode 100644 index 000000000000..3a8d24fdc462 --- /dev/null +++ b/js/src/tests/test402/lib/testBuiltInObject.js @@ -0,0 +1,124 @@ +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that obj meets the requirements for built-in objects + * defined by the introduction of chapter 15 of the ECMAScript Language Specification. + * @param {Object} obj the object to be tested. + * @param {boolean} isFunction whether the specification describes obj as a function. + * @param {boolean} isConstructor whether the specification describes obj as a constructor. + * @param {String[]} properties an array with the names of the built-in properties of obj, + * excluding length, prototype, or properties with non-default attributes. + * @param {number} length for functions only: the length specified for the function + * or derived from the argument list. + * @author Norbert Lindenberg + */ + +function testBuiltInObject(obj, isFunction, isConstructor, properties, length) { + + if (obj === undefined) { + $ERROR("Object being tested is undefined."); + } + + var objString = Object.prototype.toString.call(obj); + if (isFunction) { + if (objString !== "[object Function]") { + $ERROR("The [[Class]] internal property of a built-in function must be " + + "\"Function\", but toString() returns " + objString); + } + } else { + if (objString !== "[object Object]") { + $ERROR("The [[Class]] internal property of a built-in non-function object must be " + + "\"Object\", but toString() returns " + objString); + } + } + + if (!Object.isExtensible(obj)) { + $ERROR("Built-in objects must be extensible."); + } + + if (isFunction && Object.getPrototypeOf(obj) !== Function.prototype) { + $ERROR("Built-in functions must have Function.prototype as their prototype."); + } + + if (isConstructor && Object.getPrototypeOf(obj.prototype) !== Object.prototype) { + $ERROR("Built-in prototype objects must have Object.prototype as their prototype."); + } + + // verification of the absence of the [[Construct]] internal property has + // been moved to the end of the test + + // verification of the absence of the prototype property has + // been moved to the end of the test + + if (isFunction) { + + if (typeof obj.length !== "number" || obj.length !== Math.floor(obj.length)) { + $ERROR("Built-in functions must have a length property with an integer value."); + } + + if (obj.length !== length) { + $ERROR("Function's length property doesn't have specified value; expected " + + length + ", got " + obj.length + "."); + } + + var desc = Object.getOwnPropertyDescriptor(obj, "length"); + if (desc.writable) { + $ERROR("The length property of a built-in function must not be writable."); + } + if (desc.enumerable) { + $ERROR("The length property of a built-in function must not be enumerable."); + } + if (desc.configurable) { + $ERROR("The length property of a built-in function must not be configurable."); + } + } + + properties.forEach(function(prop) { + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (desc === undefined) { + $ERROR("Missing property " + prop + "."); + } + // accessor properties don't have writable attribute + if (desc.hasOwnProperty("writable") && !desc.writable) { + $ERROR("The " + prop + " property of this built-in function must be writable."); + } + if (desc.enumerable) { + $ERROR("The " + prop + " property of this built-in function must not be enumerable."); + } + if (!desc.configurable) { + $ERROR("The " + prop + " property of this built-in function must be configurable."); + } + }); + + // The remaining sections have been moved to the end of the test because + // unbound non-constructor functions written in JavaScript cannot possibly + // pass them, and we still want to test JavaScript implementations as much + // as possible. + + var exception; + if (isFunction && !isConstructor) { + // this is not a complete test for the presence of [[Construct]]: + // if it's absent, the exception must be thrown, but it may also + // be thrown if it's present and just has preconditions related to + // arguments or the this value that this statement doesn't meet. + try { + /*jshint newcap:false*/ + var instance = new obj(); + } catch (e) { + exception = e; + } + if (exception === undefined || exception.name !== "TypeError") { + $ERROR("Built-in functions that aren't constructors must throw TypeError when " + + "used in a \"new\" statement."); + } + } + + if (isFunction && !isConstructor && obj.hasOwnProperty("prototype")) { + $ERROR("Built-in functions that aren't constructors must not have a prototype property."); + } + + // passed the complete test! + return true; +} + diff --git a/js/src/tests/test402/lib/testIntl.js b/js/src/tests/test402/lib/testIntl.js new file mode 100644 index 000000000000..b009a2e9ed32 --- /dev/null +++ b/js/src/tests/test402/lib/testIntl.js @@ -0,0 +1,1167 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012-2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * This file contains shared functions for the tests in the conformance test + * suite for the ECMAScript Internationalization API. + * @author Norbert Lindenberg + */ + + +/** + * @description Calls the provided function for every service constructor in + * the Intl object, until f returns a falsy value. It returns the result of the + * last call to f, mapped to a boolean. + * @param {Function} f the function to call for each service constructor in + * the Intl object. + * @param {Function} Constructor the constructor object to test with. + * @result {Boolean} whether the test succeeded. + */ +function testWithIntlConstructors(f) { + var constructors = ["Collator", "NumberFormat", "DateTimeFormat"]; + return constructors.every(function (constructor) { + var Constructor = Intl[constructor]; + var result; + try { + result = f(Constructor); + } catch (e) { + e.message += " (Testing with " + constructor + ".)"; + throw e; + } + return result; + }); +} + + +/** + * Returns the name of the given constructor object, which must be one of + * Intl.Collator, Intl.NumberFormat, or Intl.DateTimeFormat. + * @param {object} Constructor a constructor + * @return {string} the name of the constructor + */ +function getConstructorName(Constructor) { + switch (Constructor) { + case Intl.Collator: + return "Collator"; + case Intl.NumberFormat: + return "NumberFormat"; + case Intl.DateTimeFormat: + return "DateTimeFormat"; + default: + $ERROR("test internal error: unknown Constructor"); + } +} + + +/** + * Taints a named data property of the given object by installing + * a setter that throws an exception. + * @param {object} obj the object whose data property to taint + * @param {string} property the property to taint + */ +function taintDataProperty(obj, property) { + Object.defineProperty(obj, property, { + set: function(value) { + $ERROR("Client code can adversely affect behavior: setter for " + property + "."); + }, + enumerable: false, + configurable: true + }); +} + + +/** + * Taints a named method of the given object by replacing it with a function + * that throws an exception. + * @param {object} obj the object whose method to taint + * @param {string} property the name of the method to taint + */ +function taintMethod(obj, property) { + Object.defineProperty(obj, property, { + value: function() { + $ERROR("Client code can adversely affect behavior: method " + property + "."); + }, + writable: true, + enumerable: false, + configurable: true + }); +} + + +/** + * Taints the given properties (and similarly named properties) by installing + * setters on Object.prototype that throw exceptions. + * @param {Array} properties an array of property names to taint + */ +function taintProperties(properties) { + properties.forEach(function (property) { + var adaptedProperties = [property, "__" + property, "_" + property, property + "_", property + "__"]; + adaptedProperties.forEach(function (property) { + taintDataProperty(Object.prototype, property); + }); + }); +} + + +/** + * Taints the Array object by creating a setter for the property "0" and + * replacing some key methods with functions that throw exceptions. + */ +function taintArray() { + taintDataProperty(Array.prototype, "0"); + taintMethod(Array.prototype, "indexOf"); + taintMethod(Array.prototype, "join"); + taintMethod(Array.prototype, "push"); + taintMethod(Array.prototype, "slice"); + taintMethod(Array.prototype, "sort"); +} + + +// auxiliary data for getLocaleSupportInfo +var languages = ["zh", "es", "en", "hi", "ur", "ar", "ja", "pa"]; +var scripts = ["Latn", "Hans", "Deva", "Arab", "Jpan", "Hant"]; +var countries = ["CN", "IN", "US", "PK", "JP", "TW", "HK", "SG"]; +var localeSupportInfo = {}; + + +/** + * Gets locale support info for the given constructor object, which must be one + * of Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat. + * @param {object} Constructor the constructor for which to get locale support info + * @return {object} locale support info with the following properties: + * supported: array of fully supported language tags + * byFallback: array of language tags that are supported through fallbacks + * unsupported: array of unsupported language tags + */ +function getLocaleSupportInfo(Constructor) { + var constructorName = getConstructorName(Constructor); + if (localeSupportInfo[constructorName] !== undefined) { + return localeSupportInfo[constructorName]; + } + + var allTags = []; + var i, j, k; + var language, script, country; + for (i = 0; i < languages.length; i++) { + language = languages[i]; + allTags.push(language); + for (j = 0; j < scripts.length; j++) { + script = scripts[j]; + allTags.push(language + "-" + script); + for (k = 0; k < countries.length; k++) { + country = countries[k]; + allTags.push(language + "-" + script + "-" + country); + } + } + for (k = 0; k < countries.length; k++) { + country = countries[k]; + allTags.push(language + "-" + country); + } + } + + var supported = []; + var byFallback = []; + var unsupported = []; + for (i = 0; i < allTags.length; i++) { + var request = allTags[i]; + var result = new Constructor([request], {localeMatcher: "lookup"}).resolvedOptions().locale; + if (request === result) { + supported.push(request); + } else if (request.indexOf(result) === 0) { + byFallback.push(request); + } else { + unsupported.push(request); + } + } + + localeSupportInfo[constructorName] = { + supported: supported, + byFallback: byFallback, + unsupported: unsupported + }; + + return localeSupportInfo[constructorName]; +} + + +/** + * @description Tests whether locale is a String value representing a + * structurally valid and canonicalized BCP 47 language tag, as defined in + * sections 6.2.2 and 6.2.3 of the ECMAScript Internationalization API + * Specification. + * @param {String} locale the string to be tested. + * @result {Boolean} whether the test succeeded. + */ +function isCanonicalizedStructurallyValidLanguageTag(locale) { + + /** + * Regular expression defining BCP 47 language tags. + * + * Spec: RFC 5646 section 2.1. + */ + var alpha = "[a-zA-Z]", + digit = "[0-9]", + alphanum = "(" + alpha + "|" + digit + ")", + regular = "(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)", + irregular = "(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)", + grandfathered = "(" + irregular + "|" + regular + ")", + privateuse = "(x(-[a-z0-9]{1,8})+)", + singleton = "(" + digit + "|[A-WY-Za-wy-z])", + extension = "(" + singleton + "(-" + alphanum + "{2,8})+)", + variant = "(" + alphanum + "{5,8}|(" + digit + alphanum + "{3}))", + region = "(" + alpha + "{2}|" + digit + "{3})", + script = "(" + alpha + "{4})", + extlang = "(" + alpha + "{3}(-" + alpha + "{3}){0,2})", + language = "(" + alpha + "{2,3}(-" + extlang + ")?|" + alpha + "{4}|" + alpha + "{5,8})", + langtag = language + "(-" + script + ")?(-" + region + ")?(-" + variant + ")*(-" + extension + ")*(-" + privateuse + ")?", + languageTag = "^(" + langtag + "|" + privateuse + "|" + grandfathered + ")$", + languageTagRE = new RegExp(languageTag, "i"); + var duplicateSingleton = "-" + singleton + "-(.*-)?\\1(?!" + alphanum + ")", + duplicateSingletonRE = new RegExp(duplicateSingleton, "i"), + duplicateVariant = "(" + alphanum + "{2,8}-)+" + variant + "-(" + alphanum + "{2,8}-)*\\3(?!" + alphanum + ")", + duplicateVariantRE = new RegExp(duplicateVariant, "i"); + + + /** + * Verifies that the given string is a well-formed BCP 47 language tag + * with no duplicate variant or singleton subtags. + * + * Spec: ECMAScript Internationalization API Specification, draft, 6.2.2. + */ + function isStructurallyValidLanguageTag(locale) { + if (!languageTagRE.test(locale)) { + return false; + } + locale = locale.split(/-x-/)[0]; + return !duplicateSingletonRE.test(locale) && !duplicateVariantRE.test(locale); + } + + + /** + * Mappings from complete tags to preferred values. + * + * Spec: IANA Language Subtag Registry. + */ + var __tagMappings = { + // property names must be in lower case; values in canonical form + + // grandfathered tags from IANA language subtag registry, file date 2011-08-25 + "art-lojban": "jbo", + "cel-gaulish": "cel-gaulish", + "en-gb-oed": "en-GB-oed", + "i-ami": "ami", + "i-bnn": "bnn", + "i-default": "i-default", + "i-enochian": "i-enochian", + "i-hak": "hak", + "i-klingon": "tlh", + "i-lux": "lb", + "i-mingo": "i-mingo", + "i-navajo": "nv", + "i-pwn": "pwn", + "i-tao": "tao", + "i-tay": "tay", + "i-tsu": "tsu", + "no-bok": "nb", + "no-nyn": "nn", + "sgn-be-fr": "sfb", + "sgn-be-nl": "vgt", + "sgn-ch-de": "sgg", + "zh-guoyu": "cmn", + "zh-hakka": "hak", + "zh-min": "zh-min", + "zh-min-nan": "nan", + "zh-xiang": "hsn", + // deprecated redundant tags from IANA language subtag registry, file date 2011-08-25 + "sgn-br": "bzs", + "sgn-co": "csn", + "sgn-de": "gsg", + "sgn-dk": "dsl", + "sgn-es": "ssp", + "sgn-fr": "fsl", + "sgn-gb": "bfi", + "sgn-gr": "gss", + "sgn-ie": "isg", + "sgn-it": "ise", + "sgn-jp": "jsl", + "sgn-mx": "mfs", + "sgn-ni": "ncs", + "sgn-nl": "dse", + "sgn-no": "nsl", + "sgn-pt": "psr", + "sgn-se": "swl", + "sgn-us": "ase", + "sgn-za": "sfs", + "zh-cmn": "cmn", + "zh-cmn-hans": "cmn-Hans", + "zh-cmn-hant": "cmn-Hant", + "zh-gan": "gan", + "zh-wuu": "wuu", + "zh-yue": "yue", + // deprecated variant with prefix from IANA language subtag registry, file date 2011-08-25 + "ja-latn-hepburn-heploc": "ja-Latn-alalc97" + }; + + + /** + * Mappings from non-extlang subtags to preferred values. + * + * Spec: IANA Language Subtag Registry. + */ + var __subtagMappings = { + // property names and values must be in canonical case + // language subtags with Preferred-Value mappings from IANA language subtag registry, file date 2011-08-25 + "in": "id", + "iw": "he", + "ji": "yi", + "jw": "jv", + "mo": "ro", + "ayx": "nun", + "cjr": "mom", + "cmk": "xch", + "drh": "khk", + "drw": "prs", + "gav": "dev", + "mst": "mry", + "myt": "mry", + "tie": "ras", + "tkk": "twm", + "tnf": "prs", + // region subtags with Preferred-Value mappings from IANA language subtag registry, file date 2011-08-25 + "BU": "MM", + "DD": "DE", + "FX": "FR", + "TP": "TL", + "YD": "YE", + "ZR": "CD" + }; + + + /** + * Mappings from extlang subtags to preferred values. + * + * Spec: IANA Language Subtag Registry. + */ + var __extlangMappings = { + // extlang subtags with Preferred-Value mappings from IANA language subtag registry, file date 2011-08-25 + // values are arrays with [0] the replacement value, [1] (if present) the prefix to be removed + "aao": ["aao", "ar"], + "abh": ["abh", "ar"], + "abv": ["abv", "ar"], + "acm": ["acm", "ar"], + "acq": ["acq", "ar"], + "acw": ["acw", "ar"], + "acx": ["acx", "ar"], + "acy": ["acy", "ar"], + "adf": ["adf", "ar"], + "ads": ["ads", "sgn"], + "aeb": ["aeb", "ar"], + "aec": ["aec", "ar"], + "aed": ["aed", "sgn"], + "aen": ["aen", "sgn"], + "afb": ["afb", "ar"], + "afg": ["afg", "sgn"], + "ajp": ["ajp", "ar"], + "apc": ["apc", "ar"], + "apd": ["apd", "ar"], + "arb": ["arb", "ar"], + "arq": ["arq", "ar"], + "ars": ["ars", "ar"], + "ary": ["ary", "ar"], + "arz": ["arz", "ar"], + "ase": ["ase", "sgn"], + "asf": ["asf", "sgn"], + "asp": ["asp", "sgn"], + "asq": ["asq", "sgn"], + "asw": ["asw", "sgn"], + "auz": ["auz", "ar"], + "avl": ["avl", "ar"], + "ayh": ["ayh", "ar"], + "ayl": ["ayl", "ar"], + "ayn": ["ayn", "ar"], + "ayp": ["ayp", "ar"], + "bbz": ["bbz", "ar"], + "bfi": ["bfi", "sgn"], + "bfk": ["bfk", "sgn"], + "bjn": ["bjn", "ms"], + "bog": ["bog", "sgn"], + "bqn": ["bqn", "sgn"], + "bqy": ["bqy", "sgn"], + "btj": ["btj", "ms"], + "bve": ["bve", "ms"], + "bvl": ["bvl", "sgn"], + "bvu": ["bvu", "ms"], + "bzs": ["bzs", "sgn"], + "cdo": ["cdo", "zh"], + "cds": ["cds", "sgn"], + "cjy": ["cjy", "zh"], + "cmn": ["cmn", "zh"], + "coa": ["coa", "ms"], + "cpx": ["cpx", "zh"], + "csc": ["csc", "sgn"], + "csd": ["csd", "sgn"], + "cse": ["cse", "sgn"], + "csf": ["csf", "sgn"], + "csg": ["csg", "sgn"], + "csl": ["csl", "sgn"], + "csn": ["csn", "sgn"], + "csq": ["csq", "sgn"], + "csr": ["csr", "sgn"], + "czh": ["czh", "zh"], + "czo": ["czo", "zh"], + "doq": ["doq", "sgn"], + "dse": ["dse", "sgn"], + "dsl": ["dsl", "sgn"], + "dup": ["dup", "ms"], + "ecs": ["ecs", "sgn"], + "esl": ["esl", "sgn"], + "esn": ["esn", "sgn"], + "eso": ["eso", "sgn"], + "eth": ["eth", "sgn"], + "fcs": ["fcs", "sgn"], + "fse": ["fse", "sgn"], + "fsl": ["fsl", "sgn"], + "fss": ["fss", "sgn"], + "gan": ["gan", "zh"], + "gom": ["gom", "kok"], + "gse": ["gse", "sgn"], + "gsg": ["gsg", "sgn"], + "gsm": ["gsm", "sgn"], + "gss": ["gss", "sgn"], + "gus": ["gus", "sgn"], + "hab": ["hab", "sgn"], + "haf": ["haf", "sgn"], + "hak": ["hak", "zh"], + "hds": ["hds", "sgn"], + "hji": ["hji", "ms"], + "hks": ["hks", "sgn"], + "hos": ["hos", "sgn"], + "hps": ["hps", "sgn"], + "hsh": ["hsh", "sgn"], + "hsl": ["hsl", "sgn"], + "hsn": ["hsn", "zh"], + "icl": ["icl", "sgn"], + "ils": ["ils", "sgn"], + "inl": ["inl", "sgn"], + "ins": ["ins", "sgn"], + "ise": ["ise", "sgn"], + "isg": ["isg", "sgn"], + "isr": ["isr", "sgn"], + "jak": ["jak", "ms"], + "jax": ["jax", "ms"], + "jcs": ["jcs", "sgn"], + "jhs": ["jhs", "sgn"], + "jls": ["jls", "sgn"], + "jos": ["jos", "sgn"], + "jsl": ["jsl", "sgn"], + "jus": ["jus", "sgn"], + "kgi": ["kgi", "sgn"], + "knn": ["knn", "kok"], + "kvb": ["kvb", "ms"], + "kvk": ["kvk", "sgn"], + "kvr": ["kvr", "ms"], + "kxd": ["kxd", "ms"], + "lbs": ["lbs", "sgn"], + "lce": ["lce", "ms"], + "lcf": ["lcf", "ms"], + "liw": ["liw", "ms"], + "lls": ["lls", "sgn"], + "lsg": ["lsg", "sgn"], + "lsl": ["lsl", "sgn"], + "lso": ["lso", "sgn"], + "lsp": ["lsp", "sgn"], + "lst": ["lst", "sgn"], + "lsy": ["lsy", "sgn"], + "ltg": ["ltg", "lv"], + "lvs": ["lvs", "lv"], + "lzh": ["lzh", "zh"], + "max": ["max", "ms"], + "mdl": ["mdl", "sgn"], + "meo": ["meo", "ms"], + "mfa": ["mfa", "ms"], + "mfb": ["mfb", "ms"], + "mfs": ["mfs", "sgn"], + "min": ["min", "ms"], + "mnp": ["mnp", "zh"], + "mqg": ["mqg", "ms"], + "mre": ["mre", "sgn"], + "msd": ["msd", "sgn"], + "msi": ["msi", "ms"], + "msr": ["msr", "sgn"], + "mui": ["mui", "ms"], + "mzc": ["mzc", "sgn"], + "mzg": ["mzg", "sgn"], + "mzy": ["mzy", "sgn"], + "nan": ["nan", "zh"], + "nbs": ["nbs", "sgn"], + "ncs": ["ncs", "sgn"], + "nsi": ["nsi", "sgn"], + "nsl": ["nsl", "sgn"], + "nsp": ["nsp", "sgn"], + "nsr": ["nsr", "sgn"], + "nzs": ["nzs", "sgn"], + "okl": ["okl", "sgn"], + "orn": ["orn", "ms"], + "ors": ["ors", "ms"], + "pel": ["pel", "ms"], + "pga": ["pga", "ar"], + "pks": ["pks", "sgn"], + "prl": ["prl", "sgn"], + "prz": ["prz", "sgn"], + "psc": ["psc", "sgn"], + "psd": ["psd", "sgn"], + "pse": ["pse", "ms"], + "psg": ["psg", "sgn"], + "psl": ["psl", "sgn"], + "pso": ["pso", "sgn"], + "psp": ["psp", "sgn"], + "psr": ["psr", "sgn"], + "pys": ["pys", "sgn"], + "rms": ["rms", "sgn"], + "rsi": ["rsi", "sgn"], + "rsl": ["rsl", "sgn"], + "sdl": ["sdl", "sgn"], + "sfb": ["sfb", "sgn"], + "sfs": ["sfs", "sgn"], + "sgg": ["sgg", "sgn"], + "sgx": ["sgx", "sgn"], + "shu": ["shu", "ar"], + "slf": ["slf", "sgn"], + "sls": ["sls", "sgn"], + "sqs": ["sqs", "sgn"], + "ssh": ["ssh", "ar"], + "ssp": ["ssp", "sgn"], + "ssr": ["ssr", "sgn"], + "svk": ["svk", "sgn"], + "swc": ["swc", "sw"], + "swh": ["swh", "sw"], + "swl": ["swl", "sgn"], + "syy": ["syy", "sgn"], + "tmw": ["tmw", "ms"], + "tse": ["tse", "sgn"], + "tsm": ["tsm", "sgn"], + "tsq": ["tsq", "sgn"], + "tss": ["tss", "sgn"], + "tsy": ["tsy", "sgn"], + "tza": ["tza", "sgn"], + "ugn": ["ugn", "sgn"], + "ugy": ["ugy", "sgn"], + "ukl": ["ukl", "sgn"], + "uks": ["uks", "sgn"], + "urk": ["urk", "ms"], + "uzn": ["uzn", "uz"], + "uzs": ["uzs", "uz"], + "vgt": ["vgt", "sgn"], + "vkk": ["vkk", "ms"], + "vkt": ["vkt", "ms"], + "vsi": ["vsi", "sgn"], + "vsl": ["vsl", "sgn"], + "vsv": ["vsv", "sgn"], + "wuu": ["wuu", "zh"], + "xki": ["xki", "sgn"], + "xml": ["xml", "sgn"], + "xmm": ["xmm", "ms"], + "xms": ["xms", "sgn"], + "yds": ["yds", "sgn"], + "ysl": ["ysl", "sgn"], + "yue": ["yue", "zh"], + "zib": ["zib", "sgn"], + "zlm": ["zlm", "ms"], + "zmi": ["zmi", "ms"], + "zsl": ["zsl", "sgn"], + "zsm": ["zsm", "ms"] + }; + + + /** + * Canonicalizes the given well-formed BCP 47 language tag, including regularized case of subtags. + * + * Spec: ECMAScript Internationalization API Specification, draft, 6.2.3. + * Spec: RFC 5646, section 4.5. + */ + function canonicalizeLanguageTag(locale) { + + // start with lower case for easier processing, and because most subtags will need to be lower case anyway + locale = locale.toLowerCase(); + + // handle mappings for complete tags + if (__tagMappings.hasOwnProperty(locale)) { + return __tagMappings[locale]; + } + + var subtags = locale.split("-"); + var i = 0; + + // handle standard part: all subtags before first singleton or "x" + while (i < subtags.length) { + var subtag = subtags[i]; + if (subtag.length === 1 && (i > 0 || subtag === "x")) { + break; + } else if (i !== 0 && subtag.length === 2) { + subtag = subtag.toUpperCase(); + } else if (subtag.length === 4) { + subtag = subtag[0].toUpperCase() + subtag.substring(1).toLowerCase(); + } + if (__subtagMappings.hasOwnProperty(subtag)) { + subtag = __subtagMappings[subtag]; + } else if (__extlangMappings.hasOwnProperty(subtag)) { + subtag = __extlangMappings[subtag][0]; + if (i === 1 && __extlangMappings[subtag][1] === subtags[0]) { + subtags.shift(); + i--; + } + } + subtags[i] = subtag; + i++; + } + var normal = subtags.slice(0, i).join("-"); + + // handle extensions + var extensions = []; + while (i < subtags.length && subtags[i] !== "x") { + var extensionStart = i; + i++; + while (i < subtags.length && subtags[i].length > 1) { + i++; + } + var extension = subtags.slice(extensionStart, i).join("-"); + extensions.push(extension); + } + extensions.sort(); + + // handle private use + var privateUse; + if (i < subtags.length) { + privateUse = subtags.slice(i).join("-"); + } + + // put everything back together + var canonical = normal; + if (extensions.length > 0) { + canonical += "-" + extensions.join("-"); + } + if (privateUse !== undefined) { + if (canonical.length > 0) { + canonical += "-" + privateUse; + } else { + canonical = privateUse; + } + } + + return canonical; + } + + return typeof locale === "string" && isStructurallyValidLanguageTag(locale) && + canonicalizeLanguageTag(locale) === locale; +} + + +/** + * Tests whether the named options property is correctly handled by the given constructor. + * @param {object} Constructor the constructor to test. + * @param {string} property the name of the options property to test. + * @param {string} type the type that values of the property are expected to have + * @param {Array} [values] an array of allowed values for the property. Not needed for boolean. + * @param {any} fallback the fallback value that the property assumes if not provided. + * @param {object} testOptions additional options: + * @param {boolean} isOptional whether support for this property is optional for implementations. + * @param {boolean} noReturn whether the resulting value of the property is not returned. + * @param {boolean} isILD whether the resulting value of the property is implementation and locale dependent. + * @param {object} extra additional option to pass along, properties are value -> {option: value}. + * @return {boolean} whether the test succeeded. + */ +function testOption(Constructor, property, type, values, fallback, testOptions) { + var isOptional = testOptions !== undefined && testOptions.isOptional === true; + var noReturn = testOptions !== undefined && testOptions.noReturn === true; + var isILD = testOptions !== undefined && testOptions.isILD === true; + + function addExtraOptions(options, value, testOptions) { + if (testOptions !== undefined && testOptions.extra !== undefined) { + var extra; + if (value !== undefined && testOptions.extra[value] !== undefined) { + extra = testOptions.extra[value]; + } else if (testOptions.extra.any !== undefined) { + extra = testOptions.extra.any; + } + if (extra !== undefined) { + Object.getOwnPropertyNames(extra).forEach(function (prop) { + options[prop] = extra[prop]; + }); + } + } + } + + var testValues, options, obj, expected, actual, error; + + // test that the specified values are accepted. Also add values that convert to specified values. + if (type === "boolean") { + if (values === undefined) { + values = [true, false]; + } + testValues = values.slice(0); + testValues.push(888); + testValues.push(0); + } else if (type === "string") { + testValues = values.slice(0); + testValues.push({toString: function () { return values[0]; }}); + } + testValues.forEach(function (value) { + options = {}; + options[property] = value; + addExtraOptions(options, value, testOptions); + obj = new Constructor(undefined, options); + if (noReturn) { + if (obj.resolvedOptions().hasOwnProperty(property)) { + $ERROR("Option property " + property + " is returned, but shouldn't be."); + } + } else { + actual = obj.resolvedOptions()[property]; + if (isILD) { + if (actual !== undefined && values.indexOf(actual) === -1) { + $ERROR("Invalid value " + actual + " returned for property " + property + "."); + } + } else { + if (type === "boolean") { + expected = Boolean(value); + } else if (type === "string") { + expected = String(value); + } + if (actual !== expected && !(isOptional && actual === undefined)) { + $ERROR("Option value " + value + " for property " + property + + " was not accepted; got " + actual + " instead."); + } + } + } + }); + + // test that invalid values are rejected + if (type === "string") { + var invalidValues = ["invalidValue", -1, null]; + // assume that we won't have values in caseless scripts + if (values[0].toUpperCase() !== values[0]) { + invalidValues.push(values[0].toUpperCase()); + } else { + invalidValues.push(values[0].toLowerCase()); + } + invalidValues.forEach(function (value) { + options = {}; + options[property] = value; + addExtraOptions(options, value, testOptions); + error = undefined; + try { + obj = new Constructor(undefined, options); + } catch (e) { + error = e; + } + if (error === undefined) { + $ERROR("Invalid option value " + value + " for property " + property + " was not rejected."); + } else if (error.name !== "RangeError") { + $ERROR("Invalid option value " + value + " for property " + property + " was rejected with wrong error " + error.name + "."); + } + }); + } + + // test that fallback value or another valid value is used if no options value is provided + if (!noReturn) { + options = {}; + addExtraOptions(options, undefined, testOptions); + obj = new Constructor(undefined, options); + actual = obj.resolvedOptions()[property]; + if (!(isOptional && actual === undefined)) { + if (fallback !== undefined) { + if (actual !== fallback) { + $ERROR("Option fallback value " + fallback + " for property " + property + + " was not used; got " + actual + " instead."); + } + } else { + if (values.indexOf(actual) === -1 && !(isILD && actual === undefined)) { + $ERROR("Invalid value " + actual + " returned for property " + property + "."); + } + } + } + } + + return true; +} + + +/** + * Tests whether the named property of the given object has a valid value + * and the default attributes of the properties of an object literal. + * @param {Object} obj the object to be tested. + * @param {string} property the name of the property + * @param {Function|Array} valid either a function that tests value for validity and returns a boolean, + * an array of valid values. + * @exception if the property has an invalid value. + */ +function testProperty(obj, property, valid) { + var desc = Object.getOwnPropertyDescriptor(obj, property); + if (!desc.writable) { + $ERROR("Property " + property + " must be writable."); + } + if (!desc.enumerable) { + $ERROR("Property " + property + " must be enumerable."); + } + if (!desc.configurable) { + $ERROR("Property " + property + " must be configurable."); + } + var value = desc.value; + var isValid = (typeof valid === "function") ? valid(value) : (valid.indexOf(value) !== -1); + if (!isValid) { + $ERROR("Property value " + value + " is not allowed for property " + property + "."); + } +} + + +/** + * Tests whether the named property of the given object, if present at all, has a valid value + * and the default attributes of the properties of an object literal. + * @param {Object} obj the object to be tested. + * @param {string} property the name of the property + * @param {Function|Array} valid either a function that tests value for validity and returns a boolean, + * an array of valid values. + * @exception if the property is present and has an invalid value. + */ +function mayHaveProperty(obj, property, valid) { + if (obj.hasOwnProperty(property)) { + testProperty(obj, property, valid); + } +} + + +/** + * Tests whether the given object has the named property with a valid value + * and the default attributes of the properties of an object literal. + * @param {Object} obj the object to be tested. + * @param {string} property the name of the property + * @param {Function|Array} valid either a function that tests value for validity and returns a boolean, + * an array of valid values. + * @exception if the property is missing or has an invalid value. + */ +function mustHaveProperty(obj, property, valid) { + if (!obj.hasOwnProperty(property)) { + $ERROR("Object is missing property " + property + "."); + } + testProperty(obj, property, valid); +} + + +/** + * Tests whether the given object does not have the named property. + * @param {Object} obj the object to be tested. + * @param {string} property the name of the property + * @exception if the property is present. + */ +function mustNotHaveProperty(obj, property) { + if (obj.hasOwnProperty(property)) { + $ERROR("Object has property it mustn't have: " + property + "."); + } +} + + +/** + * Properties of the RegExp constructor that may be affected by use of regular + * expressions, and the default values of these properties. Properties are from + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Deprecated_and_obsolete_features#RegExp_Properties + */ +var regExpProperties = ["$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", + "$_", "$*", "$&", "$+", "$`", "$'", + "input", "lastMatch", "lastParen", "leftContext", "rightContext" +]; + +var regExpPropertiesDefaultValues = (function () { + var values = Object.create(null); + regExpProperties.forEach(function (property) { + values[property] = RegExp[property]; + }); + return values; +}()); + + +/** + * Tests that executing the provided function (which may use regular expressions + * in its implementation) does not create or modify unwanted properties on the + * RegExp constructor. + */ +function testForUnwantedRegExpChanges(testFunc) { + regExpProperties.forEach(function (property) { + RegExp[property] = regExpPropertiesDefaultValues[property]; + }); + testFunc(); + regExpProperties.forEach(function (property) { + if (RegExp[property] !== regExpPropertiesDefaultValues[property]) { + $ERROR("RegExp has unexpected property " + property + " with value " + + RegExp[property] + "."); + } + }); +} + + +/** + * Tests whether name is a valid BCP 47 numbering system name + * and not excluded from use in the ECMAScript Internationalization API. + * @param {string} name the name to be tested. + * @return {boolean} whether name is a valid BCP 47 numbering system name and + * allowed for use in the ECMAScript Internationalization API. + */ + +function isValidNumberingSystem(name) { + + // source: CLDR file common/bcp47/number.xml; version CLDR 21. + var numberingSystems = [ + "arab", + "arabext", + "armn", + "armnlow", + "bali", + "beng", + "brah", + "cakm", + "cham", + "deva", + "ethi", + "finance", + "fullwide", + "geor", + "grek", + "greklow", + "gujr", + "guru", + "hanidec", + "hans", + "hansfin", + "hant", + "hantfin", + "hebr", + "java", + "jpan", + "jpanfin", + "kali", + "khmr", + "knda", + "osma", + "lana", + "lanatham", + "laoo", + "latn", + "lepc", + "limb", + "mlym", + "mong", + "mtei", + "mymr", + "mymrshan", + "native", + "nkoo", + "olck", + "orya", + "roman", + "romanlow", + "saur", + "shrd", + "sora", + "sund", + "talu", + "takr", + "taml", + "tamldec", + "telu", + "thai", + "tibt", + "traditio", + "vaii" + ]; + + var excluded = [ + "finance", + "native", + "traditio" + ]; + + + return numberingSystems.indexOf(name) !== -1 && excluded.indexOf(name) === -1; +} + + +/** + * Provides the digits of numbering systems with simple digit mappings, + * as specified in 11.3.2. + */ + +var numberingSystemDigits = { + arab: "٠١٢٣٤٥٦٧٨٩", + arabext: "۰۱۲۳۴۵۶۷۸۹", + beng: "০১২৩৪৫৬৭৮৯", + deva: "०१२३४५६७८९", + fullwide: "0123456789", + gujr: "૦૧૨૩૪૫૬૭૮૯", + guru: "੦੧੨੩੪੫੬੭੮੯", + hanidec: "〇一二三四五六七八九", + khmr: "០១២៣៤៥៦៧៨៩", + knda: "೦೧೨೩೪೫೬೭೮೯", + laoo: "໐໑໒໓໔໕໖໗໘໙", + latn: "0123456789", + mlym: "൦൧൨൩൪൫൬൭൮൯", + mong: "᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙", + mymr: "၀၁၂၃၄၅၆၇၈၉", + orya: "୦୧୨୩୪୫୬୭୮୯", + tamldec: "௦௧௨௩௪௫௬௭௮௯", + telu: "౦౧౨౩౪౫౬౭౮౯", + thai: "๐๑๒๓๔๕๖๗๘๙", + tibt: "༠༡༢༣༤༥༦༧༨༩" +}; + + +/** + * Tests that number formatting is handled correctly. The function checks that the + * digit sequences in formatted output are as specified, converted to the + * selected numbering system, and embedded in consistent localized patterns. + * @param {Array} locales the locales to be tested. + * @param {Array} numberingSystems the numbering systems to be tested. + * @param {Object} options the options to pass to Intl.NumberFormat. Options + * must include {useGrouping: false}, and must cause 1.1 to be formatted + * pre- and post-decimal digits. + * @param {Object} testData maps input data (in ES5 9.3.1 format) to expected output strings + * in unlocalized format with Western digits. + */ + +function testNumberFormat(locales, numberingSystems, options, testData) { + locales.forEach(function (locale) { + numberingSystems.forEach(function (numbering) { + var digits = numberingSystemDigits[numbering]; + var format = new Intl.NumberFormat([locale + "-u-nu-" + numbering], options); + + function getPatternParts(positive) { + var n = positive ? 1.1 : -1.1; + var formatted = format.format(n); + var oneoneRE = "([^" + digits + "]*)[" + digits + "]+([^" + digits + "]+)[" + digits + "]+([^" + digits + "]*)"; + var match = formatted.match(new RegExp(oneoneRE)); + if (match === null) { + $ERROR("Unexpected formatted " + n + " for " + + format.resolvedOptions().locale + " and options " + + JSON.stringify(options) + ": " + formatted); + } + return match; + } + + function toNumbering(raw) { + return raw.replace(/[0-9]/g, function (digit) { + return digits[digit.charCodeAt(0) - "0".charCodeAt(0)]; + }); + } + + function buildExpected(raw, patternParts) { + var period = raw.indexOf("."); + if (period === -1) { + return patternParts[1] + toNumbering(raw) + patternParts[3]; + } else { + return patternParts[1] + + toNumbering(raw.substring(0, period)) + + patternParts[2] + + toNumbering(raw.substring(period + 1)) + + patternParts[3]; + } + } + + if (format.resolvedOptions().numberingSystem === numbering) { + // figure out prefixes, infixes, suffixes for positive and negative values + var posPatternParts = getPatternParts(true); + var negPatternParts = getPatternParts(false); + + Object.getOwnPropertyNames(testData).forEach(function (input) { + var rawExpected = testData[input]; + var patternParts; + if (rawExpected[0] === "-") { + patternParts = negPatternParts; + rawExpected = rawExpected.substring(1); + } else { + patternParts = posPatternParts; + } + var expected = buildExpected(rawExpected, patternParts); + var actual = format.format(input); + if (actual !== expected) { + $ERROR("Formatted value for " + input + ", " + + format.resolvedOptions().locale + " and options " + + JSON.stringify(options) + " is " + actual + "; expected " + expected + "."); + } + }); + } + }); + }); +} + + +/** + * Return the components of date-time formats. + * @return {Array} an array with all date-time components. + */ + +function getDateTimeComponents() { + return ["weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName"]; +} + + +/** + * Return the valid values for the given date-time component, as specified + * by the table in section 12.1.1. + * @param {string} component a date-time component. + * @return {Array} an array with the valid values for the component. + */ + +function getDateTimeComponentValues(component) { + + var components = { + weekday: ["narrow", "short", "long"], + era: ["narrow", "short", "long"], + year: ["2-digit", "numeric"], + month: ["2-digit", "numeric", "narrow", "short", "long"], + day: ["2-digit", "numeric"], + hour: ["2-digit", "numeric"], + minute: ["2-digit", "numeric"], + second: ["2-digit", "numeric"], + timeZoneName: ["short", "long"] + }; + + var result = components[component]; + if (result === undefined) { + $ERROR("Internal error: No values defined for date-time component " + component + "."); + } + return result; +} + + +/** + * Tests that the given value is valid for the given date-time component. + * @param {string} component a date-time component. + * @param {string} value the value to be tested. + * @return {boolean} true if the test succeeds. + * @exception if the test fails. + */ + +function testValidDateTimeComponentValue(component, value) { + if (getDateTimeComponentValues(component).indexOf(value) === -1) { + $ERROR("Invalid value " + value + " for date-time component " + component + "."); + } + return true; +} + + +/** + * Verifies that the actual array matches the expected one in length, elements, + * and element order. + * @param {Array} expected the expected array. + * @param {Array} actual the actual array. + * @return {boolean} true if the test succeeds. + * @exception if the test fails. + */ +function testArraysAreSame(expected, actual) { + for (i = 0; i < Math.max(actual.length, expected.length); i++) { + if (actual[i] !== expected[i]) { + $ERROR("Result array element at index " + i + " should be \"" + + expected[i] + "\" but is \"" + actual[i] + "\"."); + } + } + return true; +} + From f79e34d84fdb517b4cd17fbb1a1096bdb10f91d6 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 5 Apr 2013 21:19:10 -0700 Subject: [PATCH 125/438] Bug 858677 - Make the internal deletion operations not take a strictness argument and a Value*, but rather take a JSBool* -- and let callers handle the property-couldn't-be-deleted (but no error occurred) case. r=jorendorff --- js/src/builtin/Intl.cpp | 8 +- js/src/builtin/MapObject.cpp | 8 +- js/src/builtin/Module.cpp | 2 +- js/src/builtin/ParallelArray.cpp | 4 +- js/src/builtin/TestingFunctions.cpp | 2 +- js/src/gdb/gdb-tests.cpp | 2 +- js/src/ion/AsmJS.cpp | 2 +- js/src/jit-test/tests/basic/bug821850.js | 2 +- .../jit-test/tests/basic/delete-non-config.js | 3 +- .../jsapi-tests/testAddPropertyPropcache.cpp | 2 +- .../testCallNonGenericMethodOnProxy.cpp | 2 +- js/src/jsapi-tests/testChromeBuffer.cpp | 2 +- js/src/jsapi-tests/testClassGetter.cpp | 2 +- js/src/jsapi-tests/testCustomIterator.cpp | 2 +- js/src/jsapi-tests/testLookup.cpp | 4 +- js/src/jsapi-tests/testNewObject.cpp | 2 +- .../testObjectEmulatingUndefined.cpp | 2 +- js/src/jsapi-tests/testOps.cpp | 2 +- js/src/jsapi-tests/testProfileStrings.cpp | 2 +- js/src/jsapi-tests/testPropCache.cpp | 2 +- js/src/jsapi-tests/testResolveRecursion.cpp | 4 +- js/src/jsapi-tests/tests.h | 2 +- js/src/jsapi.cpp | 34 ++-- js/src/jsapi.h | 31 ++- js/src/jsarray.cpp | 187 ++++++++++++------ js/src/jsbool.cpp | 5 +- js/src/jsclass.h | 8 +- js/src/jscntxtinlines.h | 10 + js/src/jsdate.cpp | 2 +- js/src/jsexn.cpp | 2 +- js/src/jsfun.cpp | 2 +- js/src/jsinterp.cpp | 76 ++++--- js/src/jsiter.cpp | 8 +- js/src/jsmath.cpp | 2 +- js/src/jsnum.cpp | 2 +- js/src/jsobj.cpp | 55 +++--- js/src/jsobj.h | 18 +- js/src/jsobjinlines.h | 17 +- js/src/json.cpp | 8 +- js/src/jsproxy.cpp | 33 ++-- js/src/jsstr.cpp | 2 +- js/src/jstypedarray.cpp | 47 +++-- js/src/jstypedarray.h | 15 +- js/src/jsweakmap.cpp | 2 +- js/src/methodjit/StubCalls.cpp | 33 +++- js/src/perf/jsperf.cpp | 2 +- js/src/shell/js.cpp | 25 ++- .../reverse-order-of-low-high-accesses.js | 88 +++++++++ js/src/vm/ArgumentsObject.cpp | 11 +- js/src/vm/Debugger.cpp | 18 +- js/src/vm/GlobalObject.cpp | 2 +- js/src/vm/RegExpObject.cpp | 2 +- js/src/vm/RegExpStatics.cpp | 2 +- js/src/vm/ScopeObject.cpp | 20 +- js/src/vm/SelfHosting.cpp | 2 +- 55 files changed, 526 insertions(+), 308 deletions(-) create mode 100644 js/src/tests/ecma_5/Array/reverse-order-of-low-high-accesses.js diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp index d3463125da23..6e22cc76f358 100644 --- a/js/src/builtin/Intl.cpp +++ b/js/src/builtin/Intl.cpp @@ -582,7 +582,7 @@ static Class CollatorClass = { js_Object_str, JSCLASS_HAS_RESERVED_SLOTS(COLLATOR_SLOTS_COUNT), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1060,7 +1060,7 @@ static Class NumberFormatClass = { js_Object_str, JSCLASS_HAS_RESERVED_SLOTS(NUMBER_FORMAT_SLOTS_COUNT), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1509,7 +1509,7 @@ static Class DateTimeFormatClass = { js_Object_str, JSCLASS_HAS_RESERVED_SLOTS(DATE_TIME_FORMAT_SLOTS_COUNT), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1985,7 +1985,7 @@ Class js::IntlClass = { js_Object_str, JSCLASS_HAS_CACHED_PROTO(JSProto_Intl), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 1f6258f49bcc..08100842e2a9 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -873,7 +873,7 @@ Class js::MapIteratorClass = { JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(MapIteratorObject::SlotCount), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1013,7 +1013,7 @@ Class MapObject::class_ = { JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_Map), JS_PropertyStub, // addProperty - JS_PropertyStub, // delProperty + JS_DeletePropertyStub, // delProperty JS_PropertyStub, // getProperty JS_StrictPropertyStub, // setProperty JS_EnumerateStub, @@ -1446,7 +1446,7 @@ Class js::SetIteratorClass = { JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(SetIteratorObject::SlotCount), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1556,7 +1556,7 @@ Class SetObject::class_ = { JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_Set), JS_PropertyStub, // addProperty - JS_PropertyStub, // delProperty + JS_DeletePropertyStub, // delProperty JS_PropertyStub, // getProperty JS_StrictPropertyStub, // setProperty JS_EnumerateStub, diff --git a/js/src/builtin/Module.cpp b/js/src/builtin/Module.cpp index d70ec483e11e..2aaf96508585 100644 --- a/js/src/builtin/Module.cpp +++ b/js/src/builtin/Module.cpp @@ -7,7 +7,7 @@ Class js::ModuleClass = { "Module", JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/builtin/ParallelArray.cpp b/js/src/builtin/ParallelArray.cpp index c98771d047e4..04bcae9f3af5 100644 --- a/js/src/builtin/ParallelArray.cpp +++ b/js/src/builtin/ParallelArray.cpp @@ -53,7 +53,7 @@ Class ParallelArrayObject::protoClass = { "ParallelArray", JSCLASS_HAS_CACHED_PROTO(JSProto_ParallelArray), JS_PropertyStub, // addProperty - JS_PropertyStub, // delProperty + JS_DeletePropertyStub, // delProperty JS_PropertyStub, // getProperty JS_StrictPropertyStub, // setProperty JS_EnumerateStub, @@ -65,7 +65,7 @@ Class ParallelArrayObject::class_ = { "ParallelArray", JSCLASS_HAS_CACHED_PROTO(JSProto_ParallelArray), JS_PropertyStub, // addProperty - JS_PropertyStub, // delProperty + JS_DeletePropertyStub, // delProperty JS_PropertyStub, // getProperty JS_StrictPropertyStub, // setProperty JS_EnumerateStub, diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e5f65c3a221b..9f9a57adf906 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -750,7 +750,7 @@ finalize_counter_finalize(JSFreeOp *fop, JSObject *obj) static JSClass FinalizeCounterClass = { "FinalizeCounter", JSCLASS_IS_ANONYMOUS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/gdb/gdb-tests.cpp b/js/src/gdb/gdb-tests.cpp index a19ed1e4d2fd..a5ce25cf364d 100644 --- a/js/src/gdb/gdb-tests.cpp +++ b/js/src/gdb/gdb-tests.cpp @@ -13,7 +13,7 @@ using namespace JS; /* The class of the global object. */ JSClass global_class = { "global", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index d268f1f922b8..b955bc5fd570 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -2286,7 +2286,7 @@ static Class AsmJSModuleClass = { JSCLASS_IS_ANONYMOUS | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(ASM_CODE_NUM_RESERVED_SLOTS), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jit-test/tests/basic/bug821850.js b/js/src/jit-test/tests/basic/bug821850.js index 7c7e45a4fff7..fb0819c7b661 100644 --- a/js/src/jit-test/tests/basic/bug821850.js +++ b/js/src/jit-test/tests/basic/bug821850.js @@ -6,4 +6,4 @@ assertThrowsInstanceOf(function() {"use strict"; delete m.p;}, TypeError); x = new Proxy(m, {}) assertEq(x.p, 3); -assertEq((function fun() {"use strict"; return delete x.p; })(), false); +assertThrowsInstanceOf(function fun() {"use strict"; return delete x.p; }, TypeError); diff --git a/js/src/jit-test/tests/basic/delete-non-config.js b/js/src/jit-test/tests/basic/delete-non-config.js index afc7631007c0..da6020cad89b 100644 --- a/js/src/jit-test/tests/basic/delete-non-config.js +++ b/js/src/jit-test/tests/basic/delete-non-config.js @@ -1,5 +1,4 @@ var a = [0,1,2,3,4,5,6,7,8,9,10]; for (var i = 0; i < 10; i++) - delete a.length; + assertEq(delete a.length, false); assertEq(delete a.length, false); - diff --git a/js/src/jsapi-tests/testAddPropertyPropcache.cpp b/js/src/jsapi-tests/testAddPropertyPropcache.cpp index be190df1824c..8c6979e38a39 100644 --- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp +++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp @@ -24,7 +24,7 @@ JSClass addPropertyClass = { "AddPropertyTester", 0, addProperty, - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp b/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp index 1ccc9430b20a..6dec466c4cd3 100644 --- a/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp +++ b/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp @@ -10,7 +10,7 @@ static JSClass CustomClass = { "CustomClass", JSCLASS_HAS_RESERVED_SLOTS(1), JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testChromeBuffer.cpp b/js/src/jsapi-tests/testChromeBuffer.cpp index d476d797b3d9..2ea62f7c33ea 100644 --- a/js/src/jsapi-tests/testChromeBuffer.cpp +++ b/js/src/jsapi-tests/testChromeBuffer.cpp @@ -12,7 +12,7 @@ JSClass global_class = { "global", JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testClassGetter.cpp b/js/src/jsapi-tests/testClassGetter.cpp index 420ef24c4346..86c3229afce7 100644 --- a/js/src/jsapi-tests/testClassGetter.cpp +++ b/js/src/jsapi-tests/testClassGetter.cpp @@ -27,7 +27,7 @@ static JSClass ptestClass = { JSCLASS_HAS_PRIVATE, JS_PropertyStub, // add - JS_PropertyStub, // delete + JS_DeletePropertyStub, // delete test_prop_get, // get JS_StrictPropertyStub, // set JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testCustomIterator.cpp b/js/src/jsapi-tests/testCustomIterator.cpp index e1f628fc86e4..3c850811831e 100644 --- a/js/src/jsapi-tests/testCustomIterator.cpp +++ b/js/src/jsapi-tests/testCustomIterator.cpp @@ -32,7 +32,7 @@ js::Class HasCustomIterClass = { "HasCustomIter", 0, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testLookup.cpp b/js/src/jsapi-tests/testLookup.cpp index 692ca846d5b1..65edab7c0ebc 100644 --- a/js/src/jsapi-tests/testLookup.cpp +++ b/js/src/jsapi-tests/testLookup.cpp @@ -41,7 +41,7 @@ static JSClass DocumentAllClass = { "DocumentAll", JSCLASS_EMULATES_UNDEFINED, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, @@ -78,7 +78,7 @@ document_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flag static JSClass document_class = { "document", JSCLASS_NEW_RESOLVE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub }; diff --git a/js/src/jsapi-tests/testNewObject.cpp b/js/src/jsapi-tests/testNewObject.cpp index 94b8607bb1db..5a97aa72e4ad 100644 --- a/js/src/jsapi-tests/testNewObject.cpp +++ b/js/src/jsapi-tests/testNewObject.cpp @@ -95,7 +95,7 @@ BEGIN_TEST(testNewObject_1) static JSClass cls = { "testNewObject_1", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, NULL, NULL, NULL, constructHook }; diff --git a/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp b/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp index 0ac5243a4b50..af5212a1b549 100644 --- a/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp +++ b/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp @@ -8,7 +8,7 @@ static JSClass ObjectEmulatingUndefinedClass = { "ObjectEmulatingUndefined", JSCLASS_EMULATES_UNDEFINED, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp index 648493be1df0..e0f7d8fa68ed 100644 --- a/js/src/jsapi-tests/testOps.cpp +++ b/js/src/jsapi-tests/testOps.cpp @@ -23,7 +23,7 @@ my_convert(JSContext* context, JS::HandleObject obj, JSType type, JS::MutableHan static JSClass myClass = { "MyClass", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, my_convert }; diff --git a/js/src/jsapi-tests/testProfileStrings.cpp b/js/src/jsapi-tests/testProfileStrings.cpp index bf6a82ca5e85..d02426e19ec6 100644 --- a/js/src/jsapi-tests/testProfileStrings.cpp +++ b/js/src/jsapi-tests/testProfileStrings.cpp @@ -27,7 +27,7 @@ reset(JSContext *cx) } static JSClass ptestClass = { - "Prof", 0, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, + "Prof", 0, JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; diff --git a/js/src/jsapi-tests/testPropCache.cpp b/js/src/jsapi-tests/testPropCache.cpp index 3920a1f06bfd..799347bd0567 100644 --- a/js/src/jsapi-tests/testPropCache.cpp +++ b/js/src/jsapi-tests/testPropCache.cpp @@ -20,7 +20,7 @@ CounterAdd(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHand static JSClass CounterClass = { "Counter", /* name */ 0, /* flags */ - CounterAdd, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + CounterAdd, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; diff --git a/js/src/jsapi-tests/testResolveRecursion.cpp b/js/src/jsapi-tests/testResolveRecursion.cpp index 43d7b2d2be99..f5f6bbffa6b5 100644 --- a/js/src/jsapi-tests/testResolveRecursion.cpp +++ b/js/src/jsapi-tests/testResolveRecursion.cpp @@ -20,8 +20,8 @@ BEGIN_TEST(testResolveRecursion) JSCLASS_NEW_RESOLVE | JSCLASS_HAS_PRIVATE, JS_PropertyStub, // add - JS_PropertyStub, // delete - JS_PropertyStub, // get + JS_DeletePropertyStub, // delete + JS_PropertyStub, // get JS_StrictPropertyStub, // set JS_EnumerateStub, (JSResolveOp) my_resolve, diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index e251ca981a23..60c3ba75d893 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -230,7 +230,7 @@ class JSAPITest static JSClass * basicGlobalClass() { static JSClass c = { "global", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; return &c; diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 3180e7f3e55e..6df21245fe8c 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3197,6 +3197,13 @@ JS_StrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool s return JS_TRUE; } +JS_PUBLIC_API(JSBool) +JS_DeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded) +{ + *succeeded = true; + return true; +} + JS_PUBLIC_API(JSBool) JS_EnumerateStub(JSContext *cx, JSHandleObject obj) { @@ -4432,16 +4439,17 @@ JS_DeletePropertyById2(JSContext *cx, JSObject *objArg, jsid id, jsval *rval) RootedValue value(cx); + JSBool succeeded; if (JSID_IS_SPECIAL(id)) { Rooted sid(cx, JSID_TO_SPECIALID(id)); - if (!JSObject::deleteSpecial(cx, obj, sid, &value, false)) + if (!JSObject::deleteSpecial(cx, obj, sid, &succeeded)) return false; } else { - if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &value, false)) + if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &succeeded)) return false; } - *rval = value; + *rval = BooleanValue(succeeded); return true; } @@ -4454,11 +4462,11 @@ JS_DeleteElement2(JSContext *cx, JSObject *objArg, uint32_t index, jsval *rval) assertSameCompartment(cx, obj); JSAutoResolveFlags rf(cx, 0); - RootedValue value(cx); - if (!JSObject::deleteElement(cx, obj, index, &value, false)) + JSBool succeeded; + if (!JSObject::deleteElement(cx, obj, index, &succeeded)) return false; - *rval = value; + *rval = BooleanValue(succeeded); return true; } @@ -4474,11 +4482,11 @@ JS_DeleteProperty2(JSContext *cx, JSObject *objArg, const char *name, jsval *rva if (!atom) return false; - RootedValue value(cx); - if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &value, false)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded)) return false; - *rval = value; + *rval = BooleanValue(succeeded); return true; } @@ -4494,11 +4502,11 @@ JS_DeleteUCProperty2(JSContext *cx, JSObject *objArg, const jschar *name, size_t if (!atom) return false; - RootedValue value(cx); - if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &value, false)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded)) return false; - *rval = value; + *rval = BooleanValue(succeeded); return true; } @@ -4650,7 +4658,7 @@ static Class prop_iter_class = { "PropertyIterator", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(1), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 3ea75be79d3b..11c78a73db90 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -820,11 +820,9 @@ typedef js::RawValue JSRawValue; /* JSClass operation signatures. */ /* - * Add, delete, or get a property named by id in obj. Note the jsid id - * type -- id may be a string (Unicode property identifier) or an int (element - * index). The *vp out parameter, on success, is the new property value after - * an add or get. After a successful delete, *vp is JSVAL_FALSE iff - * obj[id] can't be deleted (because it's permanent). + * Add or get a property named by id in obj. Note the jsid id type -- id may + * be a string (Unicode property identifier) or an int (element index). The + * *vp out parameter, on success, is the new property value after the action. */ typedef JSBool (* JSPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); @@ -839,6 +837,24 @@ typedef JSBool typedef JSBool (* JSStrictPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp); +/* + * Delete a property named by id in obj. + * + * If an error occurred, return false as per normal JSAPI error practice. + * + * If no error occurred, but the deletion attempt wasn't allowed (perhaps + * because the property was non-configurable), set *succeeded to false and + * return true. This will cause |delete obj[id]| to evaluate to false in + * non-strict mode code, and to throw a TypeError in strict mode code. + * + * If no error occurred and the deletion wasn't disallowed (this is *not* the + * same as saying that a deletion actually occurred -- deleting a non-existent + * property, or an inherited property, is allowed -- it's just pointless), + * set *succeeded to true and return true. + */ +typedef JSBool +(* JSDeletePropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded); + /* * This function type is used for callbacks that enumerate the properties of * a JSObject. The behavior depends on the value of enum_op: @@ -2810,7 +2826,7 @@ struct JSClass { /* Mandatory non-null function pointer members. */ JSPropertyOp addProperty; - JSPropertyOp delProperty; + JSDeletePropertyOp delProperty; JSPropertyOp getProperty; JSStrictPropertyOp setProperty; JSEnumerateOp enumerate; @@ -2999,6 +3015,9 @@ JS_PropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandl extern JS_PUBLIC_API(JSBool) JS_StrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp); +extern JS_PUBLIC_API(JSBool) +JS_DeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded); + extern JS_PUBLIC_API(JSBool) JS_EnumerateStub(JSContext *cx, JSHandleObject obj); diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index d3cbcc4be99d..3a54f904630e 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -325,20 +325,19 @@ SetArrayElement(JSContext *cx, HandleObject obj, double index, HandleValue v) } /* - * Delete the element |index| from |obj|. If |strict|, do a strict - * deletion: throw if the property is not configurable. + * Attempt to delete the element |index| from |obj| as if by + * |obj.[[Delete]](index)|. * - * - Return 1 if the deletion succeeds (that is, ES5's [[Delete]] would - * return true) + * If an error occurs while attempting to delete the element (that is, the call + * to [[Delete]] threw), return false. * - * - Return 0 if the deletion fails because the property is not - * configurable (that is, [[Delete]] would return false). Note that if - * |strict| is true we will throw, not return zero. - * - * - Return -1 if an exception occurs (that is, [[Delete]] would throw). + * Otherwise set *succeeded to indicate whether the deletion attempt succeeded + * (that is, whether the call to [[Delete]] returned true or false). (Deletes + * generally fail only when the property is non-configurable, but proxies may + * implement different semantics.) */ -static int -DeleteArrayElement(JSContext *cx, HandleObject obj, double index, bool strict) +static bool +DeleteArrayElement(JSContext *cx, HandleObject obj, double index, JSBool *succeeded) { JS_ASSERT(index >= 0); JS_ASSERT(floor(index) == index); @@ -350,37 +349,34 @@ DeleteArrayElement(JSContext *cx, HandleObject obj, double index, bool strict) obj->markDenseElementsNotPacked(cx); obj->setDenseElement(idx, MagicValue(JS_ELEMENTS_HOLE)); if (!js_SuppressDeletedElement(cx, obj, idx)) - return -1; + return false; } } - return 1; + + *succeeded = true; + return true; } - RootedValue v(cx); - if (index <= UINT32_MAX) { - if (!JSObject::deleteElement(cx, obj, uint32_t(index), &v, strict)) - return -1; - } else { - if (!JSObject::deleteByValue(cx, obj, DoubleValue(index), &v, strict)) - return -1; - } + if (index <= UINT32_MAX) + return JSObject::deleteElement(cx, obj, uint32_t(index), succeeded); - return v.isTrue() ? 1 : 0; + return JSObject::deleteByValue(cx, obj, DoubleValue(index), succeeded); } -/* - * When hole is true, delete the property at the given index. Otherwise set - * its value to v assuming v is rooted. - */ -static JSBool -SetOrDeleteArrayElement(JSContext *cx, HandleObject obj, double index, - JSBool hole, HandleValue v) +/* ES6 20130308 draft 9.3.5 */ +static bool +DeletePropertyOrThrow(JSContext *cx, HandleObject obj, double index) { - if (hole) { - JS_ASSERT(v.isUndefined()); - return DeleteArrayElement(cx, obj, index, true) >= 0; - } - return SetArrayElement(cx, obj, index, v); + JSBool succeeded; + if (!DeleteArrayElement(cx, obj, index, &succeeded)) + return false; + if (succeeded) + return true; + + RootedId id(cx); + if (!ValueToId(cx, NumberValue(index), &id)) + return false; + return obj->reportNotConfigurable(cx, id, JSREPORT_ERROR); } JSBool @@ -475,10 +471,20 @@ array_length_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, JSObject::setArrayLength(cx, obj, oldlen + 1); return false; } - int deletion = DeleteArrayElement(cx, obj, oldlen, strict); - if (deletion <= 0) { + + JSBool succeeded; + if (!DeleteArrayElement(cx, obj, oldlen, &succeeded)) + return false; + if (!succeeded) { JSObject::setArrayLength(cx, obj, oldlen + 1); - return deletion >= 0; + if (!strict) + return true; + + RootedId id(cx); + if (!IndexToId(cx, oldlen, &id)) + return false; + obj->reportNotConfigurable(cx, id); + return false; } } while (oldlen != newlen); } else { @@ -500,10 +506,18 @@ array_length_setter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, return false; if (JSID_IS_VOID(nid)) break; + + // XXX Bug! We should fail fast on the highest non-configurable + // property we find, as we do in the simple-loop case above. + // But since we're iterating in unknown order here, we don't + // know if we're hitting the highest non-configurable property + // when we hit a failure. For now just drop unsuccessful + // deletion on the floor, as the previous code here did. uint32_t index; - RootedValue junk(cx); + JSBool succeeded; if (js_IdIsIndex(nid, &index) && index - newlen < gap && - !JSObject::deleteElement(cx, obj, index, &junk, false)) { + !JSObject::deleteElement(cx, obj, index, &succeeded)) + { return false; } } @@ -567,7 +581,7 @@ Class js::ArrayClass = { "Array", JSCLASS_HAS_CACHED_PROTO(JSProto_Array), array_addProperty, - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1044,11 +1058,29 @@ array_reverse(JSContext *cx, unsigned argc, Value *vp) JSBool hole, hole2; if (!JS_CHECK_OPERATION_LIMIT(cx) || !GetElement(cx, obj, i, &hole, &lowval) || - !GetElement(cx, obj, len - i - 1, &hole2, &hival) || - !SetOrDeleteArrayElement(cx, obj, len - i - 1, hole, lowval) || - !SetOrDeleteArrayElement(cx, obj, i, hole2, hival)) { + !GetElement(cx, obj, len - i - 1, &hole2, &hival)) + { return false; } + + if (!hole && !hole2) { + if (!SetArrayElement(cx, obj, i, hival)) + return false; + if (!SetArrayElement(cx, obj, len - i - 1, lowval)) + return false; + } else if (hole && !hole2) { + if (!SetArrayElement(cx, obj, i, hival)) + return false; + if (!DeletePropertyOrThrow(cx, obj, len - i - 1)) + return false; + } else if (!hole && hole2) { + if (!DeletePropertyOrThrow(cx, obj, i)) + return false; + if (!SetArrayElement(cx, obj, len - i - 1, lowval)) + return false; + } else { + // No action required. + } } args.rval().setObject(*obj); return true; @@ -1657,7 +1689,7 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp) /* Re-create any holes that sorted to the end of the array. */ while (len > n) { - if (!JS_CHECK_OPERATION_LIMIT(cx) || DeleteArrayElement(cx, obj, --len, true) < 0) + if (!JS_CHECK_OPERATION_LIMIT(cx) || !DeletePropertyOrThrow(cx, obj, --len)) return false; } args.rval().setObject(*obj); @@ -1760,7 +1792,7 @@ array_pop_slowly(JSContext *cx, HandleObject obj, CallArgs &args) if (!GetElement(cx, obj, index, &hole, &elt)) return false; - if (!hole && DeleteArrayElement(cx, obj, index, true) < 0) + if (!hole && !DeletePropertyOrThrow(cx, obj, index)) return false; args.rval().set(elt); @@ -1783,7 +1815,7 @@ array_pop_dense(JSContext *cx, HandleObject obj, CallArgs &args) if (!GetElement(cx, obj, index, &hole, &elt)) return false; - if (!hole && DeleteArrayElement(cx, obj, index, true) < 0) + if (!hole && !DeletePropertyOrThrow(cx, obj, index)) return false; args.rval().set(elt); @@ -1871,15 +1903,21 @@ js::array_shift(JSContext *cx, unsigned argc, Value *vp) /* Slide down the array above the first element. */ RootedValue value(cx); for (uint32_t i = 0; i < length; i++) { - if (!JS_CHECK_OPERATION_LIMIT(cx) || - !GetElement(cx, obj, i + 1, &hole, &value) || - !SetOrDeleteArrayElement(cx, obj, i, hole, value)) { - return JS_FALSE; + if (!JS_CHECK_OPERATION_LIMIT(cx)) + return false; + if (!GetElement(cx, obj, i + 1, &hole, &value)) + return false; + if (hole) { + if (!DeletePropertyOrThrow(cx, obj, i)) + return false; + } else { + if (!SetArrayElement(cx, obj, i, value)) + return false; } } /* Delete the only or last element when it exists. */ - if (!hole && DeleteArrayElement(cx, obj, length, true) < 0) + if (!hole && !DeletePropertyOrThrow(cx, obj, length)) return JS_FALSE; } return SetLengthProperty(cx, obj, length); @@ -1927,10 +1965,16 @@ array_unshift(JSContext *cx, unsigned argc, Value *vp) do { --last, --upperIndex; JSBool hole; - if (!JS_CHECK_OPERATION_LIMIT(cx) || - !GetElement(cx, obj, last, &hole, &value) || - !SetOrDeleteArrayElement(cx, obj, upperIndex, hole, value)) { - return JS_FALSE; + if (!JS_CHECK_OPERATION_LIMIT(cx)) + return false; + if (!GetElement(cx, obj, last, &hole, &value)) + return false; + if (hole) { + if (!DeletePropertyOrThrow(cx, obj, upperIndex)) + return false; + } else { + if (!SetArrayElement(cx, obj, upperIndex, value)) + return false; } } while (last != 0); } @@ -2115,18 +2159,24 @@ array_splice(JSContext *cx, unsigned argc, Value *vp) /* Steps 12(a)-(b). */ RootedValue fromValue(cx); for (uint32_t from = sourceIndex, to = targetIndex; from < len; from++, to++) { - JSBool hole; - if (!JS_CHECK_OPERATION_LIMIT(cx) || - !GetElement(cx, obj, from, &hole, &fromValue) || - !SetOrDeleteArrayElement(cx, obj, to, hole, fromValue)) - { + if (!JS_CHECK_OPERATION_LIMIT(cx)) return false; + + JSBool hole; + if (!GetElement(cx, obj, from, &hole, &fromValue)) + return false; + if (hole) { + if (!DeletePropertyOrThrow(cx, obj, to)) + return false; + } else { + if (!SetArrayElement(cx, obj, to, fromValue)) + return false; } } /* Steps 12(c)-(d). */ for (uint32_t k = len; k > finalLength; k--) { - if (DeleteArrayElement(cx, obj, k - 1, true) < 0) + if (!DeletePropertyOrThrow(cx, obj, k - 1)) return false; } } @@ -2155,15 +2205,22 @@ array_splice(JSContext *cx, unsigned argc, Value *vp) } else { RootedValue fromValue(cx); for (double k = len - actualDeleteCount; k > actualStart; k--) { + if (!JS_CHECK_OPERATION_LIMIT(cx)) + return false; + double from = k + actualDeleteCount - 1; double to = k + itemCount - 1; JSBool hole; - if (!JS_CHECK_OPERATION_LIMIT(cx) || - !GetElement(cx, obj, from, &hole, &fromValue) || - !SetOrDeleteArrayElement(cx, obj, to, hole, fromValue)) - { + if (!GetElement(cx, obj, from, &hole, &fromValue)) return false; + + if (hole) { + if (!DeletePropertyOrThrow(cx, obj, to)) + return false; + } else { + if (!SetArrayElement(cx, obj, to, fromValue)) + return false; } } } diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp index b3a54c63c24e..843c3294c8b8 100644 --- a/js/src/jsbool.cpp +++ b/js/src/jsbool.cpp @@ -38,8 +38,9 @@ using namespace js::types; Class js::BooleanClass = { "Boolean", - JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean), + JS_PropertyStub, /* addProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsclass.h b/js/src/jsclass.h index 86c0e5b86e68..bb01ff046043 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -180,11 +180,11 @@ typedef JSBool typedef JSBool (* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp); typedef JSBool -(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict); +(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded); typedef JSBool -(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict); +(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded); typedef JSBool -(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict); +(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded); typedef JSObject * @@ -198,7 +198,7 @@ typedef void \ /* Mandatory non-null function pointer members. */ \ JSPropertyOp addProperty; \ - JSPropertyOp delProperty; \ + JSDeletePropertyOp delProperty; \ JSPropertyOp getProperty; \ JSStrictPropertyOp setProperty; \ JSEnumerateOp enumerate; \ diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 9c9a03d3b1da..604b206b5ab9 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -422,6 +422,16 @@ CallJSPropertyOpSetter(JSContext *cx, StrictPropertyOp op, HandleObject obj, Han return op(cx, obj, id, strict, vp); } +static inline bool +CallJSDeletePropertyOp(JSContext *cx, JSDeletePropertyOp op, HandleObject receiver, HandleId id, + JSBool *succeeded) +{ + JS_CHECK_RECURSION(cx, return false); + + assertSameCompartment(cx, receiver, id); + return op(cx, receiver, id, succeeded); +} + inline bool CallSetter(JSContext *cx, HandleObject obj, HandleId id, StrictPropertyOp op, unsigned attrs, unsigned shortid, JSBool strict, MutableHandleValue vp) diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 928c4a66a8ea..b3ce396f860d 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -511,7 +511,7 @@ Class js::DateClass = { JSCLASS_HAS_RESERVED_SLOTS(JSObject::DATE_CLASS_RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_Date), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 21d2a3afeb9e..68a5e1da59c2 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -68,7 +68,7 @@ Class js::ErrorClass = { JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_NEW_RESOLVE | JSCLASS_HAS_CACHED_PROTO(JSProto_Error), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 96d9eb2a4057..80ab7636f8a9 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -548,7 +548,7 @@ JS_FRIEND_DATA(Class) js::FunctionClass = { JSCLASS_NEW_RESOLVE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_Function), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ fun_enumerate, diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 68b4c69e57b2..f1bb3881c222 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -177,7 +177,7 @@ const uint32_t JSSLOT_SAVED_ID = 1; Class js_NoSuchMethodClass = { "NoSuchMethod", JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, }; @@ -2129,9 +2129,15 @@ BEGIN_CASE(JSOP_DELPROP) RootedObject &obj = rootObject0; FETCH_OBJECT(cx, -1, obj); - MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-1]); - if (!JSObject::deleteProperty(cx, obj, name, res, script->strict)) + JSBool succeeded; + if (!JSObject::deleteProperty(cx, obj, name, &succeeded)) goto error; + if (!succeeded && script->strict) { + obj->reportNotConfigurable(cx, NameToId(name)); + goto error; + } + MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-1]); + res.setBoolean(succeeded); } END_CASE(JSOP_DELPROP) @@ -2144,10 +2150,22 @@ BEGIN_CASE(JSOP_DELELEM) RootedValue &propval = rootValue0; propval = regs.sp[-1]; - MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-2]); - if (!JSObject::deleteByValue(cx, obj, propval, res, script->strict)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, propval, &succeeded)) goto error; + if (!succeeded && script->strict) { + // XXX This observably calls ToString(propval). We should convert to + // PropertyKey and use that to delete, and to report an error if + // necessary! + RootedId id(cx); + if (!ValueToId(cx, propval, &id)) + goto error; + obj->reportNotConfigurable(cx, id); + goto error; + } + MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-2]); + res.setBoolean(succeeded); regs.sp--; } END_CASE(JSOP_DELELEM) @@ -3613,22 +3631,17 @@ template bool js::DeleteProperty(JSContext *cx, HandleValue v, HandlePropertyName name, JSBool *bp) { - // default op result is false (failure) - *bp = true; - // convert value to JSObject pointer RootedObject obj(cx, ToObjectFromStack(cx, v)); if (!obj) return false; - // Call deleteProperty on obj - RootedValue result(cx, NullValue()); - bool delprop_ok = JSObject::deleteProperty(cx, obj, name, &result, strict); - if (!delprop_ok) + if (!JSObject::deleteProperty(cx, obj, name, bp)) return false; - - // convert result into *bp and return - *bp = result.toBoolean(); + if (strict && !*bp) { + obj->reportNotConfigurable(cx, NameToId(name)); + return false; + } return true; } @@ -3643,16 +3656,23 @@ js::DeleteElement(JSContext *cx, HandleValue val, HandleValue index, JSBool *bp) if (!obj) return false; - RootedValue result(cx); - if (!JSObject::deleteByValue(cx, obj, index, &result, strict)) + if (!JSObject::deleteByValue(cx, obj, index, bp)) return false; - - *bp = result.toBoolean(); + if (strict && !*bp) { + // XXX This observably calls ToString(propval). We should convert to + // PropertyKey and use that to delete, and to report an error if + // necessary! + RootedId id(cx); + if (!ValueToId(cx, index, &id)) + return false; + obj->reportNotConfigurable(cx, id); + return false; + } return true; } -template bool js::DeleteElement (JSContext *, HandleValue, HandleValue, JSBool *); -template bool js::DeleteElement(JSContext *, HandleValue, HandleValue, JSBool *); +template bool js::DeleteElement (JSContext *, HandleValue, HandleValue, JSBool *succeeded); +template bool js::DeleteElement(JSContext *, HandleValue, HandleValue, JSBool *succeeded); bool js::GetElement(JSContext *cx, MutableHandleValue lref, HandleValue rref, MutableHandleValue vp) @@ -3755,10 +3775,16 @@ js::DeleteNameOperation(JSContext *cx, HandlePropertyName name, HandleObject sco if (!LookupName(cx, name, scopeObj, &scope, &pobj, &shape)) return false; - /* ECMA says to return true if name is undefined or inherited. */ - res.setBoolean(true); - if (shape) - return JSObject::deleteProperty(cx, scope, name, res, false); + if (!scope) { + // Return true for non-existent names. + res.setBoolean(true); + return true; + } + + JSBool succeeded; + if (!JSObject::deleteProperty(cx, scope, name, &succeeded)) + return false; + res.setBoolean(succeeded); return true; } diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 552bdd95fb13..0308f4daee56 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -837,7 +837,7 @@ Class PropertyIteratorObject::class_ = { JSCLASS_HAS_PRIVATE | JSCLASS_BACKGROUND_FINALIZE, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -940,7 +940,7 @@ Class js::ElementIteratorClass = { JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(ElementIteratorObject::NumSlots), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1298,7 +1298,7 @@ Class js::StopIterationClass = { JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration) | JSCLASS_FREEZE_PROTO, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -1395,7 +1395,7 @@ Class js::GeneratorClass = { "Generator", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 97f880fe98d0..aa0526391cac 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -86,7 +86,7 @@ Class js::MathClass = { js_Math_str, JSCLASS_HAS_CACHED_PROTO(JSProto_Math), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 8c9dc7aff420..e89b967840ae 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -409,7 +409,7 @@ Class js::NumberClass = { js_Number_str, JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index f8cb8b97e8a4..50097ee541bc 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -82,7 +82,7 @@ Class js::ObjectClass = { js_Object_str, JSCLASS_HAS_CACHED_PROTO(JSProto_Object), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -908,8 +908,8 @@ DefinePropertyOnObject(JSContext *cx, HandleObject obj, HandleId id, const PropD * redefining it or we had invoked its setter to change its value). */ if (callDelProperty) { - RootedValue dummy(cx, UndefinedValue()); - if (!CallJSPropertyOp(cx, obj2->getClass()->delProperty, obj2, id, &dummy)) + JSBool succeeded; + if (!CallJSDeletePropertyOp(cx, obj2->getClass()->delProperty, obj2, id, &succeeded)) return false; } @@ -1617,27 +1617,26 @@ JSObject::nonNativeSetElement(JSContext *cx, HandleObject obj, } /* static */ bool -JSObject::deleteByValue(JSContext *cx, HandleObject obj, - const Value &property, MutableHandleValue rval, bool strict) +JSObject::deleteByValue(JSContext *cx, HandleObject obj, const Value &property, JSBool *succeeded) { uint32_t index; if (IsDefinitelyIndex(property, &index)) - return deleteElement(cx, obj, index, rval, strict); + return deleteElement(cx, obj, index, succeeded); RootedValue propval(cx, property); Rooted sid(cx); if (ValueIsSpecial(obj, &propval, &sid, cx)) - return deleteSpecial(cx, obj, sid, rval, strict); + return deleteSpecial(cx, obj, sid, succeeded); JSAtom *name = ToAtom(cx, propval); if (!name) return false; if (name->isIndex(&index)) - return deleteElement(cx, obj, index, rval, strict); + return deleteElement(cx, obj, index, succeeded); Rooted propname(cx, name->asPropertyName()); - return deleteProperty(cx, obj, propname, rval, strict); + return deleteProperty(cx, obj, propname, succeeded); } JS_FRIEND_API(bool) @@ -2225,8 +2224,8 @@ js::DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey ke bad: if (named) { - RootedValue rval(cx); - JSObject::deleteByValue(cx, obj, StringValue(atom), &rval, false); + JSBool succeeded; + JSObject::deleteByValue(cx, obj, StringValue(atom), &succeeded); } if (cached) ClearClassObject(obj, key); @@ -4367,10 +4366,8 @@ baseops::SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, u } JSBool -baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue rval, JSBool strict) +baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) { - rval.setBoolean(true); - RootedObject proto(cx); RootedShape shape(cx); if (!baseops::LookupProperty(cx, obj, id, &proto, &shape)) @@ -4378,17 +4375,17 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHand if (!shape || proto != obj) { /* * If no property, or the property comes from a prototype, call the - * class's delProperty hook, passing rval as the result parameter. + * class's delProperty hook, passing succeeded as the result parameter. */ - return CallJSPropertyOp(cx, obj->getClass()->delProperty, obj, id, rval); + return CallJSDeletePropertyOp(cx, obj->getClass()->delProperty, obj, id, succeeded); } GCPoke(cx->runtime); if (IsImplicitDenseElement(shape)) { - if (!CallJSPropertyOp(cx, obj->getClass()->delProperty, obj, id, rval)) + if (!CallJSDeletePropertyOp(cx, obj->getClass()->delProperty, obj, id, succeeded)) return false; - if (rval.isFalse()) + if (!succeeded) return true; JSObject::setDenseElementHole(cx, obj, JSID_TO_INT(id)); @@ -4396,9 +4393,7 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHand } if (!shape->configurable()) { - if (strict) - return obj->reportNotConfigurable(cx, id); - rval.setBoolean(false); + *succeeded = false; return true; } @@ -4406,9 +4401,9 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHand if (!shape->getUserId(cx, &userid)) return false; - if (!CallJSPropertyOp(cx, obj->getClass()->delProperty, obj, userid, rval)) + if (!CallJSDeletePropertyOp(cx, obj->getClass()->delProperty, obj, userid, succeeded)) return false; - if (rval.isFalse()) + if (!succeeded) return true; return obj->removeProperty(cx, id) && js_SuppressDeletedProperty(cx, obj, id); @@ -4416,28 +4411,26 @@ baseops::DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHand JSBool baseops::DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue rval, JSBool strict) + JSBool *succeeded) { Rooted id(cx, NameToId(name)); - return baseops::DeleteGeneric(cx, obj, id, rval, strict); + return baseops::DeleteGeneric(cx, obj, id, succeeded); } JSBool -baseops::DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue rval, JSBool strict) +baseops::DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded) { RootedId id(cx); if (!IndexToId(cx, index, &id)) return false; - return baseops::DeleteGeneric(cx, obj, id, rval, strict); + return baseops::DeleteGeneric(cx, obj, id, succeeded); } JSBool -baseops::DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue rval, JSBool strict) +baseops::DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded) { Rooted id(cx, SPECIALID_TO_JSID(sid)); - return baseops::DeleteGeneric(cx, obj, id, rval, strict); + return baseops::DeleteGeneric(cx, obj, id, succeeded); } bool diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 25a8652c5ec5..919e33229145 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -192,16 +192,16 @@ extern JSBool SetElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp); extern JSBool -DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue rval, JSBool strict); +DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded); extern JSBool -DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue rval, JSBool strict); +DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded); extern JSBool -DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue rval, JSBool strict); +DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded); extern JSBool -DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue rval, JSBool strict); +DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded); } /* namespace js::baseops */ @@ -892,15 +892,13 @@ class JSObject : public js::ObjectImpl static inline bool deleteProperty(JSContext *cx, js::HandleObject obj, js::HandlePropertyName name, - js::MutableHandleValue rval, bool strict); + JSBool *succeeded); static inline bool deleteElement(JSContext *cx, js::HandleObject obj, - uint32_t index, - js::MutableHandleValue rval, bool strict); + uint32_t index, JSBool *succeeded); static inline bool deleteSpecial(JSContext *cx, js::HandleObject obj, - js::HandleSpecialId sid, - js::MutableHandleValue rval, bool strict); + js::HandleSpecialId sid, JSBool *succeeded); static bool deleteByValue(JSContext *cx, js::HandleObject obj, - const js::Value &property, js::MutableHandleValue rval, bool strict); + const js::Value &property, JSBool *succeeded); static inline bool enumerate(JSContext *cx, JS::HandleObject obj, JSIterateOp iterop, JS::MutableHandleValue statep, JS::MutableHandleId idp); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 9213ae088914..a78e32222ba7 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -194,19 +194,18 @@ JSObject::getPropertyNoGC(JSContext *cx, JSObject *obj, JSObject *receiver, } /* static */ inline bool -JSObject::deleteProperty(JSContext *cx, js::HandleObject obj, - js::HandlePropertyName name, js::MutableHandleValue rval, bool strict) +JSObject::deleteProperty(JSContext *cx, js::HandleObject obj, js::HandlePropertyName name, + JSBool *succeeded) { JS::RootedId id(cx, js::NameToId(name)); js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType()); js::types::MarkTypePropertyConfigured(cx, obj, id); js::DeletePropertyOp op = obj->getOps()->deleteProperty; - return (op ? op : js::baseops::DeleteProperty)(cx, obj, name, rval, strict); + return (op ? op : js::baseops::DeleteProperty)(cx, obj, name, succeeded); } /* static */ inline bool -JSObject::deleteElement(JSContext *cx, js::HandleObject obj, - uint32_t index, js::MutableHandleValue rval, bool strict) +JSObject::deleteElement(JSContext *cx, js::HandleObject obj, uint32_t index, JSBool *succeeded) { JS::RootedId id(cx); if (!js::IndexToId(cx, index, &id)) @@ -214,18 +213,18 @@ JSObject::deleteElement(JSContext *cx, js::HandleObject obj, js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType()); js::types::MarkTypePropertyConfigured(cx, obj, id); js::DeleteElementOp op = obj->getOps()->deleteElement; - return (op ? op : js::baseops::DeleteElement)(cx, obj, index, rval, strict); + return (op ? op : js::baseops::DeleteElement)(cx, obj, index, succeeded); } /* static */ inline bool -JSObject::deleteSpecial(JSContext *cx, js::HandleObject obj, - js::HandleSpecialId sid, js::MutableHandleValue rval, bool strict) +JSObject::deleteSpecial(JSContext *cx, js::HandleObject obj, js::HandleSpecialId sid, + JSBool *succeeded) { JS::RootedId id(cx, SPECIALID_TO_JSID(sid)); js::types::AddTypePropertyId(cx, obj, id, js::types::Type::UndefinedType()); js::types::MarkTypePropertyConfigured(cx, obj, id); js::DeleteSpecialOp op = obj->getOps()->deleteSpecial; - return (op ? op : js::baseops::DeleteSpecial)(cx, obj, sid, rval, strict); + return (op ? op : js::baseops::DeleteSpecial)(cx, obj, sid, succeeded); } inline void diff --git a/js/src/json.cpp b/js/src/json.cpp index d03a8da9931f..66e73b9dea9a 100644 --- a/js/src/json.cpp +++ b/js/src/json.cpp @@ -45,7 +45,7 @@ Class js::JSONClass = { js_JSON_str, JSCLASS_HAS_CACHED_PROTO(JSProto_JSON), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -776,7 +776,8 @@ Walk(JSContext *cx, HandleObject holder, HandleId name, HandleValue reviver, Mut if (newElement.isUndefined()) { /* Step 2a(iii)(2). */ - if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &newElement, false)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &succeeded)) return false; } else { /* Step 2a(iii)(3). */ @@ -804,7 +805,8 @@ Walk(JSContext *cx, HandleObject holder, HandleId name, HandleValue reviver, Mut if (newElement.isUndefined()) { /* Step 2b(ii)(2). */ - if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &newElement, false)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, IdToValue(id), &succeeded)) return false; } else { /* Step 2b(ii)(3). */ diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index dda39fda162d..23220564a573 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -2948,41 +2948,36 @@ proxy_SetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, } static JSBool -proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, - MutableHandleValue rval, JSBool strict) +proxy_DeleteGeneric(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) { - // TODO: throwing away strict bool deleted; - if (!Proxy::delete_(cx, obj, id, &deleted) || !js_SuppressDeletedProperty(cx, obj, id)) + if (!Proxy::delete_(cx, obj, id, &deleted)) return false; - rval.setBoolean(deleted); - return true; + *succeeded = deleted; + return js_SuppressDeletedProperty(cx, obj, id); } static JSBool -proxy_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue rval, JSBool strict) +proxy_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded) { Rooted id(cx, NameToId(name)); - return proxy_DeleteGeneric(cx, obj, id, rval, strict); + return proxy_DeleteGeneric(cx, obj, id, succeeded); } static JSBool -proxy_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue rval, JSBool strict) +proxy_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded) { RootedId id(cx); if (!IndexToId(cx, index, &id)) return false; - return proxy_DeleteGeneric(cx, obj, id, rval, strict); + return proxy_DeleteGeneric(cx, obj, id, succeeded); } static JSBool -proxy_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue rval, JSBool strict) +proxy_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded) { Rooted id(cx, SPECIALID_TO_JSID(sid)); - return proxy_DeleteGeneric(cx, obj, id, rval, strict); + return proxy_DeleteGeneric(cx, obj, id, succeeded); } static void @@ -3070,7 +3065,7 @@ JS_FRIEND_DATA(Class) js::ObjectProxyClass = { "Proxy", Class::NON_NATIVE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(4), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3121,7 +3116,7 @@ JS_FRIEND_DATA(Class) js::OuterWindowProxyClass = { "Proxy", Class::NON_NATIVE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(4), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3196,7 +3191,7 @@ JS_FRIEND_DATA(Class) js::FunctionProxyClass = { "Proxy", Class::NON_NATIVE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(6), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3368,7 +3363,7 @@ Class js::ProxyClass = { "Proxy", JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 0e50cb0f7f74..de0dd134c7aa 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -424,7 +424,7 @@ Class js::StringClass = { JSCLASS_HAS_RESERVED_SLOTS(StringObject::RESERVED_SLOTS) | JSCLASS_NEW_RESOLVE | JSCLASS_HAS_CACHED_PROTO(JSProto_String), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ str_enumerate, diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index 15b5c5daf67b..6d4beda2fdd6 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -1087,33 +1087,33 @@ ArrayBufferObject::obj_setSpecialAttributes(JSContext *cx, HandleObject obj, } JSBool -ArrayBufferObject::obj_deleteProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, MutableHandleValue rval, JSBool strict) +ArrayBufferObject::obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + JSBool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) return false; - return baseops::DeleteProperty(cx, delegate, name, rval, strict); + return baseops::DeleteProperty(cx, delegate, name, succeeded); } JSBool -ArrayBufferObject::obj_deleteElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleValue rval, JSBool strict) +ArrayBufferObject::obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, + JSBool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) return false; - return baseops::DeleteElement(cx, delegate, index, rval, strict); + return baseops::DeleteElement(cx, delegate, index, succeeded); } JSBool -ArrayBufferObject::obj_deleteSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, MutableHandleValue rval, JSBool strict) +ArrayBufferObject::obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, + JSBool *succeeded) { RootedObject delegate(cx, ArrayBufferDelegate(cx, obj)); if (!delegate) return false; - return baseops::DeleteSpecial(cx, delegate, sid, rval, strict); + return baseops::DeleteSpecial(cx, delegate, sid, succeeded); } JSBool @@ -1628,33 +1628,30 @@ class TypedArrayTemplate } static JSBool - obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue rval, JSBool strict) + obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded) { - rval.setBoolean(true); + *succeeded = true; return true; } static JSBool - obj_deleteElement(JSContext *cx, HandleObject tarray, uint32_t index, - MutableHandleValue rval, JSBool strict) + obj_deleteElement(JSContext *cx, HandleObject tarray, uint32_t index, JSBool *succeeded) { JS_ASSERT(tarray->isTypedArray()); if (index < length(tarray)) { - rval.setBoolean(false); + *succeeded = false; return true; } - rval.setBoolean(true); + *succeeded = true; return true; } static JSBool - obj_deleteSpecial(JSContext *cx, HandleObject tarray, HandleSpecialId sid, - MutableHandleValue rval, JSBool strict) + obj_deleteSpecial(JSContext *cx, HandleObject tarray, HandleSpecialId sid, JSBool *succeeded) { - rval.setBoolean(true); + *succeeded = true; return true; } @@ -3279,7 +3276,7 @@ Class ArrayBufferObject::protoClass = { JSCLASS_HAS_RESERVED_SLOTS(ARRAYBUFFER_RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3295,7 +3292,7 @@ Class js::ArrayBufferClass = { JSCLASS_HAS_RESERVED_SLOTS(ARRAYBUFFER_RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3443,7 +3440,7 @@ IMPL_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double) JSCLASS_HAS_PRIVATE | \ JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray), \ JS_PropertyStub, /* addProperty */ \ - JS_PropertyStub, /* delProperty */ \ + JS_DeletePropertyStub, /* delProperty */ \ JS_PropertyStub, /* getProperty */ \ JS_StrictPropertyStub, /* setProperty */ \ JS_EnumerateStub, \ @@ -3459,7 +3456,7 @@ IMPL_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double) JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray) | \ Class::NON_NATIVE, \ JS_PropertyStub, /* addProperty */ \ - JS_PropertyStub, /* delProperty */ \ + JS_DeletePropertyStub, /* delProperty */ \ JS_PropertyStub, /* getProperty */ \ JS_StrictPropertyStub, /* setProperty */ \ JS_EnumerateStub, \ @@ -3659,7 +3656,7 @@ Class js::DataViewObject::protoClass = { JSCLASS_HAS_RESERVED_SLOTS(DataViewObject::RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_DataView), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -3674,7 +3671,7 @@ Class js::DataViewClass = { JSCLASS_HAS_RESERVED_SLOTS(DataViewObject::RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_DataView), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/jstypedarray.h b/js/src/jstypedarray.h index e38313b16299..08ad9479e92c 100644 --- a/js/src/jstypedarray.h +++ b/js/src/jstypedarray.h @@ -119,15 +119,12 @@ class ArrayBufferObject : public JSObject static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp); - static JSBool obj_deleteProperty(JSContext *cx, HandleObject obj, - HandlePropertyName name, MutableHandleValue rval, - JSBool strict); - static JSBool obj_deleteElement(JSContext *cx, HandleObject obj, - uint32_t index, MutableHandleValue rval, - JSBool strict); - static JSBool obj_deleteSpecial(JSContext *cx, HandleObject obj, - HandleSpecialId sid, MutableHandleValue rval, - JSBool strict); + static JSBool obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, + JSBool *succeeded); + static JSBool obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, + JSBool *succeeded); + static JSBool obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, + JSBool *succeeded); static JSBool obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op, MutableHandleValue statep, MutableHandleId idp); diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index 5977bfca5971..dc0abbea626b 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -399,7 +399,7 @@ Class js::WeakMapClass = { JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_WeakMap), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/methodjit/StubCalls.cpp b/js/src/methodjit/StubCalls.cpp index c9fda4f151fe..5a6a8f956c2b 100644 --- a/js/src/methodjit/StubCalls.cpp +++ b/js/src/methodjit/StubCalls.cpp @@ -1357,8 +1357,11 @@ stubs::DelName(VMFrame &f, PropertyName *name_) f.regs.sp++; f.regs.sp[-1] = BooleanValue(true); if (prop) { - if (!JSObject::deleteProperty(f.cx, obj, name, MutableHandleValue::fromMarkedLocation(&f.regs.sp[-1]), false)) + JSBool succeeded; + if (!JSObject::deleteProperty(f.cx, obj, name, &succeeded)) THROW(); + MutableHandleValue rval = MutableHandleValue::fromMarkedLocation(&f.regs.sp[-1]); + rval.setBoolean(succeeded); } } @@ -1374,11 +1377,15 @@ stubs::DelProp(VMFrame &f, PropertyName *name_) if (!obj) THROW(); - RootedValue rval(cx); - if (!JSObject::deleteProperty(cx, obj, name, &rval, strict)) + JSBool succeeded; + if (!JSObject::deleteProperty(cx, obj, name, &succeeded)) THROW(); + if (strict && !succeeded) { + obj->reportNotConfigurable(cx, NameToId(name)); + THROW(); + } - f.regs.sp[-1] = rval; + f.regs.sp[-1] = BooleanValue(succeeded); } template void JS_FASTCALL stubs::DelProp(VMFrame &f, PropertyName *name); @@ -1396,10 +1403,22 @@ stubs::DelElem(VMFrame &f) THROW(); const Value &propval = f.regs.sp[-1]; - MutableHandleValue rval = MutableHandleValue::fromMarkedLocation(&f.regs.sp[-2]); - - if (!JSObject::deleteByValue(cx, obj, propval, rval, strict)) + JSBool succeeded; + if (!JSObject::deleteByValue(cx, obj, propval, &succeeded)) THROW(); + if (strict && !succeeded) { + // XXX This observably calls ToString(propval). We should convert to + // PropertyKey and use that to delete, and to report an error if + // necessary -- but this code's all dying soon, so who cares? + RootedId id(cx); + if (!ValueToId(cx, propval, &id)) + THROW(); + obj->reportNotConfigurable(cx, id); + THROW(); + } + + MutableHandleValue rval = MutableHandleValue::fromMarkedLocation(&f.regs.sp[-2]); + rval.setBoolean(succeeded); } void JS_FASTCALL diff --git a/js/src/perf/jsperf.cpp b/js/src/perf/jsperf.cpp index 098361a964a4..7caa12a50a28 100644 --- a/js/src/perf/jsperf.cpp +++ b/js/src/perf/jsperf.cpp @@ -156,7 +156,7 @@ static void pm_finalize(JSFreeOp* fop, JSObject* obj); static JSClass pm_class = { "PerfMeasurement", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize }; diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 68f0c08168de..4c496dc4f09b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -2450,7 +2450,7 @@ sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, static JSClass sandbox_class = { "sandbox", JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, sandbox_enumerate, (JSResolveOp)sandbox_resolve, JS_ConvertStub @@ -2713,7 +2713,7 @@ resolver_enumerate(JSContext *cx, HandleObject obj) static JSClass resolver_class = { "resolver", JSCLASS_NEW_RESOLVE | JSCLASS_HAS_RESERVED_SLOTS(1), - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, resolver_enumerate, (JSResolveOp)resolver_resolve, JS_ConvertStub @@ -3526,7 +3526,7 @@ ObjectEmulatingUndefined(JSContext *cx, unsigned argc, jsval *vp) "ObjectEmulatingUndefined", JSCLASS_EMULATES_UNDEFINED, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, @@ -4040,15 +4040,20 @@ its_addProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue } static JSBool -its_delProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) +its_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) { - if (!its_noisy) + if (!its_noisy) { + *succeeded = true; return true; + } ToStringHelper idString(cx, id); + if (idString.threw()) + return false; + fprintf(gOutFile, "deleting its property %s,", idString.getBytes()); - ToStringHelper valueString(cx, vp); - fprintf(gOutFile, " initial value %s\n", valueString.getBytes()); + + *succeeded = true; return true; } @@ -4397,7 +4402,7 @@ global_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, JSClass global_class = { "global", JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, global_enumerate, (JSResolveOp) global_resolve, JS_ConvertStub, NULL @@ -4503,7 +4508,7 @@ env_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags, static JSClass env_class = { "environment", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, env_setProperty, env_enumerate, (JSResolveOp) env_resolve, JS_ConvertStub @@ -4602,7 +4607,7 @@ static JSFunctionSpec dom_methods[] = { static JSClass dom_class = { "FakeDOMObject", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/tests/ecma_5/Array/reverse-order-of-low-high-accesses.js b/js/src/tests/ecma_5/Array/reverse-order-of-low-high-accesses.js new file mode 100644 index 000000000000..a9b1e80deb2d --- /dev/null +++ b/js/src/tests/ecma_5/Array/reverse-order-of-low-high-accesses.js @@ -0,0 +1,88 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 858677; +var summary = + "[].reverse should swap elements low to high using accesses to low " + + "elements, then accesses to high elements"; + +print(BUGNUMBER + ": " + summary); + +/************** + * BEGIN TEST * + **************/ + +var observed = []; + +// (0, 7) hits the lowerExists/upperExists case. +// (1, 6) hits the !lowerExists/upperExists case. +// (2, 5) hits the lowerExists/!upperExists case. +// (3, 4) hits the !lowerExists/!upperExists case. +// +// It'd be a good idea to have a second version of this test at some point +// where the "array" being reversed is a proxy, to detect proper ordering of +// getproperty, hasproperty, setproperty into a hole, and deleteproperty from a +// non-configurable element. But at present our Array.prototype.reverse +// implementation probably doesn't conform fully to all this (because our +// internal MOP is still slightly off), so punt for now. +var props = + { + 0: { + configurable: true, + get: function() { observed.push("index 0 get"); return "index 0 get"; }, + set: function(v) { observed.push("index 0 set: " + v); } + }, + /* 1: hole */ + 2: { + configurable: true, + get: function() { observed.push("index 2 get"); return "index 2 get"; }, + set: function(v) { observed.push("index 2 set: " + v); } + }, + /* 3: hole */ + /* 4: hole */ + /* 5: hole */ + 6: { + configurable: true, + get: function() { observed.push("index 6 get"); return "index 6 get"; }, + set: function(v) { observed.push("index 6 set: " + v); } + }, + 7: { + configurable: true, + get: function() { observed.push("index 7 get"); return "index 7 get"; }, + set: function(v) { observed.push("index 7 set: " + v); } + }, + }; + +var arr = Object.defineProperties(new Array(8), props); + +arr.reverse(); + +var expectedObserved = + ["index 0 get", "index 7 get", "index 0 set: index 7 get", "index 7 set: index 0 get", + "index 6 get", + "index 2 get" + /* nothing for 3/4 */]; +print(observed); +// Do this before the assertions below futz even more with |observed|. +assertEq(observed.length, expectedObserved.length); +for (var i = 0; i < expectedObserved.length; i++) + assertEq(observed[i], expectedObserved[i]); + +assertEq(arr[0], "index 0 get"); // no deletion, setting doesn't overwrite +assertEq(arr[1], "index 6 get"); // copies result of getter +assertEq(2 in arr, false); // deleted +assertEq(3 in arr, false); // never there +assertEq(4 in arr, false); // never there +assertEq(arr[5], "index 2 get"); // copies result of getter +assertEq(6 in arr, false); // deleted +assertEq(arr[7], "index 7 get"); // no deletion, setter doesn't overwrite + +/******************************************************************************/ + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("Tests complete"); diff --git a/js/src/vm/ArgumentsObject.cpp b/js/src/vm/ArgumentsObject.cpp index f53e0d639d31..9e77cf3e6da1 100644 --- a/js/src/vm/ArgumentsObject.cpp +++ b/js/src/vm/ArgumentsObject.cpp @@ -210,7 +210,7 @@ ArgumentsObject::createUnexpected(JSContext *cx, AbstractFramePtr frame) } static JSBool -args_delProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp) +args_delProperty(JSContext *cx, HandleObject obj, HandleId id, JSBool *succeeded) { ArgumentsObject &argsobj = obj->asArguments(); if (JSID_IS_INT(id)) { @@ -222,6 +222,7 @@ args_delProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValu } else if (JSID_IS_ATOM(id, cx->names().callee)) { argsobj.asNormalArguments().clearCallee(); } + *succeeded = true; return true; } @@ -289,8 +290,8 @@ ArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, MutableHa * of setting it in case the user has changed the prototype to an object * that has a setter for this id. */ - RootedValue value(cx); - return baseops::DeleteGeneric(cx, obj, id, &value, false) && + JSBool succeeded; + return baseops::DeleteGeneric(cx, obj, id, &succeeded) && baseops::DefineGeneric(cx, obj, id, vp, NULL, NULL, attrs); } @@ -408,8 +409,8 @@ StrictArgSetter(JSContext *cx, HandleObject obj, HandleId id, JSBool strict, Mut * args_delProperty to clear the corresponding reserved slot so the GC can * collect its value. */ - RootedValue value(cx); - return baseops::DeleteGeneric(cx, argsobj, id, &value, strict) && + JSBool succeeded; + return baseops::DeleteGeneric(cx, argsobj, id, &succeeded) && baseops::DefineGeneric(cx, argsobj, id, vp, NULL, NULL, attrs); } diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 1f822c2d3141..032867ff5841 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -1659,7 +1659,7 @@ Class Debugger::jsclass = { "Debugger", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUG_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Debugger::finalize, NULL, /* checkAccess */ NULL, /* call */ @@ -2696,7 +2696,7 @@ Class DebuggerScript_class = { "Script", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSCRIPT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, NULL, /* checkAccess */ NULL, /* call */ @@ -3497,7 +3497,7 @@ DebuggerFrame_finalize(FreeOp *fop, RawObject obj) Class DebuggerFrame_class = { "Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGFRAME_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, DebuggerFrame_finalize }; @@ -3642,7 +3642,7 @@ DebuggerFrame_getOlder(JSContext *cx, unsigned argc, Value *vp) Class DebuggerArguments_class = { "Arguments", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGARGUMENTS_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; @@ -4093,7 +4093,7 @@ Class DebuggerObject_class = { "Object", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGOBJECT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, NULL, /* checkAccess */ NULL, /* call */ @@ -4542,8 +4542,12 @@ DebuggerObject_deleteProperty(JSContext *cx, unsigned argc, Value *vp) if (!cx->compartment->wrap(cx, &nameArg)) return false; + JSBool succeeded; ErrorCopier ec(ac, dbg->toJSObject()); - return JSObject::deleteByValue(cx, obj, nameArg, args.rval(), false); + if (!JSObject::deleteByValue(cx, obj, nameArg, &succeeded)) + return false; + args.rval().setBoolean(succeeded); + return true; } enum SealHelperOp { Seal, Freeze, PreventExtensions }; @@ -4881,7 +4885,7 @@ Class DebuggerEnv_class = { "Environment", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGENV_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, NULL, /* checkAccess */ NULL, /* call */ diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index b6716c25683e..97e2300eebf4 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -576,7 +576,7 @@ GlobalDebuggees_finalize(FreeOp *fop, RawObject obj) static Class GlobalDebuggees_class = { "GlobalDebuggee", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, GlobalDebuggees_finalize }; diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index e5dc014b5ba6..b2fe90262352 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -209,7 +209,7 @@ Class js::RegExpClass = { JSCLASS_HAS_RESERVED_SLOTS(RegExpObject::RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, /* enumerate */ diff --git a/js/src/vm/RegExpStatics.cpp b/js/src/vm/RegExpStatics.cpp index ff4b46b514b8..8f2b761fcaec 100644 --- a/js/src/vm/RegExpStatics.cpp +++ b/js/src/vm/RegExpStatics.cpp @@ -41,7 +41,7 @@ Class js::RegExpStaticsClass = { "RegExpStatics", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/vm/ScopeObject.cpp b/js/src/vm/ScopeObject.cpp index d101aaf222c4..91025f40cbcf 100644 --- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -260,7 +260,7 @@ JS_PUBLIC_DATA(Class) js::CallClass = { "Call", JSCLASS_IS_ANONYMOUS | JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -273,7 +273,7 @@ Class js::DeclEnvClass = { JSCLASS_HAS_RESERVED_SLOTS(DeclEnvObject::RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_Object), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -516,26 +516,26 @@ with_SetSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, static JSBool with_DeleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, - MutableHandleValue rval, JSBool strict) + JSBool *succeeded) { RootedObject actual(cx, &obj->asWith().object()); - return JSObject::deleteProperty(cx, actual, name, rval, strict); + return JSObject::deleteProperty(cx, actual, name, succeeded); } static JSBool with_DeleteElement(JSContext *cx, HandleObject obj, uint32_t index, - MutableHandleValue rval, JSBool strict) + JSBool *succeeded) { RootedObject actual(cx, &obj->asWith().object()); - return JSObject::deleteElement(cx, actual, index, rval, strict); + return JSObject::deleteElement(cx, actual, index, succeeded); } static JSBool with_DeleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, - MutableHandleValue rval, JSBool strict) + JSBool *succeeded) { RootedObject actual(cx, &obj->asWith().object()); - return JSObject::deleteSpecial(cx, actual, sid, rval, strict); + return JSObject::deleteSpecial(cx, actual, sid, succeeded); } static JSBool @@ -557,7 +557,7 @@ Class js::WithClass = { JSCLASS_HAS_RESERVED_SLOTS(WithObject::RESERVED_SLOTS) | JSCLASS_IS_ANONYMOUS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -715,7 +715,7 @@ Class js::BlockClass = { JSCLASS_HAS_RESERVED_SLOTS(BlockObject::RESERVED_SLOTS) | JSCLASS_IS_ANONYMOUS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index a6aa8f4f0212..0fed32c33a84 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -38,7 +38,7 @@ selfHosting_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep static JSClass self_hosting_global_class = { "self-hosting-global", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL From 763718651b141cdc2ad572ec4c41a5753f94b1d6 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 5 Apr 2013 21:22:55 -0700 Subject: [PATCH 126/438] Bug 858677 - Fix up code not built by SpiderMonkey to use the newly-changed deletion signatures. r=bholley, r=billm --- content/xbl/src/nsXBLBinding.cpp | 3 +- content/xbl/src/nsXBLDocumentInfo.cpp | 2 +- .../document/src/nsXULPrototypeDocument.cpp | 2 +- dom/base/nsDOMClassInfo.cpp | 22 ++++----- dom/base/nsDOMClassInfo.h | 2 +- dom/bindings/Codegen.py | 6 +-- dom/indexedDB/IDBObjectStore.cpp | 4 +- dom/plugins/base/nsJSNPRuntime.cpp | 12 +++-- dom/workers/Events.cpp | 8 ++-- dom/workers/Exceptions.cpp | 2 +- dom/workers/File.cpp | 4 +- dom/workers/ImageData.cpp | 2 +- dom/workers/Location.cpp | 2 +- dom/workers/Navigator.cpp | 2 +- dom/workers/Worker.cpp | 8 ++-- dom/workers/WorkerScope.cpp | 6 +-- js/ipc/ObjectWrapperChild.cpp | 2 +- js/ipc/ObjectWrapperParent.cpp | 43 +++++++++++++++-- js/ipc/ObjectWrapperParent.h | 4 +- js/jsd/jsd_high.cpp | 2 +- js/src/ctypes/CTypes.cpp | 26 +++++------ js/src/ctypes/Library.cpp | 2 +- js/xpconnect/idl/nsIXPCScriptable.idl | 5 +- js/xpconnect/loader/mozJSComponentLoader.cpp | 2 +- js/xpconnect/public/xpc_map_end.h | 2 +- js/xpconnect/shell/xpcshell.cpp | 4 +- js/xpconnect/src/XPCComponents.cpp | 2 +- js/xpconnect/src/XPCJSContextStack.cpp | 2 +- js/xpconnect/src/XPCQuickStubs.cpp | 2 +- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 46 ++++++++++++++----- js/xpconnect/src/XPCWrappedNativeScope.cpp | 2 +- js/xpconnect/wrappers/XrayWrapper.cpp | 4 +- netwerk/base/src/ProxyAutoConfig.cpp | 2 +- startupcache/test/TestStartupCache.cpp | 2 +- toolkit/components/telemetry/Telemetry.cpp | 2 +- tools/profiler/SaveProfileTask.h | 2 +- 36 files changed, 154 insertions(+), 91 deletions(-) diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index c2e48f8fd846..e5ff15be2741 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -101,7 +101,8 @@ nsXBLJSClass::nsXBLJSClass(const nsAFlatCString& aClassName, JSCLASS_NEW_RESOLVE | // Our one reserved slot holds the relevant nsXBLPrototypeBinding JSCLASS_HAS_RESERVED_SLOTS(1); - addProperty = delProperty = getProperty = ::JS_PropertyStub; + addProperty = getProperty = ::JS_PropertyStub; + delProperty = ::JS_DeletePropertyStub; setProperty = ::JS_StrictPropertyStub; enumerate = XBLEnumerate; resolve = JS_ResolveStub; diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp index 16cca7e11e47..fef1da79af36 100644 --- a/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/content/xbl/src/nsXBLDocumentInfo.cpp @@ -173,7 +173,7 @@ JSClass nsXBLDocGlobalObject::gSharedGlobalClass = { "nsXBLPrototypeScript compilation scope", JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0), - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, nsXBLDocGlobalObject_getProperty, nsXBLDocGlobalObject_setProperty, JS_EnumerateStub, nsXBLDocGlobalObject_resolve, JS_ConvertStub, nsXBLDocGlobalObject_finalize, diff --git a/content/xul/document/src/nsXULPrototypeDocument.cpp b/content/xul/document/src/nsXULPrototypeDocument.cpp index 8a1bd0500311..a3b04196caac 100644 --- a/content/xul/document/src/nsXULPrototypeDocument.cpp +++ b/content/xul/document/src/nsXULPrototypeDocument.cpp @@ -114,7 +114,7 @@ JSClass nsXULPDGlobalObject::gSharedGlobalClass = { "nsXULPrototypeScript compilation scope", JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, nsXULPDGlobalObject_resolve, JS_ConvertStub, nsXULPDGlobalObject_finalize, nullptr, nullptr, nullptr, nullptr, nullptr diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index ebe23a56adc0..3a7a3c3cf3fb 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -1386,7 +1386,7 @@ NS_INTERFACE_MAP_END static JSClass sDOMConstructorProtoClass = { "DOM Constructor.prototype", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr }; @@ -2681,8 +2681,7 @@ nsDOMClassInfo::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, NS_IMETHODIMP nsDOMClassInfo::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, - JSObject *obj, jsid id, jsval *vp, - bool *_retval) + JSObject *obj, jsid id, bool *_retval) { NS_WARNING("nsDOMClassInfo::DelProperty Don't call me!"); @@ -3176,7 +3175,7 @@ static JSClass sGlobalScopePolluterClass = { "Global Scope Polluter", JSCLASS_NEW_RESOLVE, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, nsWindowSH::GlobalScopePolluterGetProperty, JS_StrictPropertyStub, JS_EnumerateStub, @@ -6316,7 +6315,7 @@ static JSClass sHTMLDocumentAllClass = { JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE | JSCLASS_EMULATES_UNDEFINED | JSCLASS_HAS_RESERVED_SLOTS(1), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ nsHTMLDocumentSH::DocumentAllGetProperty, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -6332,7 +6331,7 @@ static JSClass sHTMLDocumentAllHelperClass = { "HTML document.all helper class", JSCLASS_NEW_RESOLVE, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ nsHTMLDocumentSH::DocumentAllHelperGetProperty, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -6345,7 +6344,7 @@ static JSClass sHTMLDocumentAllTagsClass = { "HTML document.all.tags class", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_PRIVATE_IS_NSISUPPORTS, JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -7429,7 +7428,7 @@ nsStorage2SH::SetProperty(nsIXPConnectWrappedNative *wrapper, NS_IMETHODIMP nsStorage2SH::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, - jsval *vp, bool *_retval) + bool *_retval) { nsCOMPtr storage(do_QueryWrappedNative(wrapper)); NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED); @@ -7441,11 +7440,12 @@ nsStorage2SH::DelProperty(nsIXPConnectWrappedNative *wrapper, NS_ENSURE_TRUE(keyStr.init(cx, key), NS_ERROR_UNEXPECTED); nsresult rv = storage->RemoveItem(keyStr); - if (NS_SUCCEEDED(rv)) { - rv = NS_SUCCESS_I_DID_SOMETHING; + if (NS_FAILED(rv)) { + return rv; } - return rv; + *_retval = true; + return NS_SUCCESS_I_DID_SOMETHING; } diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index bb16a11f48fd..a4cdc6adb246 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -1041,7 +1041,7 @@ protected: NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, jsval *vp, bool *_retval); NS_IMETHOD DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, - JSObject *obj, jsid id, jsval *vp, bool *_retval); + JSObject *obj, jsid id, bool *_retval); NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, uint32_t enum_op, jsval *statep, jsid *idp, bool *_retval); diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 8e3e027c1355..aca253ae9aea 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -174,7 +174,7 @@ DOMJSClass Class = { { "%s", %s, %s, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -223,7 +223,7 @@ class CGPrototypeJSClass(CGThing): "%sPrototype", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -277,7 +277,7 @@ static DOMIfaceAndProtoJSClass InterfaceObjectClass = { "Function", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_SLOTS_BASE + %i), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index 9519ba58b90d..2ab1060cd5d0 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -570,7 +570,7 @@ class ThreadLocalJSRuntime JSClass ThreadLocalJSRuntime::sGlobalClass = { "IndexedDBTransactionThreadGlobal", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; @@ -835,7 +835,7 @@ public: JSClass IDBObjectStore::sDummyPropJSClass = { "dummy", 0, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index f629afad7ca7..4f600ffe32e6 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -115,7 +115,7 @@ static JSBool NPObjWrapper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); static JSBool -NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); +NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded); static JSBool NPObjWrapper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, @@ -188,7 +188,7 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj); static JSClass sNPObjectMemberClass = { "NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, NPObjectMember_Convert, NPObjectMember_Finalize, nullptr, NPObjectMember_Call, @@ -1197,7 +1197,7 @@ NPObjWrapper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMut } static JSBool -NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) +NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded) { NPObject *npobj = GetNPObject(cx, obj); @@ -1217,12 +1217,14 @@ NPObjWrapper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMut if (!ReportExceptionIfPending(cx)) return JS_FALSE; - if (!hasProperty) + if (!hasProperty) { + *succeeded = true; return JS_TRUE; + } } if (!npobj->_class->removeProperty(npobj, identifier)) - vp.set(JSVAL_FALSE); + *succeeded = false; return ReportExceptionIfPending(cx); } diff --git a/dom/workers/Events.cpp b/dom/workers/Events.cpp index 0fb2406ee4a1..8d62b3440a1a 100644 --- a/dom/workers/Events.cpp +++ b/dom/workers/Events.cpp @@ -331,7 +331,7 @@ private: JSClass _varname = { \ _name, \ JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \ - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \ }; @@ -586,7 +586,7 @@ private: JSClass _varname = { \ _name, \ JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \ - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \ }; @@ -772,7 +772,7 @@ private: JSClass _varname = { \ _name, \ JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \ - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \ JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \ }; @@ -951,7 +951,7 @@ private: JSClass ProgressEvent::sClass = { "ProgressEvent", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/Exceptions.cpp b/dom/workers/Exceptions.cpp index 9766bb85c9d9..ed212f319a41 100644 --- a/dom/workers/Exceptions.cpp +++ b/dom/workers/Exceptions.cpp @@ -157,7 +157,7 @@ private: JSClass DOMException::sClass = { "DOMException", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/File.cpp b/dom/workers/File.cpp index 047c0ca61cdf..7e59e7e0776f 100644 --- a/dom/workers/File.cpp +++ b/dom/workers/File.cpp @@ -203,7 +203,7 @@ private: JSClass Blob::sClass = { "Blob", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; @@ -370,7 +370,7 @@ private: JSClass File::sClass = { "File", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/ImageData.cpp b/dom/workers/ImageData.cpp index 90fd6498a968..85d533fab0a2 100644 --- a/dom/workers/ImageData.cpp +++ b/dom/workers/ImageData.cpp @@ -135,7 +135,7 @@ private: JSClass ImageData::sClass = { "ImageData", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/Location.cpp b/dom/workers/Location.cpp index 21bfd098da76..772e8d4214e4 100644 --- a/dom/workers/Location.cpp +++ b/dom/workers/Location.cpp @@ -149,7 +149,7 @@ private: JSClass Location::sClass = { "WorkerLocation", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/Navigator.cpp b/dom/workers/Navigator.cpp index 3e898b84e811..69b45625e5aa 100644 --- a/dom/workers/Navigator.cpp +++ b/dom/workers/Navigator.cpp @@ -138,7 +138,7 @@ private: JSClass Navigator::sClass = { "WorkerNavigator", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize }; diff --git a/dom/workers/Worker.cpp b/dom/workers/Worker.cpp index 8abc5359fea9..387b3bdfcd8a 100644 --- a/dom/workers/Worker.cpp +++ b/dom/workers/Worker.cpp @@ -301,7 +301,7 @@ DOMJSClass Worker::sClass = { "Worker", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(3) | JSCLASS_IMPLEMENTS_BARRIERS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize, NULL, NULL, NULL, NULL, Trace }, @@ -321,7 +321,7 @@ DOMIfaceAndProtoJSClass Worker::sProtoClass = { "Worker", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, @@ -464,7 +464,7 @@ DOMJSClass ChromeWorker::sClass = { { "ChromeWorker", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(3) | JSCLASS_IMPLEMENTS_BARRIERS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize, NULL, NULL, NULL, NULL, Trace, }, @@ -484,7 +484,7 @@ DOMIfaceAndProtoJSClass ChromeWorker::sProtoClass = { "ChromeWorker", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index e13a1142c8f8..81036b51677f 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -612,7 +612,7 @@ private: JSClass WorkerGlobalScope::sClass = { "WorkerGlobalScope", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; @@ -878,7 +878,7 @@ DOMJSClass DedicatedWorkerGlobalScope::sClass = { "DedicatedWorkerGlobalScope", JSCLASS_DOM_GLOBAL | JSCLASS_IS_DOMJSCLASS | JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(3) | JSCLASS_NEW_RESOLVE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, reinterpret_cast(Resolve), JS_ConvertStub, Finalize, NULL, NULL, NULL, NULL, Trace }, @@ -898,7 +898,7 @@ DOMIfaceAndProtoJSClass DedicatedWorkerGlobalScope::sProtoClass = { "DedicatedWorkerGlobalScope", JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2), JS_PropertyStub, /* addProperty */ - JS_PropertyStub, /* delProperty */ + JS_DeletePropertyStub, /* delProperty */ JS_PropertyStub, /* getProperty */ JS_StrictPropertyStub, /* setProperty */ JS_EnumerateStub, diff --git a/js/ipc/ObjectWrapperChild.cpp b/js/ipc/ObjectWrapperChild.cpp index 7c90e3612cb0..7eb823a5440f 100644 --- a/js/ipc/ObjectWrapperChild.cpp +++ b/js/ipc/ObjectWrapperChild.cpp @@ -400,7 +400,7 @@ static const JSClass sCPOW_NewEnumerateState_JSClass = { "CPOW NewEnumerate State", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(sNumNewEnumerateStateSlots), - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CPOW_NewEnumerateState_Finalize diff --git a/js/ipc/ObjectWrapperParent.cpp b/js/ipc/ObjectWrapperParent.cpp index 9a80c99e7690..61a607107328 100644 --- a/js/ipc/ObjectWrapperParent.cpp +++ b/js/ipc/ObjectWrapperParent.cpp @@ -274,6 +274,43 @@ ObjectWrapperParent::jsval_from_JSVariant(JSContext* cx, const JSVariant& from, } } +/*static*/ bool +ObjectWrapperParent::boolean_from_JSVariant(JSContext* cx, const JSVariant& from, + JSBool* to) +{ + switch (from.type()) { + case JSVariant::Tvoid_t: + *to = false; + return true; + case JSVariant::TPObjectWrapperParent: { + JS::Rooted v(cx); + if (!jsval_from_PObjectWrapperParent(cx, from.get_PObjectWrapperParent(), v.address())) + return false; + *to = JS::ToBoolean(v); + return true; + } + case JSVariant::TnsString: + { + JSString* str = JS_NewUCStringCopyZ(cx, from.get_nsString().BeginReading()); + if (!str) + return false; + *to = JS::ToBoolean(JS::StringValue(str)); + return true; + } + case JSVariant::Tint: + *to = from.get_int() != 0; + return true; + case JSVariant::Tdouble: + *to = JS::ToBoolean(JS::DoubleValue(from.get_double())); + return true; + case JSVariant::Tbool: + *to = from.get_bool(); + return true; + default: + return false; + } +} + /*static*/ bool ObjectWrapperParent:: JSObject_to_PObjectWrapperParent(JSContext* cx, JSObject* from, PObjectWrapperParent** to) @@ -432,7 +469,7 @@ ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandl /*static*/ JSBool ObjectWrapperParent::CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, - JSMutableHandleValue vp) + JSBool *succeeded) { CPOW_LOG(("Calling CPOW_DelProperty (%s)...", JSVAL_TO_CSTR(cx, id))); @@ -454,7 +491,7 @@ ObjectWrapperParent::CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandl self->CallDelProperty(in_id, aco.StatusPtr(), &out_v) && aco.Ok() && - jsval_from_JSVariant(cx, out_v, vp.address())); + boolean_from_JSVariant(cx, out_v, succeeded)); } JSBool @@ -691,4 +728,4 @@ ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JSMutab self->CallHasInstance(in_v, aco.StatusPtr(), bp) && aco.Ok()); -} \ No newline at end of file +} diff --git a/js/ipc/ObjectWrapperParent.h b/js/ipc/ObjectWrapperParent.h index a389b52956d9..89b2e5139a70 100644 --- a/js/ipc/ObjectWrapperParent.h +++ b/js/ipc/ObjectWrapperParent.h @@ -63,7 +63,7 @@ private: CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); static JSBool - CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); + CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded); static JSBool CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp); @@ -100,6 +100,8 @@ private: static bool jsval_to_JSVariant(JSContext* cx, jsval from, JSVariant* to); static bool jsval_from_JSVariant(JSContext* cx, const JSVariant& from, jsval* to); + static bool boolean_from_JSVariant(JSContext* cx, const JSVariant& from, + JSBool* to); static bool JSObject_to_PObjectWrapperParent(JSContext* cx, JSObject* from, PObjectWrapperParent** to); static bool diff --git a/js/jsd/jsd_high.cpp b/js/jsd/jsd_high.cpp index 3a7bea446e36..9ba321cd5e1f 100644 --- a/js/jsd/jsd_high.cpp +++ b/js/jsd/jsd_high.cpp @@ -52,7 +52,7 @@ CreateJSDGlobal(JSContext *cx, JSClass *clasp); static JSClass global_class = { "JSDGlobal", JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, global_finalize }; diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index 4b29ed0ed1e5..e7213fc80c9f 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -444,14 +444,14 @@ namespace UInt64 { static JSClass sCTypesGlobalClass = { "ctypes", JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; static JSClass sCABIClass = { "CABI", JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; @@ -461,7 +461,7 @@ static JSClass sCABIClass = { static JSClass sCTypeProtoClass = { "CType", JSCLASS_HAS_RESERVED_SLOTS(CTYPEPROTO_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::FinalizeProtoClass, NULL, ConstructAbstract, NULL, ConstructAbstract }; @@ -471,14 +471,14 @@ static JSClass sCTypeProtoClass = { static JSClass sCDataProtoClass = { "CData", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; static JSClass sCTypeClass = { "CType", JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CTYPE_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::Finalize, NULL, CType::ConstructData, CType::HasInstance, CType::ConstructData, CType::Trace @@ -487,7 +487,7 @@ static JSClass sCTypeClass = { static JSClass sCDataClass = { "CData", JSCLASS_HAS_RESERVED_SLOTS(CDATA_SLOTS), - JS_PropertyStub, JS_PropertyStub, ArrayType::Getter, ArrayType::Setter, + JS_PropertyStub, JS_DeletePropertyStub, ArrayType::Getter, ArrayType::Setter, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CData::Finalize, NULL, FunctionType::Call, NULL, FunctionType::Call }; @@ -495,7 +495,7 @@ static JSClass sCDataClass = { static JSClass sCClosureClass = { "CClosure", JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CCLOSURE_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CClosure::Finalize, NULL, NULL, NULL, NULL, CClosure::Trace }; @@ -506,7 +506,7 @@ static JSClass sCClosureClass = { static JSClass sCDataFinalizerProtoClass = { "CDataFinalizer", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; @@ -519,7 +519,7 @@ static JSClass sCDataFinalizerProtoClass = { static JSClass sCDataFinalizerClass = { "CDataFinalizer", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(CDATAFINALIZER_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CDataFinalizer::Finalize, }; @@ -679,28 +679,28 @@ static JSFunctionSpec sFunctionInstanceFunctions[] = { static JSClass sInt64ProtoClass = { "Int64", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; static JSClass sUInt64ProtoClass = { "UInt64", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; static JSClass sInt64Class = { "Int64", JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize }; static JSClass sUInt64Class = { "UInt64", JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize }; diff --git a/js/src/ctypes/Library.cpp b/js/src/ctypes/Library.cpp index f76221331c25..1c2f8ea7c5ff 100644 --- a/js/src/ctypes/Library.cpp +++ b/js/src/ctypes/Library.cpp @@ -33,7 +33,7 @@ typedef Rooted RootedFlatString; static JSClass sLibraryClass = { "Library", JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize }; diff --git a/js/xpconnect/idl/nsIXPCScriptable.idl b/js/xpconnect/idl/nsIXPCScriptable.idl index 569f3ff42082..4315e4dacdcb 100644 --- a/js/xpconnect/idl/nsIXPCScriptable.idl +++ b/js/xpconnect/idl/nsIXPCScriptable.idl @@ -19,7 +19,7 @@ * boolean to PR_TRUE before making the call. Implementations may skip writing * to *_retval unless they want to return PR_FALSE. */ -[uuid(1236e34a-21e0-423c-a8c8-9b3f1e6d7060)] +[uuid(33b9d098-e680-4e4c-88a2-57cccceac145)] interface nsIXPCScriptable : nsISupports { /* bitflags used for 'flags' (only 32 bits available!) */ @@ -84,8 +84,7 @@ interface nsIXPCScriptable : nsISupports in JSValPtr vp); boolean delProperty(in nsIXPConnectWrappedNative wrapper, - in JSContextPtr cx, in JSObjectPtr obj, in jsid id, - in JSValPtr vp); + in JSContextPtr cx, in JSObjectPtr obj, in jsid id); // The returnCode should be set to NS_SUCCESS_I_DID_SOMETHING if // this method does something. diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index ae12a414638a..1532b39c8f8a 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -81,7 +81,7 @@ static JSClass kFakeBackstagePassJSClass = "FakeBackstagePass", 0, JS_PropertyStub, - JS_PropertyStub, + JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, diff --git a/js/xpconnect/public/xpc_map_end.h b/js/xpconnect/public/xpc_map_end.h index 70c40454cb16..d101c87ceafe 100644 --- a/js/xpconnect/public/xpc_map_end.h +++ b/js/xpconnect/public/xpc_map_end.h @@ -113,7 +113,7 @@ NS_IMETHODIMP XPC_MAP_CLASSNAME::AddProperty(nsIXPConnectWrappedNative *wrapper, #endif #ifndef XPC_MAP_WANT_DELPROPERTY -NS_IMETHODIMP XPC_MAP_CLASSNAME::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsid id, jsval * vp, bool *_retval) +NS_IMETHODIMP XPC_MAP_CLASSNAME::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsid id, bool *_retval) {NS_ERROR("never called"); return NS_ERROR_NOT_IMPLEMENTED;} #endif diff --git a/js/xpconnect/shell/xpcshell.cpp b/js/xpconnect/shell/xpcshell.cpp index 767156623aa8..79492ef16c4e 100644 --- a/js/xpconnect/shell/xpcshell.cpp +++ b/js/xpconnect/shell/xpcshell.cpp @@ -848,7 +848,7 @@ static JSFunctionSpec glob_functions[] = { JSClass global_class = { "global", 0, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr }; @@ -969,7 +969,7 @@ env_resolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags, static JSClass env_class = { "environment", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, env_setProperty, env_enumerate, (JSResolveOp) env_resolve, JS_ConvertStub, nullptr diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 9fc4e3148208..392f083a5f2d 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2992,7 +2992,7 @@ sandbox_convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableHandleV static JSClass SandboxClass = { "Sandbox", XPCONNECT_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, sandbox_enumerate, sandbox_resolve, sandbox_convert, sandbox_finalize, NULL, NULL, NULL, NULL, TraceXPCGlobal }; diff --git a/js/xpconnect/src/XPCJSContextStack.cpp b/js/xpconnect/src/XPCJSContextStack.cpp index cab07993ba79..f1d09ba659da 100644 --- a/js/xpconnect/src/XPCJSContextStack.cpp +++ b/js/xpconnect/src/XPCJSContextStack.cpp @@ -134,7 +134,7 @@ SafeFinalize(JSFreeOp *fop, JSObject* obj) static JSClass global_class = { "global_for_XPCJSContextStack_SafeJSContext", XPCONNECT_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, SafeGlobalResolve, JS_ConvertStub, SafeFinalize, NULL, NULL, NULL, NULL, TraceXPCGlobal }; diff --git a/js/xpconnect/src/XPCQuickStubs.cpp b/js/xpconnect/src/XPCQuickStubs.cpp index d734d27a73dd..8432193d51e2 100644 --- a/js/xpconnect/src/XPCQuickStubs.cpp +++ b/js/xpconnect/src/XPCQuickStubs.cpp @@ -94,7 +94,7 @@ PointerFinalize(JSFreeOp *fop, JSObject *obj) JSClass PointerHolderClass = { "Pointer", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize }; diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 35125019ffeb..de781293e608 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -498,6 +498,13 @@ XPC_WN_CannotModifyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); } +static JSBool +XPC_WN_CantDeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, + JSBool *succeeded) +{ + return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); +} + static JSBool XPC_WN_CannotModifyStrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) @@ -759,7 +766,7 @@ XPCWrappedNativeJSClass XPC_WN_NoHelper_JSClass = { /* Mandatory non-null function pointer members. */ XPC_WN_OnlyIWrite_AddPropertyStub, // addProperty - XPC_WN_CannotModifyPropertyStub, // delProperty + XPC_WN_CantDeletePropertyStub, // delProperty JS_PropertyStub, // getProperty XPC_WN_OnlyIWrite_SetPropertyStub, // setProperty @@ -843,6 +850,21 @@ XPC_WN_MaybeResolvingStrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHan return XPC_WN_MaybeResolvingPropertyStub(cx, obj, id, vp); } +static JSBool +XPC_WN_MaybeResolvingDeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded) +{ + MORPH_SLIM_WRAPPER(cx, obj); + XPCCallContext ccx(JS_CALLER, cx, obj); + XPCWrappedNative* wrapper = ccx.GetWrapper(); + THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper); + + if (ccx.GetResolvingWrapper() == wrapper) { + *succeeded = true; + return true; + } + return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx); +} + // macro fun! #define PRE_HELPER_STUB_NO_SLIM \ XPCWrappedNative* wrapper = \ @@ -891,10 +913,10 @@ XPC_WN_Helper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, static JSBool XPC_WN_Helper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, - JSMutableHandleValue vp) + JSBool *succeeded) { PRE_HELPER_STUB - DelProperty(wrapper, cx, obj, id, vp.address(), &retval); + DelProperty(wrapper, cx, obj, id, &retval); POST_HELPER_STUB } @@ -1311,15 +1333,15 @@ XPCNativeScriptableShared::PopulateJSClass() addProperty = XPC_WN_CannotModifyPropertyStub; mJSClass.base.addProperty = addProperty; - JSPropertyOp delProperty; + JSDeletePropertyOp delProperty; if (mFlags.WantDelProperty()) delProperty = XPC_WN_Helper_DelProperty; else if (mFlags.UseJSStubForDelProperty()) - delProperty = JS_PropertyStub; + delProperty = JS_DeletePropertyStub; else if (mFlags.AllowPropModsDuringResolve()) - delProperty = XPC_WN_MaybeResolvingPropertyStub; + delProperty = XPC_WN_MaybeResolvingDeletePropertyStub; else - delProperty = XPC_WN_CannotModifyPropertyStub; + delProperty = XPC_WN_CantDeletePropertyStub; mJSClass.base.delProperty = delProperty; if (mFlags.WantGetProperty()) @@ -1610,7 +1632,7 @@ js::Class XPC_WN_ModsAllowed_WithCall_Proto_JSClass = { /* Mandatory non-null function pointer members. */ JS_PropertyStub, // addProperty; - JS_PropertyStub, // delProperty; + JS_DeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; JS_StrictPropertyStub, // setProperty; XPC_WN_Shared_Proto_Enumerate, // enumerate; @@ -1635,7 +1657,7 @@ js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = { /* Mandatory non-null function pointer members. */ JS_PropertyStub, // addProperty; - JS_PropertyStub, // delProperty; + JS_DeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; JS_StrictPropertyStub, // setProperty; XPC_WN_Shared_Proto_Enumerate, // enumerate; @@ -1724,7 +1746,7 @@ js::Class XPC_WN_NoMods_WithCall_Proto_JSClass = { /* Mandatory non-null function pointer members. */ XPC_WN_OnlyIWrite_Proto_AddPropertyStub, // addProperty; - XPC_WN_CannotModifyPropertyStub, // delProperty; + XPC_WN_CantDeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty; XPC_WN_Shared_Proto_Enumerate, // enumerate; @@ -1749,7 +1771,7 @@ js::Class XPC_WN_NoMods_NoCall_Proto_JSClass = { /* Mandatory non-null function pointer members. */ XPC_WN_OnlyIWrite_Proto_AddPropertyStub, // addProperty; - XPC_WN_CannotModifyPropertyStub, // delProperty; + XPC_WN_CantDeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty; XPC_WN_Shared_Proto_Enumerate, // enumerate; @@ -1830,7 +1852,7 @@ js::Class XPC_WN_Tearoff_JSClass = { WRAPPER_SLOTS, // flags; XPC_WN_OnlyIWrite_AddPropertyStub, // addProperty; - XPC_WN_CannotModifyPropertyStub, // delProperty; + XPC_WN_CantDeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; XPC_WN_OnlyIWrite_SetPropertyStub, // setProperty; XPC_WN_TearOff_Enumerate, // enumerate; diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 488b8a4eace3..9593accc82da 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -301,7 +301,7 @@ js::Class XPC_WN_NoHelper_Proto_JSClass = { /* Mandatory non-null function pointer members. */ JS_PropertyStub, // addProperty; - JS_PropertyStub, // delProperty; + JS_DeletePropertyStub, // delProperty; JS_PropertyStub, // getProperty; JS_StrictPropertyStub, // setProperty; JS_EnumerateStub, // enumerate; diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index b3e6098e1fbf..d76dc37f9a68 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -42,7 +42,7 @@ namespace XrayUtils { JSClass HolderClass = { "NativePropertyHolder", JSCLASS_HAS_RESERVED_SLOTS(2), - JS_PropertyStub, JS_PropertyStub, holder_get, holder_set, + JS_PropertyStub, JS_DeletePropertyStub, holder_get, holder_set, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; } @@ -320,7 +320,7 @@ ExpandoObjectFinalize(JSFreeOp *fop, JSObject *obj) JSClass ExpandoObjectClass = { "XrayExpandoObject", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_EXPANDO_COUNT), - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ExpandoObjectFinalize }; diff --git a/netwerk/base/src/ProxyAutoConfig.cpp b/netwerk/base/src/ProxyAutoConfig.cpp index 5727b39a8891..dec6ca456149 100644 --- a/netwerk/base/src/ProxyAutoConfig.cpp +++ b/netwerk/base/src/ProxyAutoConfig.cpp @@ -549,7 +549,7 @@ private: JSClass JSRuntimeWrapper::sGlobalClass = { "PACResolutionThreadGlobal", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp index 1e78ec85263a..c5f07486e971 100644 --- a/startupcache/test/TestStartupCache.cpp +++ b/startupcache/test/TestStartupCache.cpp @@ -514,7 +514,7 @@ int main(int argc, char** argv) JSAutoRequest req(cx); static JSClass global_class = { "global", JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index c80725fc5234..222c96496660 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -694,7 +694,7 @@ WrapAndReturnHistogram(Histogram *h, JSContext *cx, JS::Value *ret) static JSClass JSHistogram_class = { "JSHistogram", /* name */ JSCLASS_HAS_PRIVATE, /* flags */ - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; diff --git a/tools/profiler/SaveProfileTask.h b/tools/profiler/SaveProfileTask.h index 9e9d4ea561f4..afe8a0f94261 100644 --- a/tools/profiler/SaveProfileTask.h +++ b/tools/profiler/SaveProfileTask.h @@ -82,7 +82,7 @@ public: JSAutoRequest ar(cx); static JSClass c = { "global", JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub }; JSObject *obj = JS_NewGlobalObject(cx, &c, NULL); From 4b45f8cdcd155cc17dc9e4d96558c0b604dedd1e Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Mon, 15 Apr 2013 16:26:06 -0700 Subject: [PATCH 127/438] Backed out 2 changesets (bug 860572) for OSX build breakage Backed out changeset d02e437f5b48 (bug 860572) Backed out changeset c849d14e7f59 (bug 860572) --- js/src/gc/RootMarking.cpp | 33 ++++----- js/src/gc/Verifier.cpp | 17 ++--- js/src/jsapi.h | 104 +---------------------------- js/src/jspubtd.h | 1 - js/xpconnect/src/XPCComponents.cpp | 10 +-- 5 files changed, 23 insertions(+), 142 deletions(-) diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index 4b55a109c40d..2f6e71da4ce6 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -68,7 +68,6 @@ MarkExactStackRoot(JSTracer *trc, Rooted *rooter, ThingRootKind kind) case THING_ROOT_ID: MarkIdRoot(trc, (jsid *)addr, "exact-id"); break; case THING_ROOT_PROPERTY_ID: MarkIdRoot(trc, &((js::PropertyId *)addr)->asId(), "exact-propertyid"); break; case THING_ROOT_BINDINGS: ((Bindings *)addr)->trace(trc); break; - case THING_ROOT_PROPERTY_DESCRIPTOR: ((JSPropertyDescriptor *)addr)->trace(trc); break; default: JS_NOT_REACHED("Invalid THING_ROOT kind"); break; } } @@ -417,7 +416,19 @@ AutoGCRooter::trace(JSTracer *trc) case DESCRIPTOR : { PropertyDescriptor &desc = *static_cast(this); - desc.trace(trc); + if (desc.obj) + MarkObjectRoot(trc, &desc.obj, "Descriptor::obj"); + MarkValueRoot(trc, &desc.value, "Descriptor::value"); + if ((desc.attrs & JSPROP_GETTER) && desc.getter) { + JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, desc.getter); + MarkObjectRoot(trc, &tmp, "Descriptor::get"); + desc.getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, tmp); + } + if (desc.attrs & JSPROP_SETTER && desc.setter) { + JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, desc.setter); + MarkObjectRoot(trc, &tmp, "Descriptor::set"); + desc.setter = JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, tmp); + } return; } @@ -638,24 +649,6 @@ StackShape::AutoRooter::trace(JSTracer *trc) MarkIdRoot(trc, (jsid*) &shape->propid, "StackShape::AutoRooter id"); } -void -JSPropertyDescriptor::trace(JSTracer *trc) -{ - if (obj) - MarkObjectRoot(trc, &obj, "Descriptor::obj"); - MarkValueRoot(trc, &value, "Descriptor::value"); - if ((attrs & JSPROP_GETTER) && getter) { - JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, getter); - MarkObjectRoot(trc, &tmp, "Descriptor::get"); - getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, tmp); - } - if ((attrs & JSPROP_SETTER) && setter) { - JSObject *tmp = JS_FUNC_TO_DATA_PTR(JSObject *, setter); - MarkObjectRoot(trc, &tmp, "Descriptor::set"); - setter = JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, tmp); - } -} - void js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots) { diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 0b20188f9b40..2a45d31f7b6e 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -30,23 +30,14 @@ using namespace mozilla; #if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE) -template -bool -CheckNonAddressThing(uintptr_t *w, T *t) -{ - return w >= (uintptr_t*)t && w < (uintptr_t*)(t + 1); -} - JS_ALWAYS_INLINE bool CheckStackRootThing(uintptr_t *w, void *address, ThingRootKind kind) { - if (kind == THING_ROOT_BINDINGS) - return CheckNonAddressThing(w, static_cast(address)); + if (kind != THING_ROOT_BINDINGS) + return address == static_cast(w); - if (kind == THING_ROOT_PROPERTY_DESCRIPTOR) - return CheckNonAddressThing(w, static_cast(address)); - - return address == static_cast(w); + Bindings *bp = static_cast(address); + return w >= (uintptr_t*)bp && w < (uintptr_t*)(bp + 1); } struct Rooter { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 11c78a73db90..846073b1386d 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3326,115 +3326,13 @@ struct JSPropertyDescriptor { unsigned shortid; JSPropertyOp getter; JSStrictPropertyOp setter; - JS::Value value; + jsval value; JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL), setter(NULL), value(JSVAL_VOID) {} - - void trace(JSTracer *trc); }; -namespace JS { - -template -class PropertyDescriptorOperations -{ - const JSPropertyDescriptor * desc() const { return static_cast(this)->extract(); } - JSPropertyDescriptor * desc() { return static_cast(this)->extract(); } - - public: - bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; } - bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; } - bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; } - bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; } - bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; } - bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; } - bool isShared() const { return desc()->attrs & JSPROP_SHARED; } - bool isIndex() const { return desc()->attrs & JSPROP_INDEX; } - bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; } - bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; } - - JS::MutableHandleObject obj() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); } - unsigned attributes() const { return desc()->attrs; } - unsigned shortid() const { - MOZ_ASSERT(hasShortId()); - return desc()->shortid; - } - JSPropertyOp getter() const { MOZ_ASSERT(!hasGetterObject()); return desc()->getter; } - JSStrictPropertyOp setter() const { MOZ_ASSERT(!hasSetterObject()); return desc()->setter; } - JS::HandleObject getterObject() const { - MOZ_ASSERT(hasGetterObject()); - return JS::HandleObject::fromMarkedLocation(reinterpret_cast(&desc()->getter)); - } - JS::HandleObject setterObject() const { - MOZ_ASSERT(hasSetterObject()); - return JS::HandleObject::fromMarkedLocation(reinterpret_cast(&desc()->setter)); - } - JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); } - - void setAttributes(unsigned attrs) { desc()->attrs = attrs; } - void setShortId(unsigned shortid) { desc()->shortid = shortid; } - void setGetter(JSPropertyOp op) { desc->getter = op; } - void setSetter(JSStrictPropertyOp op) { desc->setter = op; } - void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast(obj); } - void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast(obj); } -}; - -} /* namespace JS */ - -namespace js { - -template <> -struct RootMethods { - static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); } - static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; } - static bool poisoned(const JSPropertyDescriptor &desc) { - return (desc.obj && JS::IsPoisonedPtr(desc.obj)) || - (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) || - (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) || - (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing())); - } -}; - -template <> -class RootedBase - : public JS::PropertyDescriptorOperations > -{ - friend class JS::PropertyDescriptorOperations >; - const JSPropertyDescriptor *extract() const { - return static_cast*>(this)->address(); - } - JSPropertyDescriptor *extract() { - return static_cast*>(this)->address(); - } -}; - -template <> -class HandleBase - : public JS::PropertyDescriptorOperations > -{ - friend class JS::PropertyDescriptorOperations >; - const JSPropertyDescriptor *extract() const { - return static_cast*>(this)->address(); - } -}; - -template <> -class MutableHandleBase - : public JS::PropertyDescriptorOperations > -{ - friend class JS::PropertyDescriptorOperations >; - const JSPropertyDescriptor *extract() const { - return static_cast*>(this)->address(); - } - JSPropertyDescriptor *extract() { - return static_cast*>(this)->address(); - } -}; - -} /* namespace js */ - /* * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on * an object on the prototype chain (returned in objp). If data->obj is null, diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 5dd1c718d750..2159dd4f6cc6 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -244,7 +244,6 @@ enum ThingRootKind THING_ROOT_VALUE, THING_ROOT_TYPE, THING_ROOT_BINDINGS, - THING_ROOT_PROPERTY_DESCRIPTOR, THING_ROOT_LIMIT }; diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 392f083a5f2d..0bb740a91e91 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2709,15 +2709,15 @@ nsXPCComponents_Utils::LookupMethod(const JS::Value& object, // Alright, now do the lookup. *retval = JSVAL_VOID; - Rooted desc(cx); - if (!JS_GetPropertyDescriptorById(cx, xray, methodId, 0, desc.address())) + JSPropertyDescriptor desc; + if (!JS_GetPropertyDescriptorById(cx, xray, methodId, 0, &desc)) return NS_ERROR_FAILURE; // First look for a method value. If that's not there, try a getter, // since historically lookupMethod also works for getters. - JSObject *methodObj = desc.value().isObject() ? &desc.value().toObject() : NULL; - if (!methodObj && desc.hasGetterObject()) - methodObj = desc.getterObject(); + JSObject *methodObj = desc.value.isObject() ? &desc.value.toObject() : NULL; + if (!methodObj && (desc.attrs & JSPROP_GETTER)) + methodObj = JS_FUNC_TO_DATA_PTR(JSObject *, desc.getter); // Callers of this function seem to expect bound methods. Make it happen. // Note that this is unnecessary until bug 658909 is fixed. From 26c10590c488d3bc226dbcccd5f3212e2847b2d2 Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Mon, 15 Apr 2013 16:43:59 -0700 Subject: [PATCH 128/438] Bug 813418 - Backout fe8c74e402bc due to bustage CLOSED TREE --- security/manager/ssl/src/nsNSSCertificate.cpp | 39 +---- .../manager/ssl/src/nsNSSCertificateDB.cpp | 10 +- .../manager/ssl/src/nsUsageArrayHelper.cpp | 135 +++++++++++++++--- 3 files changed, 125 insertions(+), 59 deletions(-) diff --git a/security/manager/ssl/src/nsNSSCertificate.cpp b/security/manager/ssl/src/nsNSSCertificate.cpp index 66e8ac71c8f8..5ea2da7d5558 100644 --- a/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/security/manager/ssl/src/nsNSSCertificate.cpp @@ -825,45 +825,8 @@ nsNSSCertificate::GetChain(nsIArray **_rvChain) nsresult rv; /* Get the cert chain from NSS */ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Getting chain for \"%s\"\n", mCert->nickname)); - ScopedCERTCertList nssChain; - SECStatus srv; - nssChain = nullptr; - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); - CERTCertList *pkixNssChain = nullptr; - - // We want to test all usages, but we start with server because most of the - // time Firefox users care about server certs. - srv = certVerifier->VerifyCert(mCert, - certificateUsageSSLServer, PR_Now(), - nullptr, /*XXX fixme*/ - CertVerifier::FLAG_LOCAL_ONLY, - &pkixNssChain); - for (int usage = certificateUsageSSLClient; - usage < certificateUsageAnyCA && !pkixNssChain; - usage = usage << 1) { - if (usage == certificateUsageSSLServer) { - continue; - } - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: PKIX attempting chain(%d) for '%s'\n",usage, mCert->nickname)); - srv = certVerifier->VerifyCert(mCert, - certificateUsageSSLClient, PR_Now(), - nullptr, /*XXX fixme*/ - CertVerifier::FLAG_LOCAL_ONLY, - &pkixNssChain); - } - - if (!pkixNssChain) { - // There is not verified path for the chain, howeever we still want to - // present to the user as much of a possible chain as possible, in the case - // where there was a problem with the cert or the issuers. - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("pipnss: getchain :CertVerify failed to get chain for '%s'\n", mCert->nickname)); - nssChain = CERT_GetCertChainFromCert(mCert, PR_Now(), certUsageSSLClient); - } else { - nssChain = pkixNssChain; - } - + nssChain = CERT_GetCertChainFromCert(mCert, PR_Now(), certUsageSSLClient); if (!nssChain) return NS_ERROR_FAILURE; /* enumerate the chain for scripting purposes */ diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index f4283e0a5230..9debd7ed20ee 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -487,20 +487,20 @@ ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCe CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); const PRTime now = PR_Now(); - int chainLen = 0; + int chainLen=0; + for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); !CERT_LIST_END(chainNode, certChain); chainNode = CERT_LIST_NEXT(chainNode)) { chainLen++; } - SECItem **rawArray; rawArray = (SECItem **) PORT_Alloc(chainLen * sizeof(SECItem *)); if (!rawArray) { return SECFailure; } - int i = 0; + int i=0; for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); !CERT_LIST_END(chainNode, certChain); chainNode = CERT_LIST_NEXT(chainNode), i++) { @@ -509,7 +509,9 @@ ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCe CERT_ImportCerts(certdb, usage, chainLen, rawArray, nullptr, true, caOnly, nullptr); - PORT_Free(rawArray); + PORT_Free(rawArray); + + return SECSuccess; } diff --git a/security/manager/ssl/src/nsUsageArrayHelper.cpp b/security/manager/ssl/src/nsUsageArrayHelper.cpp index 34b5efdb58a8..38c497d51063 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp @@ -32,6 +32,66 @@ nsUsageArrayHelper::nsUsageArrayHelper(CERTCertificate *aCert) nssComponent = do_GetService(kNSSComponentCID, &m_rv); } +// XXX: old, non-libpkix version of check that will be removed after the switch +// to libpkix is final. +void +nsUsageArrayHelper::check(const char *suffix, + SECCertificateUsage aCertUsage, + uint32_t &aCounter, + PRUnichar **outUsages) +{ + if (!aCertUsage) return; + nsAutoCString typestr; + switch (aCertUsage) { + case certificateUsageSSLClient: + typestr = "VerifySSLClient"; + break; + case certificateUsageSSLServer: + typestr = "VerifySSLServer"; + break; + case certificateUsageSSLServerWithStepUp: + typestr = "VerifySSLStepUp"; + break; + case certificateUsageEmailSigner: + typestr = "VerifyEmailSigner"; + break; + case certificateUsageEmailRecipient: + typestr = "VerifyEmailRecip"; + break; + case certificateUsageObjectSigner: + typestr = "VerifyObjSign"; + break; + case certificateUsageProtectedObjectSigner: + typestr = "VerifyProtectObjSign"; + break; + case certificateUsageUserCertImport: + typestr = "VerifyUserImport"; + break; + case certificateUsageSSLCA: + typestr = "VerifySSLCA"; + break; + case certificateUsageVerifyCA: + typestr = "VerifyCAVerifier"; + break; + case certificateUsageStatusResponder: + typestr = "VerifyStatusResponder"; + break; + case certificateUsageAnyCA: + typestr = "VerifyAnyCA"; + break; + default: + break; + } + if (!typestr.IsEmpty()) { + typestr.Append(suffix); + nsAutoString verifyDesc; + m_rv = nssComponent->GetPIPNSSBundleString(typestr.get(), verifyDesc); + if (NS_SUCCEEDED(m_rv)) { + outUsages[aCounter++] = ToNewUnicode(verifyDesc); + } + } +} + namespace { // Some validation errors are non-fatal in that, we should keep checking the @@ -199,21 +259,67 @@ nsUsageArrayHelper::GetUsagesArray(const char *suffix, if (outArraySize < max_returned_out_array_size) return NS_ERROR_FAILURE; - // Bug 860076, this disabling ocsp for all NSS is incorrect. - if (!nsNSSComponent::globalConstFlagUsePKIXVerification && localOnly) { - nsresult rv; - nssComponent = do_GetService(kNSSComponentCID, &rv); - if (NS_FAILED(rv)) - return rv; - - if (nssComponent) { - nssComponent->SkipOcsp(); - } - } - uint32_t &count = *_count; count = 0; +// TODO: This block will be removed as soon as the switch to libpkix is +// complete. +if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + if (localOnly) { + nssComponent->SkipOcsp(); + } + + SECCertificateUsage usages = 0; + int err = 0; + + // CERT_VerifyCertificateNow returns SECFailure unless the certificate is + // valid for all the given usages. Hoewver, we are only looking for the list + // of usages for which the cert *is* valid. + (void) + CERT_VerifyCertificateNow(defaultcertdb, mCert, true, + certificateUsageSSLClient | + certificateUsageSSLServer | + certificateUsageSSLServerWithStepUp | + certificateUsageEmailSigner | + certificateUsageEmailRecipient | + certificateUsageObjectSigner | + certificateUsageSSLCA | + certificateUsageStatusResponder, + nullptr, &usages); + err = PR_GetError(); + + if (localOnly) { + nssComponent->SkipOcspOff(); + } + + // The following list of checks must be < max_returned_out_array_size + + check(suffix, usages & certificateUsageSSLClient, count, outUsages); + check(suffix, usages & certificateUsageSSLServer, count, outUsages); + check(suffix, usages & certificateUsageEmailSigner, count, outUsages); + check(suffix, usages & certificateUsageEmailRecipient, count, outUsages); + check(suffix, usages & certificateUsageObjectSigner, count, outUsages); +#if 0 + check(suffix, usages & certificateUsageProtectedObjectSigner, count, outUsages); + check(suffix, usages & certificateUsageUserCertImport, count, outUsages); +#endif + check(suffix, usages & certificateUsageSSLCA, count, outUsages); +#if 0 + check(suffix, usages & certificateUsageVerifyCA, count, outUsages); +#endif + check(suffix, usages & certificateUsageStatusResponder, count, outUsages); +#if 0 + check(suffix, usages & certificateUsageAnyCA, count, outUsages); +#endif + + if (count == 0) { + verifyFailed(_verified, err); + } else { + *_verified = nsNSSCertificate::VERIFIED_OK; + } + return NS_OK; +} + RefPtr certVerifier(GetDefaultCertVerifier()); NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); @@ -253,11 +359,6 @@ nsUsageArrayHelper::GetUsagesArray(const char *suffix, certificateUsageAnyCA, now, flags, count, outUsages); #endif - // Bug 860076, this disabling ocsp for all NSS is incorrect - if (!nsNSSComponent::globalConstFlagUsePKIXVerification && localOnly) { - nssComponent->SkipOcspOff(); - } - if (isFatalError(result) || count == 0) { MOZ_ASSERT(result != nsIX509Cert::VERIFIED_OK); From 181f3b3cb5e5803fd94eae3c8f63f5f50d616e77 Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Mon, 15 Apr 2013 16:44:38 -0700 Subject: [PATCH 129/438] Bug 813418 - Backout 7bcdee03b55 due to bustage CLOSED TREE --- security/manager/ssl/src/CertVerifier.cpp | 14 +-- .../ssl/src/SSLServerCertVerification.cpp | 82 ++++++------ .../manager/ssl/src/nsIdentityChecking.cpp | 4 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 119 ++++++++++-------- security/manager/ssl/src/nsNSSComponent.cpp | 6 +- 5 files changed, 119 insertions(+), 106 deletions(-) diff --git a/security/manager/ssl/src/CertVerifier.cpp b/security/manager/ssl/src/CertVerifier.cpp index 355f85cdf7a8..6b021a8e01d7 100644 --- a/security/manager/ssl/src/CertVerifier.cpp +++ b/security/manager/ssl/src/CertVerifier.cpp @@ -217,12 +217,12 @@ CertVerifier::VerifyCert(CERTCertificate * cert, if (evPolicy != SEC_OID_UNKNOWN) { // EV setup! - // XXX 859872 The current flags are not quite correct. (use - // of ocsp flags for crl preferences). + // This flags are not quite correct, but it is what we have now, so keeping + // them identical for bug landing purposes. Should be fixed later! uint64_t revMethodFlags = CERT_REV_M_TEST_USING_THIS_METHOD - | ((mOCSPDownloadEnabled && !localOnly) ? - CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) + | (mOCSPDownloadEnabled ? CERT_REV_M_ALLOW_NETWORK_FETCHING + : CERT_REV_M_FORBID_NETWORK_FETCHING) | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE | CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE | CERT_REV_M_IGNORE_MISSING_FRESH_INFO @@ -371,7 +371,6 @@ pkix_done: if (rv == SECSuccess) { if (! cvout[validationChainLocation].value.pointer.chain) { - PR_SetError(PR_UNKNOWN_ERROR, 0); return SECFailure; } PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: I have a chain\n")); @@ -383,8 +382,8 @@ pkix_done: if (!CERT_CompareCerts(trustAnchor, cert)) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("VerifyCert: adding issuer to tail for display\n")); // note: rv is reused to catch errors on cert creation! - ScopedCERTCertificate tempCert(CERT_DupCertificate(trustAnchor)); - rv = CERT_AddCertToListTail(*validationChain, tempCert); + rv = CERT_AddCertToListTail(*validationChain, + CERT_DupCertificate(trustAnchor)); if (rv != SECSuccess) { CERT_DestroyCertList(*validationChain); *validationChain = nullptr; @@ -398,7 +397,6 @@ pkix_done: } } } - return rv; } diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index a212c2b4954f..773189a2305a 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -478,14 +478,16 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, PRTime now = PR_Now(); - PLArenaPool *log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); + PLArenaPool *log_arena = nullptr; PLArenaPoolCleanerFalseParam log_arena_cleaner(log_arena); + CERTVerifyLog * verify_log = nullptr; + + log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!log_arena) { NS_ERROR("PORT_NewArena failed"); return nullptr; // PORT_NewArena set error code } - - CERTVerifyLog * verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); + verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); if (!verify_log) { NS_ERROR("PORT_ArenaZNew failed"); return nullptr; // PORT_ArenaZNew set error code @@ -494,7 +496,7 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, verify_log->arena = log_arena; srv = certVerifier->VerifyCert(cert, certificateUsageSSLServer, now, - infoObject, 0, nullptr, nullptr, verify_log); + infoObject, 0, nullptr, nullptr, verify_log); // We ignore the result code of the cert verification. // Either it is a failure, which is expected, and we'll process the @@ -519,40 +521,44 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, errorCodeMismatch = SSL_ERROR_BAD_CERT_DOMAIN; } - CERTVerifyLogNode *i_node; - for (i_node = verify_log->head; i_node; i_node = i_node->next) - { - switch (i_node->error) + if (verify_log) { + CERTVerifyLogNode *i_node; + for (i_node = verify_log->head; i_node; i_node = i_node->next) { - case SEC_ERROR_UNKNOWN_ISSUER: - case SEC_ERROR_CA_CERT_INVALID: - case SEC_ERROR_UNTRUSTED_ISSUER: - case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: - case SEC_ERROR_UNTRUSTED_CERT: - case SEC_ERROR_INADEQUATE_KEY_USAGE: - case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: - // We group all these errors as "cert not trusted" - collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; - if (errorCodeTrust == SECSuccess) { - errorCodeTrust = i_node->error; - } - break; - case SSL_ERROR_BAD_CERT_DOMAIN: - collected_errors |= nsICertOverrideService::ERROR_MISMATCH; - if (errorCodeMismatch == SECSuccess) { - errorCodeMismatch = i_node->error; - } - break; - case SEC_ERROR_EXPIRED_CERTIFICATE: - collected_errors |= nsICertOverrideService::ERROR_TIME; - if (errorCodeExpired == SECSuccess) { - errorCodeExpired = i_node->error; - } - break; - default: - PR_SetError(i_node->error, 0); - return nullptr; + switch (i_node->error) + { + case SEC_ERROR_UNKNOWN_ISSUER: + case SEC_ERROR_CA_CERT_INVALID: + case SEC_ERROR_UNTRUSTED_ISSUER: + case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + case SEC_ERROR_UNTRUSTED_CERT: + case SEC_ERROR_INADEQUATE_KEY_USAGE: + case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: + // We group all these errors as "cert not trusted" + collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; + if (errorCodeTrust == SECSuccess) { + errorCodeTrust = i_node->error; + } + break; + case SSL_ERROR_BAD_CERT_DOMAIN: + collected_errors |= nsICertOverrideService::ERROR_MISMATCH; + if (errorCodeMismatch == SECSuccess) { + errorCodeMismatch = i_node->error; + } + break; + case SEC_ERROR_EXPIRED_CERTIFICATE: + collected_errors |= nsICertOverrideService::ERROR_TIME; + if (errorCodeExpired == SECSuccess) { + errorCodeExpired = i_node->error; + } + break; + default: + PR_SetError(i_node->error, 0); + return nullptr; + } } + } else { + // XXX set errorCodeTrust, errorCodeMismatch, errorCodeExpired, collected_errors } if (!collected_errors) @@ -890,8 +896,8 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } } - ScopedCERTCertList certList(verifyCertChain); - + ScopedCERTCertList certList(CERT_GetCertChainFromCert(cert, PR_Now(), + certUsageSSLCA)); if (!certList) { rv = SECFailure; } else { diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index 52fc227df540..80e4e5797344 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -1038,7 +1038,7 @@ getRootsForOid(SECOidTag oid_tag) return certList; } -} } // namespace mozilla::psm +}} static bool isApprovedForEV(SECOidTag policyOIDTag, CERTCertificate *rootCert) @@ -1181,7 +1181,7 @@ SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) return SECFailure; } -} } // namespace mozilla::psm +}} NS_IMETHODIMP nsSSLStatus::GetIsExtendedValidation(bool* aIsEV) diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index 9debd7ed20ee..ade4fdb62a8a 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -32,6 +32,7 @@ #include "nsComponentManagerUtils.h" #include "nsIPrompt.h" #include "nsThreadUtils.h" +#include "ScopedNSSTypes.h" #include "nsIObserverService.h" #include "nsRecentBadCerts.h" #include "SharedSSLState.h" @@ -479,42 +480,6 @@ nsNSSCertificateDB::ImportCertificates(uint8_t * data, uint32_t length, return nsrv; } -static -SECStatus -ImportCertsIntoPermanentStorage(const ScopedCERTCertList &certChain, const SECCertUsage usage, - const PRBool caOnly) -{ - CERTCertDBHandle *certdb = CERT_GetDefaultCertDB(); - const PRTime now = PR_Now(); - - int chainLen=0; - - for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); - !CERT_LIST_END(chainNode, certChain); - chainNode = CERT_LIST_NEXT(chainNode)) { - chainLen++; - } - SECItem **rawArray; - rawArray = (SECItem **) PORT_Alloc(chainLen * sizeof(SECItem *)); - if (!rawArray) { - return SECFailure; - } - - int i=0; - for (CERTCertListNode *chainNode = CERT_LIST_HEAD(certChain); - !CERT_LIST_END(chainNode, certChain); - chainNode = CERT_LIST_NEXT(chainNode), i++) { - rawArray[i] = &chainNode->cert->derCert; - } - CERT_ImportCerts(certdb, usage, chainLen, - rawArray, nullptr, true, caOnly, nullptr); - - PORT_Free(rawArray); - - - return SECSuccess; -} - /* * [noscript] void importEmailCertificates(in charPtr data, in unsigned long length, @@ -597,29 +562,53 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, !CERT_LIST_END(node,certList); node = CERT_LIST_NEXT(node)) { + bool alert_and_skip = false; + if (!node->cert) { continue; } - CERTCertList *verifyCertChain = nullptr; - SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageEmailRecipient, - now, ctx, 0, &verifyCertChain); - - ScopedCERTCertList certChain(verifyCertChain); - + now, ctx); if (rv != SECSuccess) { + alert_and_skip = true; + } + + ScopedCERTCertificateList certChain; + + if (!alert_and_skip) { + certChain = CERT_CertChainFromCert(node->cert, certUsageEmailRecipient, + false); + if (!certChain) { + alert_and_skip = true; + } + } + + if (alert_and_skip) { nsCOMPtr certToShow = nsNSSCertificate::Create(node->cert); DisplayCertificateAlert(ctx, "NotImportingUnverifiedCert", certToShow); continue; } - rv = ImportCertsIntoPermanentStorage(certChain, certUsageEmailRecipient, false); - if (rv != SECSuccess) { - goto loser; - } + + /* + * CertChain returns an array of SECItems, import expects an array of + * SECItem pointers. Create the SECItem Pointers from the array of + * SECItems. + */ + rawArray = (SECItem **) PORT_Alloc(certChain->len * sizeof(SECItem *)); + if (!rawArray) { + continue; + } + for (i=0; i < certChain->len; i++) { + rawArray[i] = &certChain->certs[i]; + } + CERT_ImportCerts(certdb, certUsageEmailRecipient, certChain->len, + rawArray, nullptr, true, false, nullptr); + CERT_SaveSMimeProfile(node->cert, nullptr, nullptr); + PORT_Free(rawArray); } loser: @@ -768,21 +757,45 @@ nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfac !CERT_LIST_END(node,certList); node = CERT_LIST_NEXT(node)) { - //bool alert_and_skip = false; - CERTCertList *verifyCertChain = nullptr; + bool alert_and_skip = false; SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageVerifyCA, - PR_Now(), ctx, 0, &verifyCertChain); - - ScopedCERTCertList certChain(verifyCertChain); - + PR_Now(), ctx); if (rv != SECSuccess) { + alert_and_skip = true; + } + + ScopedCERTCertificateList certChain; + + if (!alert_and_skip) { + certChain = CERT_CertChainFromCert(node->cert, certUsageAnyCA, false); + if (!certChain) { + alert_and_skip = true; + } + } + + if (alert_and_skip) { nsCOMPtr certToShow = nsNSSCertificate::Create(node->cert); DisplayCertificateAlert(ctx, "NotImportingUnverifiedCert", certToShow); continue; } - ImportCertsIntoPermanentStorage(certChain, certUsageAnyCA, true); + /* + * CertChain returns an array of SECItems, import expects an array of + * SECItem pointers. Create the SECItem Pointers from the array of + * SECItems. + */ + rawArray = (SECItem **) PORT_Alloc(certChain->len * sizeof(SECItem *)); + if (!rawArray) { + continue; + } + for (int i=0; i < certChain->len; i++) { + rawArray[i] = &certChain->certs[i]; + } + CERT_ImportCerts(CERT_GetDefaultCertDB(), certUsageAnyCA, certChain->len, + rawArray, nullptr, true, true, nullptr); + + PORT_Free(rawArray); } return NS_OK; diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index 247a36be2cfe..57f8ac0528f4 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -2048,13 +2048,9 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, GetDecryptKeyCallback, nullptr, DecryptionAllowedCallback); - if (!p7_info) { - return NS_ERROR_FAILURE; - } - // Make sure we call SEC_PKCS7DestroyContentInfo after this point; // otherwise we leak data in p7_info - + //-- If a plaintext was provided, hash it. SECItem digest; digest.data = nullptr; From 915e0525f7e4c1f57b57a25a9a9229ebee3f9a3d Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Mon, 15 Apr 2013 16:45:11 -0700 Subject: [PATCH 130/438] Bug 813418 - Backout 2f47fcb0a648 due to bustage CLOSED TREE --- security/manager/ssl/src/CertVerifier.h | 65 ------- security/manager/ssl/src/CryptoUtil.h | 13 -- security/manager/ssl/src/Makefile.in | 2 +- .../ssl/src/SSLServerCertVerification.cpp | 168 ++++++++++-------- .../ssl/src/nsCERTValInParamWrapper.cpp | 126 +++++++++++++ .../manager/ssl/src/nsCERTValInParamWrapper.h | 71 ++++++++ security/manager/ssl/src/nsCMS.cpp | 46 +++-- .../manager/ssl/src/nsIdentityChecking.cpp | 116 +++++++++--- security/manager/ssl/src/nsNSSCertificate.cpp | 50 +++--- security/manager/ssl/src/nsNSSCertificate.h | 4 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 114 ++++++++---- security/manager/ssl/src/nsNSSComponent.cpp | 56 ++++-- security/manager/ssl/src/nsNSSComponent.h | 24 ++- .../manager/ssl/src/nsUsageArrayHelper.cpp | 71 ++++---- security/manager/ssl/src/nsUsageArrayHelper.h | 8 +- 15 files changed, 623 insertions(+), 311 deletions(-) delete mode 100644 security/manager/ssl/src/CertVerifier.h delete mode 100644 security/manager/ssl/src/CryptoUtil.h create mode 100644 security/manager/ssl/src/nsCERTValInParamWrapper.cpp create mode 100644 security/manager/ssl/src/nsCERTValInParamWrapper.h diff --git a/security/manager/ssl/src/CertVerifier.h b/security/manager/ssl/src/CertVerifier.h deleted file mode 100644 index 96dbd5441cbd..000000000000 --- a/security/manager/ssl/src/CertVerifier.h +++ /dev/null @@ -1,65 +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/. */ - -#ifndef mozilla_psm__CertVerifier_h -#define mozilla_psm__CertVerifier_h - -#include "mozilla/RefPtr.h" -#include "CryptoUtil.h" -#include "nsISupportsImpl.h" -#include "certt.h" - -class nsIInterfaceRequestor; -class nsNSSComponent; - -namespace mozilla { namespace psm { - -class CertVerifier -{ -public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CertVerifier) - - typedef unsigned int Flags; - static const Flags FLAG_LOCAL_ONLY; - // XXX: The localonly flag is ignored in the classic verification case - - // *evOidPolicy == SEC_OID_UNKNOWN means the cert is NOT EV - SECStatus VerifyCert(CERTCertificate * cert, - const SECCertificateUsage usage, - const PRTime time, - nsIInterfaceRequestor * pinArg, - const Flags flags = 0, - /*optional out*/ CERTCertList **validationChain = nullptr, - /*optional out*/ SECOidTag *evOidPolicy = nullptr , - /*optional out*/ CERTVerifyLog *verifyLog = nullptr); - - enum missing_cert_download_config { missing_cert_download_off = 0, missing_cert_download_on }; - enum crl_download_config { crl_local_only = 0, crl_download_allowed }; - enum ocsp_download_config { ocsp_off = 0, ocsp_on }; - enum ocsp_strict_config { ocsp_relaxed = 0, ocsp_strict }; - enum any_revo_fresh_config { any_revo_relaxed = 0, any_revo_strict }; - - bool IsOCSPDownloadEnabled() const { return mOCSPDownloadEnabled; } - -private: - CertVerifier(missing_cert_download_config ac, crl_download_config cdc, - ocsp_download_config odc, ocsp_strict_config osc, - any_revo_fresh_config arfc, - const char *firstNetworkRevocationMethod); - ~CertVerifier(); - - const bool mMissingCertDownloadEnabled; - const bool mCRLDownloadEnabled; - const bool mOCSPDownloadEnabled; - const bool mOCSPStrict; - const bool mRequireRevocationInfo; - const bool mCRLFirst; - friend class ::nsNSSComponent; -}; - -MOZ_WARN_UNUSED_RESULT TemporaryRef GetDefaultCertVerifier(); - -} } // namespace mozilla::psm - -#endif // mozilla_psm__CertVerifier_h diff --git a/security/manager/ssl/src/CryptoUtil.h b/security/manager/ssl/src/CryptoUtil.h deleted file mode 100644 index 8d80f9aeb72f..000000000000 --- a/security/manager/ssl/src/CryptoUtil.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef mozilla_psm__CryptoUtil_h -#define mozilla_psm__CryptoUtil_h - -#include -#include "mozilla/Types.h" - -#ifdef MOZILLA_INTERNAL_API -#define MOZ_CRYPTO_API(x) MOZ_EXPORT_API(x) -#else -#define MOZ_CRYPTO_API(x) MOZ_IMPORT_API(x) -#endif - -#endif // mozilla_psm__CryptoUtil_h diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in index 4b87ab48e5e9..2898fbc7187c 100644 --- a/security/manager/ssl/src/Makefile.in +++ b/security/manager/ssl/src/Makefile.in @@ -20,7 +20,7 @@ LIBXUL_LIBRARY = 1 CPPSRCS = \ CryptoTask.cpp \ JARSignatureVerification.cpp \ - CertVerifier.cpp \ + nsCERTValInParamWrapper.cpp \ nsNSSCleaner.cpp \ nsCertOverrideService.cpp \ nsRecentBadCerts.cpp \ diff --git a/security/manager/ssl/src/SSLServerCertVerification.cpp b/security/manager/ssl/src/SSLServerCertVerification.cpp index 773189a2305a..746ed9010dae 100644 --- a/security/manager/ssl/src/SSLServerCertVerification.cpp +++ b/security/manager/ssl/src/SSLServerCertVerification.cpp @@ -95,7 +95,6 @@ */ #include "SSLServerCertVerification.h" -#include "CertVerifier.h" #include "nsIBadCertListener2.h" #include "nsICertOverrideService.h" #include "nsIStrictTransportSecurityService.h" @@ -114,6 +113,7 @@ #include "nsServiceManagerUtils.h" #include "nsIConsoleService.h" #include "PSMRunnable.h" +#include "ScopedNSSTypes.h" #include "SharedSSLState.h" #include "ssl.h" @@ -131,7 +131,6 @@ namespace { NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); -NSSCleanupAutoPtrClass(CERTCertificate, CERT_DestroyCertificate) NSSCleanupAutoPtrClass_WithParam(PLArenaPool, PORT_FreeArena, FalseParam, false) // do not use a nsCOMPtr to avoid static initializer/destructor @@ -468,26 +467,31 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, } SECStatus srv; + nsresult nsrv; - RefPtr certVerifier(GetDefaultCertVerifier()); - if (!certVerifier) { - NS_ERROR("GetDefaultCerVerifier failed"); + nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) { + NS_ERROR("do_GetService(kNSSComponentCID) failed"); + PR_SetError(defaultErrorCodeToReport, 0); + return nullptr; + } + + RefPtr survivingParams; + nsrv = inss->GetDefaultCERTValInParam(survivingParams); + if (NS_FAILED(nsrv)) { + NS_ERROR("GetDefaultCERTValInParam failed"); PR_SetError(defaultErrorCodeToReport, 0); return nullptr; } - PRTime now = PR_Now(); - - PLArenaPool *log_arena = nullptr; + PLArenaPool *log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); PLArenaPoolCleanerFalseParam log_arena_cleaner(log_arena); - CERTVerifyLog * verify_log = nullptr; - - log_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!log_arena) { NS_ERROR("PORT_NewArena failed"); return nullptr; // PORT_NewArena set error code } - verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); + + CERTVerifyLog *verify_log = PORT_ArenaZNew(log_arena, CERTVerifyLog); if (!verify_log) { NS_ERROR("PORT_ArenaZNew failed"); return nullptr; // PORT_ArenaZNew set error code @@ -495,8 +499,22 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, CERTVerifyLogContentsCleaner verify_log_cleaner(verify_log); verify_log->arena = log_arena; - srv = certVerifier->VerifyCert(cert, certificateUsageSSLServer, now, - infoObject, 0, nullptr, nullptr, verify_log); + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + srv = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), cert, + true, certificateUsageSSLServer, + PR_Now(), static_cast(infoObject), + verify_log, nullptr); + } + else { + CERTValOutParam cvout[2]; + cvout[0].type = cert_po_errorLog; + cvout[0].value.pointer.log = verify_log; + cvout[1].type = cert_po_end; + + srv = CERT_PKIXVerifyCert(cert, certificateUsageSSLServer, + survivingParams->GetRawPointerForNSS(), + cvout, static_cast(infoObject)); + } // We ignore the result code of the cert verification. // Either it is a failure, which is expected, and we'll process the @@ -521,44 +539,40 @@ CreateCertErrorRunnable(PRErrorCode defaultErrorCodeToReport, errorCodeMismatch = SSL_ERROR_BAD_CERT_DOMAIN; } - if (verify_log) { - CERTVerifyLogNode *i_node; - for (i_node = verify_log->head; i_node; i_node = i_node->next) + CERTVerifyLogNode *i_node; + for (i_node = verify_log->head; i_node; i_node = i_node->next) + { + switch (i_node->error) { - switch (i_node->error) - { - case SEC_ERROR_UNKNOWN_ISSUER: - case SEC_ERROR_CA_CERT_INVALID: - case SEC_ERROR_UNTRUSTED_ISSUER: - case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: - case SEC_ERROR_UNTRUSTED_CERT: - case SEC_ERROR_INADEQUATE_KEY_USAGE: - case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: - // We group all these errors as "cert not trusted" - collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; - if (errorCodeTrust == SECSuccess) { - errorCodeTrust = i_node->error; - } - break; - case SSL_ERROR_BAD_CERT_DOMAIN: - collected_errors |= nsICertOverrideService::ERROR_MISMATCH; - if (errorCodeMismatch == SECSuccess) { - errorCodeMismatch = i_node->error; - } - break; - case SEC_ERROR_EXPIRED_CERTIFICATE: - collected_errors |= nsICertOverrideService::ERROR_TIME; - if (errorCodeExpired == SECSuccess) { - errorCodeExpired = i_node->error; - } - break; - default: - PR_SetError(i_node->error, 0); - return nullptr; - } + case SEC_ERROR_UNKNOWN_ISSUER: + case SEC_ERROR_CA_CERT_INVALID: + case SEC_ERROR_UNTRUSTED_ISSUER: + case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + case SEC_ERROR_UNTRUSTED_CERT: + case SEC_ERROR_INADEQUATE_KEY_USAGE: + case SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED: + // We group all these errors as "cert not trusted" + collected_errors |= nsICertOverrideService::ERROR_UNTRUSTED; + if (errorCodeTrust == SECSuccess) { + errorCodeTrust = i_node->error; + } + break; + case SSL_ERROR_BAD_CERT_DOMAIN: + collected_errors |= nsICertOverrideService::ERROR_MISMATCH; + if (errorCodeMismatch == SECSuccess) { + errorCodeMismatch = i_node->error; + } + break; + case SEC_ERROR_EXPIRED_CERTIFICATE: + collected_errors |= nsICertOverrideService::ERROR_TIME; + if (errorCodeExpired == SECSuccess) { + errorCodeExpired = i_node->error; + } + break; + default: + PR_SetError(i_node->error, 0); + return nullptr; } - } else { - // XXX set errorCodeTrust, errorCodeMismatch, errorCodeExpired, collected_errors } if (!collected_errors) @@ -647,21 +661,31 @@ SSLServerCertVerificationJob::SSLServerCertVerificationJob( } SECStatus -PSM_SSL_PKIX_AuthCertificate(CERTCertificate *peerCert, - nsIInterfaceRequestor * pinarg, - const char * hostname, - CERTCertList **validationChain, - SECOidTag *evOidPolicy) +PSM_SSL_PKIX_AuthCertificate(CERTCertificate *peerCert, void * pinarg, + const char * hostname) { - RefPtr certVerifier(GetDefaultCertVerifier()); - if (!certVerifier) { - PR_SetError(PR_INVALID_STATE_ERROR, 0); - return SECFailure; + SECStatus rv; + + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + rv = CERT_VerifyCertNow(CERT_GetDefaultCertDB(), peerCert, true, + certUsageSSLServer, pinarg); } + else { + nsresult nsrv; + nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) + return SECFailure; + RefPtr survivingParams; + if (NS_FAILED(inss->GetDefaultCERTValInParam(survivingParams))) + return SECFailure; - SECStatus rv = certVerifier->VerifyCert(peerCert, - certificateUsageSSLServer, PR_Now(), - pinarg, 0, validationChain , evOidPolicy); + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; + + rv = CERT_PKIXVerifyCert(peerCert, certificateUsageSSLServer, + survivingParams->GetRawPointerForNSS(), + cvout, pinarg); + } if (rv == SECSuccess) { /* cert is OK. This is the client side of an SSL connection. @@ -873,12 +897,8 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } } - CERTCertList *verifyCertChain = nullptr; - SECOidTag evOidPolicy; SECStatus rv = PSM_SSL_PKIX_AuthCertificate(cert, infoObject, - infoObject->GetHostName(), - &verifyCertChain, - &evOidPolicy); + infoObject->GetHostName()); // We want to remember the CA certs in the temp db, so that the application can find the // complete chain at any time it might need it. @@ -888,12 +908,7 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, RefPtr nsc; if (!status || !status->mServerCert) { - if( rv == SECSuccess ){ - nsc = nsNSSCertificate::Create(cert, &evOidPolicy); - } - else { - nsc = nsNSSCertificate::Create(cert); - } + nsc = nsNSSCertificate::Create(cert); } ScopedCERTCertList certList(CERT_GetCertChainFromCert(cert, PR_Now(), @@ -922,6 +937,13 @@ AuthCertificate(TransportSecurityInfo * infoObject, CERTCertificate * cert, } if (rv == SECSuccess) { + if (nsc) { + bool dummyIsEV; + nsc->GetIsExtendedValidation(&dummyIsEV); // the nsc object will cache the status + } + + nsCOMPtr nssComponent; + // We want to avoid storing any intermediate cert information when browsing // in private, transient contexts. if (!(providerFlags & nsISocketProvider::NO_PERMANENT_STORAGE)) { diff --git a/security/manager/ssl/src/nsCERTValInParamWrapper.cpp b/security/manager/ssl/src/nsCERTValInParamWrapper.cpp new file mode 100644 index 000000000000..a7efc3727aad --- /dev/null +++ b/security/manager/ssl/src/nsCERTValInParamWrapper.cpp @@ -0,0 +1,126 @@ +/* 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 "nsCERTValInParamWrapper.h" + +NS_IMPL_THREADSAFE_ADDREF(nsCERTValInParamWrapper) +NS_IMPL_THREADSAFE_RELEASE(nsCERTValInParamWrapper) + +nsCERTValInParamWrapper::nsCERTValInParamWrapper() +:mAlreadyConstructed(false) +,mCVIN(nullptr) +,mRev(nullptr) +{ + MOZ_COUNT_CTOR(nsCERTValInParamWrapper); +} + +nsCERTValInParamWrapper::~nsCERTValInParamWrapper() +{ + MOZ_COUNT_DTOR(nsCERTValInParamWrapper); + if (mRev) { + CERT_DestroyCERTRevocationFlags(mRev); + } + if (mCVIN) + PORT_Free(mCVIN); +} + +nsresult nsCERTValInParamWrapper::Construct(missing_cert_download_config mcdc, + crl_download_config cdc, + ocsp_download_config odc, + ocsp_strict_config osc, + any_revo_fresh_config arfc, + const char *firstNetworkRevocationMethod) +{ + if (mAlreadyConstructed) + return NS_ERROR_FAILURE; + + mOCSPDownloadEnabled = odc == ocsp_on; + + CERTValInParam *p = (CERTValInParam*)PORT_Alloc(3 * sizeof(CERTValInParam)); + if (!p) + return NS_ERROR_OUT_OF_MEMORY; + + CERTRevocationFlags *rev = CERT_AllocCERTRevocationFlags( + cert_revocation_method_ocsp +1, 1, + cert_revocation_method_ocsp +1, 1); + + if (!rev) { + PORT_Free(p); + return NS_ERROR_OUT_OF_MEMORY; + } + + p[0].type = cert_pi_useAIACertFetch; + p[0].value.scalar.b = (mcdc == missing_cert_download_on); + p[1].type = cert_pi_revocationFlags; + p[1].value.pointer.revocation = rev; + p[2].type = cert_pi_end; + + rev->leafTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + rev->chainTests.cert_rev_flags_per_method[cert_revocation_method_crl] = + // implicit default source - makes no sense for CRLs + CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE + + // let's not stop on fresh CRL. If OCSP is enabled, too, let's check it + | CERT_REV_M_CONTINUE_TESTING_ON_FRESH_INFO + + // no fresh CRL? well, let other flag decide whether to fail or not + | CERT_REV_M_IGNORE_MISSING_FRESH_INFO + + // testing using local CRLs is always allowed + | CERT_REV_M_TEST_USING_THIS_METHOD + + // no local crl and don't know where to get it from? ignore + | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE + + // crl download based on parameter + | ((cdc == crl_download_allowed) ? + CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) + ; + + rev->leafTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + rev->chainTests.cert_rev_flags_per_method[cert_revocation_method_ocsp] = + // is ocsp enabled at all? + ((odc == ocsp_on) ? + CERT_REV_M_TEST_USING_THIS_METHOD : CERT_REV_M_DO_NOT_TEST_USING_THIS_METHOD) + + // ocsp enabled controls network fetching, too + | ((odc == ocsp_on) ? + CERT_REV_M_ALLOW_NETWORK_FETCHING : CERT_REV_M_FORBID_NETWORK_FETCHING) + + // ocsp set to strict==required? + | ((osc == ocsp_strict) ? + CERT_REV_M_FAIL_ON_MISSING_FRESH_INFO : CERT_REV_M_IGNORE_MISSING_FRESH_INFO) + + // if app has a default OCSP responder configured, let's use it + | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE + + // of course OCSP doesn't work without a source. let's accept such certs + | CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE + + // ocsp success is sufficient + | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO + ; + + bool wantsCrlFirst = (firstNetworkRevocationMethod != nullptr) + && (strcmp("crl", firstNetworkRevocationMethod) == 0); + + rev->leafTests.preferred_methods[0] = + rev->chainTests.preferred_methods[0] = + wantsCrlFirst ? cert_revocation_method_crl : cert_revocation_method_ocsp; + + rev->leafTests.cert_rev_method_independent_flags = + rev->chainTests.cert_rev_method_independent_flags = + // avoiding the network is good, let's try local first + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST + + // is overall revocation requirement strict or relaxed? + | ((arfc == any_revo_strict) ? + CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE : CERT_REV_MI_NO_OVERALL_INFO_REQUIREMENT) + ; + + mAlreadyConstructed = true; + mCVIN = p; + mRev = rev; + return NS_OK; +} diff --git a/security/manager/ssl/src/nsCERTValInParamWrapper.h b/security/manager/ssl/src/nsCERTValInParamWrapper.h new file mode 100644 index 000000000000..dab0aaabcc90 --- /dev/null +++ b/security/manager/ssl/src/nsCERTValInParamWrapper.h @@ -0,0 +1,71 @@ +/* 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/. */ + +#ifndef _nsCERTValInParamWrapper_H +#define _nsCERTValInParamWrapper_H + +#include "nsISupports.h" +#include "cert.h" + +/* + * This is a wrapper around type + * CERTValInParam is a nested input parameter type for CERT_PKIXVerifyCert. + * The values inside this type depend on application preferences, + * as a consequence it's expensive to construct this object. + * (and we shall avoid to access prefs from secondary threads anyway). + * We want to create an instance of that input type once, and use as long as possible. + * Every time the preferences change, we will create a new default object. + * + * A race is possible between "verification function is active and object in use" + * and "must switch to new defaults". + * + * The global default object may be replaced at any time with a new object. + * The contents of inner CERTValInParam are supposed to be stable (const). + * + * In order to protect against the race, we use a reference counted wrapper. + * Each user of a foreign nsCERTValInParamWrapper object + * (e.g. the current global default object) + * must use RefPtr = other-object + * prior to calling CERT_PKIXVerifyCert. + * + * This guarantees the object will still be alive after the call, + * and if the default object has been replaced in the meantime, + * the reference counter will go to zero, and the old default + * object will get destroyed automatically. + */ +class nsCERTValInParamWrapper +{ +public: + NS_IMETHOD_(nsrefcnt) AddRef(); + NS_IMETHOD_(nsrefcnt) Release(); + + bool IsOCSPDownloadEnabled() const { return mOCSPDownloadEnabled; } + + nsCERTValInParamWrapper(); + virtual ~nsCERTValInParamWrapper(); + + enum missing_cert_download_config { missing_cert_download_off = 0, missing_cert_download_on }; + enum crl_download_config { crl_local_only = 0, crl_download_allowed }; + enum ocsp_download_config { ocsp_off = 0, ocsp_on }; + enum ocsp_strict_config { ocsp_relaxed = 0, ocsp_strict }; + enum any_revo_fresh_config { any_revo_relaxed = 0, any_revo_strict }; + + nsresult Construct(missing_cert_download_config ac, crl_download_config cdc, + ocsp_download_config odc, ocsp_strict_config osc, + any_revo_fresh_config arfc, + const char *firstNetworkRevocationMethod); + +private: + nsAutoRefCnt mRefCnt; + NS_DECL_OWNINGTHREAD + bool mAlreadyConstructed; + CERTValInParam *mCVIN; + CERTRevocationFlags *mRev; + bool mOCSPDownloadEnabled; + +public: + CERTValInParam *GetRawPointerForNSS() { return mCVIN; } +}; + +#endif diff --git a/security/manager/ssl/src/nsCMS.cpp b/security/manager/ssl/src/nsCMS.cpp index 89da4298111a..1c183a562ca9 100644 --- a/security/manager/ssl/src/nsCMS.cpp +++ b/security/manager/ssl/src/nsCMS.cpp @@ -3,9 +3,8 @@ * 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 "nsCMS.h" -#include "CertVerifier.h" #include "nsISupports.h" +#include "nsCMS.h" #include "nsNSSHelper.h" #include "nsNSSCertificate.h" #include "smime.h" @@ -14,17 +13,19 @@ #include "nsIArray.h" #include "nsArrayUtils.h" #include "nsCertVerificationThread.h" +#include "nsCERTValInParamWrapper.h" #include "ScopedNSSTypes.h" #include "prlog.h" -using namespace mozilla; -using namespace mozilla::psm; +#include "nsNSSComponent.h" #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; #endif +using namespace mozilla; + static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); NS_IMPL_THREADSAFE_ISUPPORTS2(nsCMSMessage, nsICMSMessage, @@ -217,8 +218,9 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, uint32_ NSSCMSSignedData *sigd = nullptr; NSSCMSSignerInfo *si; int32_t nsigners; - RefPtr certVerifier; nsresult rv = NS_ERROR_FAILURE; + RefPtr survivingParams; + nsCOMPtr inss; if (!NSS_CMSMessage_IsSigned(m_cmsMsg)) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - not signed\n")); @@ -262,16 +264,32 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, uint32_ // See bug 324474. We want to make sure the signing cert is // still valid at the current time. - certVerifier = GetDefaultCertVerifier(); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), si->cert, true, + certificateUsageEmailSigner, + si->cmsg->pwfn_arg, nullptr) != SECSuccess) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); + rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; + goto loser; + } + } + else { + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; - { - SECStatus srv = certVerifier->VerifyCert(si->cert, - certificateUsageEmailSigner, - PR_Now(), nullptr /*XXX pinarg*/); - if (srv != SECSuccess) { - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, - ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); + inss = do_GetService(kNSSComponentCID, &rv); + if (!inss) { + goto loser; + } + + if (NS_FAILED(inss->GetDefaultCERTValInParam(survivingParams))) { + goto loser; + } + SECStatus stat = CERT_PKIXVerifyCert(si->cert, certificateUsageEmailSigner, + survivingParams->GetRawPointerForNSS(), + cvout, si->cmsg->pwfn_arg); + if (stat != SECSuccess) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; goto loser; } diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index 80e4e5797344..b9c5ca90a9c3 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -4,7 +4,6 @@ * 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 "CertVerifier.h" #include "mozilla/RefPtr.h" #include "nsAppDirectoryServiceDefs.h" #include "nsStreamUtils.h" @@ -21,7 +20,6 @@ #include "ScopedNSSTypes.h" using namespace mozilla; -using namespace mozilla::psm; #ifdef DEBUG #ifndef PSM_ENABLE_TEST_EV_ROOTS @@ -1015,9 +1013,7 @@ isEVPolicy(SECOidTag policyOIDTag) return false; } -namespace mozilla { namespace psm { - -CERTCertList* +static CERTCertList* getRootsForOid(SECOidTag oid_tag) { CERTCertList *certList = CERT_NewCertList(); @@ -1038,8 +1034,6 @@ getRootsForOid(SECOidTag oid_tag) return certList; } -}} - static bool isApprovedForEV(SECOidTag policyOIDTag, CERTCertificate *rootCert) { @@ -1133,10 +1127,8 @@ nsNSSComponent::IdentityInfoInit() return PR_SUCCESS; } -namespace mozilla { namespace psm { - // Find the first policy OID that is known to be an EV policy OID. -SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) +static SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) { if (!cert) return SECFailure; @@ -1181,8 +1173,6 @@ SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag) return SECFailure; } -}} - NS_IMETHODIMP nsSSLStatus::GetIsExtendedValidation(bool* aIsEV) { @@ -1225,23 +1215,101 @@ nsNSSCertificate::hasValidEVOidTag(SECOidTag &resultOidTag, bool &validEV) return nrv; nssComponent->EnsureIdentityInfoLoaded(); - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + RefPtr certVal; + nrv = nssComponent->GetDefaultCERTValInParam(certVal); + NS_ENSURE_SUCCESS(nrv, nrv); validEV = false; resultOidTag = SEC_OID_UNKNOWN; - SECStatus rv = certVerifier->VerifyCert(mCert, - certificateUsageSSLServer, PR_Now(), - nullptr /* XXX pinarg*/, - 0, nullptr, &resultOidTag); + SECOidTag oid_tag; + SECStatus rv = getFirstEVPolicy(mCert, oid_tag); + if (rv != SECSuccess) + return NS_OK; - if (rv != SECSuccess) { - resultOidTag = SEC_OID_UNKNOWN; - } - if (resultOidTag != SEC_OID_UNKNOWN) { - validEV = true; + if (oid_tag == SEC_OID_UNKNOWN) // not in our list of OIDs accepted for EV + return NS_OK; + + ScopedCERTCertList rootList(getRootsForOid(oid_tag)); + + CERTRevocationMethodIndex preferedRevMethods[1] = { + cert_revocation_method_ocsp + }; + + uint64_t revMethodFlags = + CERT_REV_M_TEST_USING_THIS_METHOD + | (certVal->IsOCSPDownloadEnabled() ? CERT_REV_M_ALLOW_NETWORK_FETCHING + : CERT_REV_M_FORBID_NETWORK_FETCHING) + | CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE + | CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE + | CERT_REV_M_IGNORE_MISSING_FRESH_INFO + | CERT_REV_M_STOP_TESTING_ON_FRESH_INFO; + + uint64_t revMethodIndependentFlags = + CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST + | CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE; + + uint64_t methodFlags[2]; + methodFlags[cert_revocation_method_crl] = revMethodFlags; + methodFlags[cert_revocation_method_ocsp] = revMethodFlags; + + CERTRevocationFlags rev; + + rev.leafTests.number_of_defined_methods = cert_revocation_method_ocsp +1; + rev.leafTests.cert_rev_flags_per_method = methodFlags; + rev.leafTests.number_of_preferred_methods = 1; + rev.leafTests.preferred_methods = preferedRevMethods; + rev.leafTests.cert_rev_method_independent_flags = + revMethodIndependentFlags; + + rev.chainTests.number_of_defined_methods = cert_revocation_method_ocsp +1; + rev.chainTests.cert_rev_flags_per_method = methodFlags; + rev.chainTests.number_of_preferred_methods = 1; + rev.chainTests.preferred_methods = preferedRevMethods; + rev.chainTests.cert_rev_method_independent_flags = + revMethodIndependentFlags; + + CERTValInParam cvin[4]; + cvin[0].type = cert_pi_policyOID; + cvin[0].value.arraySize = 1; + cvin[0].value.array.oids = &oid_tag; + + cvin[1].type = cert_pi_revocationFlags; + cvin[1].value.pointer.revocation = &rev; + + cvin[2].type = cert_pi_trustAnchors; + cvin[2].value.pointer.chain = rootList; + + cvin[3].type = cert_pi_end; + + CERTValOutParam cvout[2]; + cvout[0].type = cert_po_trustAnchor; + cvout[0].value.pointer.cert = nullptr; + cvout[1].type = cert_po_end; + + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("calling CERT_PKIXVerifyCert nss cert %p\n", mCert.get())); + rv = CERT_PKIXVerifyCert(mCert, certificateUsageSSLServer, + cvin, cvout, nullptr); + if (rv != SECSuccess) + return NS_OK; + + ScopedCERTCertificate issuerCert(cvout[0].value.pointer.cert); + +#ifdef PR_LOGGING + if (PR_LOG_TEST(gPIPNSSLog, PR_LOG_DEBUG)) { + nsNSSCertificate ic(issuerCert); + nsAutoString fingerprint; + ic.GetSha1Fingerprint(fingerprint); + NS_LossyConvertUTF16toASCII fpa(fingerprint); + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("CERT_PKIXVerifyCert returned success, issuer: %s, SHA1: %s\n", + issuerCert->subjectName, fpa.get())); } +#endif + + validEV = isApprovedForEV(oid_tag, issuerCert); + if (validEV) + resultOidTag = oid_tag; + return NS_OK; } @@ -1277,10 +1345,8 @@ nsNSSCertificate::GetIsExtendedValidation(bool* aIsEV) if (mCachedEVStatus != ev_status_unknown) { *aIsEV = (mCachedEVStatus == ev_status_valid); - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSSCertificate::GetIsExtendedValidation value IS cached! \n")); return NS_OK; } - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("NSSCertificate::GetIsExtendedValidation value is NOT cached! \n")); SECOidTag oid_tag; return getValidEVOidTag(oid_tag, *aIsEV); diff --git a/security/manager/ssl/src/nsNSSCertificate.cpp b/security/manager/ssl/src/nsNSSCertificate.cpp index 5ea2da7d5558..31d8228bbf5e 100644 --- a/security/manager/ssl/src/nsNSSCertificate.cpp +++ b/security/manager/ssl/src/nsNSSCertificate.cpp @@ -7,12 +7,11 @@ #include "prerror.h" #include "prprf.h" -#include "nsNSSCertificate.h" -#include "CertVerifier.h" #include "nsNSSComponent.h" // for PIPNSS string bundle calls. #include "nsNSSCleaner.h" #include "nsCOMPtr.h" #include "nsIMutableArray.h" +#include "nsNSSCertificate.h" #include "nsNSSCertValidity.h" #include "nsPKCS12Blob.h" #include "nsPK11TokenDB.h" @@ -49,7 +48,6 @@ #include "plbase64.h" using namespace mozilla; -using namespace mozilla::psm; #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; @@ -77,14 +75,14 @@ NS_IMPL_THREADSAFE_ISUPPORTS7(nsNSSCertificate, nsIX509Cert, /* static */ nsNSSCertificate* -nsNSSCertificate::Create(CERTCertificate *cert, SECOidTag *evOidPolicy) +nsNSSCertificate::Create(CERTCertificate *cert) { if (GeckoProcessType_Default != XRE_GetProcessType()) { NS_ERROR("Trying to initialize nsNSSCertificate in a non-chrome process!"); return nullptr; } if (cert) - return new nsNSSCertificate(cert, evOidPolicy); + return new nsNSSCertificate(cert); else return new nsNSSCertificate(); } @@ -129,8 +127,7 @@ nsNSSCertificate::InitFromDER(char *certDER, int derLen) return true; } -nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert, - SECOidTag *evOidPolicy) : +nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert) : mCert(nullptr), mPermDelete(false), mCertType(CERT_TYPE_NOT_YET_INITIALIZED), @@ -145,18 +142,8 @@ nsNSSCertificate::nsNSSCertificate(CERTCertificate *cert, if (isAlreadyShutDown()) return; - if (cert) { + if (cert) mCert = CERT_DupCertificate(cert); - if (evOidPolicy) { - if ( *evOidPolicy == SEC_OID_UNKNOWN) { - mCachedEVStatus = ev_status_invalid; - } - else { - mCachedEVStatus = ev_status_valid; - } - mCachedEVOidTag = *evOidPolicy; - } - } } nsNSSCertificate::nsNSSCertificate() : @@ -1214,9 +1201,15 @@ nsNSSCertificate::VerifyForUsage(uint32_t usage, uint32_t *verificationResult) NS_ENSURE_ARG(verificationResult); - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); - + nsresult nsrv; + nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) + return nsrv; + RefPtr survivingParams; + nsrv = inss->GetDefaultCERTValInParam(survivingParams); + if (NS_FAILED(nsrv)) + return nsrv; + SECCertificateUsage nss_usage; switch (usage) @@ -1273,8 +1266,19 @@ nsNSSCertificate::VerifyForUsage(uint32_t usage, uint32_t *verificationResult) return NS_ERROR_FAILURE; } - SECStatus verify_result = certVerifier->VerifyCert(mCert, nss_usage, PR_Now(), - nullptr /*XXX pinarg*/); + SECStatus verify_result; + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + CERTCertDBHandle *defaultcertdb = CERT_GetDefaultCertDB(); + verify_result = CERT_VerifyCertificateNow(defaultcertdb, mCert, true, + nss_usage, nullptr, nullptr); + } + else { + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; + verify_result = CERT_PKIXVerifyCert(mCert, nss_usage, + survivingParams->GetRawPointerForNSS(), + cvout, nullptr); + } if (verify_result == SECSuccess) { diff --git a/security/manager/ssl/src/nsNSSCertificate.h b/security/manager/ssl/src/nsNSSCertificate.h index 8e3a7059a77e..f1c7066778ad 100644 --- a/security/manager/ssl/src/nsNSSCertificate.h +++ b/security/manager/ssl/src/nsNSSCertificate.h @@ -44,12 +44,12 @@ public: NS_DECL_NSISERIALIZABLE NS_DECL_NSICLASSINFO - nsNSSCertificate(CERTCertificate *cert,SECOidTag *evOidPolicy = nullptr); + nsNSSCertificate(CERTCertificate *cert); nsNSSCertificate(); /* from a request? */ virtual ~nsNSSCertificate(); nsresult FormatUIStrings(const nsAutoString &nickname, nsAutoString &nickWithSerial, nsAutoString &details); - static nsNSSCertificate* Create(CERTCertificate *cert = nullptr, SECOidTag *evOidPolicy = nullptr); + static nsNSSCertificate* Create(CERTCertificate *cert = nullptr); static nsNSSCertificate* ConstructFromDER(char *certDER, int derLen); // It is the responsibility of the caller of this method to free the returned diff --git a/security/manager/ssl/src/nsNSSCertificateDB.cpp b/security/manager/ssl/src/nsNSSCertificateDB.cpp index ade4fdb62a8a..c41f115af1dc 100644 --- a/security/manager/ssl/src/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp @@ -7,10 +7,8 @@ // only exported so PSM can use it for this specific purpose. #define CERT_AddTempCertToPerm __CERT_AddTempCertToPerm -#include "nsNSSCertificateDB.h" - -#include "CertVerifier.h" #include "nsNSSComponent.h" +#include "nsNSSCertificateDB.h" #include "mozilla/Base64.h" #include "nsCOMPtr.h" #include "nsNSSCertificate.h" @@ -48,7 +46,6 @@ #include "plbase64.h" using namespace mozilla; -using namespace mozilla::psm; using mozilla::psm::SharedSSLState; #ifdef PR_LOGGING @@ -497,9 +494,22 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, CERTCertificate **certArray = nullptr; ScopedCERTCertList certList; CERTCertListNode *node; + PRTime now; + SECCertUsage certusage; + SECCertificateUsage certificateusage; SECItem **rawArray; int numcerts; int i; + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; + + nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) + return nsrv; + RefPtr survivingParams; + nsrv = inss->GetDefaultCERTValInParam(survivingParams); + if (NS_FAILED(nsrv)) + return nsrv; PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); if (!arena) @@ -511,11 +521,9 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, return NS_ERROR_FAILURE; } - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); - certdb = CERT_GetDefaultCertDB(); - const PRTime now = PR_Now(); + certusage = certUsageEmailRecipient; + certificateusage = certificateUsageEmailRecipient; numcerts = certCollection->numcerts; @@ -529,7 +537,7 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, rawArray[i] = &certCollection->rawCerts[i]; } - srv = CERT_ImportCerts(certdb, certUsageEmailRecipient, numcerts, rawArray, + srv = CERT_ImportCerts(certdb, certusage, numcerts, rawArray, &certArray, false, false, nullptr); PORT_Free(rawArray); @@ -557,6 +565,7 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, /* go down the remaining list of certs and verify that they have * valid chains, then import them. */ + now = PR_Now(); for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node,certList); @@ -568,18 +577,25 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, continue; } - SECStatus rv = certVerifier->VerifyCert(node->cert, - certificateUsageEmailRecipient, - now, ctx); - if (rv != SECSuccess) { - alert_and_skip = true; + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + if (CERT_VerifyCert(certdb, node->cert, + true, certusage, now, ctx, nullptr) != SECSuccess) { + alert_and_skip = true; + } + } + else { + if (CERT_PKIXVerifyCert(node->cert, certificateusage, + survivingParams->GetRawPointerForNSS(), + cvout, ctx) + != SECSuccess) { + alert_and_skip = true; + } } ScopedCERTCertificateList certChain; if (!alert_and_skip) { - certChain = CERT_CertChainFromCert(node->cert, certUsageEmailRecipient, - false); + certChain = CERT_CertChainFromCert(node->cert, certusage, false); if (!certChain) { alert_and_skip = true; } @@ -603,7 +619,7 @@ nsNSSCertificateDB::ImportEmailCertificate(uint8_t * data, uint32_t length, for (i=0; i < certChain->len; i++) { rawArray[i] = &certChain->certs[i]; } - CERT_ImportCerts(certdb, certUsageEmailRecipient, certChain->len, + CERT_ImportCerts(certdb, certusage, certChain->len, rawArray, nullptr, true, false, nullptr); CERT_SaveSMimeProfile(node->cert, nullptr, nullptr); @@ -736,9 +752,14 @@ nsresult nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfaceRequestor *ctx) { SECItem **rawArray; - RefPtr certVerifier(GetDefaultCertVerifier()); - if (!certVerifier) - return NS_ERROR_UNEXPECTED; + nsresult nsrv; + nsCOMPtr inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) + return nsrv; + RefPtr survivingParams; + nsrv = inss->GetDefaultCERTValInParam(survivingParams); + if (NS_FAILED(nsrv)) + return nsrv; /* filter out the certs we don't want */ SECStatus srv = CERT_FilterCertListByUsage(certList, certUsageAnyCA, true); @@ -759,10 +780,19 @@ nsNSSCertificateDB::ImportValidCACertsInList(CERTCertList *certList, nsIInterfac bool alert_and_skip = false; - SECStatus rv = certVerifier->VerifyCert(node->cert, certificateUsageVerifyCA, - PR_Now(), ctx); - if (rv != SECSuccess) { - alert_and_skip = true; + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + if (CERT_VerifyCert(CERT_GetDefaultCertDB(), node->cert, + true, certUsageVerifyCA, PR_Now(), ctx, nullptr) != SECSuccess) { + alert_and_skip = true; + } + } + else { + if (CERT_PKIXVerifyCert(node->cert, certificateUsageVerifyCA, + survivingParams->GetRawPointerForNSS(), + cvout, ctx) + != SECSuccess) { + alert_and_skip = true; + } } ScopedCERTCertificateList certChain; @@ -1294,8 +1324,18 @@ nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEma { nsNSSShutDownPreventionLock locker; - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); + nsCOMPtr inss; + RefPtr survivingParams; + nsresult nsrv; + + if (nsNSSComponent::globalConstFlagUsePKIXVerification) { + inss = do_GetService(kNSSComponentCID, &nsrv); + if (!inss) + return nsrv; + nsrv = inss->GetDefaultCERTValInParam(survivingParams); + if (NS_FAILED(nsrv)) + return nsrv; + } ScopedCERTCertList certlist( PK11_FindCertsFromEmailAddress(aEmailAddress, nullptr)); @@ -1314,11 +1354,23 @@ nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEma !CERT_LIST_END(node, certlist); node = CERT_LIST_NEXT(node)) { - SECStatus srv = certVerifier->VerifyCert(node->cert, - certificateUsageEmailRecipient, - PR_Now(), nullptr /*XXX pinarg*/); - if (srv == SECSuccess) { - break; + if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { + if (CERT_VerifyCert(CERT_GetDefaultCertDB(), node->cert, + true, certUsageEmailRecipient, PR_Now(), nullptr, nullptr) == SECSuccess) { + // found a valid certificate + break; + } + } + else { + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; + if (CERT_PKIXVerifyCert(node->cert, certificateUsageEmailRecipient, + survivingParams->GetRawPointerForNSS(), + cvout, nullptr) + == SECSuccess) { + // found a valid certificate + break; + } } } diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index 57f8ac0528f4..8b91e5fc82e2 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -9,8 +9,6 @@ #endif #include "nsNSSComponent.h" - -#include "CertVerifier.h" #include "nsNSSCallbacks.h" #include "nsNSSIOLayer.h" #include "nsCertVerificationThread.h" @@ -69,6 +67,7 @@ #include "nsNSSShutDown.h" #include "GeneratedEvents.h" #include "nsIKeyModule.h" +#include "ScopedNSSTypes.h" #include "SharedSSLState.h" #include "nss.h" @@ -1099,18 +1098,23 @@ void nsNSSComponent::setValidationOptions(nsIPrefBranch * pref) ocspMode_FailureIsVerificationFailure : ocspMode_FailureIsNotAVerificationFailure); - mDefaultCertVerifier = new CertVerifier( + RefPtr newCVIN(new nsCERTValInParamWrapper); + if (NS_SUCCEEDED(newCVIN->Construct( aiaDownloadEnabled ? - CertVerifier::missing_cert_download_on : CertVerifier::missing_cert_download_off, + nsCERTValInParamWrapper::missing_cert_download_on : nsCERTValInParamWrapper::missing_cert_download_off, crlDownloading ? - CertVerifier::crl_download_allowed : CertVerifier::crl_local_only, + nsCERTValInParamWrapper::crl_download_allowed : nsCERTValInParamWrapper::crl_local_only, ocspEnabled ? - CertVerifier::ocsp_on : CertVerifier::ocsp_off, + nsCERTValInParamWrapper::ocsp_on : nsCERTValInParamWrapper::ocsp_off, ocspRequired ? - CertVerifier::ocsp_strict : CertVerifier::ocsp_relaxed, + nsCERTValInParamWrapper::ocsp_strict : nsCERTValInParamWrapper::ocsp_relaxed, anyFreshRequired ? - CertVerifier::any_revo_strict : CertVerifier::any_revo_relaxed, - firstNetworkRevo.get()); + nsCERTValInParamWrapper::any_revo_strict : nsCERTValInParamWrapper::any_revo_relaxed, + firstNetworkRevo.get()))) { + // Swap to new defaults, and will cause the old defaults to be released, + // as soon as any concurrent use of the old default objects has finished. + mDefaultCERTValInParam = newCVIN; + } /* * The new defaults might change the validity of already established SSL sessions, @@ -1822,6 +1826,20 @@ nsNSSComponent::InitializeNSS(bool showWarningBox) // dynamic options from prefs setValidationOptions(mPrefBranch); + // static validation options for usagesarray - do not hit the network + mDefaultCERTValInParamLocalOnly = new nsCERTValInParamWrapper; + rv = mDefaultCERTValInParamLocalOnly->Construct( + nsCERTValInParamWrapper::missing_cert_download_off, + nsCERTValInParamWrapper::crl_local_only, + nsCERTValInParamWrapper::ocsp_off, + nsCERTValInParamWrapper::ocsp_relaxed, + nsCERTValInParamWrapper::any_revo_relaxed, + FIRST_REVO_METHOD_DEFAULT); + if (NS_FAILED(rv)) { + nsPSMInitPanic::SetPanic(); + return rv; + } + RegisterMyOCSPAIAInfoCallback(); mHttpForNSS.initTable(); @@ -2035,7 +2053,7 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, *aPrincipal = nullptr; nsNSSShutDownPreventionLock locker; - ScopedSEC_PKCS7ContentInfo p7_info; + ScopedSEC_PKCS7ContentInfo p7_info; unsigned char hash[SHA1_LENGTH]; SECItem item; @@ -2048,6 +2066,10 @@ nsNSSComponent::VerifySignature(const char* aRSABuf, uint32_t aRSABufLen, GetDecryptKeyCallback, nullptr, DecryptionAllowedCallback); + if (!p7_info) { + return NS_ERROR_FAILURE; + } + // Make sure we call SEC_PKCS7DestroyContentInfo after this point; // otherwise we leak data in p7_info @@ -2504,12 +2526,22 @@ nsNSSComponent::IsNSSInitialized(bool *initialized) } NS_IMETHODIMP -nsNSSComponent::GetDefaultCertVerifier(RefPtr &out) +nsNSSComponent::GetDefaultCERTValInParam(RefPtr &out) { MutexAutoLock lock(mutex); if (!mNSSInitialized) return NS_ERROR_NOT_INITIALIZED; - out = mDefaultCertVerifier; + out = mDefaultCERTValInParam; + return NS_OK; +} + +NS_IMETHODIMP +nsNSSComponent::GetDefaultCERTValInParamLocalOnly(RefPtr &out) +{ + MutexAutoLock lock(mutex); + if (!mNSSInitialized) + return NS_ERROR_NOT_INITIALIZED; + out = mDefaultCERTValInParamLocalOnly; return NS_OK; } diff --git a/security/manager/ssl/src/nsNSSComponent.h b/security/manager/ssl/src/nsNSSComponent.h index 160a23390537..0f3ee52818ed 100644 --- a/security/manager/ssl/src/nsNSSComponent.h +++ b/security/manager/ssl/src/nsNSSComponent.h @@ -37,13 +37,7 @@ #include "nsNSSHelper.h" #include "nsClientAuthRemember.h" - -namespace mozilla { namespace psm { - -class CertVerifier; - -} } // namespace mozilla::psm - +#include "nsCERTValInParamWrapper.h" #define NS_NSSCOMPONENT_CID \ {0xa277189c, 0x1dd1, 0x11b2, {0xa8, 0xc9, 0xe4, 0xe8, 0xbf, 0xb1, 0x33, 0x8e}} @@ -163,8 +157,10 @@ class NS_NO_VTABLE nsINSSComponent : public nsISupports { NS_IMETHOD IsNSSInitialized(bool *initialized) = 0; - NS_IMETHOD GetDefaultCertVerifier( - mozilla::RefPtr &out) = 0; + NS_IMETHOD GetDefaultCERTValInParam( + mozilla::RefPtr &out) = 0; + NS_IMETHOD GetDefaultCERTValInParamLocalOnly( + mozilla::RefPtr &out) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsINSSComponent, NS_INSSCOMPONENT_IID) @@ -268,8 +264,10 @@ public: NS_IMETHOD EnsureIdentityInfoLoaded(); NS_IMETHOD IsNSSInitialized(bool *initialized); - NS_IMETHOD GetDefaultCertVerifier( - mozilla::RefPtr &out); + NS_IMETHOD GetDefaultCERTValInParam( + mozilla::RefPtr &out); + NS_IMETHOD GetDefaultCERTValInParamLocalOnly( + mozilla::RefPtr &out); private: nsresult InitializeNSS(bool showWarningBox); @@ -329,8 +327,8 @@ private: nsCertVerificationThread *mCertVerificationThread; nsNSSHttpInterface mHttpForNSS; - mozilla::RefPtr mDefaultCertVerifier; - + mozilla::RefPtr mDefaultCERTValInParam; + mozilla::RefPtr mDefaultCERTValInParamLocalOnly; static PRStatus IdentityInfoInit(void); PRCallOnceType mIdentityInfoCallOnce; diff --git a/security/manager/ssl/src/nsUsageArrayHelper.cpp b/security/manager/ssl/src/nsUsageArrayHelper.cpp index 38c497d51063..a8ed09d95739 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp @@ -16,7 +16,6 @@ #include "secerr.h" using namespace mozilla; -using namespace mozilla::psm; #ifdef PR_LOGGING extern PRLogModuleInfo* gPIPNSSLog; @@ -119,10 +118,8 @@ isFatalError(uint32_t checkResult) uint32_t nsUsageArrayHelper::check(uint32_t previousCheckResult, const char *suffix, - CertVerifier * certVerifier, SECCertificateUsage aCertUsage, - PRTime time, - CertVerifier::Flags flags, + nsCERTValInParamWrapper * aValInParams, uint32_t &aCounter, PRUnichar **outUsages) { @@ -178,8 +175,13 @@ nsUsageArrayHelper::check(uint32_t previousCheckResult, return nsIX509Cert::NOT_VERIFIED_UNKNOWN; } - SECStatus rv = certVerifier->VerifyCert(mCert, aCertUsage, - time, nullptr /*XXX:wincx*/, flags); + SECStatus rv; + CERTValOutParam cvout[1]; + cvout[0].type = cert_po_end; + + rv = CERT_PKIXVerifyCert(mCert, aCertUsage, + aValInParams->GetRawPointerForNSS(), + cvout, nullptr); if (rv == SECSuccess) { typestr.Append(suffix); @@ -296,6 +298,7 @@ if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { check(suffix, usages & certificateUsageSSLClient, count, outUsages); check(suffix, usages & certificateUsageSSLServer, count, outUsages); + check(suffix, usages & certificateUsageSSLServerWithStepUp, count, outUsages); check(suffix, usages & certificateUsageEmailSigner, count, outUsages); check(suffix, usages & certificateUsageEmailRecipient, count, outUsages); check(suffix, usages & certificateUsageObjectSigner, count, outUsages); @@ -320,43 +323,43 @@ if (!nsNSSComponent::globalConstFlagUsePKIXVerification) { return NS_OK; } - RefPtr certVerifier(GetDefaultCertVerifier()); - NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); - - PRTime now = PR_Now(); - CertVerifier::Flags flags = localOnly ? CertVerifier::FLAG_LOCAL_ONLY : 0; + RefPtr params; + nsresult rv = localOnly ? nssComponent->GetDefaultCERTValInParamLocalOnly(params) + : nssComponent->GetDefaultCERTValInParam(params); + NS_ENSURE_SUCCESS(rv, rv); // The following list of checks must be < max_returned_out_array_size uint32_t result; - result = check(nsIX509Cert::VERIFIED_OK, suffix, certVerifier, - certificateUsageSSLClient, now, flags, count, outUsages); - result = check(result, suffix, certVerifier, - certificateUsageSSLServer, now, flags, count, outUsages); - result = check(result, suffix, certVerifier, - certificateUsageEmailSigner, now, flags, count, outUsages); - result = check(result, suffix, certVerifier, - certificateUsageEmailRecipient, now, flags, count, outUsages); - result = check(result, suffix, certVerifier, - certificateUsageObjectSigner, now, flags, count, outUsages); + result = check(nsIX509Cert::VERIFIED_OK, suffix, certificateUsageSSLClient, + params, count, outUsages); + result = check(result, suffix, certificateUsageSSLServer, + params, count, outUsages); + result = check(result, suffix, certificateUsageSSLServerWithStepUp, + params, count, outUsages); + result = check(result, suffix, certificateUsageEmailSigner, + params, count, outUsages); + result = check(result, suffix, certificateUsageEmailRecipient, + params, count, outUsages); + result = check(result, suffix, certificateUsageObjectSigner, + params, count, outUsages); #if 0 - result = check(result, suffix, certVerifier, - certificateUsageProtectedObjectSigner, now, flags, count, - outUsages); - result = check(result, suffix, certVerifier, - certificateUsageUserCertImport, now, flags, count, outUsages); + result = check(result, suffix, certificateUsageProtectedObjectSigner, + params, count, outUsages); + result = check(result, suffix, certificateUsageUserCertImport, + params, count, outUsages); #endif - result = check(result, suffix, certVerifier, - certificateUsageSSLCA, now, flags, count, outUsages); + result = check(result, suffix, certificateUsageSSLCA, + params, count, outUsages); #if 0 - result = check(result, suffix, certVerifier, - certificateUsageVerifyCA, now, flags, count, outUsages); + result = check(result, suffix, certificateUsageVerifyCA, + params, count, outUsages); #endif - result = check(result, suffix, certVerifier, - certificateUsageStatusResponder, now, flags, count, outUsages); + result = check(result, suffix, certificateUsageStatusResponder, + params, count, outUsages); #if 0 - result = check(result, suffix, certVerifier, - certificateUsageAnyCA, now, flags, count, outUsages); + result = checkPKIX(result, check(suffix, certificateUsageAnyCA, + params, count, outUsages); #endif if (isFatalError(result) || count == 0) { diff --git a/security/manager/ssl/src/nsUsageArrayHelper.h b/security/manager/ssl/src/nsUsageArrayHelper.h index c2abc4aa9f47..63b46257a6ef 100644 --- a/security/manager/ssl/src/nsUsageArrayHelper.h +++ b/security/manager/ssl/src/nsUsageArrayHelper.h @@ -5,10 +5,10 @@ #ifndef _NSUSAGEARRAYHELPER_H_ #define _NSUSAGEARRAYHELPER_H_ -#include "CertVerifier.h" -#include "nsNSSComponent.h" #include "certt.h" +#include "nsNSSComponent.h" + class nsUsageArrayHelper { public: @@ -38,10 +38,8 @@ private: uint32_t check(uint32_t previousCheckResult, const char *suffix, - mozilla::psm::CertVerifier * certVerifier, SECCertificateUsage aCertUsage, - PRTime time, - mozilla::psm::CertVerifier::Flags flags, + nsCERTValInParamWrapper * aValInParams, uint32_t &aCounter, PRUnichar **outUsages); From 71d35ee552049cfd846c416f8bec25723c67706b Mon Sep 17 00:00:00 2001 From: Camilo Viecco Date: Mon, 15 Apr 2013 16:45:38 -0700 Subject: [PATCH 131/438] Bug 813418 - Backout 95add3006aaf due to bustage CLOSED TREE --- build/pgo/certs/cert8.db | Bin 65536 -> 65536 bytes build/pgo/certs/evintermediate.ca | 34 ---------- build/pgo/certs/evroot.ca | 32 --------- build/pgo/certs/key3.db | Bin 98304 -> 69632 bytes build/pgo/server-locations.txt | 2 - .../manager/ssl/src/nsIdentityChecking.cpp | 21 +----- .../ssl/tests/mochitest/bugs/Makefile.in | 2 - .../mochitest/bugs/test_ev_validation.html | 52 --------------- .../bugs/test_ev_validation_child.html | 62 ------------------ testing/mochitest/Makefile.in | 2 - testing/mochitest/intermediate-ev-tester.crl | Bin 541 -> 0 bytes testing/mochitest/root-ev-tester.crl | Bin 557 -> 0 bytes 12 files changed, 1 insertion(+), 206 deletions(-) delete mode 100644 build/pgo/certs/evintermediate.ca delete mode 100644 build/pgo/certs/evroot.ca delete mode 100644 security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html delete mode 100644 security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html delete mode 100644 testing/mochitest/intermediate-ev-tester.crl delete mode 100644 testing/mochitest/root-ev-tester.crl diff --git a/build/pgo/certs/cert8.db b/build/pgo/certs/cert8.db index aa38b3b0d57ae2c303d6873e659ee0f288853e3e..3123b417b151a77a7ededbd77dc6e9a7c6fae898 100644 GIT binary patch delta 60 zcmV-C0K@-)fCPYm1duxcAhA5eKLIF{0YFg%>MlSpvvEKj9kYNy%@MOeZ@>@%7?S~j SF$8BWoi4G_XD+jyu47SUvlVIp literal 65536 zcmeI52|QF?|G@7oc8aXYG6{)rXNF;rB}+0V+rvHr7mL9@~CJ3T_5Apg-1S_a)F{lht2pGm(i zxF8?^2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@ z00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve z0)PM@@Sh@}0)5bXtM^Rrh@Ow$kZzmqeqFNeDec4B;o7UUqp3kuJE{>iP{UorL}Qjl z59KkXkg|pHMSYvPBY6S&94VW$ndCugA=VPpi5^5UQH-ds>ZlT|oITf0e!0A_+%!2~ zIXT%lSy{;h$szCo1ONd*01yBK00BS%5C8-K0YCr{00aO5KmZT`1ONd*01yBK00BS% z5C8-K0YKn4B7j6P=j7x>qOP-jf~LZeY#-oA{KHHf7K6oNa4;V`mtxExF(3Fa7&bNt zj(9}mfw|amEAi}t*p(~3CO8GLh6Y3tSP0$2A;`Db)6c_~#_%AlV$cJKv*4L%KDVIw zV$Wa(lSv~e6O3089O?Fc&IDh&k1qi^SQ4Ir7UB^UT0wX4^Je%45sW>Y86I@HH^al3 zC=bh`yK#b&$dMMvF-Rss0lA8|pO0^Vr?;<5&>ZwMg0KKuZjK-~-Cr3!x3U9`I2TqN zZ3Y)cMAE^9=FOz}(meFh63CfU=z%nMFD6~Z!P6a<66GV3VG>b|sG&}Usn()=Bs57H zNx~5~zczc48I1773Gy*KeCgiqbVmlwmrnjqv^f$ZGxkNIQKQN0Zl1o+h*i=!@udBP^bI223{`ioTzSUXxX_l0|SKK!bx>9wL zu=A{zx;-auFkaq0pN(5VR4lCLxL)(TpqF7h)8wdEALT|+3=_jNK1n|ap2^@6GvzEZ zc3GF*A3N3cRrlF-ns?pq2c=A58$9YP*WOwmUfUt6$luoBqAk{+aJ=B5Y~hv9M78#S z0tYM(17QwCVrmc~7hp+5#3ZNSMesslHfb>aEnT_jpj|-Opw{lo+IyxWMa0kov+xK) zB*C*$sCJiDyOmdRXQk!B8|T?Q--qtDdcQxSJv-v*@6e+nxuE0K^JJXlO-V2>N=6XR z2IDZ8A((=ur17e-GOUz2Cv$d;oQtoomzJvPnEt5h?dj>OJkp!#-YO2>Ojr*+j)2#M zDX3Lm32g|A+nBv zc(y31s|P97AK8Kpzd3kV#;86|CNOPgV_9z+?EBJq@8tkx@w}wuKSJP3`O}SB?=&^* z`siG==Cy1s@SyJ?P~A=K-=ERF+Grdt!%#mL^gK1;nYj>m$d%hp3oph5zFOe^`tvqw z^5M73?mE^N)W39ysh)btrCphL;#@ypq*P#2oj-JXqiAFP+3%Lv47 z*kiw*?mt$mK#1=D4U|16^5Y>*aKzoeq0z-)5kv}+QElqiQEg;cBFe%t=pG)y8Oyvq zofu3yVSyjRk?u%X>gCIDX9UxH8J-?QX_gv6Ml=ybwizD&G$zAw>^L-Dt&bG=_l7bo zdQVv=hJK%hB0tPxh1bXHvy&iBIFeljF=<3b%o)sg{r(?0lz%f{G>IfN$~W_6I0;AG z`y0akpD^J@EIgc`5F+ru5cj`lx&6wDxsNDt~m$ref@U!#wYki8!bu?8U&_=2iEcwD@`|_M$%q%L~E^TP=HAR_3tdm!n#r!d+;=UdMbyV}p+~9`v1%?Oh~jis^WGU% z8+`dRg$HWRmMhMjPin}JC3f9UoS#S*`*KL3bi|6mvcr*BEX#~XhGHxXAvQDDx|lyO zG5zx~7(5<_W!E2LEO^>MB_+=rMo{OA~r+Bh6Y0=MyprqFL> z;~?XuAWB3I&kJ*ZwM1|jm%L*V&oX2JK5^^>rJXb&UW}P}<>#@Ggw5k4$uEo>F`_cu=mmSPn zxjOGvM(#0EQgy-gol9uPQW|g0%Pumyp})rGzGrmZ?C`X6j+LsP0?I`<_gALco}IQX zvW&}qRtou_#!BF zHIx^-B`1yYnp>Zgpqj-iW-GXMC=6Q>$fDVFlNqWWS)iYs7w#^VtCWX8LDu^zOk1?=MEy` zk*T6sY(xZf&|&F}#4n8|_g)ckH9Pel?IT|;b8}4wt64Z*H#Ya_mPT|csOl;wpi6Kc&xzcAfP$~Q=t}QBz`J3{j=_-5n-=Ym=d}X~(Ym`9#V1gc zq38a`E(!A9_pI?+Df+mUpv5subd)H~!*PTugh6lKkMGuS#}$I09~}pYBb|7{Lvero zPNEM9ihsR0_D7W&uBj*lc{zI$eCXc(bZ>$K-P@Pp#Be}nt02f7`Nc-q^)EgoP5h9h z0LvqTA@cYnZ9#YU^7N*82N4XvU58-c=j-B$P9x%A5uy-0ZMZPcn280nwaEE@yc0V? z^@p2>{9Gm7$ARWWr}_HQ9Nb7qYavKLENt=QHcXs2!UrcfH6S2B#h&J!DHDoiG7l3+4fouzrkCdUXMujFvEJlu$A zqoD5^`BTkP`|7ZqegXttvMVo;NtyOQVUy{V?Dz&hSD}0r8?VFbTM`<3BsFiI-Ogak zuaojC+QaSjs&M*=>Zk9T*julv8sAqja^7!|RCnSw%yHraff~D9 zXPbTwzX)IcG-%eex#nawrBpeZV*Ns$3mE*RT#@?&=eeUM(mYG1Rn?u{#9=shMKo^d zlCvi~EW$!12G036`Zs2Y6dUxkeq0>*$v&`hMrBI+0M;fkuBhDlCHsm8F;gRNynX!c zf>W^m^|#^n0)vI6dzaqQ^XlBNui~}dbq9gfFYZR?tyIHz$;8|m5NmmqF9%8PN?S9< zPtZet$AhMNfxK(Ih1PLn1(yh6Si&%g-SLMVh{)s z9;3Y>Xa)p@BX5}|(Dyi)K$Lb#>HgprS^@NOFSa{IsLyg<#CB1K&#a_JxaF&F$LZ?kyEO zB;}e^RLahO?^>$DTG$pQTghmx#GDOHd~<}+T;Vi3W2Iq=ZSnl#?Uw^M-p$PvI^qD? zX1sS5>F1=JJy9cj&9~0V^hUUX#vfA3MrqcXo>X17_4LEHQ-=PqTNv7Z)Uu>?m9hPe zWp|}EV+)6$iuvIw-%U=BfAxhL4FX$Sy{k1;!zvFwcU-<3GiZ|7aXC{_z;BbkgV9rl zOL}IMOSN8{XDt4R-Us4Q;^nYGKPxVTLIeCM`Qi&%!gx_4K%2=$CvSn7# z{p`5h5Pxf59-AFUwr=z2*5r^^nRQvH`QUE;@T#_h$KO2aIAbE=A2>ZH-s<_9Mc=G9 z#8#L9H7XXO6YRr|Il<@vfjP$#hO>w;%$!IVWQYVLYzbATq|v&^J42JWB8iFlJgsI zS1ty47q5J_>Ggw%k7c>41E=ko(!43kars2?Phn!09JFRBhj)}=uTG@Tt;!YUpBeU5 zq;C?!B|g)Y*hySxcY^(VOO`;-b*s~T7hI%rYLCC`H03PhdU3;)7gMqD7C&9tr1N@C z*5I+*_9d=Z<2|IRz2d~s?nUAAtjW!HBsKDwWxk2{4R5xcd43~V?$i=)Yif%^p<__b z?X1H5-mLT?<+44@B|!mErb$ld{TRL-s8IX`%BX}OQ`En{rPwj2M#beG`pki)K>~<9 zVTXuI%|zldiNgs?A!)+uBoYjhk^iXJjZIFfVe>QbZR=3T#jH=acMc-% zVah>o-Pg{`wB5WPbBYY!eRM@hm9|32BIKC0>>9p}6>QHp>q_ms+92+kG;2Z4k*H3o z{rQF;Hev&U>Z^qE*p?-1%*~9u^_p=-B*Tf3ajddu#gn@GQa*VHnT4X2*o&v8nBBd$ zWK(aSZbGq2=dhMTUXR05k&cYa`*FhT$SXK32KvqvL=|0O^FDv~DARL?wKuF<@Xa?=Z?pwzO%2i9GrIuc^UAXA=v#myc8m-AD2CA}~1j-7!v~H{T73Q6flq(B9 zww=NAUSi!e_8raV2LAjUFnFzF^@(QD`jCPA7U9$`gASiu(xsxk{F)!O6k&w&@ek_C z(=!Ug#jHF9jvu~>8sEO7X1xOqmF!6rDo%C?qM+XHuo@AOt6{}A2U)G4MkFIE0#pJ$ zl$BiqX|DDzbY~JRm`r1`vRngcOfN^K7yD?*(e(xH!wVl&JiVQvQ446a82Wq!K^o{( z%-^~oGN&Uoda@s06ZiK{jH(Lc73<%DfE}$6t98hn6SRu%?Ss7ef(THTUZ@_wUbOCF zU0IzW?F-sRw1c(RXs1!PP@SpoHS;M4DH|zkDG$`$)h)>{NqbaMR8A=yD#t1upUpnI zU7k(8T#ik?W0soi;7l_aj+v`x(#1=WXJGIF1ONd*01yBK00BS%5C8-K0YCr{00aO5 zKmZT`1ONd*01yBK00BS%5C8=JO#;Yk@DXR}3r5(N<=C0S|TNGkR*H|#w3&`?~jZO-j1`570f!%Gk%F^iG4Bc@{4hoE}4EUz_a4sT@FOvn!!xQz1%^)MseTK{Q~t%$lOMX)YMDZ-(o^`n2S%V)PiICR?{ zMuwDsRcJTKuoMH|Xc~zAv#t8r{G{bO`$}go-CMDzG<55{Ijt32pYlrjnjQ`*=j*D# zC)}eSaj~)BT^VzzHIIgWpt+XNnV-J>j~AN+`GwYNNT{uGXWCQ06dg(qKmF-#Y!39n@1)mE?OOxsJ=Sg3bpje){`NEQ=P`k)f{RYz$T9&Py z(;MEemwOma_eY(^(RCx=JkNgzZ)TQz53lEKG;Cq?0Fe`3&NFGieUhqf2Xl zpC(VP4>@Y_u>SA|Aa2Ck*@tYL!xj&oC0OIt&woqKe&_rAk8C@-#;ysqz9&&xOm5F% z|7n<^k!67Yb7hUL9sGGkCsUnI?j1rGHS42)|6ASmBd@iQ2P!gAjRdP{lF@a|$O9Fb zh^%vFCI7L#1~L499*XLuR{s)pytfDlPTO*0^A(q;ErBX+q<&z3TI) zQ(V_+zj+*%_wlBdsZ6xIvDwt-{Q>pNb(hQAbP|GR@HOsJ8dB%J<6v$lVqk1?Yz5rp{Tdgu964;{68$;I;s<~jpx1XEx zh3nm&E4$X7;^kk9W$!fN71_V+(>~nxtR!arCgomv+nVC4$gMVudE$fzBkLVSU-qrI z%F}Rs@WY=84dw~lud^-hJL|N3eTrI(kh1y9K^&Y~Q!;T=bdC<~eS1Z8nYIm2pX_UR z1G*A?7Tyo`+3%6f{BI52KN4>w;L=|Rm!OQ+Pa2QJeuHH)37Jwc5r@FdhsM7jR*QE z5?7sNO0KMu$8;05y0c%@GdXQoSJryq1%n;Z4b#>GswO^>bwZ~h1S)FYvi zMgk=vV*<;$9@lnXfdo^CRH8bGqE12wgt5tq9GQRW zdeM}oVL$%o_X!kz9OO9&!eRN-0s}GTGsSZ{cf`$ z?@-7x&2*|FzEkIT$eZ$@b@iI5Iqn&_X!S0G5nYCzi+B_%AR8LvQBnXOiJgHYL?g#~ zYex#8F@cEVrbJj-q;XjyK7RH@m47YzE&pH3lO`xXoIk$2q&I!NA5swqCWG$bi@G+9 zyF6<*5+GrM-O|7C9Ep@=RsUC|gnZ}@1l|+gm$Eu9%`BrIk&)4$fbH|qd#uY6u zf<$;=czbz!1_q659d7{HffZB}^<#Gf

}-#DC2qjn9%ro9ChFN^$g2Co=;A z+`QMj_>(kg<4a9POELZF$`mHeaon!&Iw9(>v?xI0xUloeB+beJTV~FSlO2rqdWqDX zm7EU!BomQdHy5^@CwHg|4$5(CSyf?xrdNey&>TC*(8h4^$KkwxPdzo5)Sv$ryvBgT)dru`5i~R2+C>lv5c_#j6Gi z*kjDP37%UAoK;d{w)nO#UlPD8jQ^7MJZ5vq;H7%PK3D1Yygqqu0@X}2y4c~c9%4B5 zR_`O&0)y#0)f{MgjPG{dY|5%zqd`TGTR)kubE6T4h6BYwkOu@!ZWVC9k|)%bLHwD2 zE_B$h0KauBWmY7OIY_rk8kqoNh5VSD39uho(JbfJ;m{c*HBGfKku-*r@J|AS{M0UZ z!(M0=Rb4m5zcInuK$Rv@(w*#e{e%9RB(0pBp^xJAv%lhncT;FjOwO%ah|ZuF3zlr-dt*Vn8(g+jmfEu zx}{;gp&Pf}{OmDf>4$vn>$`Yjgy`od+@wN}owfKx-kUhn;ag4x%zr|qod zUY*3hzdwQYF8xt$&&|i#J)Y}*Pn$2l(~@6$O}b=fr5ic^(V2vywW8^#w5gVs3XS`m z&Zf_$6p>t=-1X92t6jq@5?sO_z1-JohayyJ=Uv_keMFf;-V(=G4$=N*_x-D3nI1Bm;!FV^|&&f|B+#Bq*~`BlAs4)0x+-D|Mg zujY%Avy9C)ZHPYg#4pUNH_)Z)nCg}5br<+#LZe>HzZDeUy=E61mi#c5lVj`oO$UX~ zA2C%>5PZ9e@+65(Ca)Ru*+R!LuDUCWX z`iwk={Yx0vzvZCJ5>zx)00o&+gUM*1R957GugSmX_WV=fEfT_C?8$l-FvDr1)n-ju znNDp6RpW9>+S&o~v-M4c0i|s`c+!m)IBMV9;04=08NNSJb>VKvGM~1-evbG}B0iWM zgV#m5m7;tirne_1#?7tbIdno{_8YAw+_<8Os1r`n`8?hGYBN(#F7@xd(oHD9o5y9R zyxROWF7C*7X=U%>kVFT@tJMg}QAh0`d5-_UvPrB=yBxG1lYDymYKOTUGJ7vA@S7Lv z^|B!^1S`F&onPnnnmCs#8=s1~*-J}zMV3pOFLgin5 zd8;)4SsTlf5f*)7JLPX^t`;r0!N5K=a9feS>4D+RsDbE|Sy|7+T9i8n)41-6Z@pml zKEk7fjdQfVEXQ(WBI$44{$UXoKmreaA8P=OP&TRI25^&Vpdq8eq)zp*BB_lF=I{lH zdjvj!03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mA zfB+x>2mk_r03ZMe00MvjAOHve0)PM@00;mAfB+x>2mk_r03ZMe00MvjAOHve0)PM@ P00;mAfB+!yza{X0cco0F diff --git a/build/pgo/certs/evintermediate.ca b/build/pgo/certs/evintermediate.ca deleted file mode 100644 index 17a048ad86c3..000000000000 --- a/build/pgo/certs/evintermediate.ca +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF9zCCBN+gAwIBAgIBAzANBgkqhkiG9w0BAQUFADCB4TELMAkGA1UEBhMCVVMx -CzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MSMwIQYDVQQKExpN -b3ppbGxhIC0gRVYgZGVidWcgdGVzdCBDQTEdMBsGA1UECxMUU2VjdXJpdHkgRW5n -aW5lZXJpbmcxJjAkBgNVBAMTHUVWIFRlc3RpbmcgKHVudHJ1c3R3b3J0aHkpIENB -MRMwEQYDVQQpEwpldi10ZXN0LWNhMSwwKgYJKoZIhvcNAQkBFh1jaGFybGF0YW5A -dGVzdGluZy5leGFtcGxlLmNvbTAeFw0xMzAyMTQxNzU5MDlaFw0yMzAyMTIxNzU5 -MDlaMIHRMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50 -YWluIFZpZXcxIzAhBgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0w -GwYDVQQLExRTZWN1cml0eSBFbmdpbmVlcmluZzEWMBQGA1UEAxMNaW50ZXJtZWRp -YXRlMzETMBEGA1UEKRMKZXYtdGVzdC1jYTEsMCoGCSqGSIb3DQEJARYdY2hhcmxh -dGFuQHRlc3RpbmcuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDAfzrlJdawr7v8m7lslODk5FTqCiBO7tPxnWhAOEL5g05knLTZTc5J -3ywmGoW6ae6RwPlWuqRuFd2Ea+yCawyjkUoLOpFH/xziDzvaS6LXNdJoxQqWk/LX -8YYQVFfmxh8E11fz74IoCzX++mY1byaNONf3bLU2HU8vnVvENr1gy9Bzpm8wUuKm -HkBYuG0SVzaeym2H/mo5PJICPVhPa+YxfEVS8EIFCigXGH7xrz/bPXnpfgsSJTnN -4amBNkORfjf7H9x6IWkJGEkIvkVoYKT4iQ9q6/C4YDjWa9p5lA4F/qxnJefezH/I -6hcqEODSaDsY+I6vsN8ks8r8MTTnd7BjAgMBAAGjggHGMIIBwjAdBgNVHQ4EFgQU -fluXMAT0ZS21pV13vv46m8k7nRkwggEYBgNVHSMEggEPMIIBC4AUyJg651hwk+3B -V0rQvQZv9n2bWPahgeekgeQwgeExCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEW -MBQGA1UEBxMNTW91bnRhaW4gVmlldzEjMCEGA1UEChMaTW96aWxsYSAtIEVWIGRl -YnVnIHRlc3QgQ0ExHTAbBgNVBAsTFFNlY3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYD -VQQDEx1FViBUZXN0aW5nICh1bnRydXN0d29ydGh5KSBDQTETMBEGA1UEKRMKZXYt -dGVzdC1jYTEsMCoGCSqGSIb3DQEJARYdY2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBs -ZS5jb22CCQCvxT0iZiZJMjAMBgNVHRMEBTADAQH/MDYGA1UdHwQvMC0wK6ApoCeG -JWh0dHA6Ly9leGFtcGxlLmNvbS9yb290LWV2LXRlc3Rlci5jcmwwPwYDVR0gBDgw -NjA0BgRVHSAAMCwwKgYIKwYBBQUHAgEWHmh0dHA6Ly9teXRlc3Rkb21haW4ubG9j -YWwvY3BzOzANBgkqhkiG9w0BAQUFAAOCAQEAC4grNTV5K8yqiAJ/0f6oIkTMqyJ4 -lyHXvvKXMHTpRZ7Jdy0aq5KTSHswx64ZRN7V2ds+czzDWgxX3rBuZZAgOW1JYva3 -Ps3XRYUiaTW8eeaWjuVRFAp7ytRmSsOGeOtHbez8jDmTqPRQ1mTMsMzpY4bFD8do -5y0xsbz4DYIeeNnX9+XGB5u2ml8t5L8Cj65wwMAx9HlsjTrfQTMIwpwbNle6GuZ3 -9FzmE2piAND73yCgU5W66K2lZg8N6vHBq0UhPDCF72y8MlHxQOpTr3/jIGr4X7k9 -uyYq0Pw5Y/LKyGbyW5iMFdLzabm1ua8IWAf7DSFMH6L3WlK8mngCfJ1icQ== ------END CERTIFICATE----- diff --git a/build/pgo/certs/evroot.ca b/build/pgo/certs/evroot.ca deleted file mode 100644 index df220e446c44..000000000000 --- a/build/pgo/certs/evroot.ca +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFljCCBH6gAwIBAgIJAK/FPSJmJkkyMA0GCSqGSIb3DQEBBQUAMIHhMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxIzAh -BgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0wGwYDVQQLExRTZWN1 -cml0eSBFbmdpbmVlcmluZzEmMCQGA1UEAxMdRVYgVGVzdGluZyAodW50cnVzdHdv -cnRoeSkgQ0ExEzARBgNVBCkTCmV2LXRlc3QtY2ExLDAqBgkqhkiG9w0BCQEWHWNo -YXJsYXRhbkB0ZXN0aW5nLmV4YW1wbGUuY29tMB4XDTEzMDIxNDE3NDkwMFoXDTIz -MDIxMjE3NDkwMFowgeExCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UE -BxMNTW91bnRhaW4gVmlldzEjMCEGA1UEChMaTW96aWxsYSAtIEVWIGRlYnVnIHRl -c3QgQ0ExHTAbBgNVBAsTFFNlY3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYDVQQDEx1F -ViBUZXN0aW5nICh1bnRydXN0d29ydGh5KSBDQTETMBEGA1UEKRMKZXYtdGVzdC1j -YTEsMCoGCSqGSIb3DQEJARYdY2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBsZS5jb20w -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCk+k5mvnrxhVdVnhaxCeDG -ZC5kcC8951K3xTkh2JMtUpSQL2IoGLOZOWTNY+2wGNyHbdJjKDv1d0bzZfz3yDkB -AbY6OcxS4WkwccKsyIzkdacpYWhi7kEFevm9p7TI8jdrpKmItrlqfZKfteh+K+DF -XZF7xp6zpoUis6dykmk5v8RivpCZl7HIlsOW0wSqCocXWH/WWFgAQyozjW8MgGOL -/eV2aLsx+yg7it9GMMtyidggwvlYM7O8vY0gJqQKXntbHq1zV7jIJ3bXzJceur+G -Ce4HvsRHAQUSl6jUfm00aKkqS+1t3svZURIKM6qWAuIKMGcspv+L8lyn1KImG8M5 -AgMBAAGjggFNMIIBSTAdBgNVHQ4EFgQUyJg651hwk+3BV0rQvQZv9n2bWPYwggEY -BgNVHSMEggEPMIIBC4AUyJg651hwk+3BV0rQvQZv9n2bWPahgeekgeQwgeExCzAJ -BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEj -MCEGA1UEChMaTW96aWxsYSAtIEVWIGRlYnVnIHRlc3QgQ0ExHTAbBgNVBAsTFFNl -Y3VyaXR5IEVuZ2luZWVyaW5nMSYwJAYDVQQDEx1FViBUZXN0aW5nICh1bnRydXN0 -d29ydGh5KSBDQTETMBEGA1UEKRMKZXYtdGVzdC1jYTEsMCoGCSqGSIb3DQEJARYd -Y2hhcmxhdGFuQHRlc3RpbmcuZXhhbXBsZS5jb22CCQCvxT0iZiZJMjAMBgNVHRME -BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAcKVLC9MbdSZjzkVBseCm6t49aIIBm -xQrsTNV2Gnp5eIXBfUhNAfD0zbBcKHK9AfHmNT8ZK6iABjiOrnn6yQNufW5MMdNx -+/4FtTmdlBPLpyuBY7re+XbIaPxr/jB9jJ1pmh52xH3wMkO7ATDQ2fqFnODFrUKS -UpXzuydPnsCdu32KPSnewIrkDB10Sah7vw3uwASO2GWqaFtUDFWGpt6rYQTcOF8g -7a6Zj0johBMQFHE3HDRebWxiOf21ppN/tvv0gtGiA0ZIXBezeLaJ+Hob1xTbi4sw -sGYDKHPCrLuTZWXmkv0rAIkLLK4VHbsA5xYPQNJJsTpX3u0Z0vZxJd9/ ------END CERTIFICATE----- diff --git a/build/pgo/certs/key3.db b/build/pgo/certs/key3.db index a99595c52a9f799b96b1a081e885916aa8e90237..f4edf2e72fbfede0ad14ff150df337352a729964 100644 GIT binary patch delta 138 zcmZo@U~5>wGC^IGnSp_U3yArFm>q~&fLLdujWi?c#EUr_kJ#vMW;FQEzxlsCqkFrNt j7^RsP6*z3V;LN<)dGlVINeV(h#Xf8x#hWX?wMzm3!qz60 delta 3400 zcmZvfcQ_ji*Ty3u#NJeFo|=8c3W8QBYF2DjYR@Q7hZ@mX39UA2uhy(qsTre)*_cJ` z5vyvHhPG&FpAcW)?|Z-N`rhw-|G4k#oa>zX-}AdpY%ybOEcl6>03!eZVEZku-(vo) zfAoK*=|LHo(o^ygS z+>f9{BX2l}Xf*ZPY8U=tflyFsn1KlEzeHD<|p8H^aLR4$+Jzqn-#WME*7XB;$W zYqavHelg4avi7fM<%7c870jC#QeeI-2jr`wHc(h?pY-7Bx4N*scNfuYIvhb<-vyk> z_0Ksq*XDL7uC;D(r5m&=iKam=^Ez)$DG)wY`44%rJ}F1-h`;Mw>F8Kt{d|I1mx@V(BzzN{b^gOo{PB5K z!OZV9oHr&y7*wbcZQaXktufogTWmu{qdzu)v)m>ewcX7qS#AHN2xPR9bB*Rw?eKe< z-lCPzv)92otHJ?BnxD}*@nt`{v8J$-#5NpqnqSL@`FW7lc2?1k5sQ7kX6o2LOm*a6 zdCyt=62mcTn~jGTC4c;Gf#O4vz?|Cu!*q+ko)7O_>&p0VMFO(*q>_S*@zkB zwPQ@DT75Mg#W8#^UI!wt%e8rX8OVZzuBL4)s?hq8sITmwKe2`8Kh5%T0PElN;Kt*{ zAX-Yn(XY%L*KKcD=zp8}x^yz1X8l2j%SNLC( zy6ZV@L>?ZbBb6&Mm?RaGt#QzD$B)svwt~U}^U?3V7rb{%ZESVKF2XA($9uN5*t!Io zenN+qP#?a5o+|sHe2bO#CNNLcn!*{7Zfs!ZW9Lx=X95-?U3$ z85e`c?`&~4stP)GUf8EH^M=cJB}Y^@kHeo}nF0p=IDH)?D|YJ2Bag?c7{3p@ssGBd zKO}59nGz-OBZv7?-WVk5%`vVbIoA0kX(P)Bi&&ZJ9P#sdla!Am=X#_)$lfDelcUzV zta>6erRDG#hG;=0nT69D^>vj*cJWM8J*U_|P6ebJ5I?Q$i;QGFCR9Sg4VE@mB*d}Q z>&A6wZHJhucEX%Zp{C(Ec#wzg*N^wBeoY|Eq;cnsEx8s;?v0>5hPpoJ5u%_Rb45yL znyfS4C^tc*u}QUE;IHftyCUxsBGWH*aHza^?Y0A9`}i2+8m5@0XFW-{)PffAV#KAZ zH6QkZbv5;u`<@xF@%ylaq^d@m&)>sJVP3jLXXQN(*ne18%p;-YW?pP+J2v_E#t90@ zz4!3E3x9vFD@O?{{1ozIW;pjoBRlsEAb9UGyI_e8tq7D_nvNbxyl`;-dVec9{-LWC zTZ#ZZe#A#;=g@AHZL*er{FE?>BCzg0ccS>~ErS3IzfV7~1||2%2vO59w6{!d}#jRq4p(NIwRgeq742kHN#KoBeNHwj=FHHXJz7uif}jUvH~Y@-Oa$JkBH!1br3xnm~%jF!P{gS%*DyrGk3pLF^fgHGIZ>jUtbk)5Rs<`mnIC}~q5G^2gKtcSZi zfQBx4S+cKYoVWELfe;6SAW^i-^N%V0%GUZ{!om7vvWN)rPOp>1P4<@bDb(p?iA3xX zljOwK*-|CJHIFi_=XRj==UDF;9{Q$?9UBCVV%$7Ptii7b`Whm?KH$!$M;&lr-(+fch%^7q26aK!JU-6vX zCVi@H`MHNiyjIJ1Bq@!~3CQ{rgl`ePJFu`L@ zPJM`c*FIZ$4|}un)5+O#2cCfEqlYj?_Ti^r{h`)x_>>#N!rPA;wANThbdA=K(nA=Y z-DV{eSTlet96!wKJY2o8_|XBlf$g5sr_F8L+YSJVDqZD~qhtUv@e^c_HsF4RLjHEA zbgUj~Kl%&MxdMAtWaJfcK#5@XlC*JHCo6S<#ZpudCdh(s`aq|E2&HdkzpsZG`CUlZ zFH$9R`zJ9|yxyt-Pn_wvFOkq>MOZ-$6)9_&m;P2(AAyUnLcj|K4X9Xl-4)v+l9@g} zQRdf?q@uOtYZKlR$Q5PkxCz;}NhKMR))$I9<_#$ceWpwf&ueI~lllJsS`zBgtFT>W z+iZlnrS+n%(ap1MT%ZCMiHC}V*v@@>MIx}z4quAN(kaVFkjIFlPjC0!t?`7Z&xrH} z1)sE*lbhnC$21(Q6tQgGW@CLw4hDyUZjlkRdMyQQ)u98coKdoes9qm-mV~4{FJpLi zzjRp0$?#%Taz#!4{ifPREkmrQPmE3Grh2316xH6ys;SK}FjcxOb5$*AvbqrO-xo!C zVG(8*ktdtZ8RlEK@^jWZl}W>RgKLU1Mk_!xFzBGXaPBj*GbTDy4&bCuC1HN7|YXkI~-t7|I zks4I6vpW(%^p6ZB#=W-mM`B>;s zS1g{lU7~k?!qR(_>dA7G9hT`2jrdl3fMOPm#BBG7R2$({mW7WVqi#$mbgqsyC2 zI{nJG@A9dPB&*-c=G0!`hlM7G&e89)dXvODS&3yWizv*BLEh z?c2+d5joh1LAF+Nc}@RER>pasl@Pa-=aG66EUi`% zWj=-boLG0s(6<}=4FgPRycUR_PqTVcfoQcwo;I`S7A;dEz2;C_!_6cb0>2$hr1U>| zmvm6PX&%&k-BQ+N=x{7^S?IQp`OR!4RkCtmB;4K96yVVb(|=?nRG;D5g*-R#5c|9pLjJd)Gw#K>7F=)VBB9696w diff --git a/build/pgo/server-locations.txt b/build/pgo/server-locations.txt index 98c7d3f34d3e..dbc0cf4af3f2 100644 --- a/build/pgo/server-locations.txt +++ b/build/pgo/server-locations.txt @@ -101,8 +101,6 @@ https://mismatch.expired.example.com:443 privileged,cert=expired https://mismatch.untrusted.example.com:443 privileged,cert=untrusted https://untrusted-expired.example.com:443 privileged,cert=untrustedandexpired https://mismatch.untrusted-expired.example.com:443 privileged,cert=untrustedandexpired -https://ev-valid.example.com:443 privileged,cert=evvalid -https://ev-invalid.example.com:443 priviliged,cert=evinvalid # This is here so that we don't load the default live bookmark over # the network in every test suite. diff --git a/security/manager/ssl/src/nsIdentityChecking.cpp b/security/manager/ssl/src/nsIdentityChecking.cpp index b9c5ca90a9c3..da1304d13e53 100644 --- a/security/manager/ssl/src/nsIdentityChecking.cpp +++ b/security/manager/ssl/src/nsIdentityChecking.cpp @@ -109,21 +109,6 @@ static struct nsMyTrustedEVInfo myTrustedEVInfos[] = { * In other words, if you add another list, that uses the same dotted_oid * as an existing entry, then please use the same oid_name. */ - { - // This is the testing EV signature. - // C=US, ST=CA, L=Mountain View, O=Mozilla - EV debug test CA, OU=Security Engineering, CN=EV Testing (untrustworthy) CA/name=ev-test-ca/emailAddress=charlatan@testing.example.com - "1.3.6.1.4.1.13769.666.666.666.1.500.9.1", - "DEBUGtesting EV OID", - SEC_OID_UNKNOWN, - "AD:FE:0E:44:16:45:B0:17:46:8B:76:01:74:B7:FF:64:5A:EC:35:91", - "MIHhMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWlu" - "IFZpZXcxIzAhBgNVBAoTGk1vemlsbGEgLSBFViBkZWJ1ZyB0ZXN0IENBMR0wGwYD" - "VQQLExRTZWN1cml0eSBFbmdpbmVlcmluZzEmMCQGA1UEAxMdRVYgVGVzdGluZyAo" - "dW50cnVzdHdvcnRoeSkgQ0ExEzARBgNVBCkTCmV2LXRlc3QtY2ExLDAqBgkqhkiG" - "9w0BCQEWHWNoYXJsYXRhbkB0ZXN0aW5nLmV4YW1wbGUuY29t", - "AK/FPSJmJkky", - nullptr - }, { // CN=WellsSecure Public Root Certificate Authority,OU=Wells Fargo Bank NA,O=Wells Fargo WellsSecure,C=US "2.16.840.1.114171.500.9", @@ -1076,11 +1061,7 @@ nsNSSComponent::IdentityInfoInit() ias.serialNumber.type = siUnsignedInteger; entry.cert = CERT_FindCertByIssuerAndSN(nullptr, &ias); - - // The debug CA info is at position 0, and is NOT on the NSS root db - if (iEV != 0) { - NS_ASSERTION(entry.cert, "Could not find EV root in NSS storage"); - } + NS_ASSERTION(entry.cert, "Could not find EV root in NSS storage"); SECITEM_FreeItem(&ias.derIssuer, false); SECITEM_FreeItem(&ias.serialNumber, false); diff --git a/security/manager/ssl/tests/mochitest/bugs/Makefile.in b/security/manager/ssl/tests/mochitest/bugs/Makefile.in index f61c25dcc82b..8981ea47a8d9 100644 --- a/security/manager/ssl/tests/mochitest/bugs/Makefile.in +++ b/security/manager/ssl/tests/mochitest/bugs/Makefile.in @@ -15,8 +15,6 @@ MOCHITEST_FILES = \ test_bug480509.html \ test_bug483440.html \ test_bug484111.html \ - test_ev_validation.html \ - test_ev_validation_child.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html deleted file mode 100644 index 1e1812758519..000000000000 --- a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - Test for Bug 813418 - - - - - -Mozilla Bug 813418 -

- -
-
-
- - diff --git a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html b/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html deleted file mode 100644 index 0faa27a015cc..000000000000 --- a/security/manager/ssl/tests/mochitest/bugs/test_ev_validation_child.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - -

Security_state_child

- - - diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index 98ed5ee90d16..4f8240cc21cb 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -61,8 +61,6 @@ _SERV_FILES = \ plain-loop.html \ android.json \ b2g.json \ - root-ev-tester.crl \ - intermediate-ev-tester.crl \ $(NULL) ifeq ($(MOZ_BUILD_APP),mobile/android) diff --git a/testing/mochitest/intermediate-ev-tester.crl b/testing/mochitest/intermediate-ev-tester.crl deleted file mode 100644 index 3d94e958fd77301027d4b0122c9213400f8704b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 541 zcmXqLVv;myVq`SnW#iOp^Jx3d%gD&e%3#oV(U9AKlZ`o)g-w_#G#JL=5N2|AG!!!s z0m-ln^ZMqO=9MI7<|%|_rj{Ej8z_RrxrC*B^Q$s*auOAE6{7L5jGAMS@e4ON%l~DivJw(lhf?Q;Rb5(qU#Z3-e~?m82Hsrlw>jmZTaR3L6N5 zv}p=+rIzV}%+gIxG}JNBf;*d&QA{>DBe5tau_Q6i0i*(GoL*{0Vs1fBs$Oz_t~jru zv4N4HiJ^tDrKv%bIIj_iYXs$@1pqTJOc?yFKNoS^MFz8ox4U+%5f=A*l_93ASa{BV z(e=k05@w&e-Yk{CRGa9v`6uJ|hV@IHntt$N5&CG@wymc)$won8`tHeH>6VN+{05wN z&n}RxulnkFc2|vB`i}1}6fYm#WqwJc<6T(JZIKfvRv4BhwSISgYgN+FK1pBu*qZRh z%GFC}ER|iu_;gj&l!NcD{PcZq=TaEPv&+bkY4-hMsS7GP=Qq8Ldm`Z_Jl$XU(N@@aWr}ViC;$m*nPie diff --git a/testing/mochitest/root-ev-tester.crl b/testing/mochitest/root-ev-tester.crl deleted file mode 100644 index 4d0dee3a0e42bdd95c5df0476b04731a0e115e8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 557 zcmXqLV$w8dViYvsW#iOp^Jx3d%gD&e%3#p=(2(1JlZ`o)g-w_#G#JL=5N2|AG!!!s z0m-ln^ZMqO=9MI7<|%|_rj{Ej8z_RrxrC*B^Q$s*auOAE6{7L5jGAMS@e4ON%l~DivJw(lhf?Q;Rb5(hb!NR6x?q!m>b}AwWGqK?Mzl!r08%JW8C`2*fpla?t{WxrvdHA@0bGzWj$X9A?&k zaq?fdfHT>u;QSANel`7Uzpc3rUXS+Iv?;w0>=IdeabuFf?D_tD+RmYM3s{$2nLB^a zO-YBED5u=u=*MrY7gdQy9u$7Dx<2f{%!HgM-+*n$@ZoU0EOg Date: Mon, 15 Apr 2013 18:05:48 -0600 Subject: [PATCH 132/438] Backout 8ba06fb1bba0 (bug 768288). --- js/src/ion/IonBuilder.cpp | 95 +++++++++++---------------------------- js/src/ion/TypeOracle.cpp | 6 +++ js/src/jsanalyze.cpp | 2 +- js/src/jsscript.cpp | 1 - js/src/jsscript.h | 28 ++---------- 5 files changed, 36 insertions(+), 96 deletions(-) diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index ef11dca01b66..e41193c06496 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -203,8 +203,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript inlineScript(cx, target->nonLazyScript()); ExecutionMode executionMode = info().executionMode(); if (!CanIonCompile(inlineScript, executionMode)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to disable Ion compilation", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to disable Ion compilation"); return false; } @@ -213,8 +212,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) ion::IsBaselineEnabled(cx) && !inlineScript->hasBaselineScript()) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline target with no baseline jitcode", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline target with no baseline jitcode"); return false; } @@ -222,8 +220,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) IonBuilder *builder = callerBuilder_; while (builder) { if (builder->script() == inlineScript) { - IonSpew(IonSpew_Inlining, "%s:%d Not inlining recursive call", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Not inlining recursive call"); return false; } builder = builder->callerBuilder_; @@ -232,15 +229,12 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript callerScript(cx, script()); if (!oracle->canEnterInlinedFunction(target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to oracle veto %d", - inlineScript->filename(), inlineScript->lineno, - script()->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to oracle veto %d", script()->lineno); return false; } if (!oracle->callReturnTypeSetMatches(callerScript, pc, target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to return typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to return typeset mismatch"); return false; } @@ -249,8 +243,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // For constructing calls the typeset of caller should intersect the callee's typeset. // Except for the |this| type, because that is created during execution depending on target. if (!oracle->callArgsTypeSetIntersects(NULL, callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } else if (JSOp(*pc) == JSOP_FUNAPPLY) { @@ -259,25 +252,18 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // of fun.apply. Seeing a new type will only be noticed in the inlined call and // result in missed types in TI. if (!oracle->callArgsTypeSetMatches(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } else { // For normal calls the typeset of caller should intersect the callee's typeset. if (!oracle->callArgsTypeSetIntersects(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } - if (inlineScript->hasIonScript() && inlineScript->ionScript()->bailoutExpected()) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to known bailing script", - inlineScript->filename(), inlineScript->lineno); - return false; - } - + IonSpew(IonSpew_Inlining, "Inlining good to go!"); return true; } @@ -3060,12 +3046,6 @@ IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target) // Accumulate return values. MIRGraphExits &exits = *inlineBuilder.graph().exitAccumulator(); - if (exits.length() == 0) { - // Inlining of functions that have no exit is not supported. - calleeScript->analysis()->setIonUninlineable(); - abortReason_ = AbortReason_Inlining; - return false; - } MDefinition *retvalDefn = patchInlinedReturns(thisCall, exits, returnBlock); if (!retvalDefn) return false; @@ -3246,17 +3226,24 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) // Heuristics! - IonBuilder *baseBuilder = this; - while (baseBuilder->callerBuilder_) - baseBuilder = baseBuilder->callerBuilder_; + // Cap the inlining depth. + if (IsSmallFunction(targetScript)) { + if (inliningDepth_ >= js_IonOptions.smallFunctionMaxInlineDepth) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", + targetScript->filename(), targetScript->lineno); + return false; + } + } else { + if (inliningDepth_ >= js_IonOptions.maxInlineDepth) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", + targetScript->filename(), targetScript->lineno); + return false; + } + } - // When caller is excessively large only inline small functions. - if (script()->length > js_IonOptions.inlineMaxTotalBytecodeLength && - !IsSmallFunction(targetScript)) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: caller excessively large.", - targetScript->filename(), targetScript->lineno); - return false; - } + // Always inline the empty script up to the inlining depth. + if (targetScript->length == 1) + return true; // Callee must not be excessively large. // This heuristic also applies to the callsite as a whole. @@ -3281,36 +3268,6 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) return false; } - // Cap the inlining depth. - uint32_t scriptMaxInlineDepth = targetScript->maxInlineDepth(); - uint32_t globalMaxInlineDepth = js_IonOptions.maxInlineDepth; - if (IsSmallFunction(targetScript)) - globalMaxInlineDepth = js_IonOptions.smallFunctionMaxInlineDepth; - - // Cap the global inline depth. - if (inliningDepth_ >= globalMaxInlineDepth) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding global inline depth", - targetScript->filename(), targetScript->lineno); - baseBuilder->script()->disableInlineDepthCheck(); - return false; - } - - // Cap on scripts inline depth. - if (inliningDepth_ >= scriptMaxInlineDepth) - { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding script inline depth.", - targetScript->filename(), targetScript->lineno); - return false; - } - - // Update scripts max inline depth - // I.e. make sure that all known scripts that get inlined by this script still get inlined. - if (!baseBuilder->script()->isInlineDepthCheckDisabled()) { - uint32_t updatedInlineDepth = globalMaxInlineDepth - inliningDepth_ - 1; - if (updatedInlineDepth < baseBuilder->script()->maxInlineDepth()) - baseBuilder->script()->setMaxInlineDepth(updatedInlineDepth); - } - return true; } diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index 35aa88e63e26..6e67e7956079 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -703,6 +703,12 @@ TypeInferenceOracle::canEnterInlinedFunction(RawFunction target) { RootedScript targetScript(cx, target->nonLazyScript()); + // Make sure empty script has type information, to allow inlining in more cases. + if (targetScript->length == 1) { + if (!targetScript->ensureRanInference(cx)) + return false; + } + if (!targetScript->hasAnalysis() || !targetScript->analysis()->ranInference() || !targetScript->analysis()->ranSSA()) diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index 64eec6de4443..0e5312f58ce2 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -77,7 +77,7 @@ ScriptAnalysis::addJump(JSContext *cx, unsigned offset, if (offset < *currentOffset) { /* Scripts containing loops are never inlined. */ - isJaegerInlineable = false; + isJaegerInlineable = isIonInlineable = false; hasLoops_ = true; if (code->analyzed) { diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index c978f3d2c967..ed61d59d663b 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1688,7 +1688,6 @@ JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun script->sourceStart = bufStart; script->sourceEnd = bufEnd; script->userBit = options.userBit; - script->maxInlineDepth_ = uint8_t(-1); return script; } diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 34cd5055602b..595287a6b12b 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -427,6 +427,9 @@ class JSScript : public js::gc::Cell // 16-bit fields. + private: + uint16_t PADDING16; + uint16_t version; /* JS version under which script was compiled */ public: @@ -442,11 +445,6 @@ class JSScript : public js::gc::Cell uint16_t staticLevel;/* static level for display maintenance */ // 8-bit fields. - private: - uint8_t maxInlineDepth_; /* script max inline depth (IonMonkey) - uint8_t(-1): unitialized - uint8_t(-2): disabled */ - uint8_t PADDING8; public: // The kinds of the optional arrays. @@ -810,26 +808,6 @@ class JSScript : public js::gc::Cell return maxLoopCount; } - void setMaxInlineDepth(uint32_t maxInlineDepth) { - if (maxInlineDepth >= uint8_t(-2)) { - disableInlineDepthCheck(); - return; - } - maxInlineDepth_ = maxInlineDepth; - } - - uint8_t maxInlineDepth() const { - return maxInlineDepth_; - } - - void disableInlineDepthCheck() { - maxInlineDepth_ = uint8_t(-2); - } - - bool isInlineDepthCheckDisabled() { - return maxInlineDepth_ == uint8_t(-2); - } - /* * Size of the JITScript and all sections. If |mallocSizeOf| is NULL, the * size is computed analytically. (This method is implemented in From 0bdd5c7abb2091e5d3ad96878d7c8e5b326d8874 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Tue, 16 Apr 2013 11:43:22 +1200 Subject: [PATCH 133/438] Bug 861099, remove mBufferIsOpaque. r=mattwoodrow --HG-- extra : rebase_source : 89b98f9a1d73bc549fe718e52882e71c42dd6d67 --- gfx/layers/basic/BasicCanvasLayer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/gfx/layers/basic/BasicCanvasLayer.h b/gfx/layers/basic/BasicCanvasLayer.h index 3e6fbe205791..d4f31f1b09ee 100644 --- a/gfx/layers/basic/BasicCanvasLayer.h +++ b/gfx/layers/basic/BasicCanvasLayer.h @@ -104,7 +104,6 @@ class BasicShadowableCanvasLayer : public BasicCanvasLayer, public: BasicShadowableCanvasLayer(BasicShadowLayerManager* aManager) : BasicCanvasLayer(aManager), - mBufferIsOpaque(false), mCanvasClient(nullptr) { MOZ_COUNT_CTOR(BasicShadowableCanvasLayer); @@ -154,7 +153,6 @@ private: return BUFFER_IMAGE_SINGLE; } - bool mBufferIsOpaque; RefPtr mCanvasClient; }; From a461d0eae0a36ea6251b1347c2927d5dc94a540f Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Tue, 16 Apr 2013 13:20:18 +1200 Subject: [PATCH 134/438] Bug 846122 - Handle split multi-track Cues in nestegg. r=padenot --- media/libnestegg/README_MOZILLA | 2 +- media/libnestegg/src/nestegg.c | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/media/libnestegg/README_MOZILLA b/media/libnestegg/README_MOZILLA index 49ac6a10434d..d770e7f9787a 100644 --- a/media/libnestegg/README_MOZILLA +++ b/media/libnestegg/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The nestegg git repository is: git://github.com/kinetiknz/nestegg.git -The git commit ID used was ebdbb688fb13dd315fc9d16e6897adb5ee42b7bb. +The git commit ID used was 443edc8d8cb1037275b055474256a7fa089766dc. diff --git a/media/libnestegg/src/nestegg.c b/media/libnestegg/src/nestegg.c index 59a1a4734c77..b2651f335571 100644 --- a/media/libnestegg/src/nestegg.c +++ b/media/libnestegg/src/nestegg.c @@ -1407,10 +1407,14 @@ ne_find_seek_for_id(struct ebml_list_node * seek_head, uint64_t id) } static struct cue_point * -ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, uint64_t tstamp) +ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, unsigned int track, uint64_t scale, uint64_t tstamp) { uint64_t time; struct cue_point * c, * prev = NULL; + uint64_t track_number; + unsigned int t; + struct ebml_list_node * node; + struct cue_track_positions * pos; while (cue_point) { assert(cue_point->id == ID_CUE_POINT); @@ -1419,14 +1423,27 @@ ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, if (!prev) prev = c; - if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp) - break; + node = prev->cue_track_positions.head; + while (node) { + assert(node->id == ID_CUE_TRACK_POSITIONS); + pos = node->data; + if (ne_get_uint(pos->track, &track_number) != 0) + return NULL; + + if (ne_map_track_number_to_index(ctx, track_number, &t) != 0) + return NULL; + + if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp && t == track) + return prev; + + node = node->next; + } prev = cue_point->data; cue_point = cue_point->next; } - return prev; + return NULL; } static int @@ -1850,7 +1867,7 @@ nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp) tc_scale = ne_get_timecode_scale(ctx); - cue_point = ne_find_cue_point_for_tstamp(ctx->segment.cues.cue_point.head, tc_scale, tstamp); + cue_point = ne_find_cue_point_for_tstamp(ctx, ctx->segment.cues.cue_point.head, track, tc_scale, tstamp); if (!cue_point) return -1; From bb3fe4cc6f1fb55c645090644aca175ab46f873c Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 15 Apr 2013 19:49:35 -0400 Subject: [PATCH 135/438] Bug 854319 - Part 1: Call BeginDecoding before OnDecodeThreadStart; r=cpearce This is what WMFReader::OnDecodeThreadStart() expects. --- content/media/webaudio/MediaBufferDecoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/media/webaudio/MediaBufferDecoder.cpp b/content/media/webaudio/MediaBufferDecoder.cpp index a850178623f6..ab1c01264a90 100644 --- a/content/media/webaudio/MediaBufferDecoder.cpp +++ b/content/media/webaudio/MediaBufferDecoder.cpp @@ -418,10 +418,10 @@ MediaDecodeTask::Decode() { MOZ_ASSERT(!NS_IsMainThread()); - mDecoderReader->OnDecodeThreadStart(); - mBufferDecoder->BeginDecoding(NS_GetCurrentThread()); + mDecoderReader->OnDecodeThreadStart(); + VideoInfo videoInfo; nsAutoPtr tags; nsresult rv = mDecoderReader->ReadMetadata(&videoInfo, getter_Transfers(tags)); From ed2b473e4519849cd733a4ffd35d6df56156127f Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 15 Apr 2013 20:08:03 -0400 Subject: [PATCH 136/438] Bug 854319 - Part 2: Always use a ref pointer when dealing with MediaResource objects; r=cpearce --- content/media/webaudio/MediaBufferDecoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/media/webaudio/MediaBufferDecoder.cpp b/content/media/webaudio/MediaBufferDecoder.cpp index ab1c01264a90..ad030ae1e6e6 100644 --- a/content/media/webaudio/MediaBufferDecoder.cpp +++ b/content/media/webaudio/MediaBufferDecoder.cpp @@ -97,7 +97,7 @@ private: // GetReentrantMonitor correctly. ReentrantMonitor mReentrantMonitor; nsCOMPtr mDecodeThread; - nsAutoPtr mResource; + nsRefPtr mResource; }; NS_IMPL_THREADSAFE_ISUPPORTS0(BufferDecoder) @@ -389,7 +389,7 @@ MediaDecodeTask::CreateReader() { MOZ_ASSERT(NS_IsMainThread()); - BufferMediaResource* resource = + nsRefPtr resource = new BufferMediaResource(static_cast (mBuffer), mLength, mPrincipal, mContentType); From 8fce450089289df656b11ec76aa184ed0311e373 Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Mon, 15 Apr 2013 22:05:46 -0400 Subject: [PATCH 137/438] Bug 861324 - Remove unneeded mDecoder null check after usage. r=joedrew --- image/src/RasterImage.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 19cca9bd4a94..5c9e5624241e 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -2674,9 +2674,6 @@ RasterImage::WriteToDecoder(const char *aBuffer, uint32_t aCount) mDecoder->Write(aBuffer, aCount); mInDecoder = false; - if (!mDecoder) - return NS_ERROR_FAILURE; - CONTAINER_ENSURE_SUCCESS(mDecoder->GetDecoderError()); // Keep track of the total number of bytes written over the lifetime of the From 67005c35286a18b8109758f0f31908b8c6d6d620 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 15 Apr 2013 17:02:46 -0700 Subject: [PATCH 138/438] Bug 861543 - x86-64: Use movl instead of movabsq for 32-bits immediates. r=nbp Make the implementation of mov in the x86-64 assembler use movl instead of movabsq for loading immediates which fit in 32-bit immediate fields. This reduces the size of the instructions. Also, change several places to call mov instead of using movq directly, so that they can take advantage of this optimization. --HG-- extra : rebase_source : 32f9a56a1cd7c794fe07f289bfaad9c2e9f5a55a --- js/src/ion/x64/Assembler-x64.h | 11 ++++++++++- js/src/ion/x64/MacroAssembler-x64.h | 26 +++++++++++++------------- js/src/ion/x64/Trampoline-x64.cpp | 2 +- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/js/src/ion/x64/Assembler-x64.h b/js/src/ion/x64/Assembler-x64.h index 680d24c4f741..379a88eea1ae 100644 --- a/js/src/ion/x64/Assembler-x64.h +++ b/js/src/ion/x64/Assembler-x64.h @@ -510,7 +510,16 @@ class Assembler : public AssemblerX86Shared } void mov(ImmWord word, const Register &dest) { - movq(word, dest); + // If the word value is in [0,UINT32_MAX], we can use the more compact + // movl instruction, which has a 32-bit immediate field which it + // zero-extends into the 64-bit register. + if (word.value <= UINT32_MAX) { + uint32_t value32 = static_cast(word.value); + Imm32 imm32(static_cast(value32)); + movl(imm32, dest); + } else { + movq(word, dest); + } } void mov(const Imm32 &imm32, const Register &dest) { movl(imm32, dest); diff --git a/js/src/ion/x64/MacroAssembler-x64.h b/js/src/ion/x64/MacroAssembler-x64.h index 186943bf95a5..6165a0c5fe60 100644 --- a/js/src/ion/x64/MacroAssembler-x64.h +++ b/js/src/ion/x64/MacroAssembler-x64.h @@ -79,7 +79,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared // X64 helpers. ///////////////////////////////////////////////////////////////// void call(ImmWord target) { - movq(target, rax); + mov(target, rax); call(rax); } @@ -166,7 +166,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared JS_ASSERT(dest.valueReg() != ScratchReg); if (payload != dest.valueReg()) movq(payload, dest.valueReg()); - movq(ImmShiftedTag(type), ScratchReg); + mov(ImmShiftedTag(type), ScratchReg); orq(Operand(ScratchReg), dest.valueReg()); } void pushValue(ValueOperand val) { @@ -207,7 +207,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared JS_ASSERT(src != dest); JSValueShiftedTag tag = (JSValueShiftedTag)JSVAL_TYPE_TO_SHIFTED_TAG(type); - movq(ImmShiftedTag(tag), dest); + mov(ImmShiftedTag(tag), dest); #ifdef DEBUG if (type == JSVAL_TYPE_INT32 || type == JSVAL_TYPE_BOOLEAN) { Label upper32BitsZeroed; @@ -344,7 +344,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared void cmpPtr(const Register &lhs, const ImmWord rhs) { JS_ASSERT(lhs != ScratchReg); - movq(rhs, ScratchReg); + mov(rhs, ScratchReg); cmpq(lhs, ScratchReg); } void cmpPtr(const Register &lhs, const ImmGCPtr rhs) { @@ -357,7 +357,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared cmpq(lhs, ScratchReg); } void cmpPtr(const Operand &lhs, const ImmWord rhs) { - movq(rhs, ScratchReg); + mov(rhs, ScratchReg); cmpq(lhs, ScratchReg); } void cmpPtr(const Address &lhs, const ImmGCPtr rhs) { @@ -413,7 +413,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared } void addPtr(ImmWord imm, const Register &dest) { JS_ASSERT(dest != ScratchReg); - movq(imm, ScratchReg); + mov(imm, ScratchReg); addq(ScratchReg, dest); } void addPtr(const Address &src, const Register &dest) { @@ -430,14 +430,14 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared } void branch32(Condition cond, const AbsoluteAddress &lhs, Imm32 rhs, Label *label) { - movq(ImmWord(lhs.addr), ScratchReg); + mov(ImmWord(lhs.addr), ScratchReg); branch32(cond, Address(ScratchReg, 0), rhs, label); } // Specialization for AbsoluteAddress. void branchPtr(Condition cond, const AbsoluteAddress &addr, const Register &ptr, Label *label) { JS_ASSERT(ptr != ScratchReg); - movq(ImmWord(addr.addr), ScratchReg); + mov(ImmWord(addr.addr), ScratchReg); branchPtr(cond, Operand(ScratchReg, 0x0), ptr, label); } @@ -493,13 +493,13 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared movq(src, dest); } void movePtr(ImmWord imm, Register dest) { - movq(imm, dest); + mov(imm, dest); } void movePtr(ImmGCPtr imm, Register dest) { movq(imm, dest); } void loadPtr(const AbsoluteAddress &address, Register dest) { - movq(ImmWord(address.addr), ScratchReg); + mov(ImmWord(address.addr), ScratchReg); movq(Operand(ScratchReg, 0x0), dest); } void loadPtr(const Address &address, Register dest) { @@ -516,7 +516,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared shlq(Imm32(1), dest); } void storePtr(ImmWord imm, const Address &address) { - movq(imm, ScratchReg); + mov(imm, ScratchReg); movq(ScratchReg, Operand(address)); } void storePtr(ImmGCPtr imm, const Address &address) { @@ -530,7 +530,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared movq(src, dest); } void storePtr(const Register &src, const AbsoluteAddress &address) { - movq(ImmWord(address.addr), ScratchReg); + mov(ImmWord(address.addr), ScratchReg); movq(src, Operand(ScratchReg, 0x0)); } void rshiftPtr(Imm32 imm, Register dest) { @@ -871,7 +871,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared } pun; pun.d = d; if (!maybeInlineDouble(pun.u, dest)) { - movq(ImmWord(pun.u), ScratchReg); + mov(ImmWord(pun.u), ScratchReg); movqsd(ScratchReg, dest); } } diff --git a/js/src/ion/x64/Trampoline-x64.cpp b/js/src/ion/x64/Trampoline-x64.cpp index a8e1f6f86067..b25b253bed98 100644 --- a/js/src/ion/x64/Trampoline-x64.cpp +++ b/js/src/ion/x64/Trampoline-x64.cpp @@ -646,7 +646,7 @@ IonRuntime::generatePreBarrier(JSContext *cx, MIRType type) masm.PushRegsInMask(regs); JS_ASSERT(PreBarrierReg == rdx); - masm.movq(ImmWord(cx->runtime), rcx); + masm.mov(ImmWord(cx->runtime), rcx); masm.setupUnalignedABICall(2, rax); masm.passABIArg(rcx); From 722e34041460af3e977f3e3da4b3f278d7b3323e Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Tue, 16 Apr 2013 14:58:44 +1200 Subject: [PATCH 139/438] Backout 5f7a95537199 (bug 846122). --- media/libnestegg/README_MOZILLA | 2 +- media/libnestegg/src/nestegg.c | 27 +++++---------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/media/libnestegg/README_MOZILLA b/media/libnestegg/README_MOZILLA index d770e7f9787a..49ac6a10434d 100644 --- a/media/libnestegg/README_MOZILLA +++ b/media/libnestegg/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The nestegg git repository is: git://github.com/kinetiknz/nestegg.git -The git commit ID used was 443edc8d8cb1037275b055474256a7fa089766dc. +The git commit ID used was ebdbb688fb13dd315fc9d16e6897adb5ee42b7bb. diff --git a/media/libnestegg/src/nestegg.c b/media/libnestegg/src/nestegg.c index b2651f335571..59a1a4734c77 100644 --- a/media/libnestegg/src/nestegg.c +++ b/media/libnestegg/src/nestegg.c @@ -1407,14 +1407,10 @@ ne_find_seek_for_id(struct ebml_list_node * seek_head, uint64_t id) } static struct cue_point * -ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, unsigned int track, uint64_t scale, uint64_t tstamp) +ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, uint64_t tstamp) { uint64_t time; struct cue_point * c, * prev = NULL; - uint64_t track_number; - unsigned int t; - struct ebml_list_node * node; - struct cue_track_positions * pos; while (cue_point) { assert(cue_point->id == ID_CUE_POINT); @@ -1423,27 +1419,14 @@ ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, u if (!prev) prev = c; - node = prev->cue_track_positions.head; - while (node) { - assert(node->id == ID_CUE_TRACK_POSITIONS); - pos = node->data; - if (ne_get_uint(pos->track, &track_number) != 0) - return NULL; - - if (ne_map_track_number_to_index(ctx, track_number, &t) != 0) - return NULL; - - if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp && t == track) - return prev; - - node = node->next; - } + if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp) + break; prev = cue_point->data; cue_point = cue_point->next; } - return NULL; + return prev; } static int @@ -1867,7 +1850,7 @@ nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp) tc_scale = ne_get_timecode_scale(ctx); - cue_point = ne_find_cue_point_for_tstamp(ctx, ctx->segment.cues.cue_point.head, track, tc_scale, tstamp); + cue_point = ne_find_cue_point_for_tstamp(ctx->segment.cues.cue_point.head, tc_scale, tstamp); if (!cue_point) return -1; From d5d51e34cbf9338a97d1ddedbdb1bdcbde19ce8a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 11 Apr 2013 20:42:01 -0700 Subject: [PATCH 140/438] Bug 859657 (part 1) - Don't measure MEMORY_EXPLICIT in telemetry because it can cause pauses. r=jlebar. --HG-- extra : rebase_source : 93a9d3896ec62d54ccfdaa6a8a90a5e9188fe67c --- toolkit/components/telemetry/Histograms.json | 8 -------- toolkit/components/telemetry/TelemetryPing.js | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 34a5a2679dd3..92ac84da765a 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -268,14 +268,6 @@ "n_buckets": 25, "description": "Ratio of committed, unused memory to allocated memory in the heap (percentage)." }, - "MEMORY_EXPLICIT": { - "kind": "exponential", - "low": 1024, - "high": "16 * 1024 * 1024", - "n_buckets": 200, - "extended_statistics_ok": true, - "description": "Explicit memory allocations (KB)" - }, "GHOST_WINDOWS": { "kind": "exponential", "high": "128", diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js index ea56e3bcdd3a..7314c51a5347 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -58,12 +58,13 @@ const RWX_OWNER = 0700; // * MEMORY_JS_GC_HEAP, and // * MEMORY_JS_COMPARTMENTS_SYSTEM. // +// We used to measure "explicit" too, but it could cause hangs, and the data +// was always really noisy anyway. See bug 859657. const MEM_HISTOGRAMS = { "js-gc-heap": "MEMORY_JS_GC_HEAP", "js-compartments/system": "MEMORY_JS_COMPARTMENTS_SYSTEM", "js-compartments/user": "MEMORY_JS_COMPARTMENTS_USER", "js-main-runtime-temporary-peak": "MEMORY_JS_MAIN_RUNTIME_TEMPORARY_PEAK", - "explicit": "MEMORY_EXPLICIT", "resident-fast": "MEMORY_RESIDENT", "vsize": "MEMORY_VSIZE", "storage-sqlite": "MEMORY_STORAGE_SQLITE", From 1c97315e2284651059f617a7886a86b135ca9cbf Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 11 Apr 2013 20:52:32 -0700 Subject: [PATCH 141/438] Bug 859657 (part 2) - Remove nsIMemoryMultiReporter.explicitNonHeap because it's more trouble than it's worth; also remove the "explicit" single reporter. r=jlebar. --HG-- extra : rebase_source : a146536a3dd0043082bcb1c26d980c4c6d4c0730 --- content/base/src/nsDOMFile.cpp | 7 -- content/canvas/src/WebGLContextReporter.cpp | 8 -- dom/base/nsWindowMemoryReporter.cpp | 16 ---- dom/workers/WorkerPrivate.cpp | 36 +-------- dom/workers/WorkerPrivate.h | 3 +- gfx/thebes/gfxASurface.cpp | 6 -- gfx/thebes/gfxFont.cpp | 8 -- gfx/thebes/gfxPlatformFontList.cpp | 8 -- gfx/thebes/gfxWindowsPlatform.cpp | 9 --- image/src/imgLoader.cpp | 25 ------ js/public/MemoryMetrics.h | 3 - js/src/jsapi.cpp | 1 - js/src/jscntxt.cpp | 18 ----- js/src/jscntxt.h | 3 - js/src/jsmemorymetrics.cpp | 23 ------ js/src/jstypedarray.cpp | 7 -- js/xpconnect/src/XPCJSMemoryReporter.h | 2 - js/xpconnect/src/XPCJSRuntime.cpp | 16 ---- storage/src/mozStorageService.cpp | 7 -- .../tests/test_memoryReporters.xul | 10 +-- xpcom/base/MapsMemoryReporter.cpp | 7 -- xpcom/base/nsCycleCollector.cpp | 7 -- xpcom/base/nsIMemoryReporter.idl | 14 +--- xpcom/base/nsMemoryReporterManager.cpp | 80 +++---------------- 24 files changed, 19 insertions(+), 305 deletions(-) diff --git a/content/base/src/nsDOMFile.cpp b/content/base/src/nsDOMFile.cpp index 2601738b7c8c..10490dc1b940 100644 --- a/content/base/src/nsDOMFile.cpp +++ b/content/base/src/nsDOMFile.cpp @@ -631,13 +631,6 @@ class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL return NS_OK; } - NS_IMETHOD GetExplicitNonHeap(int64_t *aResult) - { - // All of this reporter's memory is on the heap. - *aResult = 0; - return NS_OK; - } - NS_IMETHOD CollectReports(nsIMemoryMultiReporterCallback *aCallback, nsISupports *aClosure) { diff --git a/content/canvas/src/WebGLContextReporter.cpp b/content/canvas/src/WebGLContextReporter.cpp index 3f8d79f1bd39..c2da4d8d5b4d 100644 --- a/content/canvas/src/WebGLContextReporter.cpp +++ b/content/canvas/src/WebGLContextReporter.cpp @@ -26,14 +26,6 @@ WebGLMemoryMultiReporter::GetName(nsACString &aName) return NS_OK; } -NS_IMETHODIMP -WebGLMemoryMultiReporter::GetExplicitNonHeap(int64_t *aAmount) -{ - // WebGLMemoryMultiReporterWrapper has no KIND_NONHEAP measurements. - *aAmount = 0; - return NS_OK; -} - NS_IMETHODIMP WebGLMemoryMultiReporter::CollectReports(nsIMemoryMultiReporterCallback* aCb, nsISupports* aClosure) diff --git a/dom/base/nsWindowMemoryReporter.cpp b/dom/base/nsWindowMemoryReporter.cpp index 84b9ea08cbe6..6fe4cc7accb4 100644 --- a/dom/base/nsWindowMemoryReporter.cpp +++ b/dom/base/nsWindowMemoryReporter.cpp @@ -410,14 +410,6 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryMultiReporterCallback* aCb, return NS_OK; } -NS_IMETHODIMP -nsWindowMemoryReporter::GetExplicitNonHeap(int64_t* aAmount) -{ - // This reporter only measures heap memory, so we don't need to report any - // bytes for it. However, the JS multi-reporter needs to be invoked. - return xpc::JSMemoryMultiReporter::GetExplicitNonHeap(aAmount); -} - uint32_t nsWindowMemoryReporter::GetGhostTimeout() { @@ -668,14 +660,6 @@ GhostURLsReporter::GetName(nsACString& aName) return NS_OK; } -NS_IMETHODIMP -nsWindowMemoryReporter:: -GhostURLsReporter::GetExplicitNonHeap(int64_t* aOut) -{ - *aOut = 0; - return NS_OK; -} - struct ReportGhostWindowsEnumeratorData { nsIMemoryMultiReporterCallback* callback; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index a84cd3751f9f..bac8d8dfcc0e 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1774,8 +1774,7 @@ public: MutexAutoLock lock(mMutex); if (!mWorkerPrivate || - !mWorkerPrivate->BlockAndCollectRuntimeStats(/* aIsQuick = */ false, - &rtStats)) { + !mWorkerPrivate->BlockAndCollectRuntimeStats(&rtStats)) { // Returning NS_OK here will effectively report 0 memory. return NS_OK; } @@ -1785,24 +1784,6 @@ public: aCallback, aClosure); } - NS_IMETHOD - GetExplicitNonHeap(int64_t* aAmount) - { - AssertIsOnMainThread(); - - { - MutexAutoLock lock(mMutex); - - if (!mWorkerPrivate || - !mWorkerPrivate->BlockAndCollectRuntimeStats(/* aIsQuick = */ true, - aAmount)) { - *aAmount = 0; - } - } - - return NS_OK; - } - private: ~MemoryReporter() { } @@ -2940,11 +2921,11 @@ WorkerPrivate::ScheduleDeletion(bool aWasPending) } bool -WorkerPrivate::BlockAndCollectRuntimeStats(bool aIsQuick, void* aData) +WorkerPrivate::BlockAndCollectRuntimeStats(JS::RuntimeStats* aRtStats) { AssertIsOnMainThread(); mMutex.AssertCurrentThreadOwns(); - NS_ASSERTION(aData, "Null data!"); + NS_ASSERTION(aRtStats, "Null RuntimeStats!"); NS_ASSERTION(!mMemoryReporterRunning, "How can we get reentered here?!"); @@ -2973,16 +2954,7 @@ WorkerPrivate::BlockAndCollectRuntimeStats(bool aIsQuick, void* aData) if (mMemoryReporter) { // Don't hold the lock while doing the actual report. MutexAutoUnlock unlock(mMutex); - - if (aIsQuick) { - *static_cast(aData) = - JS::GetExplicitNonHeapForRuntime(rt, JsWorkerMallocSizeOf); - succeeded = true; - } else { - succeeded = - JS::CollectRuntimeStats(rt, static_cast(aData), - nullptr); - } + succeeded = JS::CollectRuntimeStats(rt, aRtStats, nullptr); } NS_ASSERTION(mMemoryReporterRunning, "This isn't possible!"); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index 1d9c8b5acbca..e07490964566 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -41,6 +41,7 @@ class nsIURI; class nsPIDOMWindow; class nsITimer; class nsIXPCScriptNotify; +namespace JS { class RuntimeStats; } BEGIN_WORKERS_NAMESPACE @@ -821,7 +822,7 @@ public: ScheduleDeletion(bool aWasPending); bool - BlockAndCollectRuntimeStats(bool aIsQuick, void* aData); + BlockAndCollectRuntimeStats(JS::RuntimeStats* aRtStats); bool XHRParamsAllowed() const diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index 386cca665159..d3c60a7d8cf4 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -634,12 +634,6 @@ public: return NS_OK; } - - NS_IMETHOD GetExplicitNonHeap(int64_t *n) - { - *n = 0; // this reporter makes neither "explicit" non NONHEAP reports - return NS_OK; - } }; NS_IMPL_ISUPPORTS1(SurfaceMemoryReporter, nsIMemoryMultiReporter) diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 875374599320..ccf93a5b6e14 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -1137,14 +1137,6 @@ gfxFontCache::MemoryReporter::CollectReports return NS_OK; } -NS_IMETHODIMP -gfxFontCache::MemoryReporter::GetExplicitNonHeap(int64_t* aAmount) -{ - // This reporter only measures heap memory. - *aAmount = 0; - return NS_OK; -} - // Observer for the memory-pressure notification, to trigger // flushing of the shaped-word caches class MemoryPressureObserver MOZ_FINAL : public nsIObserver, diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index afb2f9d517ab..7dd9935f45a0 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -120,14 +120,6 @@ gfxPlatformFontList::MemoryReporter::CollectReports return NS_OK; } -NS_IMETHODIMP -gfxPlatformFontList::MemoryReporter::GetExplicitNonHeap(int64_t* aAmount) -{ - // This reporter only measures heap memory. - *aAmount = 0; - return NS_OK; -} - gfxPlatformFontList::gfxPlatformFontList(bool aNeedFullnamePostscriptNames) : mNeedFullnamePostscriptNames(aNeedFullnamePostscriptNames), mStartIndex(0), mIncrement(kNumFontsPerSlice), mNumFamilies(0) diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 1ee71f336e40..6d913f07ffa6 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -323,15 +323,6 @@ public: return NS_OK; } - - // nsIMemoryMultiReporter abstract method implementation - NS_IMETHOD - GetExplicitNonHeap(int64_t *aExplicitNonHeap) - { - // This reporter doesn't do any non-heap measurements. - *aExplicitNonHeap = 0; - return NS_OK; - } }; NS_IMPL_ISUPPORTS1(GPUAdapterMultiReporter, nsIMemoryMultiReporter) #endif // ENABLE_GPU_MEM_REPORTER diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index db829310e18c..03a1cf4cdec9 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -150,17 +150,6 @@ public: return NS_OK; } - NS_IMETHOD GetExplicitNonHeap(int64_t *n) - { - size_t n2 = 0; - for (uint32_t i = 0; i < mKnownLoaders.Length(); i++) { - mKnownLoaders[i]->mChromeCache.EnumerateRead(EntryExplicitNonHeapSize, &n2); - mKnownLoaders[i]->mCache.EnumerateRead(EntryExplicitNonHeapSize, &n2); - } - *n = n2; - return NS_OK; - } - static int64_t GetImagesContentUsedUncompressed() { size_t n = 0; @@ -222,20 +211,6 @@ private: return PL_DHASH_NEXT; } - static PLDHashOperator EntryExplicitNonHeapSize(const nsACString&, - imgCacheEntry *entry, - void *userArg) - { - size_t *n = static_cast(userArg); - nsRefPtr req = entry->GetRequest(); - Image *image = static_cast(req->mImage.get()); - if (image) { - *n += image->NonHeapSizeOfDecoded(); - } - - return PL_DHASH_NEXT; - } - static PLDHashOperator EntryUsedUncompressedSize(const nsACString&, imgCacheEntry *entry, void *userArg) diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index 14cf88ec4c60..f14dc73912cf 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -444,9 +444,6 @@ class ObjectPrivateVisitor extern JS_PUBLIC_API(bool) CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv); -extern JS_PUBLIC_API(int64_t) -GetExplicitNonHeapForRuntime(JSRuntime *rt, JSMallocSizeOfFun mallocSizeOf); - extern JS_PUBLIC_API(size_t) SystemCompartmentCount(JSRuntime *rt); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 6df21245fe8c..cfba78bcd547 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -880,7 +880,6 @@ JSRuntime::JSRuntime(JSUseHelperThreads useHelperThreads) data(NULL), gcLock(NULL), gcHelperThread(thisFromCtor()), - sizeOfNonHeapAsmJSArrays_(0), #ifdef JS_THREADSAFE #ifdef JS_ION workerThreadState(NULL), diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 2190cf5be7ae..9da194a90cf8 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -143,24 +143,6 @@ JSRuntime::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes rtSizes->scriptData += mallocSizeOf(r.front()); } -size_t -JSRuntime::sizeOfExplicitNonHeap() -{ - size_t n = stackSpace.sizeOf(); - - if (execAlloc_) { - JS::CodeSizes sizes; - execAlloc_->sizeOfCode(&sizes); - n += sizes.jaeger + sizes.ion + sizes.baseline + sizes.asmJS + - sizes.regexp + sizes.other + sizes.unused; - } - - if (bumpAlloc_) - n += bumpAlloc_->sizeOfNonHeapData(); - - return n; -} - void JSRuntime::triggerOperationCallback() { diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index fd90371f11b8..01ca74eba0e7 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -1204,8 +1204,6 @@ struct JSRuntime : private JS::shadow::Runtime, js::AsmJSMachExceptionHandler asmJSMachExceptionHandler; #endif - size_t sizeOfNonHeapAsmJSArrays_; - #ifdef JS_THREADSAFE # ifdef JS_ION js::WorkerThreadState *workerThreadState; @@ -1405,7 +1403,6 @@ struct JSRuntime : private JS::shadow::Runtime, } void sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, JS::RuntimeSizes *runtime); - size_t sizeOfExplicitNonHeap(); private: diff --git a/js/src/jsmemorymetrics.cpp b/js/src/jsmemorymetrics.cpp index fc82601c5c17..351d965446e5 100644 --- a/js/src/jsmemorymetrics.cpp +++ b/js/src/jsmemorymetrics.cpp @@ -375,29 +375,6 @@ JS::CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisit return true; } -JS_PUBLIC_API(int64_t) -JS::GetExplicitNonHeapForRuntime(JSRuntime *rt, JSMallocSizeOfFun mallocSizeOf) -{ - // explicit/*/gc-heap/* - size_t n = size_t(JS_GetGCParameter(rt, JSGC_TOTAL_CHUNKS)) * gc::ChunkSize; - - // Subtract decommitted arenas, which aren't included in "explicit". - size_t decommittedArenas = 0; - IterateChunks(rt, &decommittedArenas, DecommittedArenasChunkCallback); - n -= decommittedArenas; - - // explicit/*/objects-extra/elements/asm.js (64-bit platforms only) - n += rt->sizeOfNonHeapAsmJSArrays_; - - // explicit/runtime/mjit-code - // explicit/runtime/regexp-code - // explicit/runtime/stack-committed - // explicit/runtime/unused-code-memory - n += rt->sizeOfExplicitNonHeap(); - - return int64_t(n); -} - JS_PUBLIC_API(size_t) JS::SystemCompartmentCount(JSRuntime *rt) { diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index 6d4beda2fdd6..bc07ee898708 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -379,11 +379,6 @@ ArrayBufferObject::prepareForAsmJS(JSContext *cx, Handle buf } # endif - // We don't include the PageSize at the front so that when we sum the - // individual asm.js arrays for all the compartments in the runtime, they - // match this number. - buffer->runtime()->sizeOfNonHeapAsmJSArrays_ += buffer->byteLength(); - // Copy over the current contents of the typed array. uint8_t *data = reinterpret_cast(p) + PageSize; memcpy(data, buffer->dataPointer(), buffer->byteLength()); @@ -407,8 +402,6 @@ ArrayBufferObject::releaseAsmJSArrayBuffer(FreeOp *fop, RawObject obj) ArrayBufferObject &buffer = obj->asArrayBuffer(); JS_ASSERT(buffer.isAsmJSArrayBuffer()); - buffer.runtime()->sizeOfNonHeapAsmJSArrays_ -= buffer.byteLength(); - uint8_t *p = buffer.dataPointer() - PageSize ; JS_ASSERT(uintptr_t(p) % PageSize == 0); # ifdef XP_WIN diff --git a/js/xpconnect/src/XPCJSMemoryReporter.h b/js/xpconnect/src/XPCJSMemoryReporter.h index fe507c5eacb2..ac95b7813035 100644 --- a/js/xpconnect/src/XPCJSMemoryReporter.h +++ b/js/xpconnect/src/XPCJSMemoryReporter.h @@ -26,8 +26,6 @@ public: WindowPaths *topWindowPaths, nsIMemoryMultiReporterCallback *cb, nsISupports *closure); - - static nsresult GetExplicitNonHeap(int64_t *n); }; } diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index a9a83b7a6da6..9632d264b81a 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -2150,14 +2150,6 @@ class JSCompartmentsMultiReporter MOZ_FINAL : public nsIMemoryMultiReporter return NS_OK; } - - NS_IMETHOD - GetExplicitNonHeap(int64_t *n) - { - // This reporter does neither "explicit" nor NONHEAP measurements. - *n = 0; - return NS_OK; - } }; NS_IMPL_THREADSAFE_ISUPPORTS1(JSCompartmentsMultiReporter @@ -2425,14 +2417,6 @@ JSMemoryMultiReporter::CollectReports(WindowPaths *windowPaths, return NS_OK; } -nsresult -JSMemoryMultiReporter::GetExplicitNonHeap(int64_t *n) -{ - JSRuntime *rt = nsXPConnect::GetRuntimeInstance()->GetJSRuntime(); - *reinterpret_cast(n) = JS::GetExplicitNonHeapForRuntime(rt, JsMallocSizeOf); - return NS_OK; -} - } // namespace xpc #ifdef MOZ_CRASHREPORTER diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp index 2f8c69084167..75bd54696f89 100644 --- a/storage/src/mozStorageService.cpp +++ b/storage/src/mozStorageService.cpp @@ -163,13 +163,6 @@ public: return NS_OK; } - NS_IMETHOD GetExplicitNonHeap(int64_t *aAmount) - { - // This reporter doesn't do any non-heap measurements. - *aAmount = 0; - return NS_OK; - } - private: /** * Passes a single SQLite memory statistic to a memory multi-reporter diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul index d1bd46e454f0..2b71260ce60d 100644 --- a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul +++ b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul @@ -39,7 +39,6 @@ const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE; const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE; - let explicitAmounts = []; let vsizeAmounts = []; let residentAmounts = []; let jsGcHeapAmounts = []; @@ -60,9 +59,7 @@ function handleReport(aProcess, aPath, aKind, aUnits, aAmount, aDescription) { // Record the values of some notable reporters. - if (aPath === "explicit") { - explicitAmounts.push(aAmount); - } else if (aPath === "vsize") { + if (aPath === "vsize") { vsizeAmounts.push(aAmount); } else if (aPath === "resident") { residentAmounts.push(aAmount); @@ -122,10 +119,8 @@ let r = e.getNext().QueryInterface(Ci.nsIMemoryMultiReporter); r.collectReports(handleReport, null); - // Access |name| and |explicitNonHeap| to make sure they don't crash or - // assert. + // Access |name| to make sure it doesn't crash or assert. dummy = r.name; - dummy = r.explicitNonHeap; } function checkSpecialReport(aName, aAmounts) @@ -139,7 +134,6 @@ // If mgr.explicit failed, we won't have "heap-allocated" either. if (haveExplicit) { - checkSpecialReport("explicit", explicitAmounts); checkSpecialReport("heap-allocated", heapAllocatedAmounts); } checkSpecialReport("vsize", vsizeAmounts); diff --git a/xpcom/base/MapsMemoryReporter.cpp b/xpcom/base/MapsMemoryReporter.cpp index 692484bc9e95..e95ddf112e44 100644 --- a/xpcom/base/MapsMemoryReporter.cpp +++ b/xpcom/base/MapsMemoryReporter.cpp @@ -128,13 +128,6 @@ public: CollectReports(nsIMemoryMultiReporterCallback *aCb, nsISupports *aClosure); - NS_IMETHOD - GetExplicitNonHeap(int64_t *aAmount) { - // This reporter doesn't do any "explicit" measurements. - *aAmount = 0; - return NS_OK; - } - private: // Search through /proc/self/maps for libxul.so, and set mLibxulDir to the // the directory containing libxul. diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 7d8b933ad7fb..b50af97af7f2 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -2431,13 +2431,6 @@ class CycleCollectorMultiReporter MOZ_FINAL : public nsIMemoryMultiReporter return NS_OK; } - NS_IMETHOD GetExplicitNonHeap(int64_t* n) - { - // This reporter does neither "explicit" nor NONHEAP measurements. - *n = 0; - return NS_OK; - } - private: NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(MallocSizeOf) diff --git a/xpcom/base/nsIMemoryReporter.idl b/xpcom/base/nsIMemoryReporter.idl index c248a4fa043c..2ea043c54453 100644 --- a/xpcom/base/nsIMemoryReporter.idl +++ b/xpcom/base/nsIMemoryReporter.idl @@ -199,7 +199,7 @@ interface nsIMemoryMultiReporterCallback : nsISupports * (Compare and contrast this with nsIMemoryReporter, which allows all * fields except |amount| to be accessed without triggering computation.) */ -[scriptable, uuid(61d498d5-b460-4398-a8ea-7f75208534b4)] +[scriptable, uuid(24d61ead-237b-4969-a6bd-73fd8fed1d99)] interface nsIMemoryMultiReporter : nsISupports { /* @@ -214,18 +214,6 @@ interface nsIMemoryMultiReporter : nsISupports */ void collectReports(in nsIMemoryMultiReporterCallback callback, in nsISupports closure); - - /* - * Return the sum of all this multi-reporter's measurements that have a - * path that starts with "explicit" and are KIND_NONHEAP. - * - * This is a hack that's required to implement - * nsIMemoryReporterManager::explicit efficiently, which is important -- - * multi-reporters can special-case this operation so it's much faster - * than getting all the reports, filtering out the unneeded ones, and - * summing the remainder. - */ - readonly attribute int64_t explicitNonHeap; }; [scriptable, builtinclass, uuid(70b0e608-8dbf-4dc7-b88f-f1c745c1b48c)] diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 4bf20c351b45..02870d91cb52 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -594,27 +594,6 @@ private: return (int64_t) stats.allocated; } }; - -// The computation of "explicit" fails if "heap-allocated" isn't available, -// which is why this is depends on HAVE_JEMALLOC_STATS. -class ExplicitReporter MOZ_FINAL : public MemoryReporterBase -{ -public: - ExplicitReporter() - : MemoryReporterBase("explicit", KIND_OTHER, UNITS_BYTES, -"This is the same measurement as the root of the 'explicit' tree. However, " -"it is measured at a different time and so gives slightly different results.") - {} - - NS_IMETHOD GetAmount(int64_t *aAmount) - { - nsCOMPtr mgr = do_GetService("@mozilla.org/memory-reporter-manager;1"); - if (mgr == nullptr) - return NS_ERROR_FAILURE; - - return mgr->GetExplicit(aAmount); - } -}; #endif // HAVE_JEMALLOC_STATS // Why is this here? At first glance, you'd think it could be defined and @@ -690,13 +669,6 @@ public: return NS_OK; } - - NS_IMETHOD GetExplicitNonHeap(int64_t *n) - { - // No non-heap allocations. - *n = 0; - return NS_OK; - } }; NS_IMPL_ISUPPORTS1(DMDMultiReporter, nsIMemoryMultiReporter) @@ -727,7 +699,6 @@ nsMemoryReporterManager::Init() RegisterReporter(new HeapCommittedUnusedReporter); RegisterReporter(new HeapCommittedUnusedRatioReporter); RegisterReporter(new HeapDirtyReporter); - RegisterReporter(new ExplicitReporter); #endif #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS @@ -1107,54 +1078,23 @@ nsMemoryReporterManager::GetExplicit(int64_t *aExplicit) } } - // For each multi-reporter we could call CollectReports and filter out the - // non-explicit, non-NONHEAP measurements. But that's lots of wasted work, - // so we instead use GetExplicitNonHeap() which exists purely for this - // purpose. - // - // (Actually, in debug builds we also do it the slow way and compare the - // result to the result obtained from GetExplicitNonHeap(). This - // guarantees the two measurement paths are equivalent. This is wise - // because it's easy for memory reporters to have bugs. But there's an - // exception if DMD is enabled, because that makes DMD think that all the - // blocks are double-counted.) + // For each multi-reporter we call CollectReports and filter out the + // non-explicit, non-NONHEAP measurements. That's lots of wasted work, + // and we used to have a GetExplicitNonHeap() method which did this more + // efficiently, but it ended up being more trouble than it was worth. - int64_t explicitNonHeapMultiSize = 0; + nsRefPtr cb = + new ExplicitNonHeapCountingCallback(); + nsRefPtr wrappedExplicitNonHeapMultiSize = + new Int64Wrapper(); nsCOMPtr e2; EnumerateMultiReporters(getter_AddRefs(e2)); while (NS_SUCCEEDED(e2->HasMoreElements(&more)) && more) { nsCOMPtr r; e2->GetNext(getter_AddRefs(r)); - int64_t n; - rv = r->GetExplicitNonHeap(&n); - NS_ENSURE_SUCCESS(rv, rv); - explicitNonHeapMultiSize += n; + r->CollectReports(cb, wrappedExplicitNonHeapMultiSize); } - -#if defined(DEBUG) && !defined(MOZ_DMD) - nsRefPtr cb = - new ExplicitNonHeapCountingCallback(); - nsRefPtr wrappedExplicitNonHeapMultiSize2 = - new Int64Wrapper(); - nsCOMPtr e3; - EnumerateMultiReporters(getter_AddRefs(e3)); - while (NS_SUCCEEDED(e3->HasMoreElements(&more)) && more) { - nsCOMPtr r; - e3->GetNext(getter_AddRefs(r)); - r->CollectReports(cb, wrappedExplicitNonHeapMultiSize2); - } - int64_t explicitNonHeapMultiSize2 = wrappedExplicitNonHeapMultiSize2->mValue; - - // Check the two measurements give the same result. This was an - // NS_ASSERTION but they occasionally don't match due to races (bug - // 728990). - if (explicitNonHeapMultiSize != explicitNonHeapMultiSize2) { - NS_WARNING(nsPrintfCString("The two measurements of 'explicit' memory " - "usage don't match (%lld vs %lld)", - explicitNonHeapMultiSize, - explicitNonHeapMultiSize2).get()); - } -#endif // defined(DEBUG) && !defined(MOZ_DMD) + int64_t explicitNonHeapMultiSize = wrappedExplicitNonHeapMultiSize->mValue; *aExplicit = heapAllocated + explicitNonHeapNormalSize + explicitNonHeapMultiSize; return NS_OK; From 2d23bd6e9fa6850151a62f96ac96d8c707790be0 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 15 Apr 2013 20:45:48 -0700 Subject: [PATCH 142/438] Bug 859657 (follow-up) - Bustage fix for opt builds on a CLOSED TREE. r=me. --- xpcom/base/nsMemoryReporterManager.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 02870d91cb52..b498c4b28f89 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -991,7 +991,6 @@ nsMemoryReporterManager::GetResident(int64_t *aResident) #endif } -#if defined(DEBUG) && !defined(MOZ_DMD) // This is just a wrapper for int64_t that implements nsISupports, so it can be // passed to nsIMemoryMultiReporter::CollectReports. class Int64Wrapper MOZ_FINAL : public nsISupports { @@ -1027,7 +1026,6 @@ NS_IMPL_ISUPPORTS1( ExplicitNonHeapCountingCallback , nsIMemoryMultiReporterCallback ) -#endif // defined(DEBUG) && !defined(MOZ_DMD) NS_IMETHODIMP nsMemoryReporterManager::GetExplicit(int64_t *aExplicit) From 575b423ef17450e6ca9b9982888039f39266047a Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 16 Apr 2013 00:07:32 -0400 Subject: [PATCH 143/438] Bug 861893 - Do not hold on to nsITextServicesDocument unnecessarily in the editor and the spell checker code; r=roc --- editor/libeditor/html/nsHTMLEditor.cpp | 2 -- editor/libeditor/html/nsHTMLEditor.h | 4 ---- extensions/spellcheck/src/mozInlineSpellChecker.cpp | 13 +------------ extensions/spellcheck/src/mozInlineSpellChecker.h | 2 -- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index 68a4bb08d76a..2bc2ce65cbb7 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -162,7 +162,6 @@ nsHTMLEditor::HideAnonymousEditingUIs() NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor) NS_IMPL_CYCLE_COLLECTION_UNLINK(mTypeInState) NS_IMPL_CYCLE_COLLECTION_UNLINK(mStyleSheets) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextServices) tmp->HideAnonymousEditingUIs(); NS_IMPL_CYCLE_COLLECTION_UNLINK_END @@ -170,7 +169,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTypeInState) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextServices) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTopLeftHandle) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTopHandle) diff --git a/editor/libeditor/html/nsHTMLEditor.h b/editor/libeditor/html/nsHTMLEditor.h index a6d9bf1952d7..9b46fe24432b 100644 --- a/editor/libeditor/html/nsHTMLEditor.h +++ b/editor/libeditor/html/nsHTMLEditor.h @@ -14,7 +14,6 @@ #include "nsITableEditor.h" #include "nsIEditorMailSupport.h" #include "nsIEditorStyleSheets.h" -#include "nsITextServicesDocument.h" #include "nsEditor.h" #include "nsIDOMElement.h" @@ -766,9 +765,6 @@ protected: // an array for holding default style settings nsTArray mDefaultStyles; - // for real-time spelling - nsCOMPtr mTextServices; - protected: /* ANONYMOUS UTILS */ diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.cpp b/extensions/spellcheck/src/mozInlineSpellChecker.cpp index 0c995b68c26b..431188dbaa07 100644 --- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp +++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp @@ -481,9 +481,8 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(mozInlineSpellChecker) NS_IMPL_CYCLE_COLLECTING_RELEASE(mozInlineSpellChecker) -NS_IMPL_CYCLE_COLLECTION_4(mozInlineSpellChecker, +NS_IMPL_CYCLE_COLLECTION_3(mozInlineSpellChecker, mSpellCheck, - mTextServicesDocument, mTreeWalker, mCurrentSelectionAnchorNode) @@ -675,16 +674,6 @@ mozInlineSpellChecker::SetEnableRealTimeSpell(bool aEnabled) res = spellchecker->InitSpellChecker(editor, false); NS_ENSURE_SUCCESS(res, res); - nsCOMPtr tsDoc = do_CreateInstance("@mozilla.org/textservices/textservicesdocument;1", &res); - NS_ENSURE_SUCCESS(res, res); - - res = tsDoc->SetFilter(filter); - NS_ENSURE_SUCCESS(res, res); - - res = tsDoc->InitWithEditor(editor); - NS_ENSURE_SUCCESS(res, res); - - mTextServicesDocument = tsDoc; mSpellCheck = spellchecker; // spell checking is enabled, register our event listeners to track navigation diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.h b/extensions/spellcheck/src/mozInlineSpellChecker.h index 374efe644443..dcdb06c4bc56 100644 --- a/extensions/spellcheck/src/mozInlineSpellChecker.h +++ b/extensions/spellcheck/src/mozInlineSpellChecker.h @@ -11,7 +11,6 @@ #include "nsIEditorSpellCheck.h" #include "nsIEditActionListener.h" #include "nsIInlineSpellChecker.h" -#include "nsITextServicesDocument.h" #include "nsIDOMTreeWalker.h" #include "nsWeakReference.h" #include "nsEditor.h" @@ -130,7 +129,6 @@ private: nsWeakPtr mEditor; nsCOMPtr mSpellCheck; - nsCOMPtr mTextServicesDocument; nsCOMPtr mTreeWalker; nsCOMPtr mConverter; From 4134b5fe70af6a20a3cba41edc43d5bb783687b1 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 16 Apr 2013 00:08:04 -0400 Subject: [PATCH 144/438] Bug 861897 - Cleanup nsComposeTxtSrvFilter to use nsGkAtoms; r=roc --- content/base/src/nsGkAtomList.h | 1 + editor/composer/src/nsComposeTxtSrvFilter.cpp | 50 +++++++------------ editor/composer/src/nsComposeTxtSrvFilter.h | 20 +------- 3 files changed, 20 insertions(+), 51 deletions(-) diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 27a9c672de53..21efd138e7c9 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -45,6 +45,7 @@ GK_ATOM(mozgeneratedcontentbefore, "_moz_generated_content_before") GK_ATOM(mozgeneratedcontentafter, "_moz_generated_content_after") GK_ATOM(mozgeneratedcontentimage, "_moz_generated_content_image") GK_ATOM(mozquote, "_moz_quote") +GK_ATOM(mozsignature, "moz-signature") GK_ATOM(_moz_is_glyph, "-moz-is-glyph") GK_ATOM(_moz_original_size, "_moz_original_size") GK_ATOM(_moz_target, "_moz_target") diff --git a/editor/composer/src/nsComposeTxtSrvFilter.cpp b/editor/composer/src/nsComposeTxtSrvFilter.cpp index 84577de2ec5c..bf3049601d1d 100644 --- a/editor/composer/src/nsComposeTxtSrvFilter.cpp +++ b/editor/composer/src/nsComposeTxtSrvFilter.cpp @@ -3,11 +3,9 @@ * 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 "nsCaseTreatment.h" #include "nsComposeTxtSrvFilter.h" #include "nsError.h" // for NS_OK #include "nsIContent.h" // for nsIContent -#include "nsID.h" #include "nsIDOMNode.h" // for nsIDOMNode #include "nsINameSpaceManager.h" // for kNameSpaceID_None #include "nsLiteralString.h" // for NS_LITERAL_STRING @@ -16,25 +14,11 @@ nsComposeTxtSrvFilter::nsComposeTxtSrvFilter() : mIsForMail(false) { - - mBlockQuoteAtom = do_GetAtom("blockquote"); - mSpanAtom = do_GetAtom("span"); - mTableAtom = do_GetAtom("table"); - mMozQuoteAtom = do_GetAtom("_moz_quote"); - mClassAtom = do_GetAtom("class"); - mTypeAtom = do_GetAtom("type"); - mScriptAtom = do_GetAtom("script"); - mTextAreaAtom = do_GetAtom("textarea"); - mSelectAreaAtom = do_GetAtom("select"); - mMapAtom = do_GetAtom("map"); - mCiteAtom = do_GetAtom("cite"); - mTrueAtom = do_GetAtom("true"); - mMozSignatureAtom= do_GetAtom("moz-signature"); } NS_IMPL_ISUPPORTS1(nsComposeTxtSrvFilter, nsITextServicesFilter) -NS_IMETHODIMP +NS_IMETHODIMP nsComposeTxtSrvFilter::Skip(nsIDOMNode* aNode, bool *_retval) { *_retval = false; @@ -45,32 +29,32 @@ nsComposeTxtSrvFilter::Skip(nsIDOMNode* aNode, bool *_retval) nsCOMPtr content(do_QueryInterface(aNode)); if (content) { nsIAtom *tag = content->Tag(); - if (tag == mBlockQuoteAtom) { + if (tag == nsGkAtoms::blockquote) { if (mIsForMail) { - *_retval = content->AttrValueIs(kNameSpaceID_None, mTypeAtom, - mCiteAtom, eIgnoreCase); + *_retval = content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, + nsGkAtoms::cite, eIgnoreCase); } - } else if (tag == mSpanAtom) { + } else if (tag == nsGkAtoms::span) { if (mIsForMail) { - *_retval = content->AttrValueIs(kNameSpaceID_None, mMozQuoteAtom, - mTrueAtom, eIgnoreCase); + *_retval = content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::mozquote, + nsGkAtoms::_true, eIgnoreCase); if (!*_retval) { - *_retval = content->AttrValueIs(kNameSpaceID_None, mClassAtom, - mMozSignatureAtom, eCaseMatters); + *_retval = content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::_class, + nsGkAtoms::mozsignature, eCaseMatters); } - } - } else if (tag == mScriptAtom || - tag == mTextAreaAtom || - tag == mSelectAreaAtom || - tag == mMapAtom) { + } + } else if (tag == nsGkAtoms::script || + tag == nsGkAtoms::textarea || + tag == nsGkAtoms::select || + tag == nsGkAtoms::map) { *_retval = true; - } else if (tag == mTableAtom) { + } else if (tag == nsGkAtoms::table) { if (mIsForMail) { *_retval = - content->AttrValueIs(kNameSpaceID_None, mClassAtom, + content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::_class, NS_LITERAL_STRING("moz-email-headers-table"), eCaseMatters); - } + } } } diff --git a/editor/composer/src/nsComposeTxtSrvFilter.h b/editor/composer/src/nsComposeTxtSrvFilter.h index 90cd4933c210..6a27ca9b0cad 100644 --- a/editor/composer/src/nsComposeTxtSrvFilter.h +++ b/editor/composer/src/nsComposeTxtSrvFilter.h @@ -6,8 +6,6 @@ #ifndef nsComposeTxtSrvFilter_h__ #define nsComposeTxtSrvFilter_h__ -#include "nsCOMPtr.h" // for nsCOMPtr -#include "nsIAtom.h" // for nsIAtom #include "nsISupportsImpl.h" // for NS_DECL_ISUPPORTS #include "nsITextServicesFilter.h" @@ -18,11 +16,10 @@ * This filter is used to skip over various form control nodes and * mail's cite nodes */ -class nsComposeTxtSrvFilter : public nsITextServicesFilter +class nsComposeTxtSrvFilter MOZ_FINAL : public nsITextServicesFilter { public: nsComposeTxtSrvFilter(); - virtual ~nsComposeTxtSrvFilter() {} // nsISupports interface... NS_DECL_ISUPPORTS @@ -33,21 +30,8 @@ public: // Helper - Intializer void Init(bool aIsForMail) { mIsForMail = aIsForMail; } -protected: +private: bool mIsForMail; - nsCOMPtr mBlockQuoteAtom; - nsCOMPtr mSpanAtom; // mail plain text quotes are wrapped in span tags - nsCOMPtr mMozQuoteAtom; // _moz_quote_ - nsCOMPtr mTableAtom; - nsCOMPtr mClassAtom; - nsCOMPtr mTypeAtom; - nsCOMPtr mScriptAtom; - nsCOMPtr mTextAreaAtom; - nsCOMPtr mSelectAreaAtom; - nsCOMPtr mMapAtom; - nsCOMPtr mCiteAtom; - nsCOMPtr mTrueAtom; - nsCOMPtr mMozSignatureAtom; }; #define NS_COMPOSERTXTSRVFILTER_CID \ From bf197ee0b6828c1a3894dba48df80953031cd515 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sun, 14 Apr 2013 14:18:43 -0400 Subject: [PATCH 145/438] Bug 834513 - Part 1: Refactor WebAudioDecodeJob::GetJSContext into AudioContext; r=roc --- content/media/webaudio/AudioContext.cpp | 14 ++++++++++++++ content/media/webaudio/AudioContext.h | 2 ++ content/media/webaudio/MediaBufferDecoder.cpp | 18 ++---------------- content/media/webaudio/MediaBufferDecoder.h | 1 - 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/content/media/webaudio/AudioContext.cpp b/content/media/webaudio/AudioContext.cpp index 078f7715c8a4..c4fec440dc8f 100644 --- a/content/media/webaudio/AudioContext.cpp +++ b/content/media/webaudio/AudioContext.cpp @@ -247,5 +247,19 @@ AudioContext::Resume() } } +JSContext* +AudioContext::GetJSContext() const +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsCOMPtr scriptGlobal = + do_QueryInterface(GetParentObject()); + nsIScriptContext* scriptContext = scriptGlobal->GetContext(); + if (!scriptContext) { + return nullptr; + } + return scriptContext->GetNativeContext(); +} + } } diff --git a/content/media/webaudio/AudioContext.h b/content/media/webaudio/AudioContext.h index 4ca8b006c09d..f3069b6de1e0 100644 --- a/content/media/webaudio/AudioContext.h +++ b/content/media/webaudio/AudioContext.h @@ -141,6 +141,8 @@ public: void UnregisterPannerNode(PannerNode* aNode); void UpdatePannerSource(); + JSContext* GetJSContext() const; + private: void RemoveFromDecodeQueue(WebAudioDecodeJob* aDecodeJob); diff --git a/content/media/webaudio/MediaBufferDecoder.cpp b/content/media/webaudio/MediaBufferDecoder.cpp index ad030ae1e6e6..9dd3d522e55a 100644 --- a/content/media/webaudio/MediaBufferDecoder.cpp +++ b/content/media/webaudio/MediaBufferDecoder.cpp @@ -591,7 +591,7 @@ WebAudioDecodeJob::FinalizeBufferData() MOZ_ASSERT(mOutput); MOZ_ASSERT(mChannels == mChannelBuffers.Length()); - AutoPushJSContext cx(GetJSContext()); + AutoPushJSContext cx(mContext->GetJSContext()); if (!cx) { return false; } @@ -603,20 +603,6 @@ WebAudioDecodeJob::FinalizeBufferData() return true; } -JSContext* -WebAudioDecodeJob::GetJSContext() const -{ - MOZ_ASSERT(NS_IsMainThread()); - - nsCOMPtr scriptGlobal = - do_QueryInterface(mContext->GetParentObject()); - nsIScriptContext* scriptContext = scriptGlobal->GetContext(); - if (!scriptContext) { - return nullptr; - } - return scriptContext->GetNativeContext(); -} - bool WebAudioDecodeJob::AllocateBuffer() { @@ -624,7 +610,7 @@ WebAudioDecodeJob::AllocateBuffer() MOZ_ASSERT(NS_IsMainThread()); // First, get a JSContext - AutoPushJSContext cx(GetJSContext()); + AutoPushJSContext cx(mContext->GetJSContext()); if (!cx) { return false; } diff --git a/content/media/webaudio/MediaBufferDecoder.h b/content/media/webaudio/MediaBufferDecoder.h index ed214208344d..75832008806f 100644 --- a/content/media/webaudio/MediaBufferDecoder.h +++ b/content/media/webaudio/MediaBufferDecoder.h @@ -50,7 +50,6 @@ struct WebAudioDecodeJob void OnFailure(ErrorCode aErrorCode); bool AllocateBuffer(); - JSContext* GetJSContext() const; bool FinalizeBufferData(); nsCString mContentType; From aee7119fc8c0ac9b926e6294f46a0d31b4152deb Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 8 Apr 2013 16:09:35 +1200 Subject: [PATCH 146/438] Bug 849996. Check the correct frame for transforms in PushAbsoluteContainingBlock --- it might not be the containing block itself. r=bzbarsky --- layout/base/nsCSSFrameConstructor.cpp | 37 ++++++++++++++++---------- layout/base/nsCSSFrameConstructor.h | 5 +++- layout/reftests/bugs/849996-1-ref.html | 23 ++++++++++++++++ layout/reftests/bugs/849996-1.html | 27 +++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 5 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 layout/reftests/bugs/849996-1-ref.html create mode 100644 layout/reftests/bugs/849996-1.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index deab4aed4a7e..6922d96963bf 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -791,7 +791,12 @@ public: // logic in GetAbsoluteContainingBlock. // Also makes aNewAbsoluteContainingBlock the containing block for // fixed-pos elements if necessary. + // aPositionedFrame is the frame whose style actually makes + // aNewAbsoluteContainingBlock a containing block. E.g. for a scrollable element + // aPositionedFrame is the element's primary frame and + // aNewAbsoluteContainingBlock is the scrolled frame. void PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock, + nsIFrame* aPositionedFrame, nsFrameConstructorSaveState& aSaveState); // Function to push the existing float containing block state and @@ -1029,6 +1034,7 @@ AdjustAbsoluteContainingBlock(nsIFrame* aContainingBlockIn) void nsFrameConstructorState::PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock, + nsIFrame* aPositionedFrame, nsFrameConstructorSaveState& aSaveState) { aSaveState.mItems = &mAbsoluteItems; @@ -1044,14 +1050,14 @@ nsFrameConstructorState::PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteConta mFixedItems = mAbsoluteItems; } - mAbsoluteItems = + mAbsoluteItems = nsAbsoluteItems(AdjustAbsoluteContainingBlock(aNewAbsoluteContainingBlock)); /* See if we're wiring the fixed-pos and abs-pos lists together. This happens iff * we're a transformed element. */ - mFixedPosIsAbsPos = aNewAbsoluteContainingBlock && - aNewAbsoluteContainingBlock->StyleDisplay()->HasTransform(aNewAbsoluteContainingBlock); + mFixedPosIsAbsPos = aPositionedFrame && + aPositionedFrame->StyleDisplay()->HasTransform(aPositionedFrame); if (aNewAbsoluteContainingBlock) { aNewAbsoluteContainingBlock->MarkAsAbsoluteContainingBlock(); @@ -1955,7 +1961,7 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, (display->HasTransformStyle() && aParentFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms))) && !aParentFrame->IsSVGText()) { - aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState); + aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState); } if (aItem.mFCData->mBits & FCDATA_USE_CHILD_ITEMS) { ConstructFramesFromItemList(aState, aItem.mChildItems, @@ -2357,6 +2363,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle // the root element mDocElementContainingBlock->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); state.PushAbsoluteContainingBlock(mDocElementContainingBlock, + mDocElementContainingBlock, absoluteSaveState); } @@ -2443,7 +2450,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle mDocElementContainingBlock), mDocElementContainingBlock, styleContext, &contentFrame, frameItems, - display->IsPositioned(contentFrame), nullptr); + display->IsPositioned(contentFrame) ? contentFrame : nullptr, + nullptr); newFrame = frameItems.FirstChild(); NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames"); } @@ -3064,7 +3072,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState, newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); if (newFrame->IsPositioned()) { - aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState); + aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState); } ProcessChildren(aState, content, styleContext, blockFrame, true, @@ -3615,7 +3623,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsFrameConstructorSaveState absoluteSaveState; if (bits & FCDATA_FORCE_NULL_ABSPOS_CONTAINER) { - aState.PushAbsoluteContainingBlock(nullptr, absoluteSaveState); + aState.PushAbsoluteContainingBlock(nullptr, nullptr, absoluteSaveState); } else if (!(bits & FCDATA_SKIP_ABSPOS_PUSH)) { nsIFrame* cb = maybeAbsoluteContainingBlock; cb->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); @@ -3624,7 +3632,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt (maybeAbsoluteContainingBlockDisplay->HasTransformStyle() && cb->IsFrameOfType(nsIFrame::eSupportsCSSTransforms))) && !cb->IsSVGText()) { - aState.PushAbsoluteContainingBlock(cb, absoluteSaveState); + aState.PushAbsoluteContainingBlock(cb, primaryFrame, absoluteSaveState); } } @@ -4359,7 +4367,7 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState, ConstructBlock(aState, scrolledContentStyle->StyleDisplay(), content, newFrame, newFrame, scrolledContentStyle, &scrolledFrame, blockItem, - aDisplay->IsPositioned(scrolledFrame), + aDisplay->IsPositioned(newFrame) ? newFrame : nullptr, aItem.mPendingBinding); NS_ASSERTION(blockItem.FirstChild() == scrolledFrame, @@ -4402,7 +4410,8 @@ nsCSSFrameConstructor::ConstructNonScrollableBlock(nsFrameConstructorState& aSta ConstructBlock(aState, aDisplay, aItem.mContent, aState.GetGeometricParent(aDisplay, aParentFrame), aParentFrame, styleContext, &newFrame, - aFrameItems, aDisplay->IsPositioned(newFrame), + aFrameItems, + aDisplay->IsPositioned(newFrame) ? newFrame : nullptr, aItem.mPendingBinding); return newFrame; } @@ -10892,7 +10901,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState, nsStyleContext* aStyleContext, nsIFrame** aNewFrame, nsFrameItems& aFrameItems, - bool aAbsPosContainer, + nsIFrame* aPositionedFrameForAbsPosContainer, PendingBinding* aPendingBinding) { // Create column wrapper if necessary @@ -10937,9 +10946,9 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState, // in nsBlockFrame::CalculateContainingBlockSizeForAbsolutes. nsFrameConstructorSaveState absoluteSaveState; (*aNewFrame)->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); - if (aAbsPosContainer) { + if (aPositionedFrameForAbsPosContainer) { // NS_ASSERTION(aRelPos, "should have made area frame for this"); - aState.PushAbsoluteContainingBlock(*aNewFrame, absoluteSaveState); + aState.PushAbsoluteContainingBlock(*aNewFrame, aPositionedFrameForAbsPosContainer, absoluteSaveState); } // Process the child content @@ -11038,7 +11047,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState, if (positioned) { // Relatively positioned frames becomes a container for child // frames that are positioned - aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState); + aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState); } // Process the child content diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 7a8db6e22858..68594ee848b6 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -1582,6 +1582,9 @@ private: // block // @param aContentParent is the parent the block would have if it // were in-flow + // @param aPositionedFrameForAbsPosContainer if non-null, then the new + // block should be an abs-pos container and aPositionedFrameForAbsPosContainer + // is the frame whose style is making this block an abs-pos container. // @param aPendingBinding the pending binding from this block's frame // construction item. void ConstructBlock(nsFrameConstructorState& aState, @@ -1592,7 +1595,7 @@ private: nsStyleContext* aStyleContext, nsIFrame** aNewFrame, nsFrameItems& aFrameItems, - bool aAbsPosContainer, + nsIFrame* aPositionedFrameForAbsPosContainer, PendingBinding* aPendingBinding); nsIFrame* ConstructInline(nsFrameConstructorState& aState, diff --git a/layout/reftests/bugs/849996-1-ref.html b/layout/reftests/bugs/849996-1-ref.html new file mode 100644 index 000000000000..7b149f1ac807 --- /dev/null +++ b/layout/reftests/bugs/849996-1-ref.html @@ -0,0 +1,23 @@ + + + + + + +
+
+
+ + diff --git a/layout/reftests/bugs/849996-1.html b/layout/reftests/bugs/849996-1.html new file mode 100644 index 000000000000..b6cef62c2dd2 --- /dev/null +++ b/layout/reftests/bugs/849996-1.html @@ -0,0 +1,27 @@ + + + + + + +
+
+
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 92192d7f219a..64b30cf6d44a 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1753,5 +1753,6 @@ skip-if(B2G) == 818276-1.html 818276-1-ref.html == 847850-1.html 847850-1-ref.html == 848421-1.html 848421-1-ref.html test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html +== 849996-1.html 849996-1-ref.html == 858803-1.html 858803-1-ref.html != 860370.html 860370-notref.html From 33f03795217185e4a2708dc7489803cb8ab991ca Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 9 Apr 2013 12:05:12 +1200 Subject: [PATCH 147/438] Bug 841363. Ensure padding-rect edges are included in scrollable area used to compute scrollWidth/scrollHeight for overflow:visible elements. r=matspal --- content/base/src/Element.cpp | 9 ++-- layout/generic/test/Makefile.in | 1 + layout/generic/test/test_bug841361.html | 56 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 layout/generic/test/test_bug841361.html diff --git a/content/base/src/Element.cpp b/content/base/src/Element.cpp index eb77095fc392..68480ceb10ab 100644 --- a/content/base/src/Element.cpp +++ b/content/base/src/Element.cpp @@ -589,11 +589,14 @@ static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame) return nsSize(0,0); } - nsRect paddingRect = aFrame->GetPaddingRectRelativeToSelf(); - nsOverflowAreas overflowAreas(paddingRect, paddingRect); + nsOverflowAreas overflowAreas; nsLayoutUtils::UnionChildOverflow(aFrame, overflowAreas); + // Make sure that an empty padding-rect's edges are included + nsRect paddingRect = aFrame->GetPaddingRectRelativeToSelf(); + nsRect overflowRect = + overflowAreas.ScrollableOverflow().UnionEdges(paddingRect); return nsLayoutUtils::GetScrolledRect(aFrame, - overflowAreas.ScrollableOverflow(), paddingRect.Size(), + overflowRect, paddingRect.Size(), aFrame->StyleVisibility()->mDirection).Size(); } diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index 7f1a70ba81d0..e9659287b3aa 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -105,6 +105,7 @@ MOCHITEST_FILES = \ test_bug785324.html \ test_bug791616.html \ test_bug831780.html \ + test_bug841361.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/layout/generic/test/test_bug841361.html b/layout/generic/test/test_bug841361.html new file mode 100644 index 000000000000..cc7a23dbf457 --- /dev/null +++ b/layout/generic/test/test_bug841361.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 841361 + + + + +Mozilla Bug 841361 +

+ +

+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +

+ +
+
+
+ + From a3114aa95b16bcecc2b9d24d12f3176e1b18ad08 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 16 Apr 2013 18:14:56 +1200 Subject: [PATCH 148/438] Bug 860579. Make FindContentInDocument use the frame tree as much as possible. r=mattwoodrow --- layout/base/crashtests/860579-1.html | 21 ++++++++++++++++++++ layout/base/crashtests/crashtests.list | 1 + layout/base/nsDisplayList.cpp | 27 +++++++------------------- 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 layout/base/crashtests/860579-1.html diff --git a/layout/base/crashtests/860579-1.html b/layout/base/crashtests/860579-1.html new file mode 100644 index 000000000000..3f7ef558b2e2 --- /dev/null +++ b/layout/base/crashtests/860579-1.html @@ -0,0 +1,21 @@ + + + + + + + diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index b3deafebf51e..392fac8a084b 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -391,5 +391,6 @@ load 770381-1.html load 795646.html load 813372-1.html load 836990-1.html +load 860579-1.html pref(layers.force-active,true) load 859526-1.html pref(layers.force-active,true) load 859630-1.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index a01878d57b0e..a87409917665 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1396,28 +1396,15 @@ static void Sort(nsDisplayList* aList, int32_t aCount, nsDisplayList::SortLEQ aC } static nsIContent* FindContentInDocument(nsDisplayItem* aItem, nsIDocument* aDoc) { - nsIFrame* frame = aItem->GetUnderlyingFrame(); - nsIContent* c = frame->GetContent(); - for (;;) { - nsIDocument* d; - if (c) { - d = c->OwnerDoc(); - } else { - d = frame->PresContext()->Document(); - } - if (d == aDoc) { - return c; - } - nsIDocument* parentDoc = d->GetParentDocument(); - if (!parentDoc) { - return nullptr; - } - c = parentDoc->FindContentForSubDocument(d); - if (!c) { - NS_ERROR("No content for subdocument?"); - return nullptr; + nsIFrame* f = aItem->GetUnderlyingFrame(); + while (f) { + nsPresContext* pc = f->PresContext(); + if (pc->Document() == aDoc) { + return f->GetContent(); } + f = nsLayoutUtils::GetCrossDocParentFrame(pc->PresShell()->GetRootFrame()); } + return nullptr; } static bool IsContentLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2, From badcb00fcbdbecf4ed7114325fed8ca9aa1b1e58 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 15 Apr 2013 19:10:19 +1200 Subject: [PATCH 149/438] Bug 860253. Clear clip state on children of an nsDisplayTransform because they're in a different coordinate system, and we'll clip the nsDisplayTransform itself. r=mattwoodrow --- layout/generic/nsSimplePageSequence.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsSimplePageSequence.cpp b/layout/generic/nsSimplePageSequence.cpp index 0e73b688bf05..6ff5f6808e67 100644 --- a/layout/generic/nsSimplePageSequence.cpp +++ b/layout/generic/nsSimplePageSequence.cpp @@ -807,11 +807,19 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, DisplayBorderBackgroundOutline(aBuilder, aLists); nsDisplayList content; - nsIFrame* child = GetFirstPrincipalChild(); - while (child) { - child->BuildDisplayListForStackingContext(aBuilder, - child->GetVisualOverflowRectRelativeToSelf(), &content); - child = child->GetNextSibling(); + + { + // Clear clip state while we construct the children of the + // nsDisplayTransform, since they'll be in a different coordinate system. + DisplayListClipState::AutoSaveRestore clipState(aBuilder); + clipState.Clear(); + + nsIFrame* child = GetFirstPrincipalChild(); + while (child) { + child->BuildDisplayListForStackingContext(aBuilder, + child->GetVisualOverflowRectRelativeToSelf(), &content); + child = child->GetNextSibling(); + } } content.AppendNewToTop(new (aBuilder) From cd389da925df3db4983d8a4d9e6514d869b2d636 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 16 Apr 2013 08:20:40 +0200 Subject: [PATCH 150/438] Bug 861973 - Force STLport not to use its own allocator. r=ted --- build/stlport/stl/config/_android.h.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/stlport/stl/config/_android.h.in b/build/stlport/stl/config/_android.h.in index bfe6b32ee39f..17ca9896f478 100644 --- a/build/stlport/stl/config/_android.h.in +++ b/build/stlport/stl/config/_android.h.in @@ -24,4 +24,8 @@ #undef _STLP_NATIVE_CPP_RUNTIME_HEADER #define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <../../system/include/header> +// Use operator new instead of stlport own node allocator +#undef _STLP_USE_NEWALLOC +#define _STLP_USE_NEWALLOC 1 + #endif /* mozilla_stl_config__android_h */ From 803e59e01a3e0d6ed8f41375e38556c387bd063c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sun, 17 Mar 2013 08:03:05 +0100 Subject: [PATCH 151/438] Bug 850332 - Use jemalloc inside mozglue. r=kats,r=mwu --- build/autoconf/android.m4 | 2 +- js/src/build/autoconf/android.m4 | 2 +- mozglue/android/nsGeckoUtils.cpp | 6 -- mozglue/build/BionicGlue.cpp | 151 +++++++++++++++++++++++-------- mozglue/build/Makefile.in | 2 +- 5 files changed, 117 insertions(+), 46 deletions(-) diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4 index 2144d6e9f980..a3ceccd906d0 100644 --- a/build/autoconf/android.m4 +++ b/build/autoconf/android.m4 @@ -254,7 +254,7 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then fi STLPORT_SOURCES="$android_ndk/sources/cxx-stl/stlport" STLPORT_CPPFLAGS="-I$_objdir/build/stlport -I$android_ndk/sources/cxx-stl/stlport/stlport" - STLPORT_LIBS="-lstlport_static" + STLPORT_LIBS="-lstlport_static -static-libstdc++" elif test "$target" != "arm-android-eabi"; then dnl fail if we're not building with NDKr4 AC_MSG_ERROR([Couldn't find path to stlport in the android ndk]) diff --git a/js/src/build/autoconf/android.m4 b/js/src/build/autoconf/android.m4 index 2144d6e9f980..a3ceccd906d0 100644 --- a/js/src/build/autoconf/android.m4 +++ b/js/src/build/autoconf/android.m4 @@ -254,7 +254,7 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then fi STLPORT_SOURCES="$android_ndk/sources/cxx-stl/stlport" STLPORT_CPPFLAGS="-I$_objdir/build/stlport -I$android_ndk/sources/cxx-stl/stlport/stlport" - STLPORT_LIBS="-lstlport_static" + STLPORT_LIBS="-lstlport_static -static-libstdc++" elif test "$target" != "arm-android-eabi"; then dnl fail if we're not building with NDKr4 AC_MSG_ERROR([Couldn't find path to stlport in the android ndk]) diff --git a/mozglue/android/nsGeckoUtils.cpp b/mozglue/android/nsGeckoUtils.cpp index fa21db6933f3..0a5e327a76e7 100644 --- a/mozglue/android/nsGeckoUtils.cpp +++ b/mozglue/android/nsGeckoUtils.cpp @@ -5,12 +5,6 @@ #include -#ifdef MOZ_MEMORY -// Wrap malloc and free to use jemalloc -#define malloc __wrap_malloc -#define free __wrap_free -#endif - #include #include #include "APKOpen.h" diff --git a/mozglue/build/BionicGlue.cpp b/mozglue/build/BionicGlue.cpp index a9f6c5d07c72..46ca2c3d6b66 100644 --- a/mozglue/build/BionicGlue.cpp +++ b/mozglue/build/BionicGlue.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -20,7 +21,44 @@ struct AtForkFuncs { void (*parent)(void); void (*child)(void); }; -static std::vector atfork; + +/* jemalloc's initialization calls pthread_atfork. When pthread_atfork (see + * further below) stores the corresponding data, it's going to allocate memory, + * which will loop back to jemalloc's initialization, leading to a dead-lock. + * So, for that specific vector, we use a special allocator that returns a + * static buffer for small sizes, and force the initial vector capacity to + * a size enough to store one atfork function table. */ +template +struct SpecialAllocator: public std::allocator +{ + SpecialAllocator(): bufUsed(false) {} + + inline typename std::allocator::pointer allocate(typename std::allocator::size_type n, const void * = 0) { + if (!bufUsed && n == 1) { + bufUsed = true; + return buf.addr(); + } + return reinterpret_cast(::operator new(sizeof(T) * n)); + } + + inline void deallocate(typename std::allocator::pointer p, typename std::allocator::size_type n) { + if (p == buf.addr()) + bufUsed = false; + else + ::operator delete(p); + } + + template + struct rebind { + typedef SpecialAllocator other; + }; + +private: + mozilla::AlignedStorage2 buf; + bool bufUsed; +}; + +static std::vector > atfork; #ifdef MOZ_WIDGET_GONK #include "cpuacct.h" @@ -46,6 +84,8 @@ WRAP(pthread_atfork)(void (*prepare)(void), void (*parent)(void), void (*child)( funcs.prepare = prepare; funcs.parent = parent; funcs.child = child; + if (!atfork.capacity()) + atfork.reserve(1); atfork.push_back(funcs); return 0; } @@ -133,40 +173,77 @@ PR_GetEnvLock(void) #ifndef MOZ_WIDGET_GONK #include -extern "C" NS_EXPORT void* __wrap_memccpy(void * a0, const void * a1, int a2, size_t a3) { return memccpy(a0, a1, a2, a3); } -extern "C" NS_EXPORT void* __wrap_memchr(const void * a0, int a1, size_t a2) { return memchr(a0, a1, a2); } -extern "C" NS_EXPORT void* __wrap_memrchr(const void * a0, int a1, size_t a2) { return memrchr(a0, a1, a2); } -extern "C" NS_EXPORT int __wrap_memcmp(const void * a0, const void * a1, size_t a2) { return memcmp(a0, a1, a2); } -extern "C" NS_EXPORT void* __wrap_memcpy(void * a0, const void * a1, size_t a2) { return memcpy(a0, a1, a2); } -extern "C" NS_EXPORT void* __wrap_memmove(void * a0, const void * a1, size_t a2) { return memmove(a0, a1, a2); } -extern "C" NS_EXPORT void* __wrap_memset(void * a0, int a1, size_t a2) { return memset(a0, a1, a2); } -extern "C" NS_EXPORT void* __wrap_memmem(const void * a0, size_t a1, const void * a2, size_t a3) { return memmem(a0, a1, a2, a3); } -extern "C" NS_EXPORT void __wrap_memswap(void * a0, void * a1, size_t a2) { memswap(a0, a1, a2); } -extern "C" NS_EXPORT char* __wrap_index(const char * a0, int a1) { return index(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strchr(const char * a0, int a1) { return strchr(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strrchr(const char * a0, int a1) { return strrchr(a0, a1); } -extern "C" NS_EXPORT size_t __wrap_strlen(const char * a0) { return strlen(a0); } -extern "C" NS_EXPORT int __wrap_strcmp(const char * a0, const char * a1) { return strcmp(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strcpy(char * a0, const char * a1) { return strcpy(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strcat(char * a0, const char * a1) { return strcat(a0, a1); } -extern "C" NS_EXPORT int __wrap_strcasecmp(const char * a0, const char * a1) { return strcasecmp(a0, a1); } -extern "C" NS_EXPORT int __wrap_strncasecmp(const char * a0, const char * a1, size_t a2) { return strncasecmp(a0, a1, a2); } -extern "C" NS_EXPORT char* __wrap_strstr(const char * a0, const char * a1) { return strstr(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strcasestr(const char * a0, const char * a1) { return strcasestr(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strtok(char * a0, const char * a1) { return strtok(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strtok_r(char * a0, const char * a1, char** a2) { return strtok_r(a0, a1, a2); } -extern "C" NS_EXPORT char* __wrap_strerror(int a0) { return strerror(a0); } -extern "C" NS_EXPORT int __wrap_strerror_r(int a0, char * a1, size_t a2) { return strerror_r(a0, a1, a2); } -extern "C" NS_EXPORT size_t __wrap_strnlen(const char * a0, size_t a1) { return strnlen(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strncat(char * a0, const char * a1, size_t a2) { return strncat(a0, a1, a2); } -extern "C" NS_EXPORT int __wrap_strncmp(const char * a0, const char * a1, size_t a2) { return strncmp(a0, a1, a2); } -extern "C" NS_EXPORT char* __wrap_strncpy(char * a0, const char * a1, size_t a2) { return strncpy(a0, a1, a2); } -extern "C" NS_EXPORT size_t __wrap_strlcat(char * a0, const char * a1, size_t a2) { return strlcat(a0, a1, a2); } -extern "C" NS_EXPORT size_t __wrap_strlcpy(char * a0, const char * a1, size_t a2) { return strlcpy(a0, a1, a2); } -extern "C" NS_EXPORT size_t __wrap_strcspn(const char * a0, const char * a1) { return strcspn(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strpbrk(const char * a0, const char * a1) { return strpbrk(a0, a1); } -extern "C" NS_EXPORT char* __wrap_strsep(char ** a0, const char * a1) { return strsep(a0, a1); } -extern "C" NS_EXPORT size_t __wrap_strspn(const char * a0, const char * a1) { return strspn(a0, a1); } -extern "C" NS_EXPORT int __wrap_strcoll(const char * a0, const char * a1) { return strcoll(a0, a1); } -extern "C" NS_EXPORT size_t __wrap_strxfrm(char * a0, const char * a1, size_t a2) { return strxfrm(a0, a1, a2); } +extern "C" NS_EXPORT void* __real_memccpy(void * a0, const void * a1, int a2, size_t a3); +extern "C" NS_EXPORT void* __real_memchr(const void * a0, int a1, size_t a2); +extern "C" NS_EXPORT void* __real_memrchr(const void * a0, int a1, size_t a2); +extern "C" NS_EXPORT int __real_memcmp(const void * a0, const void * a1, size_t a2); +extern "C" NS_EXPORT void* __real_memcpy(void * a0, const void * a1, size_t a2); +extern "C" NS_EXPORT void* __real_memmove(void * a0, const void * a1, size_t a2); +extern "C" NS_EXPORT void* __real_memset(void * a0, int a1, size_t a2); +extern "C" NS_EXPORT void* __real_memmem(const void * a0, size_t a1, const void * a2, size_t a3); +extern "C" NS_EXPORT void __real_memswap(void * a0, void * a1, size_t a2); +extern "C" NS_EXPORT char* __real_index(const char * a0, int a1); +extern "C" NS_EXPORT char* __real_strchr(const char * a0, int a1); +extern "C" NS_EXPORT char* __real_strrchr(const char * a0, int a1); +extern "C" NS_EXPORT size_t __real_strlen(const char * a0); +extern "C" NS_EXPORT int __real_strcmp(const char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strcpy(char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strcat(char * a0, const char * a1); +extern "C" NS_EXPORT int __real_strcasecmp(const char * a0, const char * a1); +extern "C" NS_EXPORT int __real_strncasecmp(const char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT char* __real_strstr(const char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strcasestr(const char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strtok(char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strtok_r(char * a0, const char * a1, char** a2); +extern "C" NS_EXPORT char* __real_strerror(int a0); +extern "C" NS_EXPORT int __real_strerror_r(int a0, char * a1, size_t a2); +extern "C" NS_EXPORT size_t __real_strnlen(const char * a0, size_t a1); +extern "C" NS_EXPORT char* __real_strncat(char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT int __real_strncmp(const char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT char* __real_strncpy(char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT size_t __real_strlcat(char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT size_t __real_strlcpy(char * a0, const char * a1, size_t a2); +extern "C" NS_EXPORT size_t __real_strcspn(const char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strpbrk(const char * a0, const char * a1); +extern "C" NS_EXPORT char* __real_strsep(char ** a0, const char * a1); +extern "C" NS_EXPORT size_t __real_strspn(const char * a0, const char * a1); +extern "C" NS_EXPORT int __real_strcoll(const char * a0, const char * a1); +extern "C" NS_EXPORT size_t __real_strxfrm(char * a0, const char * a1, size_t a2); + +extern "C" NS_EXPORT void* __wrap_memccpy(void * a0, const void * a1, int a2, size_t a3) { return __real_memccpy(a0, a1, a2, a3); } +extern "C" NS_EXPORT void* __wrap_memchr(const void * a0, int a1, size_t a2) { return __real_memchr(a0, a1, a2); } +extern "C" NS_EXPORT void* __wrap_memrchr(const void * a0, int a1, size_t a2) { return __real_memrchr(a0, a1, a2); } +extern "C" NS_EXPORT int __wrap_memcmp(const void * a0, const void * a1, size_t a2) { return __real_memcmp(a0, a1, a2); } +extern "C" NS_EXPORT void* __wrap_memcpy(void * a0, const void * a1, size_t a2) { return __real_memcpy(a0, a1, a2); } +extern "C" NS_EXPORT void* __wrap_memmove(void * a0, const void * a1, size_t a2) { return __real_memmove(a0, a1, a2); } +extern "C" NS_EXPORT void* __wrap_memset(void * a0, int a1, size_t a2) { return __real_memset(a0, a1, a2); } +extern "C" NS_EXPORT void* __wrap_memmem(const void * a0, size_t a1, const void * a2, size_t a3) { return __real_memmem(a0, a1, a2, a3); } +extern "C" NS_EXPORT void __wrap_memswap(void * a0, void * a1, size_t a2) { __real_memswap(a0, a1, a2); } +extern "C" NS_EXPORT char* __wrap_index(const char * a0, int a1) { return __real_index(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strchr(const char * a0, int a1) { return __real_strchr(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strrchr(const char * a0, int a1) { return __real_strrchr(a0, a1); } +extern "C" NS_EXPORT size_t __wrap_strlen(const char * a0) { return __real_strlen(a0); } +extern "C" NS_EXPORT int __wrap_strcmp(const char * a0, const char * a1) { return __real_strcmp(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strcpy(char * a0, const char * a1) { return __real_strcpy(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strcat(char * a0, const char * a1) { return __real_strcat(a0, a1); } +extern "C" NS_EXPORT int __wrap_strcasecmp(const char * a0, const char * a1) { return __real_strcasecmp(a0, a1); } +extern "C" NS_EXPORT int __wrap_strncasecmp(const char * a0, const char * a1, size_t a2) { return __real_strncasecmp(a0, a1, a2); } +extern "C" NS_EXPORT char* __wrap_strstr(const char * a0, const char * a1) { return __real_strstr(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strcasestr(const char * a0, const char * a1) { return __real_strcasestr(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strtok(char * a0, const char * a1) { return __real_strtok(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strtok_r(char * a0, const char * a1, char** a2) { return __real_strtok_r(a0, a1, a2); } +extern "C" NS_EXPORT char* __wrap_strerror(int a0) { return __real_strerror(a0); } +extern "C" NS_EXPORT int __wrap_strerror_r(int a0, char * a1, size_t a2) { return __real_strerror_r(a0, a1, a2); } +extern "C" NS_EXPORT size_t __wrap_strnlen(const char * a0, size_t a1) { return __real_strnlen(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strncat(char * a0, const char * a1, size_t a2) { return __real_strncat(a0, a1, a2); } +extern "C" NS_EXPORT int __wrap_strncmp(const char * a0, const char * a1, size_t a2) { return __real_strncmp(a0, a1, a2); } +extern "C" NS_EXPORT char* __wrap_strncpy(char * a0, const char * a1, size_t a2) { return __real_strncpy(a0, a1, a2); } +extern "C" NS_EXPORT size_t __wrap_strlcat(char * a0, const char * a1, size_t a2) { return __real_strlcat(a0, a1, a2); } +extern "C" NS_EXPORT size_t __wrap_strlcpy(char * a0, const char * a1, size_t a2) { return __real_strlcpy(a0, a1, a2); } +extern "C" NS_EXPORT size_t __wrap_strcspn(const char * a0, const char * a1) { return __real_strcspn(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strpbrk(const char * a0, const char * a1) { return __real_strpbrk(a0, a1); } +extern "C" NS_EXPORT char* __wrap_strsep(char ** a0, const char * a1) { return __real_strsep(a0, a1); } +extern "C" NS_EXPORT size_t __wrap_strspn(const char * a0, const char * a1) { return __real_strspn(a0, a1); } +extern "C" NS_EXPORT int __wrap_strcoll(const char * a0, const char * a1) { return __real_strcoll(a0, a1); } +extern "C" NS_EXPORT size_t __wrap_strxfrm(char * a0, const char * a1, size_t a2) { return __real_strxfrm(a0, a1, a2); } #endif diff --git a/mozglue/build/Makefile.in b/mozglue/build/Makefile.in index ace0153e737b..ddd085dac57b 100644 --- a/mozglue/build/Makefile.in +++ b/mozglue/build/Makefile.in @@ -115,7 +115,7 @@ endif SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt) ifeq (Android, $(OS_TARGET)) -WRAP_LDFLAGS = +WRAP_LDFLAGS := $(filter -Wl%,$(WRAP_LDFLAGS)) endif include $(topsrcdir)/config/rules.mk From 2366df304af2b2024937204b24079f33b6a492a1 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Mon, 15 Apr 2013 06:02:16 -0600 Subject: [PATCH 152/438] Bug 845596 - Keep track of free variables during syntax parsing, r=jorendorff. --- js/src/frontend/FullParseHandler.h | 62 +++++- js/src/frontend/ParseMaps-inl.h | 25 ++- js/src/frontend/ParseMaps.cpp | 65 ++---- js/src/frontend/ParseMaps.h | 143 ++++++++----- js/src/frontend/ParseNode.cpp | 6 +- js/src/frontend/ParseNode.h | 16 +- js/src/frontend/Parser.cpp | 288 ++++++++++++--------------- js/src/frontend/Parser.h | 15 +- js/src/frontend/SyntaxParseHandler.h | 31 ++- 9 files changed, 360 insertions(+), 291 deletions(-) diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index f292c8b306e6..4152bc957c9c 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -48,7 +48,7 @@ class FullParseHandler foldConstants(foldConstants) {} - static Definition *null() { return NULL; } + static ParseNode *null() { return NULL; } ParseNode *freeTree(ParseNode *pn) { return allocator.freeTree(pn); } void prepareNodeForMutation(ParseNode *pn) { return allocator.prepareNodeForMutation(pn); } @@ -62,6 +62,16 @@ class FullParseHandler pn->setOp(JSOP_NAME); return pn; } + Definition *newPlaceholder(ParseNode *pn, ParseContext *pc) { + Definition *dn = (Definition *) NameNode::create(PNK_NAME, pn->pn_atom, this, pc); + if (!dn) + return NULL; + + dn->setOp(JSOP_NOP); + dn->setDefn(true); + dn->pn_dflags |= PND_PLACEHOLDER; + return dn; + } ParseNode *newAtom(ParseNodeKind kind, JSAtom *atom, JSOp op = JSOP_NOP) { ParseNode *pn = NullaryNode::create(kind, this); if (!pn) @@ -168,6 +178,9 @@ class FullParseHandler void setFunctionBox(ParseNode *pn, FunctionBox *funbox) { pn->pn_funbox = funbox; } + void addFunctionArgument(ParseNode *pn, ParseNode *argpn) { + pn->pn_body->append(argpn); + } inline ParseNode *newLexicalScope(ObjectBox *blockbox); bool isOperationWithoutParens(ParseNode *pn, ParseNodeKind kind) { return pn->isKind(kind) && !pn->isInParens(); @@ -192,6 +205,9 @@ class FullParseHandler JS_ASSERT(pn->pn_pos.begin <= pn->pn_pos.end); } + void setPosition(ParseNode *pn, const TokenPos &pos) { + pn->pn_pos = pos; + } TokenPos getPosition(ParseNode *pn) { return pn->pn_pos; } @@ -254,6 +270,50 @@ class FullParseHandler } inline ParseNode *makeAssignment(ParseNode *pn, ParseNode *rhs); + + static Definition *getDefinitionNode(Definition *dn) { + return dn; + } + static Definition::Kind getDefinitionKind(Definition *dn) { + return dn->kind(); + } + void linkUseToDef(ParseNode *pn, Definition *dn) + { + JS_ASSERT(!pn->isUsed()); + JS_ASSERT(!pn->isDefn()); + JS_ASSERT(pn != dn->dn_uses); + JS_ASSERT(dn->isDefn()); + pn->pn_link = dn->dn_uses; + dn->dn_uses = pn; + dn->pn_dflags |= pn->pn_dflags & PND_USE2DEF_FLAGS; + pn->setUsed(true); + pn->pn_lexdef = dn; + } + Definition *resolve(Definition *dn) { + return dn->resolve(); + } + void deoptimizeUsesWithin(Definition *dn, const TokenPos &pos) + { + for (ParseNode *pnu = dn->dn_uses; pnu; pnu = pnu->pn_link) { + JS_ASSERT(pnu->isUsed()); + JS_ASSERT(!pnu->isDefn()); + if (pnu->pn_pos.begin >= pos.begin && pnu->pn_pos.end <= pos.end) + pnu->pn_dflags |= PND_DEOPTIMIZED; + } + } + bool dependencyCovered(ParseNode *pn, unsigned blockid, bool functionScope) { + return pn->pn_blockid >= blockid; + } + + static uintptr_t definitionToBits(Definition *dn) { + return uintptr_t(dn); + } + static Definition *definitionFromBits(uintptr_t bits) { + return (Definition *) bits; + } + static Definition *nullDefinition() { + return NULL; + } }; inline bool diff --git a/js/src/frontend/ParseMaps-inl.h b/js/src/frontend/ParseMaps-inl.h index 6d62fc344a84..55fca1a6eb66 100644 --- a/js/src/frontend/ParseMaps-inl.h +++ b/js/src/frontend/ParseMaps-inl.h @@ -48,18 +48,20 @@ ParseMapPool::allocate() return map; } -inline Definition * -AtomDecls::lookupFirst(JSAtom *atom) const +template +inline typename ParseHandler::DefinitionNode +AtomDecls::lookupFirst(JSAtom *atom) const { JS_ASSERT(map); AtomDefnListPtr p = map->lookup(atom); if (!p) - return NULL; - return p.value().front(); + return ParseHandler::nullDefinition(); + return p.value().front(); } +template inline DefinitionList::Range -AtomDecls::lookupMulti(JSAtom *atom) const +AtomDecls::lookupMulti(JSAtom *atom) const { JS_ASSERT(map); if (AtomDefnListPtr p = map->lookup(atom)) @@ -67,15 +69,16 @@ AtomDecls::lookupMulti(JSAtom *atom) const return DefinitionList::Range(); } +template inline bool -AtomDecls::addUnique(JSAtom *atom, Definition *defn) +AtomDecls::addUnique(JSAtom *atom, DefinitionNode defn) { JS_ASSERT(map); AtomDefnListAddPtr p = map->lookupForAdd(atom); if (!p) - return map->add(p, atom, DefinitionList(defn)); + return map->add(p, atom, DefinitionList(ParseHandler::definitionToBits(defn))); JS_ASSERT(!p.value().isMultiple()); - p.value() = DefinitionList(defn); + p.value() = DefinitionList(ParseHandler::definitionToBits(defn)); return true; } @@ -99,15 +102,17 @@ AtomThingMapPtr::releaseMap(JSContext *cx) map_ = NULL; } +template inline bool -AtomDecls::init() +AtomDecls::init() { map = cx->parseMapPool().acquire(); return map; } +template inline -AtomDecls::~AtomDecls() +AtomDecls::~AtomDecls() { if (map) cx->parseMapPool().release(map); diff --git a/js/src/frontend/ParseMaps.cpp b/js/src/frontend/ParseMaps.cpp index ba117d230661..3426d861d903 100644 --- a/js/src/frontend/ParseMaps.cpp +++ b/js/src/frontend/ParseMaps.cpp @@ -5,10 +5,12 @@ * 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 "ParseMaps-inl.h" #include "jscntxt.h" #include "jscompartment.h" +#include "FullParseHandler.h" +#include "SyntaxParseHandler.h" +#include "ParseMaps-inl.h" #include "vm/String-inl.h" using namespace js; @@ -58,7 +60,7 @@ ParseMapPool::allocateFresh() } DefinitionList::Node * -DefinitionList::allocNode(JSContext *cx, Definition *head, Node *tail) +DefinitionList::allocNode(JSContext *cx, uintptr_t head, Node *tail) { Node *result = cx->tempLifoAlloc().new_(head, tail); if (!result) @@ -66,58 +68,17 @@ DefinitionList::allocNode(JSContext *cx, Definition *head, Node *tail) return result; } -bool -DefinitionList::pushFront(JSContext *cx, Definition *val) -{ - Node *tail; - if (isMultiple()) { - tail = firstNode(); - } else { - tail = allocNode(cx, defn(), NULL); - if (!tail) - return false; - } - - Node *node = allocNode(cx, val, tail); - if (!node) - return false; - *this = DefinitionList(node); - return true; -} - -bool -DefinitionList::pushBack(JSContext *cx, Definition *val) -{ - Node *last; - if (isMultiple()) { - last = firstNode(); - while (last->next) - last = last->next; - } else { - last = allocNode(cx, defn(), NULL); - if (!last) - return false; - } - - Node *node = allocNode(cx, val, NULL); - if (!node) - return false; - last->next = node; - if (!isMultiple()) - *this = DefinitionList(last); - return true; -} - #ifdef DEBUG +template void -AtomDecls::dump() +AtomDecls::dump() { for (AtomDefnListRange r = map->all(); !r.empty(); r.popFront()) { fprintf(stderr, "atom: "); js_DumpAtom(r.front().key()); const DefinitionList &dlist = r.front().value(); for (DefinitionList::Range dr = dlist.all(); !dr.empty(); dr.popFront()) { - fprintf(stderr, " defn: %p\n", (void *) dr.front()); + fprintf(stderr, " defn: %p\n", (void *) dr.front()); } } } @@ -133,19 +94,20 @@ DumpAtomDefnMap(const AtomDefnMapPtr &map) for (AtomDefnRange r = map->all(); !r.empty(); r.popFront()) { fprintf(stderr, "atom: "); js_DumpAtom(r.front().key()); - fprintf(stderr, "defn: %p\n", (void *) r.front().value()); + fprintf(stderr, "defn: %p\n", (void *) r.front().value().get()); } } #endif +template bool -AtomDecls::addShadow(JSAtom *atom, Definition *defn) +AtomDecls::addShadow(JSAtom *atom, typename ParseHandler::DefinitionNode defn) { AtomDefnListAddPtr p = map->lookupForAdd(atom); if (!p) - return map->add(p, atom, DefinitionList(defn)); + return map->add(p, atom, DefinitionList(ParseHandler::definitionToBits(defn))); - return p.value().pushFront(cx, defn); + return p.value().pushFront(cx, defn); } void @@ -171,3 +133,6 @@ frontend::InitAtomMap(JSContext *cx, frontend::AtomIndexMap *indices, HeapPtrAto } } } + +template class AtomDecls; +template class AtomDecls; diff --git a/js/src/frontend/ParseMaps.h b/js/src/frontend/ParseMaps.h index 89451c1d3ccd..a8026167be12 100644 --- a/js/src/frontend/ParseMaps.h +++ b/js/src/frontend/ParseMaps.h @@ -18,11 +18,11 @@ namespace js { namespace frontend { -struct Definition; +class DefinitionSingle; class DefinitionList; typedef InlineMap AtomIndexMap; -typedef InlineMap AtomDefnMap; +typedef InlineMap AtomDefnMap; typedef InlineMap AtomDefnListMap; /* @@ -135,15 +135,6 @@ struct AtomThingMapPtr Map &operator*() const { return *map_; } }; -struct AtomDefnMapPtr : public AtomThingMapPtr -{ - JS_ALWAYS_INLINE - Definition *lookupDefn(JSAtom *atom) { - AtomDefnMap::Ptr p = map_->lookup(atom); - return p ? p.value() : NULL; - } -}; - typedef AtomThingMapPtr AtomIndexMapPtr; /* @@ -165,9 +156,49 @@ class OwnedAtomThingMapPtr : public AtomThingMapPtrT } }; -typedef OwnedAtomThingMapPtr OwnedAtomDefnMapPtr; typedef OwnedAtomThingMapPtr OwnedAtomIndexMapPtr; +/* + * DefinitionSingle and DefinitionList represent either a single definition + * or a list of them. The representation of definitions varies between + * parse handlers, being either a Definition* (FullParseHandler) or a + * Definition::Kind (SyntaxParseHandler). Methods on the below classes are + * templated to distinguish the kind of value wrapped by the class. + */ + +/* Wrapper for a single definition. */ +class DefinitionSingle +{ + uintptr_t bits; + + public: + + template + static DefinitionSingle new_(typename ParseHandler::DefinitionNode defn) + { + DefinitionSingle res; + res.bits = ParseHandler::definitionToBits(defn); + return res; + } + + template + typename ParseHandler::DefinitionNode get() { + return ParseHandler::definitionFromBits(bits); + } +}; + +struct AtomDefnMapPtr : public AtomThingMapPtr +{ + template + JS_ALWAYS_INLINE + typename ParseHandler::DefinitionNode lookupDefn(JSAtom *atom) { + AtomDefnMap::Ptr p = map_->lookup(atom); + return p ? p.value().get() : ParseHandler::nullDefinition(); + } +}; + +typedef OwnedAtomThingMapPtr OwnedAtomDefnMapPtr; + /* * A nonempty list containing one or more pointers to Definitions. * @@ -191,30 +222,24 @@ class DefinitionList /* A node in a linked list of Definitions. */ struct Node { - Definition *defn; + uintptr_t bits; Node *next; - Node(Definition *defn, Node *next) : defn(defn), next(next) {} + Node(uintptr_t bits, Node *next) : bits(bits), next(next) {} }; union { - Definition *defn; - Node *head; uintptr_t bits; + Node *head; } u; - Definition *defn() const { - JS_ASSERT(!isMultiple()); - return u.defn; - } - Node *firstNode() const { JS_ASSERT(isMultiple()); return (Node *) (u.bits & ~0x1); } static Node * - allocNode(JSContext *cx, Definition *head, Node *tail); + allocNode(JSContext *cx, uintptr_t bits, Node *tail); public: class Range @@ -222,40 +247,41 @@ class DefinitionList friend class DefinitionList; Node *node; - Definition *defn; + uintptr_t bits; explicit Range(const DefinitionList &list) { if (list.isMultiple()) { node = list.firstNode(); - defn = node->defn; + bits = node->bits; } else { node = NULL; - defn = list.defn(); + bits = list.u.bits; } } public: /* An empty Range. */ - Range() : node(NULL), defn(NULL) {} + Range() : node(NULL), bits(0) {} void popFront() { JS_ASSERT(!empty()); if (!node) { - defn = NULL; + bits = 0; return; } node = node->next; - defn = node ? node->defn : NULL; + bits = node ? node->bits : 0; } - Definition *front() { + template + typename ParseHandler::DefinitionNode front() { JS_ASSERT(!empty()); - return defn; + return ParseHandler::definitionFromBits(bits); } bool empty() const { - JS_ASSERT_IF(!defn, !node); - return !defn; + JS_ASSERT_IF(!bits, !node); + return !bits; } }; @@ -263,8 +289,8 @@ class DefinitionList u.bits = 0; } - explicit DefinitionList(Definition *defn) { - u.defn = defn; + explicit DefinitionList(uintptr_t bits) { + u.bits = bits; JS_ASSERT(!isMultiple()); } @@ -276,8 +302,9 @@ class DefinitionList bool isMultiple() const { return (u.bits & 0x1) != 0; } - Definition *front() { - return isMultiple() ? firstNode()->defn : defn(); + template + typename ParseHandler::DefinitionNode front() { + return ParseHandler::definitionFromBits(isMultiple() ? firstNode()->bits : u.bits); } /* @@ -294,7 +321,7 @@ class DefinitionList if (next->next) *this = DefinitionList(next); else - *this = DefinitionList(next->defn); + *this = DefinitionList(next->bits); return true; } @@ -303,17 +330,31 @@ class DefinitionList * * Return true on success. On OOM, report on cx and return false. */ - bool pushFront(JSContext *cx, Definition *val); + template + bool pushFront(JSContext *cx, typename ParseHandler::DefinitionNode defn) { + Node *tail; + if (isMultiple()) { + tail = firstNode(); + } else { + tail = allocNode(cx, u.bits, NULL); + if (!tail) + return false; + } - /* Like pushFront, but add the given val to the end of the list. */ - bool pushBack(JSContext *cx, Definition *val); + Node *node = allocNode(cx, ParseHandler::definitionToBits(defn), tail); + if (!node) + return false; + *this = DefinitionList(node); + return true; + } /* Overwrite the first Definition in the list. */ - void setFront(Definition *val) { + template + void setFront(typename ParseHandler::DefinitionNode defn) { if (isMultiple()) - firstNode()->defn = val; + firstNode()->bits = ParseHandler::definitionToBits(defn); else - *this = DefinitionList(val); + *this = DefinitionList(ParseHandler::definitionToBits(defn)); } Range all() const { return Range(*this); } @@ -341,8 +382,11 @@ class DefinitionList * method addShadow. When we leave the block associated with the let, the method * remove is used to unshadow the declaration immediately preceding it. */ +template class AtomDecls { + typedef typename ParseHandler::DefinitionNode DefinitionNode; + /* AtomDeclsIter needs to get at the DefnListMap directly. */ friend class AtomDeclsIter; @@ -364,21 +408,21 @@ class AtomDecls } /* Return the definition at the head of the chain for |atom|. */ - inline Definition *lookupFirst(JSAtom *atom) const; + inline DefinitionNode lookupFirst(JSAtom *atom) const; /* Perform a lookup that can iterate over the definitions associated with |atom|. */ inline DefinitionList::Range lookupMulti(JSAtom *atom) const; /* Add-or-update a known-unique definition for |atom|. */ - inline bool addUnique(JSAtom *atom, Definition *defn); - bool addShadow(JSAtom *atom, Definition *defn); + inline bool addUnique(JSAtom *atom, DefinitionNode defn); + bool addShadow(JSAtom *atom, DefinitionNode defn); /* Updating the definition for an entry that is known to exist is infallible. */ - void updateFirst(JSAtom *atom, Definition *defn) { + void updateFirst(JSAtom *atom, DefinitionNode defn) { JS_ASSERT(map); AtomDefnListMap::Ptr p = map->lookup(atom); JS_ASSERT(p); - p.value().setFront(defn); + p.value().setFront(defn); } /* Remove the node at the head of the chain for |atom|. */ @@ -420,6 +464,9 @@ typedef AtomDefnListMap::Range AtomDefnListRange; namespace mozilla { +template <> +struct IsPod : TrueType {}; + template <> struct IsPod : TrueType {}; diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index efafe29caf6c..f705e604db70 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -363,7 +363,7 @@ const char * Definition::kindString(Kind kind) { static const char *table[] = { - js_var_str, js_const_str, js_let_str, js_function_str, "argument", "unknown" + "", js_var_str, js_const_str, js_let_str, js_function_str, "argument", "unknown" }; JS_ASSERT(unsigned(kind) <= unsigned(ARG)); @@ -461,7 +461,7 @@ Parser::cloneParseTree(ParseNode *opn) */ if (opn->isDefn()) { opn->setDefn(false); - LinkUseToDef(opn, (Definition *) pn); + handler.linkUseToDef(opn, (Definition *) pn); } } break; @@ -552,7 +552,7 @@ Parser::cloneLeftHandSide(ParseNode *opn) pn->pn_dflags &= ~PND_BOUND; pn->setDefn(false); - LinkUseToDef(pn, (Definition *) opn); + handler.linkUseToDef(pn, (Definition *) opn); } } return pn; diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index 08a25c9d8bae..f280390e2609 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -12,7 +12,6 @@ #include "jsscript.h" -#include "frontend/ParseMaps.h" #include "frontend/TokenStream.h" namespace js { @@ -1215,7 +1214,7 @@ struct Definition : public ParseNode return pn_cookie.isFree(); } - enum Kind { VAR, CONST, LET, ARG, NAMED_LAMBDA, PLACEHOLDER }; + enum Kind { MISSING = 0, VAR, CONST, LET, ARG, NAMED_LAMBDA, PLACEHOLDER }; bool canHaveInitializer() { return int(kind()) <= int(ARG); } @@ -1298,19 +1297,6 @@ ParseNode::isConstant() } } -inline void -LinkUseToDef(ParseNode *pn, Definition *dn) -{ - JS_ASSERT(!pn->isUsed()); - JS_ASSERT(!pn->isDefn()); - JS_ASSERT(pn != dn->dn_uses); - pn->pn_link = dn->dn_uses; - dn->dn_uses = pn; - dn->pn_dflags |= pn->pn_dflags & PND_USE2DEF_FLAGS; - pn->setUsed(true); - pn->pn_lexdef = dn; -} - class ObjectBox { public: JSObject *object; diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 38d83598256d..88320dad663b 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -125,7 +125,7 @@ ParseContext::define(JSContext *cx, HandlePropertyName name, JS_ASSERT(!decls_.lookupFirst(name)); if (!prevDef) - prevDef = lexdeps.lookupDefn(name); + prevDef = lexdeps.lookupDefn(name); if (prevDef) { ParseNode **pnup = &prevDef->dn_uses; @@ -196,8 +196,7 @@ ParseContext::define(JSContext *cx, HandlePropertyName name, return false; break; - case Definition::PLACEHOLDER: - case Definition::NAMED_LAMBDA: + default: JS_NOT_REACHED("unexpected kind"); break; } @@ -210,17 +209,20 @@ bool ParseContext::define(JSContext *cx, HandlePropertyName name, Node pn, Definition::Kind kind) { - return true; + JS_ASSERT(!decls_.lookupFirst(name)); + + if (lexdeps.lookupDefn(name)) + lexdeps->remove(name); + + return decls_.addUnique(name, kind); } template void -ParseContext::prepareToAddDuplicateArg(Definition *prevDecl) +ParseContext::prepareToAddDuplicateArg(HandlePropertyName name, DefinitionNode prevDecl) { - JS_ASSERT(prevDecl->kind() == Definition::ARG); - JS_ASSERT(decls_.lookupFirst(prevDecl->name()) == prevDecl); - JS_ASSERT(!prevDecl->isClosed()); - decls_.remove(prevDecl->name()); + JS_ASSERT(decls_.lookupFirst(name) == prevDecl); + decls_.remove(name); } template @@ -258,7 +260,7 @@ template void ParseContext::popLetDecl(JSAtom *atom) { - JS_ASSERT(decls_.lookupFirst(atom)->isLet()); + JS_ASSERT(ParseHandler::getDefinitionKind(decls_.lookupFirst(atom)) == Definition::LET); decls_.remove(atom); } @@ -281,9 +283,7 @@ AppendPackedBindings(const ParseContext *pc, const DeclVector &vec case Definition::ARG: kind = ARGUMENT; break; - case Definition::LET: - case Definition::NAMED_LAMBDA: - case Definition::PLACEHOLDER: + default: JS_NOT_REACHED("unexpected dn->kind"); } @@ -821,11 +821,6 @@ Parser::checkStrictBinding(HandlePropertyName name, Node pn) return true; } -template <> -bool -Parser::defineArg(ParseNode *funcpn, HandlePropertyName name, - bool disallowDuplicateArgs, Definition **duplicatedArg); - template <> ParseNode * Parser::standaloneFunctionBody(HandleFunction fun, const AutoNameVector &formals, @@ -875,27 +870,21 @@ template <> bool Parser::checkFunctionArguments() { - /* Time to implement the odd semantics of 'arguments'. */ - HandlePropertyName arguments = context->names().arguments; - /* * Non-top-level functions use JSOP_DEFFUN which is a dynamic scope * operation which means it aliases any bindings with the same name. - * Due to the implicit declaration mechanism (below), 'arguments' will not - * have decls and, even if it did, they will not be noted as closed in the - * emitter. Thus, in the corner case of function-statement-overridding- - * arguments, flag the whole scope as dynamic. */ if (FuncStmtSet *set = pc->funcStmts) { for (FuncStmtSet::Range r = set->all(); !r.empty(); r.popFront()) { PropertyName *name = r.front()->asPropertyName(); - if (name == arguments) - pc->sc->setBindingsAccessedDynamically(); - else if (Definition *dn = pc->decls().lookupFirst(name)) + if (Definition *dn = pc->decls().lookupFirst(name)) dn->pn_dflags |= PND_CLOSED; } } + /* Time to implement the odd semantics of 'arguments'. */ + HandlePropertyName arguments = context->names().arguments; + /* * As explained by the ContextFlags::funArgumentsHasLocalBinding comment, * create a declaration for 'arguments' if there are any unbound uses in @@ -903,7 +892,7 @@ Parser::checkFunctionArguments() */ for (AtomDefnRange r = pc->lexdeps->all(); !r.empty(); r.popFront()) { if (r.front().key() == arguments) { - Definition *dn = r.front().value(); + Definition *dn = r.front().value().get(); pc->lexdeps->remove(arguments); dn->pn_dflags |= PND_IMPLICITARGUMENTS; if (!pc->define(context, arguments, dn, Definition::VAR)) @@ -979,7 +968,7 @@ Parser::checkFunctionArguments() for (AtomDefnListMap::Range r = pc->decls().all(); !r.empty(); r.popFront()) { DefinitionList &dlist = r.front().value(); for (DefinitionList::Range dr = dlist.all(); !dr.empty(); dr.popFront()) { - Definition *dn = dr.front(); + Definition *dn = dr.front(); if (dn->kind() == Definition::ARG && dn->isAssigned()) funbox->setDefinitelyNeedsArgsObj(); } @@ -1045,23 +1034,6 @@ Parser::functionBody(FunctionSyntaxKind kind, FunctionBodyType typ return pn; } -// Create a placeholder Definition node for |atom|. -// Nb: unlike most functions that are passed a Parser, this one gets a -// SharedContext passed in separately, because in this case |pc| may not equal -// |parser->pc|. -static Definition * -MakePlaceholder(ParseNode *pn, FullParseHandler *handler, ParseContext *pc) -{ - Definition *dn = (Definition *) NameNode::create(PNK_NAME, pn->pn_atom, handler, pc); - if (!dn) - return NULL; - - dn->setOp(JSOP_NOP); - dn->setDefn(true); - dn->pn_dflags |= PND_PLACEHOLDER; - return dn; -} - static void ForgetUse(ParseNode *pn) { @@ -1253,23 +1225,6 @@ MatchOrInsertSemicolon(JSContext *cx, TokenStream *ts) return true; } -static bool -DeoptimizeUsesWithin(Definition *dn, const TokenPos &pos) -{ - unsigned ndeoptimized = 0; - - for (ParseNode *pnu = dn->dn_uses; pnu; pnu = pnu->pn_link) { - JS_ASSERT(pnu->isUsed()); - JS_ASSERT(!pnu->isDefn()); - if (pnu->pn_pos.begin >= pos.begin && pnu->pn_pos.end <= pos.end) { - pnu->pn_dflags |= PND_DEOPTIMIZED; - ++ndeoptimized; - } - } - - return ndeoptimized != 0; -} - /* * Beware: this function is called for functions nested in other functions or * global scripts but not for functions compiled through the Function @@ -1294,7 +1249,7 @@ Parser::leaveFunction(ParseNode *fn, HandlePropertyName funNam if (pc->lexdeps->count()) { for (AtomDefnRange r = pc->lexdeps->all(); !r.empty(); r.popFront()) { JSAtom *atom = r.front().key(); - Definition *dn = r.front().value(); + Definition *dn = r.front().value().get(); JS_ASSERT(dn->isPlaceholder()); if (atom == funName && kind == Expression) { @@ -1337,12 +1292,12 @@ Parser::leaveFunction(ParseNode *fn, HandlePropertyName funNam * having an extensible scope) or any enclosing 'with'. */ if (funbox->hasExtensibleScope() || outerpc->parsingWith) - DeoptimizeUsesWithin(dn, fn->pn_pos); + handler.deoptimizeUsesWithin(dn, fn->pn_pos); if (!outer_dn) { AtomDefnAddPtr p = outerpc->lexdeps->lookupForAdd(atom); if (p) { - outer_dn = p.value(); + outer_dn = p.value().get(); } else { /* * Create a new placeholder for our outer lexdep. We could @@ -1365,8 +1320,11 @@ Parser::leaveFunction(ParseNode *fn, HandlePropertyName funNam * inherited lexdeps into uses of a new outer definition * allows us to handle both these cases in a natural way. */ - outer_dn = MakePlaceholder(dn, &handler, outerpc); - if (!outer_dn || !outerpc->lexdeps->add(p, atom, outer_dn)) + outer_dn = handler.newPlaceholder(dn, outerpc); + if (!outer_dn) + return false; + DefinitionSingle def = DefinitionSingle::new_(outer_dn); + if (!outerpc->lexdeps->add(p, atom, def)) return false; } } @@ -1438,26 +1396,28 @@ Parser::leaveFunction(Node fn, HandlePropertyName funName, * argument with the same name. The caller may use this to report an error when * one of the abovementioned features occurs after a duplicate. */ -template <> +template bool -Parser::defineArg(ParseNode *funcpn, HandlePropertyName name, - bool disallowDuplicateArgs, Definition **duplicatedArg) +Parser::defineArg(Node funcpn, HandlePropertyName name, + bool disallowDuplicateArgs, Node *duplicatedArg) { SharedContext *sc = pc->sc; /* Handle duplicate argument names. */ - if (Definition *prevDecl = pc->decls().lookupFirst(name)) { + if (DefinitionNode prevDecl = pc->decls().lookupFirst(name)) { + Node pn = handler.getDefinitionNode(prevDecl); + /* * Strict-mode disallows duplicate args. We may not know whether we are * in strict mode or not (since the function body hasn't been parsed). - * In such cases, reportStrictModeError will queue up the potential - * error and return 'true'. + * In such cases, report will queue up the potential error and return + * 'true'. */ if (sc->needStrictChecks()) { JSAutoByteString bytes; if (!js_AtomToPrintableString(context, name, &bytes)) return false; - if (!report(ParseStrictError, pc->sc->strict, prevDecl, + if (!report(ParseStrictError, pc->sc->strict, pn, JSMSG_DUPLICATE_FORMAL, bytes.ptr())) { return false; @@ -1465,36 +1425,29 @@ Parser::defineArg(ParseNode *funcpn, HandlePropertyName name, } if (disallowDuplicateArgs) { - report(ParseError, false, prevDecl, JSMSG_BAD_DUP_ARGS); + report(ParseError, false, pn, JSMSG_BAD_DUP_ARGS); return false; } if (duplicatedArg) - *duplicatedArg = prevDecl; + *duplicatedArg = pn; /* ParseContext::define assumes and asserts prevDecl is not in decls. */ - pc->prepareToAddDuplicateArg(prevDecl); + JS_ASSERT(handler.getDefinitionKind(prevDecl) == Definition::ARG); + pc->prepareToAddDuplicateArg(name, prevDecl); } - ParseNode *argpn = handler.newName(name, pc); + Node argpn = handler.newName(name, pc); if (!argpn) return false; if (!checkStrictBinding(name, argpn)) return false; - funcpn->pn_body->append(argpn); + handler.addFunctionArgument(funcpn, argpn); return pc->define(context, name, argpn, Definition::ARG); } -template <> -bool -Parser::defineArg(Node funcpn, HandlePropertyName name, - bool disallowDuplicateArgs, DefinitionNode *duplicatedArg) -{ - return true; -} - #if JS_HAS_DESTRUCTURING template /* static */ bool @@ -1547,7 +1500,7 @@ Parser::functionArguments(FunctionSyntaxKind kind, Node *listp, No if (parenFreeArrow || !tokenStream.matchToken(TOK_RP)) { bool hasDefaults = false; - DefinitionNode duplicatedArg = null(); + Node duplicatedArg = null(); bool destructuringArg = false; #if JS_HAS_DESTRUCTURING Node list = null(); @@ -1737,7 +1690,7 @@ Parser::checkFunctionDefinition(HandlePropertyName funName, * pre-created definition node for this function that primaryExpr * put in pc->lexdeps on first forward reference, and recycle pn. */ - if (Definition *fn = pc->lexdeps.lookupDefn(funName)) { + if (Definition *fn = pc->lexdeps.lookupDefn(funName)) { JS_ASSERT(fn->isDefn()); fn->setKind(PNK_FUNCTION); fn->setArity(PN_CODE); @@ -1790,6 +1743,15 @@ Parser::checkFunctionDefinition(HandlePropertyName funName, } if (!pc->funcStmts->put(funName)) return false; + + /* + * Due to the implicit declaration mechanism, 'arguments' will not + * have decls and, even if it did, they will not be noted as closed + * in the emitter. Thus, in the corner case of function statements + * overridding arguments, flag the whole scope as dynamic. + */ + if (funName == context->names().arguments) + pc->sc->setBindingsAccessedDynamically(); } /* No further binding (in BindNameToSlot) is needed for functions. */ @@ -1807,6 +1769,36 @@ bool Parser::checkFunctionDefinition(HandlePropertyName funName, Node *pn, FunctionSyntaxKind kind) { + /* Function statements add a binding to the enclosing scope. */ + bool bodyLevel = pc->atBodyLevel(); + + if (kind == Statement) { + /* + * Handle redeclaration and optimize cases where we can statically bind the + * function (thereby avoiding JSOP_DEFFUN and dynamic name lookup). + */ + if (DefinitionNode dn = pc->decls().lookupFirst(funName)) { + if (dn == Definition::CONST) { + JSAutoByteString name; + if (!js_AtomToPrintableString(context, funName, &name) || + !report(ParseError, false, null(), JSMSG_REDECLARED_VAR, + Definition::kindString(dn), name.ptr())) + { + return false; + } + } + } else if (bodyLevel) { + if (pc->lexdeps.lookupDefn(funName)) + pc->lexdeps->remove(funName); + + if (!pc->define(context, funName, *pn, Definition::VAR)) + return false; + } + + if (!bodyLevel && funName == context->names().arguments) + pc->sc->setBindingsAccessedDynamically(); + } + return true; } @@ -2474,17 +2466,17 @@ OuterLet(ParseContext *pc, StmtInfoPC *stmt, HandleAtom atom) return false; } -template <> +template /* static */ bool -Parser::bindVarOrConst(JSContext *cx, BindData *data, - HandlePropertyName name, Parser *parser) +Parser::bindVarOrConst(JSContext *cx, BindData *data, + HandlePropertyName name, Parser *parser) { - ParseContext *pc = parser->pc; - ParseNode *pn = data->pn; + ParseContext *pc = parser->pc; + Node pn = data->pn; bool isConstDecl = data->op == JSOP_DEFCONST; /* Default best op for pn is JSOP_NAME; we'll try to improve below. */ - pn->setOp(JSOP_NAME); + parser->handler.setOp(pn, JSOP_NAME); if (!parser->checkStrictBinding(name, pn)) return false; @@ -2492,7 +2484,7 @@ Parser::bindVarOrConst(JSContext *cx, BindDatatype == STMT_WITH) { - pn->pn_dflags |= PND_DEOPTIMIZED; + parser->handler.setFlag(pn, PND_DEOPTIMIZED); if (pc->sc->isFunctionBox()) { FunctionBox *funbox = pc->sc->asFunctionBox(); funbox->setMightAliasLocals(); @@ -2523,8 +2515,8 @@ Parser::bindVarOrConst(JSContext *cx, BindDatakind(); + DefinitionNode dn = defs.front(); + Definition::Kind dn_kind = parser->handler.getDefinitionKind(dn); if (dn_kind == Definition::ARG) { JSAutoByteString bytes; if (!js_AtomToPrintableString(cx, name, &bytes)) @@ -2557,16 +2549,7 @@ Parser::bindVarOrConst(JSContext *cx, BindData -/* static */ bool -Parser::bindVarOrConst(JSContext *cx, BindData *data, - HandlePropertyName name, - Parser *parser) -{ + parser->handler.linkUseToDef(pn, dn); return true; } @@ -2589,21 +2572,20 @@ Parser::makeSetCall(ParseNode *pn, unsigned msg) return true; } -template <> +template bool -Parser::noteNameUse(ParseNode *pn) +Parser::noteNameUse(HandlePropertyName name, Node pn) { - RootedPropertyName name(context, pn->pn_atom->asPropertyName()); StmtInfoPC *stmt = LexicalLookup(pc, name, NULL, (StmtInfoPC *)NULL); DefinitionList::Range defs = pc->decls().lookupMulti(name); - Definition *dn; + DefinitionNode dn; if (!defs.empty()) { - dn = defs.front(); + dn = defs.front(); } else { if (AtomDefnAddPtr p = pc->lexdeps->lookupForAdd(name)) { - dn = p.value(); + dn = p.value().get(); } else { /* * No definition before this use in any lexical scope. @@ -2613,28 +2595,23 @@ Parser::noteNameUse(ParseNode *pn) * - Be left as a free variable definition if we never * see the real definition. */ - dn = MakePlaceholder(pn, &handler, pc); - if (!dn || !pc->lexdeps->add(p, name, dn)) + dn = handler.newPlaceholder(pn, pc); + if (!dn) + return false; + DefinitionSingle def = DefinitionSingle::new_(dn); + if (!pc->lexdeps->add(p, name, def)) return false; } } - JS_ASSERT(dn->isDefn()); - LinkUseToDef(pn, dn); + handler.linkUseToDef(pn, dn); if (stmt && stmt->type == STMT_WITH) - pn->pn_dflags |= PND_DEOPTIMIZED; + handler.setFlag(pn, PND_DEOPTIMIZED); return true; } -template <> -bool -Parser::noteNameUse(Node pn) -{ - return true; -} - #if JS_HAS_DESTRUCTURING template <> @@ -2816,7 +2793,8 @@ Parser::checkDestructuring(BindData *data, * officially linked to its def or registered in lexdeps. Do * that now. */ - if (pair->pn_right == pair->pn_left && !noteNameUse(pn)) + RootedPropertyName name(context, pn->pn_atom->asPropertyName()); + if (pair->pn_right == pair->pn_left && !noteNameUse(name, pn)) return false; ok = bindDestructuringLHS(pn); } @@ -3143,9 +3121,9 @@ PushBlocklikeStatement(StmtInfoPC *stmt, StmtType type, ParseContextblockid); } -template <> -ParseNode * -Parser::newBindingNode(PropertyName *name, VarContext varContext) +template +typename ParseHandler::Node +Parser::newBindingNode(PropertyName *name, bool functionScope, VarContext varContext) { /* * If this name is being injected into an existing block/function, see if @@ -3156,13 +3134,15 @@ Parser::newBindingNode(PropertyName *name, VarContext varConte */ if (varContext == HoistVars) { if (AtomDefnPtr p = pc->lexdeps->lookup(name)) { - ParseNode *lexdep = p.value(); - JS_ASSERT(lexdep->isPlaceholder()); - if (lexdep->pn_blockid >= pc->blockid()) { - lexdep->pn_blockid = pc->blockid(); + DefinitionNode lexdep = p.value().get(); + JS_ASSERT(handler.getDefinitionKind(lexdep) == Definition::PLACEHOLDER); + + Node pn = handler.getDefinitionNode(lexdep); + if (handler.dependencyCovered(pn, pc->blockid(), functionScope)) { + handler.setBlockId(pn, pc->blockid()); pc->lexdeps->remove(p); - lexdep->pn_pos = tokenStream.currentToken().pos; - return lexdep; + handler.setPosition(pn, tokenStream.currentToken().pos); + return pn; } } } @@ -3172,13 +3152,6 @@ Parser::newBindingNode(PropertyName *name, VarContext varConte return handler.newName(name, pc); } -template <> -SyntaxParseHandler::Node -Parser::newBindingNode(PropertyName *name, VarContext varContext) -{ - return SyntaxParseHandler::NodeGeneric; -} - template typename ParseHandler::Node Parser::switchStatement() @@ -3904,7 +3877,7 @@ Parser::tryStatement() case TOK_NAME: { RootedPropertyName label(context, tokenStream.currentToken().name()); - catchName = newBindingNode(label); + catchName = newBindingNode(label, false); if (!catchName) return null(); data.pn = catchName; @@ -4020,9 +3993,10 @@ Parser::withStatement() * to safely optimize binding globals (see bug 561923). */ for (AtomDefnRange r = pc->lexdeps->all(); !r.empty(); r.popFront()) { - Definition *defn = r.front().value(); - Definition *lexdep = defn->resolve(); - DeoptimizeUsesWithin(lexdep, TokenPos::make(begin, tokenStream.currentToken().pos.begin)); + DefinitionNode defn = r.front().value().get(); + DefinitionNode lexdep = handler.resolve(defn); + handler.deoptimizeUsesWithin(lexdep, + TokenPos::make(begin, tokenStream.currentToken().pos.begin)); } Node pn = handler.newBinary(PNK_WITH, objectExpr, innerBlock); @@ -4594,7 +4568,7 @@ Parser::variables(ParseNodeKind kind, bool *psimple, } RootedPropertyName name(context, tokenStream.currentToken().name()); - pn2 = newBindingNode(name, varContext); + pn2 = newBindingNode(name, kind == PNK_VAR || kind == PNK_CONST, varContext); if (!pn2) return null(); if (data.op == JSOP_DEFCONST) @@ -5445,7 +5419,7 @@ CompExprTransplanter::transplant(ParseNode *pn) * generator) a use of a new placeholder in the generator's * lexdeps. */ - Definition *dn2 = MakePlaceholder(pn, &parser->handler, parser->pc); + Definition *dn2 = parser->handler.newPlaceholder(pn, parser->pc); if (!dn2) return false; dn2->pn_pos = root->pn_pos; @@ -5464,7 +5438,8 @@ CompExprTransplanter::transplant(ParseNode *pn) dn2->dn_uses = dn->dn_uses; dn->dn_uses = *pnup; *pnup = NULL; - if (!pc->lexdeps->put(atom, dn2)) + DefinitionSingle def = DefinitionSingle::new_(dn2); + if (!pc->lexdeps->put(atom, def)) return false; if (dn->isClosed()) dn2->pn_dflags |= PND_CLOSED; @@ -5475,7 +5450,8 @@ CompExprTransplanter::transplant(ParseNode *pn) * from the parent's lexdeps into the generator's lexdeps. */ outerpc->lexdeps->remove(atom); - if (!pc->lexdeps->put(atom, dn)) + DefinitionSingle def = DefinitionSingle::new_(dn); + if (!pc->lexdeps->put(atom, def)) return false; } else if (dn->isImplicitArguments()) { /* @@ -5629,7 +5605,7 @@ Parser::comprehensionTail(ParseNode *kid, unsigned blockid, bo * and it tries to bind all names to slots, so we must let it do * the deed. */ - pn3 = newBindingNode(name); + pn3 = newBindingNode(name, false); if (!pn3) return null(); break; @@ -6145,12 +6121,12 @@ Parser::identifierName() { JS_ASSERT(tokenStream.isCurrentTokenType(TOK_NAME)); - PropertyName *name = tokenStream.currentToken().name(); + RootedPropertyName name(context, tokenStream.currentToken().name()); Node pn = handler.newName(name, pc); if (!pn) return null(); - if (!pc->inDeclDestructuring && !noteNameUse(pn)) + if (!pc->inDeclDestructuring && !noteNameUse(name, pn)) return null(); return pn; diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 060f94e3b1f9..2dcab9c3242a 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -85,6 +85,7 @@ struct ParseContext : public GenericParseContext { typedef StmtInfoPC StmtInfo; typedef typename ParseHandler::Node Node; + typedef typename ParseHandler::DefinitionNode DefinitionNode; uint32_t bodyid; /* block number of program/function body */ uint32_t blockidGen; /* preincremented block number generator */ @@ -103,12 +104,12 @@ struct ParseContext : public GenericParseContext Node blockNode; /* parse node for a block with let declarations (block with its own lexical scope) */ private: - AtomDecls decls_; /* function, const, and var declarations */ + AtomDecls decls_; /* function, const, and var declarations */ DeclVector args_; /* argument definitions */ DeclVector vars_; /* var/const definitions */ public: - const AtomDecls &decls() const { + const AtomDecls &decls() const { return decls_; } @@ -161,7 +162,7 @@ struct ParseContext : public GenericParseContext void popLetDecl(JSAtom *atom); /* See the sad story in defineArg. */ - void prepareToAddDuplicateArg(Definition *prevDecl); + void prepareToAddDuplicateArg(HandlePropertyName name, DefinitionNode prevDecl); /* See the sad story in MakeDefIntoUse. */ void updateDecl(JSAtom *atom, Node newDecl); @@ -494,13 +495,13 @@ struct Parser : private AutoGCRooter, public StrictModeGetter bool checkStrictBinding(HandlePropertyName name, Node pn); bool checkDeleteExpression(Node *pn); bool defineArg(Node funcpn, HandlePropertyName name, - bool disallowDuplicateArgs = false, DefinitionNode *duplicatedArg = NULL); + bool disallowDuplicateArgs = false, Node *duplicatedArg = NULL); Node pushLexicalScope(StmtInfoPC *stmt); Node pushLexicalScope(Handle blockObj, StmtInfoPC *stmt); Node pushLetScope(Handle blockObj, StmtInfoPC *stmt); - bool noteNameUse(Node pn); + bool noteNameUse(HandlePropertyName name, Node pn); Node newRegExp(const jschar *chars, size_t length, RegExpFlag flags); - Node newBindingNode(PropertyName *name, VarContext varContext = HoistVars); + Node newBindingNode(PropertyName *name, bool functionScope, VarContext varContext = HoistVars); bool checkDestructuring(BindData *data, Node left, bool toplevel = true); bool bindDestructuringVar(BindData *data, Node pn); bool bindDestructuringLHS(Node pn); @@ -521,7 +522,7 @@ struct Parser : private AutoGCRooter, public StrictModeGetter bindVarOrConst(JSContext *cx, BindData *data, HandlePropertyName name, Parser *parser); - static DefinitionNode null() { return ParseHandler::null(); } + static Node null() { return ParseHandler::null(); } bool reportRedeclaration(Node pn, bool isConst, JSAtom *atom); bool reportBadReturn(Node pn, ParseReportKind kind, unsigned errnum, unsigned anonerrnum); diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h index 085dec56800f..dd0ba4faedf1 100644 --- a/js/src/frontend/SyntaxParseHandler.h +++ b/js/src/frontend/SyntaxParseHandler.h @@ -27,7 +27,7 @@ class SyntaxParseHandler NodeStringExprStatement, NodeLValue }; - typedef Node DefinitionNode; + typedef Definition::Kind DefinitionNode; SyntaxParseHandler(JSContext *cx, TokenStream &tokenStream, bool foldConstants) : lastAtom(NULL), @@ -43,6 +43,9 @@ class SyntaxParseHandler lastAtom = name; return NodeName; } + DefinitionNode newPlaceholder(Node pn, ParseContext *pc) { + return Definition::PLACEHOLDER; + } Node newAtom(ParseNodeKind kind, JSAtom *atom, JSOp op = JSOP_NOP) { if (kind == PNK_STRING) { lastAtom = atom; @@ -102,6 +105,7 @@ class SyntaxParseHandler Node newFunctionDefinition() { return NodeGeneric; } void setFunctionBody(Node pn, Node kid) {} void setFunctionBox(Node pn, FunctionBox *funbox) {} + void addFunctionArgument(Node pn, Node argpn) {} Node newLexicalScope(ObjectBox *blockbox) { return NodeGeneric; } bool isOperationWithoutParens(Node pn, ParseNodeKind kind) { // It is OK to return false here, callers should only use this method @@ -119,6 +123,8 @@ class SyntaxParseHandler void setEndPosition(Node pn, Node oth) {} void setEndPosition(Node pn, uint32_t end) {} + + void setPosition(Node pn, const TokenPos &pos) {} TokenPos getPosition(Node pn) { return tokenStream.currentToken().pos; } @@ -154,6 +160,29 @@ class SyntaxParseHandler bool isEmptySemicolon(Node pn) { return false; } Node makeAssignment(Node pn, Node rhs) { return NodeGeneric; } + + static Node getDefinitionNode(DefinitionNode dn) { return NodeGeneric; } + static Definition::Kind getDefinitionKind(DefinitionNode dn) { return dn; } + void linkUseToDef(Node pn, DefinitionNode dn) {} + DefinitionNode resolve(DefinitionNode dn) { return dn; } + void deoptimizeUsesWithin(DefinitionNode dn, const TokenPos &pos) {} + bool dependencyCovered(Node pn, unsigned blockid, bool functionScope) { + // Only resolve lexical dependencies in cases where a definition covers + // the entire function. Not enough information is kept to compare the + // dependency location with blockid. + return functionScope; + } + + static uintptr_t definitionToBits(DefinitionNode dn) { + // Use a shift, as DefinitionList tags the lower bit of its associated union. + return uintptr_t(dn << 1); + } + static DefinitionNode definitionFromBits(uintptr_t bits) { + return (DefinitionNode) (bits >> 1); + } + static DefinitionNode nullDefinition() { + return Definition::MISSING; + } }; } // namespace frontend From a4706ed92ab361b056d47d25e7ed021e3b185db4 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 15 Apr 2013 13:17:22 +0100 Subject: [PATCH 153/438] bug 861403 - fix mixing of device pixels with global display pixels in MoveClient and ResizeClient calculations. r=roc --- widget/gtk2/nsWindow.cpp | 9 +++------ widget/windows/nsWindow.cpp | 10 +++------- widget/xpwidgets/nsBaseWidget.cpp | 27 +++++++++++++++++++-------- widget/xpwidgets/nsBaseWidget.h | 10 ++++++++++ 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/widget/gtk2/nsWindow.cpp b/widget/gtk2/nsWindow.cpp index f3f1cf8920d5..59a7a61867e5 100644 --- a/widget/gtk2/nsWindow.cpp +++ b/widget/gtk2/nsWindow.cpp @@ -995,8 +995,7 @@ nsWindow::Show(bool aState) NS_IMETHODIMP nsWindow::Resize(double aWidth, double aHeight, bool aRepaint) { - double scale = - mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t width = NSToIntRound(scale * aWidth); int32_t height = NSToIntRound(scale * aHeight); ConstrainSize(&width, &height); @@ -1076,8 +1075,7 @@ NS_IMETHODIMP nsWindow::Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) { - double scale = - mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t width = NSToIntRound(scale * aWidth); int32_t height = NSToIntRound(scale * aHeight); ConstrainSize(&width, &height); @@ -1165,8 +1163,7 @@ nsWindow::Move(double aX, double aY) LOG(("nsWindow::Move [%p] %f %f\n", (void *)this, aX, aY)); - double scale = - mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t x = NSToIntRound(aX * scale); int32_t y = NSToIntRound(aY * scale); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 91b95bf14b32..ff4f652ffdd7 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -1315,8 +1315,7 @@ NS_METHOD nsWindow::Move(double aX, double aY) // for top-level windows only, convert coordinates from global display pixels // (the "parent" coordinate space) to the window's device pixel space - double scale = - (mWindowType <= eWindowType_popup) ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t x = NSToIntRound(aX * scale); int32_t y = NSToIntRound(aY * scale); @@ -1369,8 +1368,7 @@ NS_METHOD nsWindow::Resize(double aWidth, double aHeight, bool aRepaint) { // for top-level windows only, convert coordinates from global display pixels // (the "parent" coordinate space) to the window's device pixel space - double scale = - (mWindowType <= eWindowType_popup) ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t width = NSToIntRound(aWidth * scale); int32_t height = NSToIntRound(aHeight * scale); @@ -1420,8 +1418,7 @@ NS_METHOD nsWindow::Resize(double aX, double aY, double aWidth, double aHeight, { // for top-level windows only, convert coordinates from global display pixels // (the "parent" coordinate space) to the window's device pixel space - double scale = - (mWindowType <= eWindowType_popup) ? GetDefaultScale() : 1.0; + double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0; int32_t x = NSToIntRound(aX * scale); int32_t y = NSToIntRound(aY * scale); int32_t width = NSToIntRound(aWidth * scale); @@ -1846,7 +1843,6 @@ NS_METHOD nsWindow::GetBounds(nsIntRect &aRect) } else { aRect = mBounds; } - return NS_OK; } diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index edba4c2271ca..c300373e7a5f 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -1030,8 +1030,13 @@ NS_METHOD nsBaseWidget::SetWindowClass(const nsAString& xulWinType) NS_METHOD nsBaseWidget::MoveClient(double aX, double aY) { nsIntPoint clientOffset(GetClientOffset()); - aX -= clientOffset.x; - aY -= clientOffset.y; + + // GetClientOffset returns device pixels; scale back to display pixels + // if that's what this widget uses for the Move/Resize APIs + double scale = BoundsUseDisplayPixels() ? 1.0 / GetDefaultScale() : 1.0; + aX -= clientOffset.x * scale; + aY -= clientOffset.y * scale; + return Move(aX, aY); } @@ -1044,8 +1049,12 @@ NS_METHOD nsBaseWidget::ResizeClient(double aWidth, nsIntRect clientBounds; GetClientBounds(clientBounds); - aWidth = mBounds.width + (aWidth - clientBounds.width); - aHeight = mBounds.height + (aHeight - clientBounds.height); + + // GetClientBounds and mBounds are device pixels; scale back to display pixels + // if that's what this widget uses for the Move/Resize APIs + double scale = BoundsUseDisplayPixels() ? 1.0 / GetDefaultScale() : 1.0; + aWidth = mBounds.width * scale + (aWidth - clientBounds.width * scale); + aHeight = mBounds.height * scale + (aHeight - clientBounds.height * scale); return Resize(aWidth, aHeight, aRepaint); } @@ -1061,12 +1070,14 @@ NS_METHOD nsBaseWidget::ResizeClient(double aX, nsIntRect clientBounds; GetClientBounds(clientBounds); - aWidth = mBounds.width + (aWidth - clientBounds.width); - aHeight = mBounds.height + (aHeight - clientBounds.height); + + double scale = BoundsUseDisplayPixels() ? 1.0 / GetDefaultScale() : 1.0; + aWidth = mBounds.width * scale + (aWidth - clientBounds.width * scale); + aHeight = mBounds.height * scale + (aHeight - clientBounds.height * scale); nsIntPoint clientOffset(GetClientOffset()); - aX -= clientOffset.x; - aY -= clientOffset.y; + aX -= clientOffset.x * scale; + aY -= clientOffset.y * scale; return Resize(aX, aY, aWidth, aHeight, aRepaint); } diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index 5b92a9b3306d..9e11c7bcda83 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -118,6 +118,16 @@ public: virtual gfxASurface* GetThebesSurface(); NS_IMETHOD SetModal(bool aModal); NS_IMETHOD SetWindowClass(const nsAString& xulWinType); + // Return whether this widget interprets parameters to Move and Resize APIs + // as "global display pixels" rather than "device pixels", and therefore + // applies its GetDefaultScale() value to them before using them as mBounds + // etc (which are always stored in device pixels). + // Note that APIs that -get- the widget's position/size/bounds, rather than + // -setting- them (i.e. moving or resizing the widget) will always return + // values in the widget's device pixels. + bool BoundsUseDisplayPixels() const { + return mWindowType <= eWindowType_popup; + } NS_IMETHOD MoveClient(double aX, double aY); NS_IMETHOD ResizeClient(double aWidth, double aHeight, bool aRepaint); NS_IMETHOD ResizeClient(double aX, double aY, double aWidth, double aHeight, bool aRepaint); From 297949d6610726e492584a375d12066a1e88f866 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 15 Apr 2013 13:30:28 +0100 Subject: [PATCH 154/438] Bug 861805 - Stop layers from snapping transforms for SVG content. r=roc --- gfx/layers/Layers.cpp | 6 ++++-- gfx/layers/Layers.h | 7 ++++++- layout/base/FrameLayerBuilder.cpp | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index b30bcb79db5a..7a2e0bac0b61 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -453,7 +453,8 @@ Layer::SnapTransformTranslation(const gfx3DMatrix& aTransform, gfxMatrix matrix2D; gfx3DMatrix result; - if (mManager->IsSnappingEffectiveTransforms() && + if (!(mContentFlags & CONTENT_DISABLE_TRANSFORM_SNAPPING) && + mManager->IsSnappingEffectiveTransforms() && aTransform.Is2D(&matrix2D) && !matrix2D.HasNonTranslation() && matrix2D.HasNonIntegerTranslation()) { @@ -485,7 +486,8 @@ Layer::SnapTransform(const gfx3DMatrix& aTransform, gfxMatrix matrix2D; gfx3DMatrix result; - if (mManager->IsSnappingEffectiveTransforms() && + if (!(mContentFlags & CONTENT_DISABLE_TRANSFORM_SNAPPING) && + mManager->IsSnappingEffectiveTransforms() && aTransform.Is2D(&matrix2D) && gfxSize(1.0, 1.0) <= aSnapRect.Size() && matrix2D.PreservesAxisAlignedRectangles()) { diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 94c3407a433e..4d8d589acb39 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -639,7 +639,12 @@ public: * transaction where there is no possibility of redrawing the content, so the * implementation should be ready for that. */ - CONTENT_MAY_CHANGE_TRANSFORM = 0x08 + CONTENT_MAY_CHANGE_TRANSFORM = 0x08, + /** + * This indicates that the content does not want to be snapped to pixel + * boundaries, so the layers code should not do transform snapping. + */ + CONTENT_DISABLE_TRANSFORM_SNAPPING = 0x10 }; /** * CONSTRUCTION PHASE ONLY diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 7ebd53658c38..e2bc7c05deb2 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -2940,6 +2940,11 @@ FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder* aBuilder, flags = Layer::CONTENT_OPAQUE; } } + + if (aContainerFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) { + flags |= Layer::CONTENT_DISABLE_TRANSFORM_SNAPPING; + } + containerLayer->SetContentFlags(flags); mContainerLayerGeneration = oldGeneration; From f29df2e52febbb4f10c105cec81d8bcd942b4ee0 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Mon, 15 Apr 2013 14:38:48 +0200 Subject: [PATCH 155/438] Bug 600307 - localStorage and sessionStorage implementation overhaul, r=mak77+smaug, sr=smaug --- .../base/content/test/browser_aboutHome.js | 6 +- .../sessionstore/src/SessionStorage.jsm | 15 +- content/events/src/nsEventDispatcher.cpp | 1 - docshell/base/nsDocShell.cpp | 218 +- docshell/base/nsDocShell.h | 14 +- docshell/base/nsIDocShell.idl | 19 +- dom/base/nsDOMClassInfo.cpp | 16 +- dom/base/nsDOMClassInfoClasses.h | 2 - dom/base/nsGlobalWindow.cpp | 147 +- dom/base/nsGlobalWindow.h | 3 +- dom/indexedDB/CheckPermissionsHelper.cpp | 1 - dom/interfaces/storage/moz.build | 2 - dom/interfaces/storage/nsIDOMStorageItem.idl | 28 - .../storage/nsIDOMStorageManager.idl | 82 +- .../storage/nsIDOMStorageObsolete.idl | 65 - dom/interfaces/storage/nsPIDOMStorage.h | 41 +- dom/ipc/ContentChild.cpp | 6 +- dom/ipc/ContentChild.h | 2 +- dom/ipc/ContentParent.cpp | 9 +- dom/ipc/ContentParent.h | 2 +- dom/ipc/PContent.ipdl | 19 +- dom/src/storage/DOMStorage.cpp | 353 ++++ dom/src/storage/DOMStorage.h | 85 + dom/src/storage/DOMStorageCache.cpp | 801 ++++++++ dom/src/storage/DOMStorageCache.h | 253 +++ dom/src/storage/DOMStorageDBThread.cpp | 1296 ++++++++++++ dom/src/storage/DOMStorageDBThread.h | 350 ++++ dom/src/storage/DOMStorageIPC.cpp | 712 +++++++ dom/src/storage/DOMStorageIPC.h | 191 ++ dom/src/storage/DOMStorageManager.cpp | 631 ++++++ dom/src/storage/DOMStorageManager.h | 127 ++ dom/src/storage/DOMStorageObserver.cpp | 332 +++ dom/src/storage/DOMStorageObserver.h | 62 + dom/src/storage/Makefile.in | 20 +- dom/src/storage/PStorage.ipdl | 66 +- dom/src/storage/StorageChild.cpp | 250 --- dom/src/storage/StorageChild.h | 71 - dom/src/storage/StorageParent.cpp | 157 -- dom/src/storage/StorageParent.h | 60 - dom/src/storage/nsDOMStorage.cpp | 1808 ----------------- dom/src/storage/nsDOMStorage.h | 486 ----- dom/src/storage/nsDOMStorageBaseDB.cpp | 86 - dom/src/storage/nsDOMStorageBaseDB.h | 58 - dom/src/storage/nsDOMStorageDBWrapper.cpp | 397 ---- dom/src/storage/nsDOMStorageDBWrapper.h | 238 --- dom/src/storage/nsDOMStorageMemoryDB.cpp | 383 ---- dom/src/storage/nsDOMStorageMemoryDB.h | 145 -- dom/src/storage/nsDOMStoragePersistentDB.cpp | 1143 ----------- dom/src/storage/nsDOMStoragePersistentDB.h | 265 --- dom/src/storage/nsLocalStorageCache.cpp | 416 ---- dom/src/storage/nsLocalStorageCache.h | 184 -- dom/tests/mochitest/localstorage/Makefile.in | 4 +- .../localstorage/frameBug624047.html | 30 - .../localstorage/localStorageCommon.js | 46 + .../localstorage/test_bug600307-DBOps.html | 166 ++ .../localstorage/test_bug624047.html | 64 - .../localstorage/test_localStorageBase.html | 37 +- .../test_localStorageFromChrome.xhtml | 4 +- .../mochitest/sessionstorage/Makefile.in | 2 + .../sessionstorage/test_cookieSession.html | 98 + .../test_sessionStorageBase.html | 23 +- .../test_sessionStorageBaseSessionOnly.html | 214 ++ .../windowwatcher/src/nsWindowWatcher.cpp | 22 +- js/xpconnect/src/dom_quickstubs.qsconf | 1 - layout/build/nsLayoutCID.h | 16 +- layout/build/nsLayoutModule.cpp | 18 +- layout/build/nsLayoutStatics.cpp | 11 +- testing/mochitest/b2g.json | 2 + toolkit/components/telemetry/Histograms.json | 88 +- toolkit/content/Services.jsm | 2 +- .../test/unit/test_removeDataFromDomain.js | 4 +- xpcom/base/ErrorList.h | 6 + 72 files changed, 6181 insertions(+), 6801 deletions(-) delete mode 100644 dom/interfaces/storage/nsIDOMStorageItem.idl delete mode 100644 dom/interfaces/storage/nsIDOMStorageObsolete.idl create mode 100644 dom/src/storage/DOMStorage.cpp create mode 100644 dom/src/storage/DOMStorage.h create mode 100644 dom/src/storage/DOMStorageCache.cpp create mode 100644 dom/src/storage/DOMStorageCache.h create mode 100644 dom/src/storage/DOMStorageDBThread.cpp create mode 100644 dom/src/storage/DOMStorageDBThread.h create mode 100644 dom/src/storage/DOMStorageIPC.cpp create mode 100644 dom/src/storage/DOMStorageIPC.h create mode 100644 dom/src/storage/DOMStorageManager.cpp create mode 100644 dom/src/storage/DOMStorageManager.h create mode 100644 dom/src/storage/DOMStorageObserver.cpp create mode 100644 dom/src/storage/DOMStorageObserver.h delete mode 100644 dom/src/storage/StorageChild.cpp delete mode 100644 dom/src/storage/StorageChild.h delete mode 100644 dom/src/storage/StorageParent.cpp delete mode 100644 dom/src/storage/StorageParent.h delete mode 100644 dom/src/storage/nsDOMStorage.cpp delete mode 100644 dom/src/storage/nsDOMStorage.h delete mode 100644 dom/src/storage/nsDOMStorageBaseDB.cpp delete mode 100644 dom/src/storage/nsDOMStorageBaseDB.h delete mode 100644 dom/src/storage/nsDOMStorageDBWrapper.cpp delete mode 100644 dom/src/storage/nsDOMStorageDBWrapper.h delete mode 100644 dom/src/storage/nsDOMStorageMemoryDB.cpp delete mode 100644 dom/src/storage/nsDOMStorageMemoryDB.h delete mode 100644 dom/src/storage/nsDOMStoragePersistentDB.cpp delete mode 100644 dom/src/storage/nsDOMStoragePersistentDB.h delete mode 100644 dom/src/storage/nsLocalStorageCache.cpp delete mode 100644 dom/src/storage/nsLocalStorageCache.h delete mode 100644 dom/tests/mochitest/localstorage/frameBug624047.html create mode 100644 dom/tests/mochitest/localstorage/localStorageCommon.js create mode 100644 dom/tests/mochitest/localstorage/test_bug600307-DBOps.html delete mode 100644 dom/tests/mochitest/localstorage/test_bug624047.html create mode 100644 dom/tests/mochitest/sessionstorage/test_cookieSession.html create mode 100644 dom/tests/mochitest/sessionstorage/test_sessionStorageBaseSessionOnly.html diff --git a/browser/base/content/test/browser_aboutHome.js b/browser/base/content/test/browser_aboutHome.js index b3a698f10061..ae7a6b5c6636 100644 --- a/browser/base/content/test/browser_aboutHome.js +++ b/browser/base/content/test/browser_aboutHome.js @@ -25,9 +25,9 @@ let gTests = [ desc: "Check that clearing cookies does not clear storage", setup: function () { - Cc["@mozilla.org/dom/storagemanager;1"] - .getService(Ci.nsIObserver) - .observe(null, "cookie-changed", "cleared"); + Cc["@mozilla.org/observer-service;1"] + .getService(Ci.nsIObserverService) + .notifyObservers(null, "cookie-changed", "cleared"); }, run: function (aSnippetsMap) { diff --git a/browser/components/sessionstore/src/SessionStorage.jsm b/browser/components/sessionstore/src/SessionStorage.jsm index 8c14900c8d8a..cf217ab04bcc 100644 --- a/browser/components/sessionstore/src/SessionStorage.jsm +++ b/browser/components/sessionstore/src/SessionStorage.jsm @@ -85,7 +85,12 @@ let DomStorage = { for (let [host, data] in Iterator(aStorageData)) { let uri = Services.io.newURI(host, null, null); let principal = Services.scriptSecurityManager.getDocShellCodebasePrincipal(uri, aDocShell); - let storage = aDocShell.getSessionStorageForPrincipal(principal, "", true); + let storageManager = aDocShell.QueryInterface(Components.interfaces.nsIDOMStorageManager); + + // There is no need to pass documentURI, it's only used to fill documentURI property of + // domstorage event, which in this case has no consumer. Prevention of events in case + // of missing documentURI will be solved in a followup bug to bug 600307. + let storage = storageManager.createStorage(principal, "", aDocShell.usePrivateBrowsing); for (let [key, value] in Iterator(data)) { try { @@ -110,12 +115,8 @@ let DomStorage = { let storage; try { - // Using getSessionStorageForPrincipal instead of - // getSessionStorageForURI just to be able to pass aCreate = false, - // that avoids creation of the sessionStorage object for the page - // earlier than the page really requires it. It was causing problems - // while accessing a storage when a page later changed its domain. - storage = aDocShell.getSessionStorageForPrincipal(aPrincipal, "", false); + let storageManager = aDocShell.QueryInterface(Components.interfaces.nsIDOMStorageManager); + storage = storageManager.getStorage(aPrincipal); } catch (e) { // sessionStorage might throw if it's turned off, see bug 458954 } diff --git a/content/events/src/nsEventDispatcher.cpp b/content/events/src/nsEventDispatcher.cpp index c73da62bbbf4..2be0fa4eb256 100644 --- a/content/events/src/nsEventDispatcher.cpp +++ b/content/events/src/nsEventDispatcher.cpp @@ -16,7 +16,6 @@ #include "nsPIDOMWindow.h" #include "nsFrameLoader.h" #include "nsDOMTouchEvent.h" -#include "nsDOMStorage.h" #include "GeckoProfiler.h" #include "GeneratedEvents.h" #include "mozilla/dom/EventTarget.h" diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 5db18712da09..783c4ba44001 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -849,8 +849,6 @@ nsDocShell::Init() rv = mContentListener->Init(); NS_ENSURE_SUCCESS(rv, rv); - mStorages.Init(); - // We want to hold a strong ref to the loadgroup, so it better hold a weak // ref to us... use an InterfaceRequestorProxy to do this. nsCOMPtr proxy = @@ -917,6 +915,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell) NS_INTERFACE_MAP_ENTRY(nsIWebShellServices) NS_INTERFACE_MAP_ENTRY(nsILinkHandler) NS_INTERFACE_MAP_ENTRY(nsIClipboardCommands) + NS_INTERFACE_MAP_ENTRY(nsIDOMStorageManager) NS_INTERFACE_MAP_END_INHERITING(nsDocLoader) ///***************************************************************************** @@ -2596,199 +2595,70 @@ nsDocShell::HistoryTransactionRemoved(int32_t aIndex) return NS_OK; } +nsIDOMStorageManager* +nsDocShell::TopSessionStorageManager() +{ + nsresult rv; + + nsCOMPtr topItem; + rv = GetSameTypeRootTreeItem(getter_AddRefs(topItem)); + if (NS_FAILED(rv)) { + return nullptr; + } + + if (!topItem) { + return nullptr; + } + + nsDocShell* topDocShell = static_cast(topItem.get()); + if (topDocShell != this) { + return topDocShell->TopSessionStorageManager(); + } + + if (!mSessionStorageManager) { + mSessionStorageManager = + do_CreateInstance("@mozilla.org/dom/sessionStorage-manager;1"); + } + + return mSessionStorageManager; +} + NS_IMETHODIMP nsDocShell::GetSessionStorageForPrincipal(nsIPrincipal* aPrincipal, const nsAString& aDocumentURI, bool aCreate, nsIDOMStorage** aStorage) { - NS_ENSURE_ARG_POINTER(aStorage); - *aStorage = nullptr; - - if (!aPrincipal) - return NS_OK; - - nsresult rv; - - nsCOMPtr topItem; - rv = GetSameTypeRootTreeItem(getter_AddRefs(topItem)); - if (NS_FAILED(rv)) - return rv; - - if (!topItem) - return NS_ERROR_FAILURE; - - nsDocShell* topDocShell = static_cast(topItem.get()); - if (topDocShell != this) - return topDocShell->GetSessionStorageForPrincipal(aPrincipal, - aDocumentURI, - aCreate, - aStorage); - - nsXPIDLCString origin; - rv = aPrincipal->GetOrigin(getter_Copies(origin)); - if (NS_FAILED(rv)) - return rv; - - if (origin.IsEmpty()) - return NS_OK; - - if (!mStorages.Get(origin, aStorage) && aCreate) { - nsCOMPtr newstorage = - do_CreateInstance("@mozilla.org/dom/storage;2"); - if (!newstorage) - return NS_ERROR_OUT_OF_MEMORY; - - nsCOMPtr pistorage = do_QueryInterface(newstorage); - if (!pistorage) - return NS_ERROR_FAILURE; - - rv = pistorage->InitAsSessionStorage(aPrincipal, aDocumentURI, mInPrivateBrowsing); - if (NS_FAILED(rv)) - return rv; - - mStorages.Put(origin, newstorage); - - newstorage.swap(*aStorage); -#if defined(PR_LOGGING) && defined(DEBUG) - PR_LOG(gDocShellLog, PR_LOG_DEBUG, - ("nsDocShell[%p]: created a new sessionStorage %p", - this, *aStorage)); -#endif - } - else if (*aStorage) { - nsCOMPtr piStorage = do_QueryInterface(*aStorage); - if (piStorage) { - nsCOMPtr storagePrincipal = piStorage->Principal(); - - // The origin string used to map items in the hash table is - // an implicit security check. That check is double-confirmed - // by checking the principal a storage was demanded for - // really is the principal for which that storage was originally - // created. Originally, the check was hidden in the CanAccess - // method but it's implementation has changed. - bool equals; - nsresult rv = aPrincipal->EqualsIgnoringDomain(storagePrincipal, &equals); - NS_ASSERTION(NS_SUCCEEDED(rv) && equals, - "GetSessionStorageForPrincipal got a storage " - "that could not be accessed!"); - - if (NS_FAILED(rv) || !equals) { - NS_RELEASE(*aStorage); - return NS_ERROR_DOM_SECURITY_ERR; - } - } - -#if defined(PR_LOGGING) && defined(DEBUG) - PR_LOG(gDocShellLog, PR_LOG_DEBUG, - ("nsDocShell[%p]: returns existing sessionStorage %p", - this, *aStorage)); -#endif + nsCOMPtr manager = TopSessionStorageManager(); + if (!manager) { + return NS_ERROR_UNEXPECTED; } if (aCreate) { - // We are asked to create a new storage object. This indicates - // that a new windows wants it. At this moment we "fork" the existing - // storage object (what it means is described in the paragraph bellow). - // We must create a single object per a single window to distinguish - // a window originating oparations on the storage object to succesfully - // prevent dispatch of a storage event to this same window that ivoked - // a change in its storage. We also do this to correctly fill - // documentURI property in the storage event. - // - // The difference between clone and fork is that clone creates - // a completelly new and independent storage, but fork only creates - // a new object wrapping the storage implementation and data and - // the forked storage then behaves completelly the same way as - // the storage it has been forked of, all such forked storage objects - // shares their state and data and change on one such object affects - // all others the same way. - nsCOMPtr piStorage = do_QueryInterface(*aStorage); - nsCOMPtr fork = piStorage->Fork(aDocumentURI); -#if defined(PR_LOGGING) && defined(DEBUG) - PR_LOG(gDocShellLog, PR_LOG_DEBUG, - ("nsDocShell[%p]: forked sessionStorage %p to %p", - this, *aStorage, fork.get())); -#endif - fork.swap(*aStorage); + return manager->CreateStorage(aPrincipal, aDocumentURI, + mInPrivateBrowsing, aStorage); } - return NS_OK; + return manager->GetStorage(aPrincipal, mInPrivateBrowsing, aStorage); } nsresult nsDocShell::AddSessionStorage(nsIPrincipal* aPrincipal, nsIDOMStorage* aStorage) { - NS_ENSURE_ARG_POINTER(aStorage); - - if (!aPrincipal) - return NS_OK; - - nsCOMPtr topItem; - nsresult rv = GetSameTypeRootTreeItem(getter_AddRefs(topItem)); - if (NS_FAILED(rv)) - return rv; - - if (topItem) { - nsCOMPtr topDocShell = do_QueryInterface(topItem); - if (topDocShell == this) { - nsXPIDLCString origin; - rv = aPrincipal->GetOrigin(getter_Copies(origin)); - if (NS_FAILED(rv)) - return rv; - - if (origin.IsEmpty()) - return NS_ERROR_FAILURE; - - // Do not replace an existing session storage. - if (mStorages.GetWeak(origin)) - return NS_ERROR_NOT_AVAILABLE; - -#if defined(PR_LOGGING) && defined(DEBUG) - PR_LOG(gDocShellLog, PR_LOG_DEBUG, - ("nsDocShell[%p]: was added a sessionStorage %p", - this, aStorage)); -#endif - mStorages.Put(origin, aStorage); - } - else { - return topDocShell->AddSessionStorage(aPrincipal, aStorage); - } - } - - return NS_OK; -} - -static PLDHashOperator -CloneSessionStorages(nsCStringHashKey::KeyType aKey, nsIDOMStorage* aStorage, - void* aUserArg) -{ - nsIDocShell *docShell = static_cast(aUserArg); nsCOMPtr pistorage = do_QueryInterface(aStorage); - - if (pistorage) { - nsCOMPtr storage = pistorage->Clone(); - docShell->AddSessionStorage(pistorage->Principal(), storage); + nsIPrincipal* storagePrincipal = pistorage->GetPrincipal(); + if (storagePrincipal != aPrincipal) { + NS_ERROR("Wanting to add a sessionStorage for different principal"); + return NS_ERROR_DOM_SECURITY_ERR; } - return PL_DHASH_NEXT; -} + nsCOMPtr manager = TopSessionStorageManager(); + if (!manager) { + return NS_ERROR_UNEXPECTED; + } -NS_IMETHODIMP -nsDocShell::CloneSessionStoragesTo(nsIDocShell* aDocShell) -{ - aDocShell->ClearSessionStorages(); - mStorages.EnumerateRead(CloneSessionStorages, aDocShell); - - return NS_OK; -} - -NS_IMETHODIMP -nsDocShell::ClearSessionStorages() -{ - mStorages.Clear(); - return NS_OK; + return manager->CloneStorage(aStorage); } NS_IMETHODIMP diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 588643b20811..51c72b97f2de 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -23,6 +23,7 @@ #include "nsITextScroll.h" #include "nsIDocShellTreeOwner.h" #include "nsIContentViewerContainer.h" +#include "nsIDOMStorageManager.h" #include "nsDocLoader.h" #include "nsIURILoader.h" @@ -146,7 +147,8 @@ class nsDocShell : public nsDocLoader, public nsILoadContext, public nsIWebShellServices, public nsILinkHandler, - public nsIClipboardCommands + public nsIClipboardCommands, + public nsIDOMStorageManager { friend class nsDSURIContentListener; @@ -178,6 +180,7 @@ public: NS_DECL_NSIOBSERVER NS_DECL_NSICLIPBOARDCOMMANDS NS_DECL_NSIWEBSHELLSERVICES + NS_FORWARD_SAFE_NSIDOMSTORAGEMANAGER(TopSessionStorageManager()) NS_IMETHOD Stop() { // Need this here because otherwise nsIWebNavigation::Stop @@ -628,10 +631,8 @@ protected: void ReattachEditorToWindow(nsISHEntry *aSHEntry); - nsresult GetSessionStorageForURI(nsIURI* aURI, - const nsSubstring& aDocumentURI, - bool create, - nsIDOMStorage** aStorage); + nsCOMPtr mSessionStorageManager; + nsIDOMStorageManager* TopSessionStorageManager(); // helpers for executing commands nsresult GetControllerForCommand(const char *inCommand, @@ -676,9 +677,6 @@ protected: bool HasUnloadedParent(); - // hash of session storages, keyed by domain - nsInterfaceHashtable mStorages; - // Dimensions of the docshell nsIntRect mBounds; nsString mName; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index c6e629c1e6f4..d2faf3443ac7 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -40,7 +40,7 @@ interface nsIWebBrowserPrint; interface nsIVariant; interface nsIPrivacyTransitionObserver; -[scriptable, builtinclass, uuid(4277354d-5069-4278-935a-5d596ce9bfbf)] +[scriptable, builtinclass, uuid(2b192c9c-dea4-4696-a445-1bef7bc0db6d)] interface nsIDocShell : nsIDocShellTreeItem { /** @@ -407,6 +407,8 @@ interface nsIDocShell : nsIDocShellTreeItem void historyPurged(in long numEntries); /* + * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead. + * * Retrieves the WebApps session storage object for the supplied principal. * * @param principal returns a storage for this principal @@ -420,6 +422,8 @@ interface nsIDocShell : nsIDocShellTreeItem in boolean create); /* + * @deprecated, use nsIDocShell.QueryInterface(nsIDOMStorageManager) instead. + * * Add a WebApps session storage object to the docshell. * * @param principal the principal the storage object is associated with @@ -427,19 +431,6 @@ interface nsIDocShell : nsIDocShellTreeItem */ void addSessionStorage(in nsIPrincipal principal, in nsIDOMStorage storage); - /** - * Clones all session storage objects and attaches them to the given docshell. - * Useful when duplicating tabs and their states. - * - * @param docShell the docshell to clone the sessionstorage objects to - */ - void cloneSessionStoragesTo(in nsIDocShell docShell); - - /** - * Removes all WebApps session storage objects attached to the docshell. - */ - void clearSessionStorages(); - /** * Gets the channel for the currently loaded document, if any. * For a new document load, this will be the channel of the previous document diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 42eb105e405a..ebe23a56adc0 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -229,7 +229,7 @@ #include "nsIImageDocument.h" // Storage includes -#include "nsDOMStorage.h" +#include "DOMStorage.h" // Device Storage #include "nsIDOMDeviceStorage.h" @@ -758,9 +758,6 @@ static nsDOMClassInfoData sClassInfoData[] = { // since a call to addProperty() is always followed by a call to // setProperty(), except in the case when a getter or setter is set // for a property. But we don't care about getters or setters here. - NS_DEFINE_CLASSINFO_DATA(StorageObsolete, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(Storage, nsStorage2SH, DOM_DEFAULT_SCRIPTABLE_FLAGS | nsIXPCScriptable::WANT_NEWRESOLVE | @@ -769,8 +766,6 @@ static nsDOMClassInfoData sClassInfoData[] = { nsIXPCScriptable::WANT_DELPROPERTY | nsIXPCScriptable::DONT_ENUM_STATIC_PROPS | nsIXPCScriptable::WANT_NEWENUMERATE) - NS_DEFINE_CLASSINFO_DATA(StorageItem, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(XULCommandEvent, nsEventSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) @@ -2069,19 +2064,10 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathResult) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(StorageObsolete, nsIDOMStorageObsolete) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageObsolete) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(Storage, nsIDOMStorage) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(StorageItem, nsIDOMStorageItem) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageItem) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMToString) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(XULCommandEvent, nsIDOMXULCommandEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index d65f6060cbaf..cf910eccca90 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -136,9 +136,7 @@ DOMCI_CLASS(XPathNSResolver) DOMCI_CLASS(XPathResult) // WhatWG WebApps Objects -DOMCI_CLASS(StorageObsolete) DOMCI_CLASS(Storage) -DOMCI_CLASS(StorageItem) DOMCI_CLASS(XULCommandEvent) DOMCI_CLASS(CommandEvent) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index dd6436922796..d2d9dcb2f4d5 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -18,12 +18,15 @@ #include "nsPerformance.h" #include "nsDOMNavigationTiming.h" #include "nsBarProps.h" -#include "nsDOMStorage.h" +#include "nsIDOMStorage.h" +#include "nsIDOMStorageManager.h" +#include "DOMStorage.h" #include "nsDOMOfflineResourceList.h" #include "nsError.h" #include "nsIIdleService.h" #include "nsIPowerManagerService.h" #include "nsISizeOfEventTarget.h" +#include "nsIPermissionManager.h" #ifdef XP_WIN #ifdef GetClassName @@ -2520,9 +2523,38 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, } } + PreloadLocalStorage(); + return NS_OK; } +void +nsGlobalWindow::PreloadLocalStorage() +{ + if (!Preferences::GetBool(kStorageEnabled)) { + return; + } + + if (IsChromeWindow()) { + return; + } + + nsIPrincipal* principal = GetPrincipal(); + if (!principal) { + return; + } + + nsresult rv; + + nsCOMPtr storageManager = + do_GetService("@mozilla.org/dom/localStorage-manager;1", &rv); + if (NS_FAILED(rv)) { + return; + } + + storageManager->PrecacheStorage(principal); +} + void nsGlobalWindow::DispatchDOMWindowCreated() { @@ -2708,19 +2740,6 @@ nsGlobalWindow::DetachFromDocShell() MaybeForgiveSpamCount(); CleanUp(false); - - if (mLocalStorage) { - nsCOMPtr obs = do_GetInterface(mLocalStorage); - if (obs) { - mDocShell->AddWeakPrivacyTransitionObserver(obs); - } - } - if (mSessionStorage) { - nsCOMPtr obs = do_GetInterface(mSessionStorage); - if (obs) { - mDocShell->AddWeakPrivacyTransitionObserver(obs); - } - } } void @@ -8826,7 +8845,7 @@ nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage) "window %x owned sessionStorage " "that could not be accessed!"); if (!canAccess) { - mSessionStorage = nullptr; + mSessionStorage = nullptr; } } } @@ -8840,7 +8859,7 @@ nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage) } // If the document has the sandboxed origin flag set - // don't allow access to localStorage. + // don't allow access to sessionStorage. if (!mDoc) { return NS_ERROR_FAILURE; } @@ -8849,10 +8868,17 @@ nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage) return NS_ERROR_DOM_SECURITY_ERR; } - nsresult rv = docShell->GetSessionStorageForPrincipal(principal, - documentURI, - true, - getter_AddRefs(mSessionStorage)); + nsresult rv; + + nsCOMPtr storageManager = do_QueryInterface(docShell, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr loadContext = do_QueryInterface(docShell); + + rv = storageManager->CreateStorage(principal, + documentURI, + loadContext && loadContext->UsePrivateBrowsing(), + getter_AddRefs(mSessionStorage)); NS_ENSURE_SUCCESS(rv, rv); #ifdef PR_LOGGING @@ -8864,17 +8890,12 @@ nsGlobalWindow::GetSessionStorage(nsIDOMStorage ** aSessionStorage) if (!mSessionStorage) { return NS_ERROR_DOM_NOT_SUPPORTED_ERR; } - - nsCOMPtr obs = do_GetInterface(mSessionStorage); - if (obs) { - docShell->AddWeakPrivacyTransitionObserver(obs); - } } #ifdef PR_LOGGING - if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { - PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get()); - } + if (PR_LOG_TEST(gDOMLeakPRLog, PR_LOG_DEBUG)) { + PR_LogPrint("nsGlobalWindow %p returns %p sessionStorage", this, mSessionStorage.get()); + } #endif NS_ADDREF(*aSessionStorage = mSessionStorage); @@ -8898,41 +8919,38 @@ nsGlobalWindow::GetLocalStorage(nsIDOMStorage ** aLocalStorage) nsresult rv; - if (!nsDOMStorage::CanUseStorage()) + if (!DOMStorage::CanUseStorage()) { return NS_ERROR_DOM_SECURITY_ERR; + } nsIPrincipal *principal = GetPrincipal(); - if (!principal) + if (!principal) { return NS_OK; + } nsCOMPtr storageManager = - do_GetService("@mozilla.org/dom/storagemanager;1", &rv); + do_GetService("@mozilla.org/dom/localStorage-manager;1", &rv); NS_ENSURE_SUCCESS(rv, rv); - nsString documentURI; - if (mDocument) { - mDocument->GetDocumentURI(documentURI); - } - // If the document has the sandboxed origin flag set // don't allow access to localStorage. if (mDoc && (mDoc->GetSandboxFlags() & SANDBOXED_ORIGIN)) { return NS_ERROR_DOM_SECURITY_ERR; } + nsString documentURI; + if (mDocument) { + mDocument->GetDocumentURI(documentURI); + } + nsIDocShell* docShell = GetDocShell(); nsCOMPtr loadContext = do_QueryInterface(docShell); - rv = storageManager->GetLocalStorageForPrincipal(principal, - documentURI, - loadContext && loadContext->UsePrivateBrowsing(), - getter_AddRefs(mLocalStorage)); + rv = storageManager->CreateStorage(principal, + documentURI, + loadContext && loadContext->UsePrivateBrowsing(), + getter_AddRefs(mLocalStorage)); NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr obs = do_GetInterface(mLocalStorage); - if (obs && docShell) { - docShell->AddWeakPrivacyTransitionObserver(obs); - } } NS_ADDREF(*aLocalStorage = mLocalStorage); @@ -9506,8 +9524,13 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic, rv = event->GetStorageArea(getter_AddRefs(changingStorage)); NS_ENSURE_SUCCESS(rv, rv); + bool fireMozStorageChanged = false; + principal = GetPrincipal(); + if (!principal) { + return NS_OK; + } + nsCOMPtr pistorage = do_QueryInterface(changingStorage); - nsPIDOMStorage::nsDOMStorageType storageType = pistorage->StorageType(); nsCOMPtr loadContext = do_QueryInterface(GetDocShell()); bool isPrivate = loadContext && loadContext->UsePrivateBrowsing(); @@ -9515,28 +9538,21 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic, return NS_OK; } - bool fireMozStorageChanged = false; - principal = GetPrincipal(); - switch (storageType) + switch (pistorage->GetType()) { case nsPIDOMStorage::SessionStorage: { - nsCOMPtr storage = mSessionStorage; - if (!storage) { - nsIDocShell* docShell = GetDocShell(); - if (principal && docShell) { - // No need to pass documentURI here, it's only needed when we want - // to create a new storage, the third paramater would be true - docShell->GetSessionStorageForPrincipal(principal, - EmptyString(), - false, - getter_AddRefs(storage)); - } + bool check = false; + + nsCOMPtr storageManager = do_QueryInterface(GetDocShell()); + if (storageManager) { + rv = storageManager->CheckStorage(principal, changingStorage, &check); + NS_ENSURE_SUCCESS(rv, rv); } - if (!pistorage->IsForkOf(storage)) { - // This storage event is coming from a different doc shell, - // i.e. it is a clone, ignore this event. + if (!check) { + // This storage event is not coming from our storage or is coming + // from a different docshell, i.e. it is a clone, ignore this event. return NS_OK; } @@ -9549,13 +9565,14 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic, fireMozStorageChanged = SameCOMIdentity(mSessionStorage, changingStorage); break; } + case nsPIDOMStorage::LocalStorage: { // Allow event fire only for the same principal storages // XXX We have to use EqualsIgnoreDomain after bug 495337 lands - nsIPrincipal *storagePrincipal = pistorage->Principal(); - bool equals; + nsIPrincipal* storagePrincipal = pistorage->GetPrincipal(); + bool equals = false; rv = storagePrincipal->Equals(principal, &equals); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 806af650eeb6..0684c4b8c2f0 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -46,7 +46,6 @@ #include "nsRect.h" #include "mozFlushType.h" #include "prclist.h" -#include "nsIDOMStorageObsolete.h" #include "nsIDOMStorageEvent.h" #include "nsIDOMStorageIndexedDB.h" #include "nsIDOMOfflineResourceList.h" @@ -1022,6 +1021,8 @@ protected: bool aDefaultStylesOnly, nsIDOMCSSStyleDeclaration** aReturn); + void PreloadLocalStorage(); + // When adding new member variables, be careful not to create cycles // through JavaScript. If there is any chance that a member variable // could own objects that are implemented in JavaScript, then those diff --git a/dom/indexedDB/CheckPermissionsHelper.cpp b/dom/indexedDB/CheckPermissionsHelper.cpp index fce1f55f6d97..8c1bcd9b7491 100644 --- a/dom/indexedDB/CheckPermissionsHelper.cpp +++ b/dom/indexedDB/CheckPermissionsHelper.cpp @@ -17,7 +17,6 @@ #include "CheckQuotaHelper.h" #include "nsContentUtils.h" -#include "nsDOMStorage.h" #include "nsNetUtil.h" #include "nsThreadUtils.h" #include "mozilla/dom/quota/QuotaManager.h" diff --git a/dom/interfaces/storage/moz.build b/dom/interfaces/storage/moz.build index 69001ea6fbf4..31466faf6dfe 100644 --- a/dom/interfaces/storage/moz.build +++ b/dom/interfaces/storage/moz.build @@ -8,9 +8,7 @@ XPIDL_SOURCES += [ 'nsIDOMStorage.idl', 'nsIDOMStorageEvent.idl', 'nsIDOMStorageIndexedDB.idl', - 'nsIDOMStorageItem.idl', 'nsIDOMStorageManager.idl', - 'nsIDOMStorageObsolete.idl', 'nsIDOMToString.idl', ] diff --git a/dom/interfaces/storage/nsIDOMStorageItem.idl b/dom/interfaces/storage/nsIDOMStorageItem.idl deleted file mode 100644 index dc0d349f3e6b..000000000000 --- a/dom/interfaces/storage/nsIDOMStorageItem.idl +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "domstubs.idl" - -/** - * Interface for a client side storage item. See - * http://www.whatwg.org/specs/web-apps/current-work/#scs-client-side - * for more information. - * - * A respresentation of a storage object item. - */ - -[scriptable, uuid(0CC37C78-4C5F-48E1-ADFC-7480B8FE9DC4)] -interface nsIDOMStorageItem : nsISupports -{ - /** - * Indicates whether a key is available only in a secure context. - */ - attribute boolean secure; - - /** - * The value associated with the item. - */ - attribute DOMString value; -}; diff --git a/dom/interfaces/storage/nsIDOMStorageManager.idl b/dom/interfaces/storage/nsIDOMStorageManager.idl index 67bea890b970..a839fb681798 100644 --- a/dom/interfaces/storage/nsIDOMStorageManager.idl +++ b/dom/interfaces/storage/nsIDOMStorageManager.idl @@ -8,23 +8,89 @@ interface nsIDOMStorage; interface nsIPrincipal; -[scriptable, uuid(b16b207c-d883-43f5-a27e-548e7f2f5c20)] +/** + * General purpose interface that has two implementations, for localStorage + * resp. sessionStorage with "@mozilla.org/dom/localStorage-manager;1" resp. + * "@mozilla.org/dom/sessionStorage-manager;1" contract IDs. + */ +[scriptable, uuid(8096f9ea-fa61-4960-b5d7-fb30ac42c8d8)] interface nsIDOMStorageManager : nsISupports { /** - * Return the amount of disk space used by a domain. Usage is checked - * against the domain of the page that set the key (the owner domain), not - * the domain of the storage object. - * - * @param aOwnerDomain The domain to check. - * @returns the space usage of the domain, in bytes. + * This starts async preloading of a storage cache for scope + * defined by the principal. */ - long getUsage(in AString aOwnerDomain); + void precacheStorage(in nsIPrincipal aPrincipal); /** + * Returns instance of DOM storage object for given principal. + * A new object is always returned and it is ensured there is + * a storage for the scope created. + * + * @param aPrincipal + * Principal to bound storage to. + * @param aDocumentURI + * URL of the demanding document, used for DOM storage event only. + * @param aPrivate + * Whether the demanding document is running in Private Browsing mode or not. + */ + nsIDOMStorage createStorage(in nsIPrincipal aPrincipal, + in DOMString aDocumentURI, + [optional] in bool aPrivate); + /** + * Returns instance of DOM storage object for given principal. + * If there is no storage managed for the scope, then null is returned and + * no object is created. Otherwise, an object (new) for the existing storage + * scope is returned. + * + * @param aPrincipal + * Principal to bound storage to. + * @param aPrivate + * Whether the demanding document is running in Private Browsing mode or not. + */ + nsIDOMStorage getStorage(in nsIPrincipal aPrincipal, + [optional] in bool aPrivate); + + /** + * Clones given storage into this storage manager. + * + * @param aStorageToCloneFrom + * The storage to copy all items from into this manager. Manager will then + * return a new and independent object that contains snapshot of data from + * the moment this method was called. Modification to this new object will + * not affect the original storage content we cloned from and vice versa. + */ + void cloneStorage(in nsIDOMStorage aStorageToCloneFrom); + + /** + * Returns true if the storage belongs to the given principal and is managed + * (i.e. has been created and is cached) by this storage manager. + * + * @param aPrincipal + * Principal to check the storage against. + * @param aStorage + * The storage object to examine. + * + * @result + * true when the storage object is bound with the principal and is managed + * by this storage manager. + * false otherwise + */ + bool checkStorage(in nsIPrincipal aPrincipal, + in nsIDOMStorage aStorage); + + /** + * @deprecated + * * Returns instance of localStorage object for aURI's origin. * This method ensures there is always only a single instance * for a single origin. + * + * Currently just forwards to the createStorage method of this + * interface. + * + * Extension developers are strongly encouraged to use getStorage + * or createStorage method instead. */ nsIDOMStorage getLocalStorageForPrincipal(in nsIPrincipal aPrincipal, in DOMString aDocumentURI, diff --git a/dom/interfaces/storage/nsIDOMStorageObsolete.idl b/dom/interfaces/storage/nsIDOMStorageObsolete.idl deleted file mode 100644 index f196ac5ab2c0..000000000000 --- a/dom/interfaces/storage/nsIDOMStorageObsolete.idl +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "domstubs.idl" - -/** - * Interface for client side storage. See - * http://www.whatwg.org/specs/web-apps/current-work/#scs-client-side - * for more information. - * - * A storage object stores an arbitrary set of key-value pairs, which - * may be retrieved, modified and removed as needed. A key may only - * exist once within a storage object, and only one value may be - * associated with a particular key. Keys are stored in a particular - * order with the condition that this order not change by merely changing - * the value associated with a key, but the order may change when a - * key is added or removed. - */ - -interface nsIDOMStorageItem; - -[scriptable, uuid(18013CF9-B104-49cf-9484-C2A7A845457E)] -interface nsIDOMStorageObsolete : nsISupports -{ - /** - * The number of keys stored. - */ - readonly attribute unsigned long length; - - /** - * Retrieve the name of the key at a particular index. - * - * @param index index of the item to retrieve - * @returns the key at index - * @throws INDEX_SIZE_ERR if there is no key at that index - */ - DOMString key(in unsigned long index); - - /** - * Retrieve an item with a given key - * - * @param key key to retrieve - * @returns found item or null if the key was not found - */ - nsIDOMStorageItem getItem(in DOMString key); - - /** - * Assign a value with a key. If the key does not exist already, a new - * key is added associated with that value. If the key already exists, - * then the existing value is replaced with a new value. - * - * @param key key to set - * @param data data to associate with the key - */ - void setItem(in DOMString key, in DOMString data); - - /** - * Remove a key and its corresponding value. - * - * @param key key to remove - */ - void removeItem(in DOMString key); -}; diff --git a/dom/interfaces/storage/nsPIDOMStorage.h b/dom/interfaces/storage/nsPIDOMStorage.h index 9d0fe8170449..f9ca9a3cb42d 100644 --- a/dom/interfaces/storage/nsPIDOMStorage.h +++ b/dom/interfaces/storage/nsPIDOMStorage.h @@ -8,43 +8,44 @@ #define __nsPIDOMStorage_h_ #include "nsISupports.h" +#include "nsString.h" #include "nsTArray.h" -class nsIDOMStorageObsolete; -class nsIURI; class nsIPrincipal; +namespace mozilla { +namespace dom { + +class DOMStorageCache; +class DOMStorageManager; + +} // ::dom +} // ::mozilla + +// {09198A51-5D27-4992-97E4-38A9CEA2A65D} #define NS_PIDOMSTORAGE_IID \ -{ 0x9c292365, 0x6ae4, 0x461b, \ - { 0x86, 0x98, 0xf5, 0x23, 0x6f, 0xfa, 0xd2, 0x30 } } + { 0x9198a51, 0x5d27, 0x4992, \ + { 0x97, 0xe4, 0x38, 0xa9, 0xce, 0xa2, 0xa6, 0x5d } } class nsPIDOMStorage : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMSTORAGE_IID) - typedef enum { - Unknown = 0, + enum StorageType { LocalStorage = 1, SessionStorage = 2 - } nsDOMStorageType; + }; - virtual nsresult InitAsSessionStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) = 0; - virtual nsresult InitAsLocalStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) = 0; + virtual StorageType GetType() const = 0; + virtual mozilla::dom::DOMStorageManager* GetManager() const = 0; + virtual const mozilla::dom::DOMStorageCache* GetCache() const = 0; - virtual already_AddRefed Clone() = 0; - virtual already_AddRefed Fork(const nsSubstring &aDocumentURI) = 0; - virtual bool IsForkOf(nsIDOMStorage* aThat) = 0; + virtual nsTArray* GetKeys() = 0; - virtual nsTArray *GetKeys() = 0; - - virtual nsIPrincipal* Principal() = 0; + virtual nsIPrincipal* GetPrincipal() = 0; + virtual bool PrincipalEquals(nsIPrincipal* principal) = 0; virtual bool CanAccess(nsIPrincipal *aPrincipal) = 0; - - virtual nsDOMStorageType StorageType() = 0; - virtual bool IsPrivate() = 0; }; diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 6086c0e417b0..1e86af0b3092 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -19,7 +19,7 @@ #include "mozilla/Attributes.h" #include "mozilla/dom/ExternalHelperAppChild.h" #include "mozilla/dom/PCrashReporterChild.h" -#include "mozilla/dom/StorageChild.h" +#include "mozilla/dom/DOMStorageIPC.h" #include "mozilla/Hal.h" #include "mozilla/hal_sandbox/PHalChild.h" #include "mozilla/ipc/GeckoChildProcessHost.h" @@ -839,7 +839,7 @@ ContentChild::DeallocPSms(PSmsChild* aSms) } PStorageChild* -ContentChild::AllocPStorage(const StorageConstructData& aData) +ContentChild::AllocPStorage() { NS_NOTREACHED("We should never be manually allocating PStorageChild actors"); return nullptr; @@ -848,7 +848,7 @@ ContentChild::AllocPStorage(const StorageConstructData& aData) bool ContentChild::DeallocPStorage(PStorageChild* aActor) { - StorageChild* child = static_cast(aActor); + DOMStorageDBChild* child = static_cast(aActor); child->ReleaseIPDLReference(); return true; } diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index f3e115b83839..af28f8c36ef8 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -142,7 +142,7 @@ public: virtual PSmsChild* AllocPSms(); virtual bool DeallocPSms(PSmsChild*); - virtual PStorageChild* AllocPStorage(const StorageConstructData& aData); + virtual PStorageChild* AllocPStorage(); virtual bool DeallocPStorage(PStorageChild* aActor); virtual PBluetoothChild* AllocPBluetooth(); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index afb0aaf385e5..ea2fc83feb8f 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -29,7 +29,7 @@ #include "mozilla/dom/ExternalHelperAppParent.h" #include "mozilla/dom/PMemoryReportRequestParent.h" #include "mozilla/dom/power/PowerManagerService.h" -#include "mozilla/dom/StorageParent.h" +#include "mozilla/dom/DOMStorageIPC.h" #include "mozilla/dom/bluetooth/PBluetoothParent.h" #include "mozilla/dom/devicestorage/DeviceStorageRequestParent.h" #include "SmsParent.h" @@ -1969,15 +1969,16 @@ ContentParent::DeallocPSms(PSmsParent* aSms) } PStorageParent* -ContentParent::AllocPStorage(const StorageConstructData& aData) +ContentParent::AllocPStorage() { - return new StorageParent(aData); + return new DOMStorageDBParent(); } bool ContentParent::DeallocPStorage(PStorageParent* aActor) { - delete aActor; + DOMStorageDBParent* child = static_cast(aActor); + child->ReleaseIPDLReference(); return true; } diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 598b39a84b5d..a12d9f76a0c6 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -285,7 +285,7 @@ private: virtual PSmsParent* AllocPSms(); virtual bool DeallocPSms(PSmsParent*); - virtual PStorageParent* AllocPStorage(const StorageConstructData& aData); + virtual PStorageParent* AllocPStorage(); virtual bool DeallocPStorage(PStorageParent* aActor); virtual PBluetoothParent* AllocPBluetooth(); diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 5756a7d1ba69..f3a5064a3d24 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -50,23 +50,6 @@ using gfxIntSize; namespace mozilla { namespace dom { -// Data required to clone an existing DOMStorageImpl in the parent -struct StorageClone -{ - // Existing cross-process storage actor to clone - PStorage actor; - // Result of calling IsCallerSecure() in the child - bool callerSecure; -}; - -// When creating a new PStorage protocol, an existing one can be -// cloned (see nsDOMStorage2::Clone) -union StorageConstructData -{ - null_t; - StorageClone; -}; - struct FontListEntry { nsString familyName; nsString faceName; @@ -401,7 +384,7 @@ parent: PSpeechSynthesis(); - PStorage(StorageConstructData data); + PStorage(); PBluetooth(); diff --git a/dom/src/storage/DOMStorage.cpp b/dom/src/storage/DOMStorage.cpp new file mode 100644 index 000000000000..20a69a7a4b0c --- /dev/null +++ b/dom/src/storage/DOMStorage.cpp @@ -0,0 +1,353 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorage.h" +#include "DOMStorageCache.h" +#include "DOMStorageManager.h" + +#include "nsIDOMStorageEvent.h" +#include "nsIObserverService.h" +#include "nsIScriptSecurityManager.h" +#include "nsIPermissionManager.h" +#include "nsIPrincipal.h" +#include "nsICookiePermission.h" + +#include "nsDOMClassInfoID.h" +#include "mozilla/Services.h" +#include "mozilla/Preferences.h" +#include "GeneratedEvents.h" +#include "nsThreadUtils.h" +#include "nsContentUtils.h" +#include "nsServiceManagerUtils.h" + +DOMCI_DATA(Storage, mozilla::dom::DOMStorage) + +namespace mozilla { +namespace dom { + +NS_IMPL_ADDREF(DOMStorage) +NS_IMPL_RELEASE(DOMStorage) + +NS_INTERFACE_MAP_BEGIN(DOMStorage) + NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorage) + NS_INTERFACE_MAP_ENTRY(nsIDOMStorage) + NS_INTERFACE_MAP_ENTRY(nsPIDOMStorage) + NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) + NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Storage) +NS_INTERFACE_MAP_END + +DOMStorage::DOMStorage(DOMStorageManager* aManager, + DOMStorageCache* aCache, + const nsAString& aDocumentURI, + nsIPrincipal* aPrincipal, + bool aIsPrivate) +: mManager(aManager) +, mCache(aCache) +, mDocumentURI(aDocumentURI) +, mPrincipal(aPrincipal) +, mIsPrivate(aIsPrivate) +, mIsSessionOnly(false) +{ + mCache->Preload(); +} + +DOMStorage::~DOMStorage() +{ + mCache->KeepAlive(); +} + +// nsIDOMStorage (web content public API implementation) + +NS_IMETHODIMP +DOMStorage::GetLength(uint32_t* aLength) +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + return mCache->GetLength(this, aLength); +} + +NS_IMETHODIMP +DOMStorage::Key(uint32_t aIndex, nsAString& aRetval) +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + return mCache->GetKey(this, aIndex, aRetval); +} + +NS_IMETHODIMP +DOMStorage::GetItem(const nsAString& aKey, nsAString& aRetval) +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + return mCache->GetItem(this, aKey, aRetval); +} + +NS_IMETHODIMP +DOMStorage::SetItem(const nsAString& aKey, const nsAString& aData) +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + Telemetry::Accumulate(GetType() == LocalStorage + ? Telemetry::LOCALDOMSTORAGE_KEY_SIZE_BYTES + : Telemetry::SESSIONDOMSTORAGE_KEY_SIZE_BYTES, aKey.Length()); + Telemetry::Accumulate(GetType() == LocalStorage + ? Telemetry::LOCALDOMSTORAGE_VALUE_SIZE_BYTES + : Telemetry::SESSIONDOMSTORAGE_VALUE_SIZE_BYTES, aData.Length()); + + nsString old; + nsresult rv = mCache->SetItem(this, aKey, nsString(aData), old); + if (NS_FAILED(rv)) { + return rv; + } + + if (rv != NS_SUCCESS_DOM_NO_OPERATION) { + BroadcastChangeNotification(aKey, old, aData); + } + + return NS_OK; +} + +NS_IMETHODIMP +DOMStorage::RemoveItem(const nsAString& aKey) +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + nsAutoString old; + nsresult rv = mCache->RemoveItem(this, aKey, old); + if (NS_FAILED(rv)) { + return rv; + } + + if (rv != NS_SUCCESS_DOM_NO_OPERATION) { + BroadcastChangeNotification(aKey, old, NullString()); + } + + return NS_OK; +} + +NS_IMETHODIMP +DOMStorage::Clear() +{ + if (!CanUseStorage(this)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + + nsresult rv = mCache->Clear(this); + if (NS_FAILED(rv)) { + return rv; + } + + if (rv != NS_SUCCESS_DOM_NO_OPERATION) { + BroadcastChangeNotification(NullString(), NullString(), NullString()); + } + + return NS_OK; +} + +namespace { + +class StorageNotifierRunnable : public nsRunnable +{ +public: + StorageNotifierRunnable(nsISupports* aSubject) + : mSubject(aSubject) + { } + + NS_DECL_NSIRUNNABLE + +private: + nsCOMPtr mSubject; +}; + +NS_IMETHODIMP +StorageNotifierRunnable::Run() +{ + nsCOMPtr observerService = + mozilla::services::GetObserverService(); + if (observerService) { + observerService->NotifyObservers(mSubject, "dom-storage2-changed", nullptr); + } + return NS_OK; +} + +} // anonymous namespace + +void +DOMStorage::BroadcastChangeNotification(const nsSubstring& aKey, + const nsSubstring& aOldValue, + const nsSubstring& aNewValue) +{ + nsCOMPtr domEvent; + // Note, this DOM event should never reach JS. It is cloned later in + // nsGlobalWindow. + NS_NewDOMStorageEvent(getter_AddRefs(domEvent), nullptr, nullptr, nullptr); + + nsCOMPtr event = do_QueryInterface(domEvent); + nsresult rv = event->InitStorageEvent(NS_LITERAL_STRING("storage"), + false, + false, + aKey, + aOldValue, + aNewValue, + mDocumentURI, + static_cast(this)); + if (NS_FAILED(rv)) { + return; + } + + nsRefPtr r = new StorageNotifierRunnable(event); + NS_DispatchToMainThread(r); +} + +static const uint32_t ASK_BEFORE_ACCEPT = 1; +static const uint32_t ACCEPT_SESSION = 2; +static const uint32_t BEHAVIOR_REJECT = 2; + +static const char kPermissionType[] = "cookie"; +static const char kStorageEnabled[] = "dom.storage.enabled"; +static const char kCookiesBehavior[] = "network.cookie.cookieBehavior"; +static const char kCookiesLifetimePolicy[] = "network.cookie.lifetimePolicy"; + +// static, public +bool +DOMStorage::CanUseStorage(DOMStorage* aStorage) +{ + // This method is responsible for correct setting of mIsSessionOnly. + // It doesn't work with mIsPrivate flag at all, since it is checked + // regardless mIsSessionOnly flag in DOMStorageCache code. + if (aStorage) { + aStorage->mIsSessionOnly = false; + } + + if (!mozilla::Preferences::GetBool(kStorageEnabled)) { + return false; + } + + // chrome can always use aStorage regardless of permission preferences + if (nsContentUtils::IsCallerChrome()) { + return true; + } + + nsCOMPtr subjectPrincipal; + nsresult rv = nsContentUtils::GetSecurityManager()-> + GetSubjectPrincipal(getter_AddRefs(subjectPrincipal)); + NS_ENSURE_SUCCESS(rv, false); + + // if subjectPrincipal were null we'd have returned after + // IsCallerChrome(). + + nsCOMPtr permissionManager = + do_GetService(NS_PERMISSIONMANAGER_CONTRACTID); + if (!permissionManager) { + return false; + } + + uint32_t perm; + permissionManager->TestPermissionFromPrincipal(subjectPrincipal, + kPermissionType, &perm); + + if (perm == nsIPermissionManager::DENY_ACTION) { + return false; + } + + if (perm == nsICookiePermission::ACCESS_SESSION) { + if (aStorage) { + aStorage->mIsSessionOnly = true; + } + } else if (perm != nsIPermissionManager::ALLOW_ACTION) { + uint32_t cookieBehavior = Preferences::GetUint(kCookiesBehavior); + uint32_t lifetimePolicy = Preferences::GetUint(kCookiesLifetimePolicy); + + // Treat "ask every time" as "reject always". + if ((cookieBehavior == BEHAVIOR_REJECT || lifetimePolicy == ASK_BEFORE_ACCEPT)) { + return false; + } + + if (lifetimePolicy == ACCEPT_SESSION && aStorage) { + aStorage->mIsSessionOnly = true; + } + } + + if (aStorage) { + return aStorage->CanAccess(subjectPrincipal); + } + + return true; +} + +// nsPIDOMStorage + +nsPIDOMStorage::StorageType +DOMStorage::GetType() const +{ + return mManager->Type(); +} + +nsIPrincipal* +DOMStorage::GetPrincipal() +{ + return mPrincipal; +} + +// Defined in DOMStorageManager.cpp +extern bool +PrincipalsEqual(nsIPrincipal* aObjectPrincipal, nsIPrincipal* aSubjectPrincipal); + +bool +DOMStorage::PrincipalEquals(nsIPrincipal* aPrincipal) +{ + return PrincipalsEqual(mPrincipal, aPrincipal); +} + +bool +DOMStorage::CanAccess(nsIPrincipal* aPrincipal) +{ + // Allow C++ callers to access the storage + if (!aPrincipal) { + return true; + } + + // For content, either the code base or domain must be the same. When code + // base is the same, this is enough to say it is safe for a page to access + // this storage. + + bool subsumes; + nsresult rv = aPrincipal->SubsumesIgnoringDomain(mPrincipal, &subsumes); + if (NS_FAILED(rv)) { + return false; + } + + if (!subsumes) { + nsresult rv = aPrincipal->Subsumes(mPrincipal, &subsumes); + if (NS_FAILED(rv)) { + return false; + } + } + + return subsumes; +} + +nsTArray* +DOMStorage::GetKeys() +{ + if (!CanUseStorage(this)) { + return new nsTArray(); // return just an empty array + } + + return mCache->GetKeys(this); +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorage.h b/dom/src/storage/DOMStorage.h new file mode 100644 index 000000000000..af3645309d49 --- /dev/null +++ b/dom/src/storage/DOMStorage.h @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsDOMStorage_h___ +#define nsDOMStorage_h___ + +#include "nsIDOMStorage.h" +#include "nsPIDOMStorage.h" +#include "nsWeakReference.h" +#include "nsAutoPtr.h" + +namespace mozilla { +namespace dom { + +class DOMStorageManager; +class DOMStorageCache; + +class DOMStorage MOZ_FINAL : public nsIDOMStorage + , public nsPIDOMStorage + , public nsSupportsWeakReference +{ + NS_DECL_ISUPPORTS + NS_DECL_NSIDOMSTORAGE + + // nsPIDOMStorage + virtual StorageType GetType() const; + virtual DOMStorageManager* GetManager() const { return mManager; } + virtual const DOMStorageCache* GetCache() const { return mCache; } + + virtual nsTArray* GetKeys(); + virtual nsIPrincipal* GetPrincipal(); + virtual bool PrincipalEquals(nsIPrincipal* aPrincipal); + virtual bool CanAccess(nsIPrincipal* aPrincipal); + virtual bool IsPrivate() { return mIsPrivate; } + + DOMStorage(DOMStorageManager* aManager, + DOMStorageCache* aCache, + const nsAString& aDocumentURI, + nsIPrincipal* aPrincipal, + bool aIsPrivate); + ~DOMStorage(); + + // The method checks whether the caller can use a storage. + // CanUseStorage is called before any DOM initiated operation + // on a storage is about to happen and ensures that the storage's + // session-only flag is properly set according the current settings. + // It is an optimization since the privileges check and session only + // state determination are complex and share the code (comes hand in + // hand together). + static bool CanUseStorage(DOMStorage* aStorage = nullptr); + + bool IsPrivate() const { return mIsPrivate; } + bool IsSessionOnly() const { return mIsSessionOnly; } + +private: + friend class DOMStorageManager; + friend class DOMStorageCache; + + nsRefPtr mManager; + nsRefPtr mCache; + nsString mDocumentURI; + + // Principal this DOMStorage (i.e. localStorage or sessionStorage) has + // been created for + nsCOMPtr mPrincipal; + + // Whether this storage is running in private-browsing window. + bool mIsPrivate : 1; + + // Whether storage is set to persist data only per session, may change + // dynamically and is set by CanUseStorage function that is called + // before any operation on the storage. + bool mIsSessionOnly : 1; + + void BroadcastChangeNotification(const nsSubstring& aKey, + const nsSubstring& aOldValue, + const nsSubstring& aNewValue); +}; + +} // ::dom +} // ::mozilla + +#endif /* nsDOMStorage_h___ */ diff --git a/dom/src/storage/DOMStorageCache.cpp b/dom/src/storage/DOMStorageCache.cpp new file mode 100644 index 000000000000..c2ac8409ca6b --- /dev/null +++ b/dom/src/storage/DOMStorageCache.cpp @@ -0,0 +1,801 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorageCache.h" + +#include "DOMStorage.h" +#include "DOMStorageDBThread.h" +#include "DOMStorageIPC.h" +#include "DOMStorageManager.h" + +#include "nsDOMString.h" +#include "nsXULAppAPI.h" +#include "mozilla/unused.h" +#include "nsProxyRelease.h" + +namespace mozilla { +namespace dom { + +#define DOM_STORAGE_CACHE_KEEP_ALIVE_TIME_MS 20000 + +// static +DOMStorageDBBridge* DOMStorageCache::sDatabase = nullptr; + +namespace { // anon + +const uint32_t kDefaultSet = 0; +const uint32_t kPrivateSet = 1; +const uint32_t kSessionSet = 2; + +inline uint32_t +GetDataSetIndex(bool aPrivate, bool aSessionOnly) +{ + if (aPrivate) { + return kPrivateSet; + } + + if (aSessionOnly) { + return kSessionSet; + } + + return kDefaultSet; +} + +inline uint32_t +GetDataSetIndex(const DOMStorage* aStorage) +{ + return GetDataSetIndex(aStorage->IsPrivate(), aStorage->IsSessionOnly()); +} + +} // anon + +// DOMStorageCacheBridge + +NS_IMPL_THREADSAFE_ADDREF(DOMStorageCacheBridge) + +// Since there is no consumer of return value of Release, we can turn this +// method to void to make implementation of asynchronous DOMStorageCache::Release +// much simpler. +NS_IMETHODIMP_(void) DOMStorageCacheBridge::Release(void) +{ + MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); + nsrefcnt count = NS_AtomicDecrementRefcnt(mRefCnt); + NS_LOG_RELEASE(this, count, "DOMStorageCacheBridge"); + if (0 == count) { + mRefCnt = 1; /* stabilize */ + /* enable this to find non-threadsafe destructors: */ + /* NS_ASSERT_OWNINGTHREAD(_class); */ + delete (this); + } +} + +// DOMStorageCache + +DOMStorageCache::DOMStorageCache(const nsACString* aScope) +: mManager(nullptr) +, mScope(*aScope) +, mMonitor("DOMStorageCache") +, mLoaded(false) +, mLoadResult(NS_OK) +, mInitialized(false) +, mSessionOnlyDataSetActive(false) +, mPreloadTelemetryRecorded(false) +{ + MOZ_COUNT_CTOR(DOMStorageCache); +} + +DOMStorageCache::~DOMStorageCache() +{ + if (mManager) { + mManager->DropCache(this); + } + + MOZ_COUNT_DTOR(DOMStorageCache); +} + +NS_IMETHODIMP_(void) +DOMStorageCache::Release(void) +{ + // We must actually release on the main thread since the cache removes it + // self from the manager's hash table. And we don't want to lock access to + // that hash table. + if (NS_IsMainThread()) { + DOMStorageCacheBridge::Release(); + return; + } + + nsRefPtr > event = + NS_NewNonOwningRunnableMethod(static_cast(this), + &DOMStorageCacheBridge::Release); + + nsresult rv = NS_DispatchToMainThread(event); + if (NS_FAILED(rv)) { + NS_WARNING("DOMStorageCache::Release() on a non-main thread"); + DOMStorageCacheBridge::Release(); + } +} + +void +DOMStorageCache::Init(DOMStorageManager* aManager, + bool aPersistent, + nsIPrincipal* aPrincipal, + const nsACString& aQuotaScope) +{ + if (mInitialized) { + return; + } + + mManager = aManager; + mInitialized = true; + mPrincipal = aPrincipal; + mPersistent = aPersistent; + mQuotaScope = aQuotaScope.IsEmpty() ? mScope : aQuotaScope; + + if (mPersistent) { + Preload(); + } +} + +inline bool +DOMStorageCache::Persist(const DOMStorage* aStorage) const +{ + return mPersistent && + !aStorage->IsSessionOnly() && + !aStorage->IsPrivate(); +} + +namespace { // anon + +PLDHashOperator +CloneSetData(const nsAString& aKey, const nsString aValue, void* aArg) +{ + DOMStorageCache::Data* target = static_cast(aArg); + target->mKeys.Put(aKey, aValue); + + return PL_DHASH_NEXT; +} + +} // anon + +DOMStorageCache::Data& +DOMStorageCache::DataSet(const DOMStorage* aStorage) +{ + uint32_t index = GetDataSetIndex(aStorage); + + if (index == kSessionSet && !mSessionOnlyDataSetActive) { + // Session only data set is demanded but not filled with + // current data set, copy to session only set now. + + WaitForPreload(Telemetry::LOCALDOMSTORAGE_SESSIONONLY_PRELOAD_BLOCKING_MS); + + Data& defaultSet = mData[kDefaultSet]; + Data& sessionSet = mData[kSessionSet]; + + defaultSet.mKeys.EnumerateRead(CloneSetData, &sessionSet); + + mSessionOnlyDataSetActive = true; + + // This updates sessionSet.mOriginQuotaUsage and also updates global usage + // for all session only data + ProcessUsageDelta(kSessionSet, defaultSet.mOriginQuotaUsage); + } + + return mData[index]; +} + +bool +DOMStorageCache::ProcessUsageDelta(const DOMStorage* aStorage, int64_t aDelta) +{ + return ProcessUsageDelta(GetDataSetIndex(aStorage), aDelta); +} + +bool +DOMStorageCache::ProcessUsageDelta(uint32_t aGetDataSetIndex, const int64_t aDelta) +{ + // Check limit per this origin + Data& data = mData[aGetDataSetIndex]; + uint64_t newOriginUsage = data.mOriginQuotaUsage + aDelta; + if (aDelta > 0 && newOriginUsage > DOMStorageManager::GetQuota()) { + return false; + } + + // Now check eTLD+1 limit + GetDatabase(); + if (sDatabase) { + DOMStorageUsage* usage = sDatabase->GetScopeUsage(mQuotaScope); + if (!usage->CheckAndSetETLD1UsageDelta(aGetDataSetIndex, aDelta)) { + return false; + } + } + + // Update size in our data set + data.mOriginQuotaUsage = newOriginUsage; + return true; +} + +void +DOMStorageCache::Preload() +{ + if (mLoaded || !mPersistent) { + return; + } + + if (!StartDatabase()) { + mLoaded = true; + mLoadResult = NS_ERROR_FAILURE; + return; + } + + sDatabase->AsyncPreload(this); + sDatabase->GetScopeUsage(mQuotaScope); +} + +namespace { // anon + +// This class is passed to timer as a tick observer. It refers the cache +// and keeps it alive for a time. +class DOMStorageCacheHolder : public nsITimerCallback +{ + NS_DECL_ISUPPORTS + + NS_IMETHODIMP + Notify(nsITimer* aTimer) + { + mCache = nullptr; + return NS_OK; + } + + virtual ~DOMStorageCacheHolder() {} + + nsRefPtr mCache; + +public: + DOMStorageCacheHolder(DOMStorageCache* aCache) : mCache(aCache) {} +}; + +NS_IMPL_ISUPPORTS1(DOMStorageCacheHolder, nsITimerCallback) + +} // anon + +void +DOMStorageCache::KeepAlive() +{ + // Missing reference back to the manager means the cache is not responsible + // for its lifetime. Used for keeping sessionStorage live forever. + if (!mManager) { + return; + } + + if (!NS_IsMainThread()) { + // Timer and the holder must be initialized on the main thread. + nsRefPtr > event = + NS_NewRunnableMethod(this, &DOMStorageCache::KeepAlive); + + NS_DispatchToMainThread(event); + return; + } + + nsCOMPtr timer = do_CreateInstance("@mozilla.org/timer;1"); + if (!timer) { + return; + } + + nsRefPtr holder = new DOMStorageCacheHolder(this); + timer->InitWithCallback(holder, DOM_STORAGE_CACHE_KEEP_ALIVE_TIME_MS, + nsITimer::TYPE_ONE_SHOT); + + mKeepAliveTimer.swap(timer); +} + +namespace { // anon + +// The AutoTimer provided by telemetry headers is only using static, +// i.e. compile time known ID, but here we know the ID only at run time. +// Hence a new class. +class TelemetryAutoTimer +{ +public: + TelemetryAutoTimer(Telemetry::ID aId) + : id(aId), start(TimeStamp::Now()) {} + ~TelemetryAutoTimer() + { Telemetry::AccumulateDelta_impl::compute(id, start); } +private: + Telemetry::ID id; + const TimeStamp start; +}; + +} // anon + +void +DOMStorageCache::WaitForPreload(Telemetry::ID aTelemetryID) +{ + if (!mPersistent) { + return; + } + + bool loaded = mLoaded; + + // Telemetry of rates of pending preloads + if (!mPreloadTelemetryRecorded) { + mPreloadTelemetryRecorded = true; + Telemetry::Accumulate( + Telemetry::LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS, + !loaded); + } + + if (loaded) { + return; + } + + // Measure which operation blocks and for how long + TelemetryAutoTimer timer(aTelemetryID); + + // If preload already started (i.e. we got some first data, but not all) + // SyncPreload will just wait for it to finish rather then synchronously + // read from the database. It seems to me more optimal. + + // TODO place for A/B testing (force main thread load vs. let preload finish) + sDatabase->SyncPreload(this); +} + +nsresult +DOMStorageCache::GetLength(const DOMStorage* aStorage, uint32_t* aRetval) +{ + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_GETLENGTH_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + return mLoadResult; + } + } + + *aRetval = DataSet(aStorage).mKeys.Count(); + return NS_OK; +} + +namespace { // anon + +class IndexFinderData +{ +public: + IndexFinderData(uint32_t aIndex, nsAString& aRetval) + : mIndex(aIndex), mKey(aRetval) + { + mKey.SetIsVoid(true); + } + + uint32_t mIndex; + nsAString& mKey; +}; + +PLDHashOperator +FindKeyOrder(const nsAString& aKey, const nsString aValue, void* aArg) +{ + IndexFinderData* data = static_cast(aArg); + + if (data->mIndex--) { + return PL_DHASH_NEXT; + } + + data->mKey = aKey; + return PL_DHASH_STOP; +} + +} // anon + +nsresult +DOMStorageCache::GetKey(const DOMStorage* aStorage, uint32_t aIndex, nsAString& aRetval) +{ + // XXX: This does a linear search for the key at index, which would + // suck if there's a large numer of indexes. Do we care? If so, + // maybe we need to have a lazily populated key array here or + // something? + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_GETKEY_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + return mLoadResult; + } + } + + IndexFinderData data(aIndex, aRetval); + DataSet(aStorage).mKeys.EnumerateRead(FindKeyOrder, &data); + return NS_OK; +} + +namespace { // anon + +static PLDHashOperator +KeysArrayBuilder(const nsAString& aKey, const nsString aValue, void* aArg) +{ + nsTArray* keys = static_cast* >(aArg); + + keys->AppendElement(aKey); + return PL_DHASH_NEXT; +} + +} // anon + +nsTArray* +DOMStorageCache::GetKeys(const DOMStorage* aStorage) +{ + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_GETALLKEYS_BLOCKING_MS); + } + + nsTArray* result = new nsTArray(); + if (NS_SUCCEEDED(mLoadResult)) { + DataSet(aStorage).mKeys.EnumerateRead(KeysArrayBuilder, result); + } + + return result; +} + +nsresult +DOMStorageCache::GetItem(const DOMStorage* aStorage, const nsAString& aKey, + nsAString& aRetval) +{ + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + return mLoadResult; + } + } + + // not using AutoString since we don't want to copy buffer to result + nsString value; + if (!DataSet(aStorage).mKeys.Get(aKey, &value)) { + SetDOMStringToNull(value); + } + + aRetval = value; + + return NS_OK; +} + +nsresult +DOMStorageCache::SetItem(const DOMStorage* aStorage, const nsAString& aKey, + const nsString& aValue, nsString& aOld) +{ + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_SETVALUE_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + return mLoadResult; + } + } + + Data& data = DataSet(aStorage); + if (!data.mKeys.Get(aKey, &aOld)) { + SetDOMStringToNull(aOld); + } + + // Check the quota first + const int64_t delta = static_cast(aValue.Length()) - + static_cast(aOld.Length()); + if (!ProcessUsageDelta(aStorage, delta)) { + return NS_ERROR_DOM_QUOTA_REACHED; + } + + if (aValue == aOld && DOMStringIsNull(aValue) == DOMStringIsNull(aOld)) { + return NS_SUCCESS_DOM_NO_OPERATION; + } + + data.mKeys.Put(aKey, aValue); + + if (Persist(aStorage)) { + if (DOMStringIsNull(aOld)) { + return sDatabase->AsyncAddItem(this, aKey, aValue); + } + + return sDatabase->AsyncUpdateItem(this, aKey, aValue); + } + + return NS_OK; +} + +nsresult +DOMStorageCache::RemoveItem(const DOMStorage* aStorage, const nsAString& aKey, + nsString& aOld) +{ + Telemetry::AutoTimer autoTimer; + + if (Persist(aStorage)) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_REMOVEKEY_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + return mLoadResult; + } + } + + Data& data = DataSet(aStorage); + if (!data.mKeys.Get(aKey, &aOld)) { + SetDOMStringToNull(aOld); + return NS_SUCCESS_DOM_NO_OPERATION; + } + + // Recalculate the cached data size + const int64_t delta = -(static_cast(aOld.Length())); + unused << ProcessUsageDelta(aStorage, delta); + data.mKeys.Remove(aKey); + + if (Persist(aStorage)) { + return sDatabase->AsyncRemoveItem(this, aKey); + } + + return NS_OK; +} + +nsresult +DOMStorageCache::Clear(const DOMStorage* aStorage) +{ + Telemetry::AutoTimer autoTimer; + + bool refresh = false; + if (Persist(aStorage)) { + // We need to preload all data (know the size) before we can proceeed + // to correctly decrease cached usage number. + // XXX as in case of unload, this is not technically needed now, but + // after super-scope quota introduction we have to do this. Get telemetry + // right now. + WaitForPreload(Telemetry::LOCALDOMSTORAGE_CLEAR_BLOCKING_MS); + if (NS_FAILED(mLoadResult)) { + // When we failed to load data from the database, force delete of the + // scope data and make use of the storage possible again. + refresh = true; + mLoadResult = NS_OK; + } + } + + Data& data = DataSet(aStorage); + bool hadData = !!data.mKeys.Count(); + + if (hadData) { + unused << ProcessUsageDelta(aStorage, -data.mOriginQuotaUsage); + data.mKeys.Clear(); + } + + if (Persist(aStorage) && (refresh || hadData)) { + return sDatabase->AsyncClear(this); + } + + return hadData ? NS_OK : NS_SUCCESS_DOM_NO_OPERATION; +} + +void +DOMStorageCache::CloneFrom(const DOMStorageCache* aThat) +{ + mLoaded = aThat->mLoaded; + mInitialized = aThat->mInitialized; + mPersistent = aThat->mPersistent; + mSessionOnlyDataSetActive = aThat->mSessionOnlyDataSetActive; + + for (uint32_t i = 0; i < kDataSetCount; ++i) { + aThat->mData[i].mKeys.EnumerateRead(CloneSetData, &mData[i]); + ProcessUsageDelta(i, aThat->mData[i].mOriginQuotaUsage); + } +} + +// Defined in DOMStorageManager.cpp +extern bool +PrincipalsEqual(nsIPrincipal* aObjectPrincipal, nsIPrincipal* aSubjectPrincipal); + +bool +DOMStorageCache::CheckPrincipal(nsIPrincipal* aPrincipal) const +{ + return PrincipalsEqual(mPrincipal, aPrincipal); +} + +void +DOMStorageCache::UnloadItems(uint32_t aUnloadFlags) +{ + if (aUnloadFlags & kUnloadDefault) { + // Must wait for preload to pass correct usage to ProcessUsageDelta + // XXX this is not technically needed right now since there is just + // per-origin isolated quota handling, but when we introduce super- + // -scope quotas, we have to do this. Better to start getting + // telemetry right now. + WaitForPreload(Telemetry::LOCALDOMSTORAGE_UNLOAD_BLOCKING_MS); + + mData[kDefaultSet].mKeys.Clear(); + ProcessUsageDelta(kDefaultSet, -mData[kDefaultSet].mOriginQuotaUsage); + } + + if (aUnloadFlags & kUnloadPrivate) { + mData[kPrivateSet].mKeys.Clear(); + ProcessUsageDelta(kPrivateSet, -mData[kPrivateSet].mOriginQuotaUsage); + } + + if (aUnloadFlags & kUnloadSession) { + mData[kSessionSet].mKeys.Clear(); + ProcessUsageDelta(kSessionSet, -mData[kSessionSet].mOriginQuotaUsage); + mSessionOnlyDataSetActive = false; + } + +#ifdef DOM_STORAGE_TESTS + if (aUnloadFlags & kTestReload) { + WaitForPreload(Telemetry::LOCALDOMSTORAGE_UNLOAD_BLOCKING_MS); + + mData[kDefaultSet].mKeys.Clear(); + mLoaded = false; // This is only used in testing code + Preload(); + } +#endif +} + +// DOMStorageCacheBridge + +uint32_t +DOMStorageCache::LoadedCount() +{ + MonitorAutoLock monitor(mMonitor); + Data& data = mData[kDefaultSet]; + return data.mKeys.Count(); +} + +bool +DOMStorageCache::LoadItem(const nsAString& aKey, const nsString& aValue) +{ + MonitorAutoLock monitor(mMonitor); + if (mLoaded) { + return false; + } + + Data& data = mData[kDefaultSet]; + if (data.mKeys.Get(aKey, nullptr)) { + return true; // don't stop, just don't override + } + + data.mKeys.Put(aKey, aValue); + data.mOriginQuotaUsage += aKey.Length() + aValue.Length(); + return true; +} + +void +DOMStorageCache::LoadDone(nsresult aRv) +{ + // Keep the preloaded cache alive for a time + KeepAlive(); + + MonitorAutoLock monitor(mMonitor); + mLoadResult = aRv; + mLoaded = true; + monitor.Notify(); +} + +void +DOMStorageCache::LoadWait() +{ + MonitorAutoLock monitor(mMonitor); + while (!mLoaded) { + monitor.Wait(); + } +} + +// DOMStorageUsage + +DOMStorageUsage::DOMStorageUsage(const nsACString& aScope) + : mScope(aScope) +{ + mUsage[kDefaultSet] = mUsage[kPrivateSet] = mUsage[kSessionSet] = 0LL; +} + +namespace { // anon + +class LoadUsageRunnable : public nsRunnable +{ +public: + LoadUsageRunnable(int64_t* aUsage, const int64_t aDelta) + : mTarget(aUsage) + , mDelta(aDelta) + {} + +private: + int64_t* mTarget; + int64_t mDelta; + + NS_IMETHOD Run() { *mTarget = mDelta; return NS_OK; } +}; + +} // anon + +void +DOMStorageUsage::LoadUsage(const int64_t aUsage) +{ + // Using kDefaultSet index since it is the index for the persitent data + // stored in the database we have just loaded usage for. + if (!NS_IsMainThread()) { + // In single process scenario we get this call from the DB thread + nsRefPtr r = + new LoadUsageRunnable(mUsage + kDefaultSet, aUsage); + NS_DispatchToMainThread(r); + } else { + // On a child process we get this on the main thread already + mUsage[kDefaultSet] += aUsage; + } +} + +bool +DOMStorageUsage::CheckAndSetETLD1UsageDelta(uint32_t aDataSetIndex, const int64_t aDelta) +{ + MOZ_ASSERT(NS_IsMainThread()); + + int64_t newUsage = mUsage[aDataSetIndex] + aDelta; + if (aDelta > 0 && newUsage > DOMStorageManager::GetQuota()) { + return false; + } + + mUsage[aDataSetIndex] = newUsage; + return true; +} + + +// static +DOMStorageDBBridge* +DOMStorageCache::StartDatabase() +{ + if (sDatabase) { + return sDatabase; + } + + if (XRE_GetProcessType() == GeckoProcessType_Default) { + nsAutoPtr db(new DOMStorageDBThread()); + + nsresult rv = db->Init(); + if (NS_FAILED(rv)) { + return nullptr; + } + + sDatabase = db.forget(); + } else { + nsRefPtr db = new DOMStorageDBChild( + DOMLocalStorageManager::Self()); + + nsresult rv = db->Init(); + if (NS_FAILED(rv)) { + return nullptr; + } + + db.forget(&sDatabase); + } + + return sDatabase; +} + +// static +DOMStorageDBBridge* +DOMStorageCache::GetDatabase() +{ + return sDatabase; +} + +// static +nsresult +DOMStorageCache::StopDatabase() +{ + if (!sDatabase) { + return NS_OK; + } + + nsresult rv = sDatabase->Shutdown(); + if (XRE_GetProcessType() == GeckoProcessType_Default) { + delete sDatabase; + } else { + DOMStorageDBChild* child = static_cast(sDatabase); + NS_RELEASE(child); + } + + sDatabase = nullptr; + return rv; +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorageCache.h b/dom/src/storage/DOMStorageCache.h new file mode 100644 index 000000000000..c5626e46c433 --- /dev/null +++ b/dom/src/storage/DOMStorageCache.h @@ -0,0 +1,253 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsDOMStorageCache_h___ +#define nsDOMStorageCache_h___ + +#include "nsIPrincipal.h" +#include "nsITimer.h" + +#include "nsString.h" +#include "nsDataHashtable.h" +#include "nsHashKeys.h" +#include "mozilla/Monitor.h" +#include "mozilla/Telemetry.h" +#include "nsAutoPtr.h" + +namespace mozilla { +namespace dom { + +class DOMStorage; +class DOMStorageManager; +class DOMStorageDBBridge; + +// Interface class on which only the database or IPC may call. +// Used to populate the cache with DB data. +class DOMStorageCacheBridge +{ +public: + NS_IMETHOD_(nsrefcnt) AddRef(void); + NS_IMETHOD_(void) Release(void); + + virtual ~DOMStorageCacheBridge() {} + + // The scope (origin) in the database usage format (reversed) + virtual const nsCString& Scope() const = 0; + + // Whether the cache is already fully loaded + virtual bool Loaded() = 0; + + // How many items has so far been loaded into the cache, used + // for optimization purposes + virtual uint32_t LoadedCount() = 0; + + // Called by the database to load a key and its value to the cache + virtual bool LoadItem(const nsAString& aKey, const nsString& aValue) = 0; + + // Called by the database after all keys and values has been loaded + // to this cache + virtual void LoadDone(nsresult aRv) = 0; + + // Use to synchronously wait until the cache gets fully loaded with data, + // this method exits after LoadDone has been called + virtual void LoadWait() = 0; + +protected: + nsAutoRefCnt mRefCnt; +}; + +// Implementation of scope cache that is responsible for preloading data +// for persistent storage (localStorage) and hold data for non-private, +// private and session-only cookie modes. It is also responsible for +// persisting data changes using the database, works as a write-back cache. +class DOMStorageCache : public DOMStorageCacheBridge +{ +public: + NS_IMETHOD_(void) Release(void); + + DOMStorageCache(const nsACString* aScope); + virtual ~DOMStorageCache(); + + void Init(DOMStorageManager* aManager, bool aPersistent, nsIPrincipal* aPrincipal, + const nsACString& aQuotaScope); + + // Copies all data from the other storage. + void CloneFrom(const DOMStorageCache* aThat); + + // Starts async preload of this cache if it persistent and not loaded. + void Preload(); + + // Keeps the cache alive (i.e. present in the manager's hash table) for a time. + void KeepAlive(); + + // The set of methods that are invoked by DOM storage web API. + // We are passing the DOMStorage object just to let the cache + // read properties like mPrivate and mSessionOnly. + // Get* methods return error when load from the database has failed. + nsresult GetLength(const DOMStorage* aStorage, uint32_t* aRetval); + nsresult GetKey(const DOMStorage* aStorage, uint32_t index, nsAString& aRetval); + nsresult GetItem(const DOMStorage* aStorage, const nsAString& aKey, nsAString& aRetval); + nsresult SetItem(const DOMStorage* aStorage, const nsAString& aKey, const nsString& aValue, nsString& aOld); + nsresult RemoveItem(const DOMStorage* aStorage, const nsAString& aKey, nsString& aOld); + nsresult Clear(const DOMStorage* aStorage); + + nsTArray* GetKeys(const DOMStorage* aStorage); + + // Whether the principal equals principal the cache was created for + bool CheckPrincipal(nsIPrincipal* aPrincipal) const; + nsIPrincipal* Principal() const { return mPrincipal; } + + // Starts the database engine thread or the IPC bridge + static DOMStorageDBBridge* StartDatabase(); + static DOMStorageDBBridge* GetDatabase(); + + // Stops the thread and flushes all uncommited data + static nsresult StopDatabase(); + + // DOMStorageCacheBridge + + virtual const nsCString& Scope() const { return mScope; } + virtual bool Loaded() { return mLoaded; } + virtual uint32_t LoadedCount(); + virtual bool LoadItem(const nsAString& aKey, const nsString& aValue); + virtual void LoadDone(nsresult aRv); + virtual void LoadWait(); + + // Cache keeps 3 sets of data: regular, private and session-only. + // This class keeps keys and values for a set and also caches + // size of the data for quick per-origin quota checking. + class Data + { + public: + Data() : mOriginQuotaUsage(0) { mKeys.Init(); } + int64_t mOriginQuotaUsage; + nsDataHashtable mKeys; + }; + +public: + // Number of data sets we keep: default, private, session + static const uint32_t kDataSetCount = 3; + +private: + // API to clear the cache data, this is invoked by chrome operations + // like cookie deletion. + friend class DOMStorageManager; + + static const uint32_t kUnloadDefault = 1 << 0; + static const uint32_t kUnloadPrivate = 1 << 1; + static const uint32_t kUnloadSession = 1 << 2; + static const uint32_t kUnloadComplete = + kUnloadDefault | kUnloadPrivate | kUnloadSession; + +#ifdef DOM_STORAGE_TESTS + static const uint32_t kTestReload = 1 << 15; +#endif + + void UnloadItems(uint32_t aUnloadFlags); + +private: + // Synchronously blocks until the cache is fully loaded from the database + void WaitForPreload(mozilla::Telemetry::ID aTelemetryID); + + // Helper to get one of the 3 data sets (regular, private, session) + Data& DataSet(const DOMStorage* aStorage); + + // Whether the storage change is about to persist + bool Persist(const DOMStorage* aStorage) const; + + // Changes the quota usage on the given data set if it fits the quota. + // If not, then false is returned and no change to the set must be done. + bool ProcessUsageDelta(uint32_t aGetDataSetIndex, const int64_t aDelta); + bool ProcessUsageDelta(const DOMStorage* aStorage, const int64_t aDelta); + +private: + // When a cache is reponsible for its life time (in case of localStorage data + // cache) we need to refer our manager since removal of the cache from the hash + // table is handled in the destructor by call to the manager. + // Cache could potentially overlive the manager, hence the hard ref. + nsRefPtr mManager; + + // Timer that holds this cache alive for a while after it has been preloaded. + nsCOMPtr mKeepAliveTimer; + + // Principal the cache has been initially created for, this is used only + // for sessionStorage access checks since sessionStorage objects are strictly + // scoped by a principal. localStorage objects on the other hand are scoped by + // origin only. + nsCOMPtr mPrincipal; + + // The scope this cache belongs to in the "DB format", i.e. reversed + nsCString mScope; + + // The eTLD+1 scope used to count quota usage. + nsCString mQuotaScope; + + // Non-private Browsing, Private Browsing and Session Only sets. + Data mData[kDataSetCount]; + + // This monitor is used to wait for full load of data. + mozilla::Monitor mMonitor; + + // Flag that is initially false. When the cache is about to work with + // the database (i.e. it is persistent) this flags is set to true after + // all keys and coresponding values are loaded from the database. + // This flag never goes from true back to false. + bool mLoaded; + + // Result of load from the database. Valid after mLoaded flag has been set. + nsresult mLoadResult; + + // Init() method has been called + bool mInitialized : 1; + + // This cache is about to be bound with the database (i.e. it has + // to load from the DB first and has to persist when modifying the + // default data set.) + bool mPersistent : 1; + + // - False when the session-only data set was never used. + // - True after access to session-only data has been made for the first time. + // We also fill session-only data set with the default one at that moment. + // Drops back to false when session-only data are cleared from chrome. + bool mSessionOnlyDataSetActive : 1; + + // Whether we have already captured state of the cache preload on our first access. + bool mPreloadTelemetryRecorded : 1; + + // DOMStorageDBThread on the parent or single process, + // DOMStorageDBChild on the child process. + static DOMStorageDBBridge* sDatabase; +}; + +// DOMStorageUsage +// Infrastructure to manage and check eTLD+1 quota +class DOMStorageUsageBridge +{ +public: + virtual ~DOMStorageUsageBridge() {} + + virtual const nsCString& Scope() = 0; + virtual void LoadUsage(const int64_t aUsage) = 0; +}; + +class DOMStorageUsage : public DOMStorageUsageBridge +{ +public: + DOMStorageUsage(const nsACString& aScope); + + bool CheckAndSetETLD1UsageDelta(uint32_t aDataSetIndex, int64_t aUsageDelta); + +private: + virtual const nsCString& Scope() { return mScope; } + virtual void LoadUsage(const int64_t aUsage); + + nsCString mScope; + int64_t mUsage[DOMStorageCache::kDataSetCount]; +}; + +} // ::dom +} // ::mozilla + +#endif diff --git a/dom/src/storage/DOMStorageDBThread.cpp b/dom/src/storage/DOMStorageDBThread.cpp new file mode 100644 index 000000000000..3a18cb0ebdd3 --- /dev/null +++ b/dom/src/storage/DOMStorageDBThread.cpp @@ -0,0 +1,1296 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorageDBThread.h" +#include "DOMStorageCache.h" + +#include "nsIEffectiveTLDService.h" +#include "nsDirectoryServiceUtils.h" +#include "nsAppDirectoryServiceDefs.h" +#include "nsThreadUtils.h" +#include "nsProxyRelease.h" +#include "mozStorageCID.h" +#include "mozStorageHelper.h" +#include "mozIStorageService.h" +#include "mozIStorageBindingParamsArray.h" +#include "mozIStorageBindingParams.h" +#include "mozIStorageValueArray.h" +#include "mozIStorageFunction.h" +#include "nsIObserverService.h" +#include "nsIVariant.h" +#include "mozilla/Services.h" + +// How long we collect write oprerations +// before they are flushed to the database +// In milliseconds. +#define FLUSHING_INTERVAL_MS 5000 + +namespace mozilla { +namespace dom { + +DOMStorageDBBridge::DOMStorageDBBridge() +{ + mUsages.Init(); +} + +DOMStorageUsage* +DOMStorageDBBridge::GetScopeUsage(const nsACString& aScope) +{ + DOMStorageUsage* usage; + if (mUsages.Get(aScope, &usage)) { + return usage; + } + + usage = new DOMStorageUsage(aScope); + AsyncGetUsage(usage); + mUsages.Put(aScope, usage); + + return usage; +} + + +DOMStorageDBThread::DOMStorageDBThread() +: mThread(nullptr) +, mMonitor("DOMStorageThreadMonitor") +, mStopIOThread(false) +, mDBReady(false) +, mStatus(NS_OK) +, mWorkerStatements(mWorkerConnection) +, mReaderStatements(mReaderConnection) +, mDirtyEpoch(0) +, mFlushImmediately(false) +, mPriorityCounter(0) +{ + mScopesHavingData.Init(); +} + +nsresult +DOMStorageDBThread::Init() +{ + nsresult rv; + + // Need to determine location on the main thread, since + // NS_GetSpecialDirectory access the atom table that can + // be accessed only on the main thread. + rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, + getter_AddRefs(mDatabaseFile)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mDatabaseFile->Append(NS_LITERAL_STRING("webappsstore.sqlite")); + NS_ENSURE_SUCCESS(rv, rv); + + // Ensure mozIStorageService init on the main thread first. + nsCOMPtr service = + do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + // Need to keep the lock to avoid setting mThread later then + // the thread body executes. + MonitorAutoLock monitor(mMonitor); + + mThread = PR_CreateThread(PR_USER_THREAD, &DOMStorageDBThread::ThreadFunc, this, + PR_PRIORITY_LOW, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, + 262144); + if (!mThread) { + return NS_ERROR_OUT_OF_MEMORY; + } + + return NS_OK; +} + +nsresult +DOMStorageDBThread::Shutdown() +{ + if (!mThread) { + return NS_ERROR_NOT_INITIALIZED; + } + + Telemetry::AutoTimer timer; + + { + MonitorAutoLock monitor(mMonitor); + + // After we stop, no other operations can be accepted + mFlushImmediately = true; + mStopIOThread = true; + monitor.Notify(); + } + + mReaderStatements.FinalizeStatements(); + if (mReaderConnection) { + mReaderConnection->Close(); + mReaderConnection = nullptr; + } + + PR_JoinThread(mThread); + mThread = nullptr; + + return mStatus; +} + +void +DOMStorageDBThread::SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync) +{ + if (!aForceSync && aCache->LoadedCount()) { + // Preload already started for this cache, just wait for it to finish. + // LoadWait will exit after LoadDone on the cache has been called. + SetHigherPriority(); + aCache->LoadWait(); + SetDefaultPriority(); + return; + } + + // Bypass sync load when an update is pending in the queue to write, we would + // get incosistent data in the cache. Also don't allow sync main-thread preload + // when DB open and init is still pending on the background thread. + if (mWALModeEnabled && mDBReady) { + bool pendingTasks; + { + MonitorAutoLock monitor(mMonitor); + pendingTasks = mPendingTasks.IsScopeUpdatePending(aCache->Scope()) || + mPendingTasks.IsScopeClearPending(aCache->Scope()); + } + + if (!pendingTasks) { + // WAL is enabled, thus do the load synchronously on the main thread. + DBOperation preload(DBOperation::opPreload, aCache); + preload.PerformAndFinalize(this); + return; + } + } + + // Need to go asynchronously since WAL is not allowed or scheduled updates + // need to be flushed first. + // Schedule preload for this cache as the first operation. + nsresult rv = InsertDBOp(new DBOperation(DBOperation::opPreloadUrgent, aCache)); + + // LoadWait exits after LoadDone of the cache has been called. + if (NS_SUCCEEDED(rv)) { + aCache->LoadWait(); + } +} + +void +DOMStorageDBThread::AsyncFlush() +{ + MonitorAutoLock monitor(mMonitor); + mFlushImmediately = true; + monitor.Notify(); +} + +bool +DOMStorageDBThread::ShouldPreloadScope(const nsACString& aScope) +{ + MonitorAutoLock monitor(mMonitor); + return mScopesHavingData.Contains(aScope); +} + +namespace { // anon + +PLDHashOperator +GetScopesHavingDataEnum(nsCStringHashKey* aKey, void* aArg) +{ + InfallibleTArray* scopes = + static_cast*>(aArg); + scopes->AppendElement(aKey->GetKey()); + return PL_DHASH_NEXT; +} + +} // anon + +void +DOMStorageDBThread::GetScopesHavingData(InfallibleTArray* aScopes) +{ + MonitorAutoLock monitor(mMonitor); + mScopesHavingData.EnumerateEntries(GetScopesHavingDataEnum, aScopes); +} + +nsresult +DOMStorageDBThread::InsertDBOp(DOMStorageDBThread::DBOperation* aOperation) +{ + MonitorAutoLock monitor(mMonitor); + + // Sentinel to don't forget to delete the operation when we exit early. + nsAutoPtr opScope(aOperation); + + if (mStopIOThread) { + // Thread use after shutdown demanded. + MOZ_ASSERT(false); + return NS_ERROR_NOT_INITIALIZED; + } + + if (NS_FAILED(mStatus)) { + MonitorAutoUnlock unlock(mMonitor); + aOperation->Finalize(mStatus); + return mStatus; + } + + switch (aOperation->Type()) { + case DBOperation::opPreload: + case DBOperation::opPreloadUrgent: + if (mPendingTasks.IsScopeUpdatePending(aOperation->Scope())) { + // If there is a pending update operation for the scope first do the flush + // before we preload the cache. This may happen in an extremely rare case + // when a child process throws away its cache before flush on the parent + // has finished. If we would preloaded the cache as a priority operation + // before the pending flush, we would have got an inconsistent cache content. + mFlushImmediately = true; + } else if (mPendingTasks.IsScopeClearPending(aOperation->Scope())) { + // The scope is scheduled to be cleared, so just quickly load as empty. + // We need to do this to prevent load of the DB data before the scope has + // actually been cleared from the database. Preloads are processed + // immediately before update and clear operations on the database that + // are flushed periodically in batches. + MonitorAutoUnlock unlock(mMonitor); + aOperation->Finalize(NS_OK); + return NS_OK; + } + // NO BREAK + + case DBOperation::opGetUsage: + if (aOperation->Type() == DBOperation::opPreloadUrgent) { + SetHigherPriority(); // Dropped back after urgent preload execution + mPreloads.InsertElementAt(0, aOperation); + } else { + mPreloads.AppendElement(aOperation); + } + + // DB operation adopted, don't delete it. + opScope.forget(); + + // Immediately start executing this. + monitor.Notify(); + break; + + default: + // Update operations are first collected, coalesced and then flushed + // after a short time. + mPendingTasks.Add(aOperation); + + // DB operation adopted, don't delete it. + opScope.forget(); + + ScheduleFlush(); + break; + } + + return NS_OK; +} + +void +DOMStorageDBThread::SetHigherPriority() +{ + ++mPriorityCounter; + PR_SetThreadPriority(mThread, PR_PRIORITY_URGENT); +} + +void +DOMStorageDBThread::SetDefaultPriority() +{ + if (--mPriorityCounter <= 0) { + PR_SetThreadPriority(mThread, PR_PRIORITY_LOW); + } +} + +void +DOMStorageDBThread::ThreadFunc(void* aArg) +{ + PR_SetCurrentThreadName("localStorage DB"); + + DOMStorageDBThread* thread = static_cast(aArg); + thread->ThreadFunc(); +} + +void +DOMStorageDBThread::ThreadFunc() +{ + nsresult rv = InitDatabase(); + + MonitorAutoLock lockMonitor(mMonitor); + + if (NS_FAILED(rv)) { + mStatus = rv; + mStopIOThread = true; + return; + } + + while (MOZ_LIKELY(!mStopIOThread || mPreloads.Length() || mPendingTasks.HasTasks())) { + if (MOZ_UNLIKELY(TimeUntilFlush() == 0)) { + // Flush time is up or flush has been forced, do it now. + UnscheduleFlush(); + if (mPendingTasks.Prepare()) { + { + MonitorAutoUnlock unlockMonitor(mMonitor); + rv = mPendingTasks.Execute(this); + } + + if (!mPendingTasks.Finalize(rv)) { + mStatus = rv; + NS_WARNING("localStorage DB access broken"); + } + } + NotifyFlushCompletion(); + } else if (MOZ_LIKELY(mPreloads.Length())) { + nsAutoPtr op(mPreloads[0]); + mPreloads.RemoveElementAt(0); + { + MonitorAutoUnlock unlockMonitor(mMonitor); + op->PerformAndFinalize(this); + } + + if (op->Type() == DBOperation::opPreloadUrgent) { + SetDefaultPriority(); // urgent preload unscheduled + } + } else if (MOZ_UNLIKELY(!mStopIOThread)) { + lockMonitor.Wait(TimeUntilFlush()); + } + } // thread loop + + mStatus = ShutdownDatabase(); +} + +extern void +ReverseString(const nsCSubstring& aSource, nsCSubstring& aResult); + +namespace { // anon + +class nsReverseStringSQLFunction MOZ_FINAL : public mozIStorageFunction +{ + NS_DECL_ISUPPORTS + NS_DECL_MOZISTORAGEFUNCTION +}; + +NS_IMPL_ISUPPORTS1(nsReverseStringSQLFunction, mozIStorageFunction) + +NS_IMETHODIMP +nsReverseStringSQLFunction::OnFunctionCall( + mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult) +{ + nsresult rv; + + nsAutoCString stringToReverse; + rv = aFunctionArguments->GetUTF8String(0, stringToReverse); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString result; + ReverseString(stringToReverse, result); + + nsCOMPtr outVar(do_CreateInstance( + NS_VARIANT_CONTRACTID, &rv)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = outVar->SetAsAUTF8String(result); + NS_ENSURE_SUCCESS(rv, rv); + + *aResult = outVar.get(); + outVar.forget(); + return NS_OK; +} + +} // anon + +nsresult +DOMStorageDBThread::OpenDatabaseConnection() +{ + nsresult rv; + + nsCOMPtr service + = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr connection; + rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(connection)); + if (rv == NS_ERROR_FILE_CORRUPTED) { + // delete the db and try opening again + rv = mDatabaseFile->Remove(false); + NS_ENSURE_SUCCESS(rv, rv); + rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(connection)); + } + NS_ENSURE_SUCCESS(rv, rv); + + if (NS_IsMainThread()) { + connection.swap(mReaderConnection); + } else { + connection.swap(mWorkerConnection); + } + + return NS_OK; +} + +nsresult +DOMStorageDBThread::InitDatabase() +{ + Telemetry::AutoTimer timer; + + nsresult rv; + + // Here we are on the worker thread. This opens the worker connection. + MOZ_ASSERT(!NS_IsMainThread()); + + rv = OpenDatabaseConnection(); + NS_ENSURE_SUCCESS(rv, rv); + + rv = TryJournalMode(); + NS_ENSURE_SUCCESS(rv, rv); + + mozStorageTransaction transaction(mWorkerConnection, false); + + // Ensure Gecko 1.9.1 storage table + rv = mWorkerConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE TABLE IF NOT EXISTS webappsstore2 (" + "scope TEXT, " + "key TEXT, " + "value TEXT, " + "secure INTEGER, " + "owner TEXT)")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mWorkerConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE UNIQUE INDEX IF NOT EXISTS scope_key_index" + " ON webappsstore2(scope, key)")); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr function1(new nsReverseStringSQLFunction()); + NS_ENSURE_TRUE(function1, NS_ERROR_OUT_OF_MEMORY); + + rv = mWorkerConnection->CreateFunction(NS_LITERAL_CSTRING("REVERSESTRING"), 1, function1); + NS_ENSURE_SUCCESS(rv, rv); + + bool exists; + + // Check if there is storage of Gecko 1.9.0 and if so, upgrade that storage + // to actual webappsstore2 table and drop the obsolete table. First process + // this newer table upgrade to priority potential duplicates from older + // storage table. + rv = mWorkerConnection->TableExists(NS_LITERAL_CSTRING("webappsstore"), + &exists); + NS_ENSURE_SUCCESS(rv, rv); + + if (exists) { + rv = mWorkerConnection->ExecuteSimpleSQL( + NS_LITERAL_CSTRING("INSERT OR IGNORE INTO " + "webappsstore2(scope, key, value, secure, owner) " + "SELECT REVERSESTRING(domain) || '.:', key, value, secure, owner " + "FROM webappsstore")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mWorkerConnection->ExecuteSimpleSQL( + NS_LITERAL_CSTRING("DROP TABLE webappsstore")); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Check if there is storage of Gecko 1.8 and if so, upgrade that storage + // to actual webappsstore2 table and drop the obsolete table. Potential + // duplicates will be ignored. + rv = mWorkerConnection->TableExists(NS_LITERAL_CSTRING("moz_webappsstore"), + &exists); + NS_ENSURE_SUCCESS(rv, rv); + + if (exists) { + rv = mWorkerConnection->ExecuteSimpleSQL( + NS_LITERAL_CSTRING("INSERT OR IGNORE INTO " + "webappsstore2(scope, key, value, secure, owner) " + "SELECT REVERSESTRING(domain) || '.:', key, value, secure, domain " + "FROM moz_webappsstore")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mWorkerConnection->ExecuteSimpleSQL( + NS_LITERAL_CSTRING("DROP TABLE moz_webappsstore")); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = transaction.Commit(); + NS_ENSURE_SUCCESS(rv, rv); + + // Database open and all initiation operation are done. Switching this flag + // to true allow main thread to read directly from the database. + // If we would allow this sooner, we would have opened a window where main thread + // read might operate on a totaly broken and incosistent database. + mDBReady = true; + + // List scopes having any stored data + nsCOMPtr stmt; + rv = mWorkerConnection->CreateStatement(NS_LITERAL_CSTRING("SELECT DISTINCT scope FROM webappsstore2"), + getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + mozStorageStatementScoper scope(stmt); + + while (NS_SUCCEEDED(rv = stmt->ExecuteStep(&exists)) && exists) { + nsAutoCString foundScope; + rv = stmt->GetUTF8String(0, foundScope); + NS_ENSURE_SUCCESS(rv, rv); + + MonitorAutoLock monitor(mMonitor); + mScopesHavingData.PutEntry(foundScope); + } + + return NS_OK; +} + +nsresult +DOMStorageDBThread::SetJournalMode(bool aIsWal) +{ + nsresult rv; + + nsAutoCString stmtString( + MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA journal_mode = "); + if (aIsWal) { + stmtString.AppendLiteral("wal"); + } else { + stmtString.AppendLiteral("truncate"); + } + + nsCOMPtr stmt; + rv = mWorkerConnection->CreateStatement(stmtString, getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + mozStorageStatementScoper scope(stmt); + + bool hasResult = false; + rv = stmt->ExecuteStep(&hasResult); + NS_ENSURE_SUCCESS(rv, rv); + if (!hasResult) { + return NS_ERROR_FAILURE; + } + + nsAutoCString journalMode; + rv = stmt->GetUTF8String(0, journalMode); + NS_ENSURE_SUCCESS(rv, rv); + if ((aIsWal && !journalMode.EqualsLiteral("wal")) || + (!aIsWal && !journalMode.EqualsLiteral("truncate"))) { + return NS_ERROR_FAILURE; + } + + return NS_OK; +} + +nsresult +DOMStorageDBThread::TryJournalMode() +{ + nsresult rv; + + rv = SetJournalMode(true); + if (NS_FAILED(rv)) { + mWALModeEnabled = false; + + rv = SetJournalMode(false); + NS_ENSURE_SUCCESS(rv, rv); + } else { + mWALModeEnabled = true; + } + + return NS_OK; +} + +nsresult +DOMStorageDBThread::ShutdownDatabase() +{ + nsresult rv = mStatus; + + // Finalize the cached statements. + mWorkerStatements.FinalizeStatements(); + if (mWorkerConnection) { + rv = mWorkerConnection->Close(); + mWorkerConnection = nullptr; + } + + return rv; +} + +void +DOMStorageDBThread::ScheduleFlush() +{ + if (mDirtyEpoch) { + return; // Already scheduled + } + + mDirtyEpoch = PR_IntervalNow() | 1; // Must be non-zero to indicate we are scheduled + + // Wake the monitor from indefinite sleep... + mMonitor.Notify(); +} + +void +DOMStorageDBThread::UnscheduleFlush() +{ + // We are just about to do the flush, drop flags + mFlushImmediately = false; + mDirtyEpoch = 0; +} + +PRIntervalTime +DOMStorageDBThread::TimeUntilFlush() +{ + if (mFlushImmediately) { + return 0; // Do it now regardless the timeout. + } + + MOZ_STATIC_ASSERT(PR_INTERVAL_NO_TIMEOUT != 0, + "PR_INTERVAL_NO_TIMEOUT must be non-zero"); + + if (!mDirtyEpoch) { + return PR_INTERVAL_NO_TIMEOUT; // No pending task... + } + + static const PRIntervalTime kMaxAge = PR_MillisecondsToInterval(FLUSHING_INTERVAL_MS); + + PRIntervalTime now = PR_IntervalNow() | 1; + PRIntervalTime age = now - mDirtyEpoch; + if (age > kMaxAge) { + return 0; // It is time. + } + + return kMaxAge - age; // Time left, this is used to sleep the monitor +} + +void +DOMStorageDBThread::NotifyFlushCompletion() +{ +#ifdef DOM_STORAGE_TESTS + if (!NS_IsMainThread()) { + nsRefPtr > event = + NS_NewNonOwningRunnableMethod(this, &DOMStorageDBThread::NotifyFlushCompletion); + NS_DispatchToMainThread(event); + return; + } + + nsCOMPtr obs = mozilla::services::GetObserverService(); + if (obs) { + obs->NotifyObservers(nullptr, "domstorage-test-flushed", nullptr); + } +#endif +} + +// DOMStorageDBThread::DBOperation + +DOMStorageDBThread::DBOperation::DBOperation(const OperationType aType, + DOMStorageCacheBridge* aCache, + const nsAString& aKey, + const nsAString& aValue) +: mType(aType) +, mCache(aCache) +, mKey(aKey) +, mValue(aValue) +{ + MOZ_COUNT_CTOR(DOMStorageDBThread::DBOperation); +} + +DOMStorageDBThread::DBOperation::DBOperation(const OperationType aType, + DOMStorageUsageBridge* aUsage) +: mType(aType) +, mUsage(aUsage) +{ + MOZ_COUNT_CTOR(DOMStorageDBThread::DBOperation); +} + +DOMStorageDBThread::DBOperation::DBOperation(const OperationType aType, + const nsACString& aScope) +: mType(aType) +, mCache(nullptr) +, mScope(aScope) +{ + MOZ_COUNT_CTOR(DOMStorageDBThread::DBOperation); +} + +DOMStorageDBThread::DBOperation::~DBOperation() +{ + MOZ_COUNT_DTOR(DOMStorageDBThread::DBOperation); +} + +const nsCString +DOMStorageDBThread::DBOperation::Scope() +{ + if (mCache) { + return mCache->Scope(); + } + + return mScope; +} + +const nsCString +DOMStorageDBThread::DBOperation::Target() +{ + switch (mType) { + case opAddItem: + case opUpdateItem: + case opRemoveItem: + return Scope() + NS_LITERAL_CSTRING("|") + NS_ConvertUTF16toUTF8(mKey); + + default: + return Scope(); + } +} + +void +DOMStorageDBThread::DBOperation::PerformAndFinalize(DOMStorageDBThread* aThread) +{ + Finalize(Perform(aThread)); +} + +nsresult +DOMStorageDBThread::DBOperation::Perform(DOMStorageDBThread* aThread) +{ + nsresult rv; + + switch (mType) { + case opPreload: + case opPreloadUrgent: + { + // Already loaded? + if (mCache->Loaded()) { + break; + } + + StatementCache* statements; + if (MOZ_UNLIKELY(NS_IsMainThread())) { + if (MOZ_UNLIKELY(!aThread->mReaderConnection)) { + // Do lazy main thread connection opening + rv = aThread->OpenDatabaseConnection(); + NS_ENSURE_SUCCESS(rv, rv); + } + + statements = &aThread->mReaderStatements; + } else { + statements = &aThread->mWorkerStatements; + } + + // OFFSET is an optimization when we have to do a sync load + // and cache has already loaded some parts asynchronously. + // It skips keys we have already loaded. + nsCOMPtr stmt = statements->GetCachedStatement( + "SELECT key, value FROM webappsstore2 " + "WHERE scope = :scope ORDER BY key " + "LIMIT -1 OFFSET :offset"); + NS_ENSURE_STATE(stmt); + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mCache->Scope()); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("offset"), + static_cast(mCache->LoadedCount())); + NS_ENSURE_SUCCESS(rv, rv); + + bool exists; + while (NS_SUCCEEDED(rv = stmt->ExecuteStep(&exists)) && exists) { + nsAutoString key; + rv = stmt->GetString(0, key); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoString value; + rv = stmt->GetString(1, value); + NS_ENSURE_SUCCESS(rv, rv); + + if (!mCache->LoadItem(key, value)) { + break; + } + } + + mCache->LoadDone(NS_OK); + break; + } + + case opGetUsage: + { + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "SELECT SUM(LENGTH(key) + LENGTH(value)) FROM webappsstore2" + " WHERE scope LIKE :scope" + ); + NS_ENSURE_STATE(stmt); + + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mUsage->Scope() + NS_LITERAL_CSTRING("%")); + NS_ENSURE_SUCCESS(rv, rv); + + bool exists; + rv = stmt->ExecuteStep(&exists); + NS_ENSURE_SUCCESS(rv, rv); + + int64_t usage; + if (exists) { + rv = stmt->GetInt64(0, &usage); + NS_ENSURE_SUCCESS(rv, rv); + } + + mUsage->LoadUsage(usage); + break; + } + + case opAddItem: + case opUpdateItem: + { + MOZ_ASSERT(!NS_IsMainThread()); + + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "INSERT OR REPLACE INTO webappsstore2 (scope, key, value) " + "VALUES (:scope, :key, :value) " + ); + NS_ENSURE_STATE(stmt); + + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mCache->Scope()); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("key"), + mKey); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("value"), + mValue); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + aThread->mScopesHavingData.PutEntry(Scope()); + break; + } + + case opRemoveItem: + { + MOZ_ASSERT(!NS_IsMainThread()); + + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "DELETE FROM webappsstore2 " + "WHERE scope = :scope " + "AND key = :key " + ); + NS_ENSURE_STATE(stmt); + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mCache->Scope()); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("key"), + mKey); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + break; + } + + case opClear: + { + MOZ_ASSERT(!NS_IsMainThread()); + + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "DELETE FROM webappsstore2 " + "WHERE scope = :scope" + ); + NS_ENSURE_STATE(stmt); + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mCache->Scope()); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + aThread->mScopesHavingData.RemoveEntry(Scope()); + break; + } + + case opClearAll: + { + MOZ_ASSERT(!NS_IsMainThread()); + + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "DELETE FROM webappsstore2" + ); + NS_ENSURE_STATE(stmt); + mozStorageStatementScoper scope(stmt); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + aThread->mScopesHavingData.Clear(); + break; + } + + case opClearMatchingScope: + { + MOZ_ASSERT(!NS_IsMainThread()); + + nsCOMPtr stmt = aThread->mWorkerStatements.GetCachedStatement( + "DELETE FROM webappsstore2" + " WHERE scope GLOB :scope" + ); + NS_ENSURE_STATE(stmt); + mozStorageStatementScoper scope(stmt); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), + mScope + NS_LITERAL_CSTRING("*")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + break; + } + + default: + NS_ERROR("Unknown task type"); + break; + } + + return NS_OK; +} + +void +DOMStorageDBThread::DBOperation::Finalize(nsresult aRv) +{ + switch (mType) { + case opPreloadUrgent: + case opPreload: + if (NS_FAILED(aRv)) { + // When we are here, something failed when loading from the database. + // Notify that the storage is loaded to prevent deadlock of the main thread, + // even though it is actually empty or incomplete. + NS_WARNING("Failed to preload localStorage"); + } + + mCache->LoadDone(aRv); + break; + + case opGetUsage: + if (NS_FAILED(aRv)) { + mUsage->LoadUsage(0); + } + + break; + + default: + if (NS_FAILED(aRv)) { + NS_WARNING("localStorage update/clear operation failed," + " data may not persist or clean up"); + } + + break; + } +} + +// DOMStorageDBThread::PendingOperations + +DOMStorageDBThread::PendingOperations::PendingOperations() +: mFlushFailureCount(0) +{ + mClears.Init(); + mUpdates.Init(); +} + +bool +DOMStorageDBThread::PendingOperations::HasTasks() +{ + return !!mUpdates.Count() || !!mClears.Count(); +} + +namespace { // anon + +PLDHashOperator +ForgetUpdatesForScope(const nsACString& aMapping, + nsAutoPtr& aPendingTask, + void* aArg) +{ + DOMStorageDBThread::DBOperation* newOp = static_cast(aArg); + + if (newOp->Type() == DOMStorageDBThread::DBOperation::opClear && + aPendingTask->Scope() != newOp->Scope()) { + return PL_DHASH_NEXT; + } + + if (newOp->Type() == DOMStorageDBThread::DBOperation::opClearMatchingScope && + !StringBeginsWith(aPendingTask->Scope(), newOp->Scope())) { + return PL_DHASH_NEXT; + } + + return PL_DHASH_REMOVE; +} + +} // anon + +bool +DOMStorageDBThread::PendingOperations::CheckForCoalesceOpportunity(DBOperation* aNewOp, + DBOperation::OperationType aPendingType, + DBOperation::OperationType aNewType) +{ + if (aNewOp->Type() != aNewType) { + return false; + } + + DOMStorageDBThread::DBOperation* pendingTask; + if (!mUpdates.Get(aNewOp->Target(), &pendingTask)) { + return false; + } + + if (pendingTask->Type() != aPendingType) { + return false; + } + + return true; +} + +void +DOMStorageDBThread::PendingOperations::Add(DOMStorageDBThread::DBOperation* aOperation) +{ + // Optimize: when a key to remove has never been written to disk + // just bypass this operation. A kew is new when an operation scheduled + // to write it to the database is of type opAddItem. + if (CheckForCoalesceOpportunity(aOperation, DBOperation::opAddItem, DBOperation::opRemoveItem)) { + mUpdates.Remove(aOperation->Target()); + delete aOperation; + return; + } + + // Optimize: when changing a key that is new and has never been + // written to disk, keep type of the operation to store it at opAddItem. + // This allows optimization to just forget adding a new key when + // it is removed from the storage before flush. + if (CheckForCoalesceOpportunity(aOperation, DBOperation::opAddItem, DBOperation::opUpdateItem)) { + aOperation->mType = DBOperation::opAddItem; + } + + // Optimize: to prevent lose of remove operation on a key when doing + // remove/set/remove on a previously existing key we have to change + // opAddItem to opUpdateItem on the new operation when there is opRemoveItem + // pending for the key. + if (CheckForCoalesceOpportunity(aOperation, DBOperation::opRemoveItem, DBOperation::opAddItem)) { + aOperation->mType = DBOperation::opUpdateItem; + } + + switch (aOperation->Type()) + { + // Operations on single keys + + case DBOperation::opAddItem: + case DBOperation::opUpdateItem: + case DBOperation::opRemoveItem: + // Override any existing operation for the target (=scope+key). + mUpdates.Put(aOperation->Target(), aOperation); + break; + + // Clear operations + + case DBOperation::opClear: + case DBOperation::opClearMatchingScope: + // Drop all update (insert/remove) operations for equivavelent or matching scope. + // We do this as an optimization as well as a must based on the logic, + // if we would not delete the update tasks, changes would have been stored + // to the database after clear operations have been executed. + mUpdates.Enumerate(ForgetUpdatesForScope, aOperation); + mClears.Put(aOperation->Target(), aOperation); + break; + + case DBOperation::opClearAll: + // Drop simply everything, this is a super-operation. + mUpdates.Clear(); + mClears.Clear(); + mClears.Put(aOperation->Target(), aOperation); + break; + + default: + MOZ_ASSERT(false); + break; + } +} + +namespace { // anon + +PLDHashOperator +CollectTasks(const nsACString& aMapping, nsAutoPtr& aOperation, void* aArg) +{ + nsTArray >* tasks = + static_cast >*>(aArg); + + tasks->AppendElement(aOperation.forget()); + return PL_DHASH_NEXT; +} + +} // anon + +bool +DOMStorageDBThread::PendingOperations::Prepare() +{ + // Called under the lock + + // First collect clear operations and then updates, we can + // do this since whenever a clear operation for a scope is + // scheduled, we drop all updates matching that scope. So, + // all scope-related update operations we have here now were + // scheduled after the clear operations. + mClears.Enumerate(CollectTasks, &mExecList); + mClears.Clear(); + + mUpdates.Enumerate(CollectTasks, &mExecList); + mUpdates.Clear(); + + return !!mExecList.Length(); +} + +nsresult +DOMStorageDBThread::PendingOperations::Execute(DOMStorageDBThread* aThread) +{ + // Called outside the lock + + mozStorageTransaction transaction(aThread->mWorkerConnection, false); + + nsresult rv; + + for (uint32_t i = 0; i < mExecList.Length(); ++i) { + DOMStorageDBThread::DBOperation* task = mExecList[i]; + rv = task->Perform(aThread); + if (NS_FAILED(rv)) { + return rv; + } + } + + rv = transaction.Commit(); + if (NS_FAILED(rv)) { + return rv; + } + + return NS_OK; +} + +bool +DOMStorageDBThread::PendingOperations::Finalize(nsresult aRv) +{ + // Called under the lock + + // The list is kept on a failure to retry it + if (NS_FAILED(aRv)) { + // XXX Followup: we may try to reopen the database and flush these + // pending tasks, however testing showed that even though I/O is actually + // broken some amount of operations is left in sqlite+system buffers and + // seems like successfully flushed to disk. + // Tested by removing a flash card and disconnecting from network while + // using a network drive on Windows system. + NS_WARNING("Flush operation on localStorage database failed"); + + ++mFlushFailureCount; + + return mFlushFailureCount >= 5; + } + + mFlushFailureCount = 0; + mExecList.Clear(); + return true; +} + +namespace { // anon + +class FindPendingOperationForScopeData +{ +public: + FindPendingOperationForScopeData(const nsACString& aScope) : mScope(aScope), mFound(false) {} + nsCString mScope; + bool mFound; +}; + +PLDHashOperator +FindPendingClearForScope(const nsACString& aMapping, + DOMStorageDBThread::DBOperation* aPendingOperation, + void* aArg) +{ + FindPendingOperationForScopeData* data = + static_cast(aArg); + + if (aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opClearAll) { + data->mFound = true; + return PL_DHASH_STOP; + } + + if (aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opClear && + data->mScope == aPendingOperation->Scope()) { + data->mFound = true; + return PL_DHASH_STOP; + } + + if (aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opClearMatchingScope && + StringBeginsWith(data->mScope, aPendingOperation->Scope())) { + data->mFound = true; + return PL_DHASH_STOP; + } + + return PL_DHASH_NEXT; +} + +} // anon + +bool +DOMStorageDBThread::PendingOperations::IsScopeClearPending(const nsACString& aScope) +{ + // Called under the lock + + FindPendingOperationForScopeData data(aScope); + mClears.EnumerateRead(FindPendingClearForScope, &data); + if (data.mFound) { + return true; + } + + for (uint32_t i = 0; i < mExecList.Length(); ++i) { + DOMStorageDBThread::DBOperation* task = mExecList[i]; + FindPendingClearForScope(EmptyCString(), task, &data); + + if (data.mFound) { + return true; + } + } + + return false; +} + +namespace { // anon + +PLDHashOperator +FindPendingUpdateForScope(const nsACString& aMapping, + DOMStorageDBThread::DBOperation* aPendingOperation, + void* aArg) +{ + FindPendingOperationForScopeData* data = + static_cast(aArg); + + if ((aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opAddItem || + aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opUpdateItem || + aPendingOperation->Type() == DOMStorageDBThread::DBOperation::opRemoveItem) && + data->mScope == aPendingOperation->Scope()) { + data->mFound = true; + return PL_DHASH_STOP; + } + + return PL_DHASH_NEXT; +} + +} // anon + +bool +DOMStorageDBThread::PendingOperations::IsScopeUpdatePending(const nsACString& aScope) +{ + // Called under the lock + + FindPendingOperationForScopeData data(aScope); + mUpdates.EnumerateRead(FindPendingUpdateForScope, &data); + if (data.mFound) { + return true; + } + + for (uint32_t i = 0; i < mExecList.Length(); ++i) { + DOMStorageDBThread::DBOperation* task = mExecList[i]; + FindPendingUpdateForScope(EmptyCString(), task, &data); + + if (data.mFound) { + return true; + } + } + + return false; +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorageDBThread.h b/dom/src/storage/DOMStorageDBThread.h new file mode 100644 index 000000000000..d6c6bda4a9d3 --- /dev/null +++ b/dom/src/storage/DOMStorageDBThread.h @@ -0,0 +1,350 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef DOMStorageDBThread_h___ +#define DOMStorageDBThread_h___ + +#include "prthread.h" +#include "prinrval.h" +#include "nsTArray.h" +#include "mozilla/Monitor.h" +#include "mozilla/storage/StatementCache.h" +#include "nsString.h" +#include "nsCOMPtr.h" +#include "nsClassHashtable.h" +#include "nsIFile.h" + +class mozIStorageConnection; + +namespace mozilla { +namespace dom { + +class DOMStorageCacheBridge; +class DOMStorageUsageBridge; +class DOMStorageUsage; + +typedef mozilla::storage::StatementCache StatementCache; + +// Interface used by the cache to post operations to the asynchronous +// database thread or process. +class DOMStorageDBBridge +{ +public: + DOMStorageDBBridge(); + virtual ~DOMStorageDBBridge() {} + + // Ensures the database engine is started + virtual nsresult Init() = 0; + + // Releases the database and disallows its usage + virtual nsresult Shutdown() = 0; + + // Asynchronously fills the cache with data from the database for first use. + // When |aPriority| is true, the preload operation is scheduled as the first one. + // This method is responsible to keep hard reference to the cache for the time of + // the preload or, when preload cannot be performed, call LoadDone() immediately. + virtual void AsyncPreload(DOMStorageCacheBridge* aCache, bool aPriority = false) = 0; + + // Asynchronously fill the |usage| object with actual usage of data by its scope. + // The scope is eTLD+1 tops, never deeper subdomains. + virtual void AsyncGetUsage(DOMStorageUsageBridge* aUsage) = 0; + + // Synchronously fills the cache, when |aForceSync| is false and cache already got some + // data before, the method waits for the running preload to finish + virtual void SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync = false) = 0; + + // Called when an existing key is modified in the storage, schedules update to the database + virtual nsresult AsyncAddItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue) = 0; + + // Called when an existing key is modified in the storage, schedules update to the database + virtual nsresult AsyncUpdateItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue) = 0; + + // Called when an item is removed from the storage, schedules delete of the key + virtual nsresult AsyncRemoveItem(DOMStorageCacheBridge* aCache, const nsAString& aKey) = 0; + + // Called when the whole storage is cleared by the DOM API, schedules delete of the scope + virtual nsresult AsyncClear(DOMStorageCacheBridge* aCache) = 0; + + // Called when chrome deletes e.g. cookies, schedules delete of the whole database + virtual void AsyncClearAll() = 0; + + // Called when only a domain and its subdomains or an app data is about to clear + virtual void AsyncClearMatchingScope(const nsACString& aScope) = 0; + + // Forces scheduled DB operations to be early flushed to the disk + virtual void AsyncFlush() = 0; + + // Check whether the scope has any data stored on disk and is thus allowed to preload + virtual bool ShouldPreloadScope(const nsACString& aScope) = 0; + + // Get the complete list of scopes having data + virtual void GetScopesHavingData(InfallibleTArray* aScopes) = 0; + + // Returns object keeping usage cache for the scope. + DOMStorageUsage* GetScopeUsage(const nsACString& aScope); + +protected: + // Keeps usage cache objects for eTLD+1 scopes we have touched. + nsClassHashtable mUsages; +}; + +// The implementation of the the database engine, this directly works +// with the sqlite or any other db API we are based on +// This class is resposible for collecting and processing asynchronous +// DB operations over caches (DOMStorageCache) communicating though +// DOMStorageCacheBridge interface class +class DOMStorageDBThread MOZ_FINAL : public DOMStorageDBBridge +{ +public: + class PendingOperations; + + // Representation of a singe database task, like adding and removing keys, + // (pre)loading the whole origin data, cleaning. + class DBOperation + { + public: + typedef enum { + // Only operation that reads data from the database + opPreload, + // The same as opPreload, just executed with highest priority + opPreloadUrgent, + + // Load usage of a scope + opGetUsage, + + // Operations invoked by the DOM content API + opAddItem, + opUpdateItem, + opRemoveItem, + opClear, + + // Operations invoked by chrome + opClearAll, + opClearMatchingScope, + } OperationType; + + DBOperation(const OperationType aType, + DOMStorageCacheBridge* aCache = nullptr, + const nsAString& aKey = EmptyString(), + const nsAString& aValue = EmptyString()); + DBOperation(const OperationType aType, + DOMStorageUsageBridge* aUsage); + DBOperation(const OperationType aType, + const nsACString& aScope); + ~DBOperation(); + + // Executes the operation, doesn't necessarity have to be called on the I/O thread + void PerformAndFinalize(DOMStorageDBThread* aThread); + + // Finalize the operation, i.e. do any internal cleanup and finish calls + void Finalize(nsresult aRv); + + // The operation type + OperationType Type() { return mType; } + + // The operation scope (=origin) + const nsCString Scope(); + + // |Scope + key| the operation is working with + const nsCString Target(); + + private: + // The operation implementation body + nsresult Perform(DOMStorageDBThread* aThread); + + friend class PendingOperations; + OperationType mType; + nsRefPtr mCache; + DOMStorageUsageBridge* mUsage; + nsString mKey; + nsString mValue; + nsCString mScope; + }; + + // Encapsulation of collective and coalescing logic for all pending operations + // except preloads that are handled separately as priority operations + class PendingOperations { + public: + PendingOperations(); + + // Method responsible for coalescing redundant update operations with the same + // |Target()| or clear operations with the same or matching |Scope()| + void Add(DBOperation* aOperation); + + // True when there are some scheduled operations to flush on disk + bool HasTasks(); + + // Moves collected operations to a local flat list to allow execution of the operation + // list out of the thread lock + bool Prepare(); + + // Executes the previously |Prepared()'ed| list of operations, retuns result, but doesn't + // handle it in any way in case of a failure + nsresult Execute(DOMStorageDBThread* aThread); + + // Finalizes the pending operation list, returns false when too many operations failed + // to flush what indicates a long standing issue with the database access. + bool Finalize(nsresult aRv); + + // true when a clear that deletes the given |scope| is among the pending operations; + // when a preload for that scope is being scheduled, it must be finished right away + bool IsScopeClearPending(const nsACString& aScope); + + // Checks whether there is a pending update (or clear, actually) operation for this scope. + bool IsScopeUpdatePending(const nsACString& aScope); + + private: + // Returns true iff new operation is of type newType and there is a pending + // operation of type pendingType for the same key (target). + bool CheckForCoalesceOpportunity(DBOperation* aNewOp, + DBOperation::OperationType aPendingType, + DBOperation::OperationType aNewType); + + // List of all clearing operations, executed first + nsClassHashtable mClears; + + // List of all update/insert operations, executed as second + nsClassHashtable mUpdates; + + // Collection of all tasks, valid only between Prepare() and Execute() + nsTArray > mExecList; + + // Number of failing flush attempts + uint32_t mFlushFailureCount; + }; + +public: + DOMStorageDBThread(); + virtual ~DOMStorageDBThread() {} + + virtual nsresult Init(); + virtual nsresult Shutdown(); + + virtual void AsyncPreload(DOMStorageCacheBridge* aCache, bool aPriority = false) + { InsertDBOp(new DBOperation(aPriority ? DBOperation::opPreloadUrgent : DBOperation::opPreload, aCache)); } + + virtual void SyncPreload(DOMStorageCacheBridge* aCache, bool aForce = false); + + virtual void AsyncGetUsage(DOMStorageUsageBridge * aUsage) + { InsertDBOp(new DBOperation(DBOperation::opGetUsage, aUsage)); } + + virtual nsresult AsyncAddItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue) + { return InsertDBOp(new DBOperation(DBOperation::opAddItem, aCache, aKey, aValue)); } + + virtual nsresult AsyncUpdateItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue) + { return InsertDBOp(new DBOperation(DBOperation::opUpdateItem, aCache, aKey, aValue)); } + + virtual nsresult AsyncRemoveItem(DOMStorageCacheBridge* aCache, const nsAString& aKey) + { return InsertDBOp(new DBOperation(DBOperation::opRemoveItem, aCache, aKey)); } + + virtual nsresult AsyncClear(DOMStorageCacheBridge* aCache) + { return InsertDBOp(new DBOperation(DBOperation::opClear, aCache)); } + + virtual void AsyncClearAll() + { InsertDBOp(new DBOperation(DBOperation::opClearAll)); } + + virtual void AsyncClearMatchingScope(const nsACString& aScope) + { InsertDBOp(new DBOperation(DBOperation::opClearMatchingScope, aScope)); } + + virtual void AsyncFlush(); + + virtual bool ShouldPreloadScope(const nsACString& aScope); + virtual void GetScopesHavingData(InfallibleTArray* aScopes); + +private: + nsCOMPtr mDatabaseFile; + PRThread* mThread; + + // The monitor we drive the thread with + Monitor mMonitor; + + // Flag to stop, protected by the monitor + bool mStopIOThread; + + // Whether WAL is enabled + bool mWALModeEnabled; + + // Whether DB has already been open, avoid races between main thread reads + // and pending DB init in the background I/O thread + bool mDBReady; + + // State of the database initiation + nsresult mStatus; + + // List of scopes having data, for optimization purposes only + nsTHashtable mScopesHavingData; + + StatementCache mWorkerStatements; + StatementCache mReaderStatements; + + // Connection used by the worker thread for all read and write ops + nsCOMPtr mWorkerConnection; + + // Connection used only on the main thread for sync read operations + nsCOMPtr mReaderConnection; + + // Time the first pending operation has been added to the pending operations + // list + PRIntervalTime mDirtyEpoch; + + // Flag to force immediate flush of all pending operations + bool mFlushImmediately; + + // List of preloading operations, in chronological or priority order. + // Executed prioritly over pending update operations. + nsTArray mPreloads; + + // Collector of pending update operations + PendingOperations mPendingTasks; + + // Counter of calls for thread priority rising. + int32_t mPriorityCounter; + + // Helper to direct an operation to one of the arrays above; + // also checks IsScopeClearPending for preloads + nsresult InsertDBOp(DBOperation* aOperation); + + // Opens the database, first thing we do after start of the thread. + nsresult OpenDatabaseConnection(); + nsresult InitDatabase(); + nsresult ShutdownDatabase(); + + // Tries to establish WAL mode + nsresult SetJournalMode(bool aIsWal); + nsresult TryJournalMode(); + + void SetHigherPriority(); + void SetDefaultPriority(); + + // Ensures we flush pending tasks in some reasonble time + void ScheduleFlush(); + + // Called when flush of pending tasks is being executed + void UnscheduleFlush(); + + // This method is used for two purposes: + // 1. as a value passed to monitor.Wait() method + // 2. as in indicator that flush has to be performed + // + // Return: + // - PR_INTERVAL_NO_TIMEOUT when no pending tasks are scheduled + // - larger then zero when tasks have been scheduled, but it is + // still not time to perform the flush ; it is actual interval + // time to wait until the flush has to happen + // - 0 when it is time to do the flush + PRIntervalTime TimeUntilFlush(); + + // Notifies to the main thread that flush has completed + void NotifyFlushCompletion(); + + // Thread loop + static void ThreadFunc(void* aArg); + void ThreadFunc(); +}; + +} // ::dom +} // ::mozilla + +#endif /* DOMStorageDBThread_h___ */ diff --git a/dom/src/storage/DOMStorageIPC.cpp b/dom/src/storage/DOMStorageIPC.cpp new file mode 100644 index 000000000000..77b32e78be1b --- /dev/null +++ b/dom/src/storage/DOMStorageIPC.cpp @@ -0,0 +1,712 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorageIPC.h" + +#include "DOMStorageManager.h" + +#include "mozilla/dom/ContentChild.h" +#include "mozilla/unused.h" + +namespace mozilla { +namespace dom { + +// ---------------------------------------------------------------------------- +// Child +// ---------------------------------------------------------------------------- + +NS_IMPL_THREADSAFE_ADDREF(DOMStorageDBChild) + +NS_IMETHODIMP_(nsrefcnt) DOMStorageDBChild::Release(void) +{ + NS_PRECONDITION(0 != mRefCnt, "dup release"); + nsrefcnt count = --mRefCnt; + NS_LOG_RELEASE(this, count, "DOMStorageDBChild"); + if (count == 1 && mIPCOpen) { + Send__delete__(this); + return 0; + } + if (count == 0) { + mRefCnt = 1; + delete this; + return 0; + } + return count; +} + +void +DOMStorageDBChild::AddIPDLReference() +{ + NS_ABORT_IF_FALSE(!mIPCOpen, "Attempting to retain multiple IPDL references"); + mIPCOpen = true; + AddRef(); +} + +void +DOMStorageDBChild::ReleaseIPDLReference() +{ + NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference"); + mIPCOpen = false; + Release(); +} + +DOMStorageDBChild::DOMStorageDBChild(DOMLocalStorageManager* aManager) + : mManager(aManager) + , mStatus(NS_OK) + , mIPCOpen(false) +{ + mLoadingCaches.Init(); +} + +DOMStorageDBChild::~DOMStorageDBChild() +{ +} + +nsTHashtable& +DOMStorageDBChild::ScopesHavingData() +{ + if (!mScopesHavingData.IsInitialized()) { + mScopesHavingData.Init(); + } + + return mScopesHavingData; +} + +nsresult +DOMStorageDBChild::Init() +{ + ContentChild* child = ContentChild::GetSingleton(); + AddIPDLReference(); + child->SendPStorageConstructor(this); + return NS_OK; +} + +nsresult +DOMStorageDBChild::Shutdown() +{ + // There is nothing to do here, IPC will release automatically and + // the actual thread running on the parent process will also stop + // automatically in profile-before-change topic observer. + return NS_OK; +} + +void +DOMStorageDBChild::AsyncPreload(DOMStorageCacheBridge* aCache, bool aPriority) +{ + if (mIPCOpen) { + // Adding ref to cache for the time of preload. This ensures a reference to + // to the cache and that all keys will load into this cache object. + mLoadingCaches.PutEntry(aCache); + SendAsyncPreload(aCache->Scope(), aPriority); + } else { + // No IPC, no love. But the LoadDone call is expected. + aCache->LoadDone(NS_ERROR_UNEXPECTED); + } +} + +void +DOMStorageDBChild::AsyncGetUsage(DOMStorageUsageBridge* aUsage) +{ + if (mIPCOpen) { + SendAsyncGetUsage(aUsage->Scope()); + } +} + +void +DOMStorageDBChild::SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync) +{ + if (NS_FAILED(mStatus)) { + aCache->LoadDone(mStatus); + return; + } + + if (!mIPCOpen) { + aCache->LoadDone(NS_ERROR_UNEXPECTED); + return; + } + + // There is no way to put the child process to a wait state to receive all + // incoming async responses from the parent, hence we have to do a sync preload + // instead. We are smart though, we only demand keys that are left to load in + // case the async preload has already loaded some keys. + InfallibleTArray keys, values; + nsresult rv; + SendPreload(aCache->Scope(), aCache->LoadedCount(), &keys, &values, &rv); + + for (uint32_t i = 0; i < keys.Length(); ++i) { + aCache->LoadItem(keys[i], values[i]); + } + + aCache->LoadDone(rv); +} + +nsresult +DOMStorageDBChild::AsyncAddItem(DOMStorageCacheBridge* aCache, + const nsAString& aKey, + const nsAString& aValue) +{ + if (NS_FAILED(mStatus) || !mIPCOpen) { + return mStatus; + } + + SendAsyncAddItem(aCache->Scope(), nsString(aKey), nsString(aValue)); + ScopesHavingData().PutEntry(aCache->Scope()); + return NS_OK; +} + +nsresult +DOMStorageDBChild::AsyncUpdateItem(DOMStorageCacheBridge* aCache, + const nsAString& aKey, + const nsAString& aValue) +{ + if (NS_FAILED(mStatus) || !mIPCOpen) { + return mStatus; + } + + SendAsyncUpdateItem(aCache->Scope(), nsString(aKey), nsString(aValue)); + ScopesHavingData().PutEntry(aCache->Scope()); + return NS_OK; +} + +nsresult +DOMStorageDBChild::AsyncRemoveItem(DOMStorageCacheBridge* aCache, + const nsAString& aKey) +{ + if (NS_FAILED(mStatus) || !mIPCOpen) { + return mStatus; + } + + SendAsyncRemoveItem(aCache->Scope(), nsString(aKey)); + return NS_OK; +} + +nsresult +DOMStorageDBChild::AsyncClear(DOMStorageCacheBridge* aCache) +{ + if (NS_FAILED(mStatus) || !mIPCOpen) { + return mStatus; + } + + SendAsyncClear(aCache->Scope()); + ScopesHavingData().RemoveEntry(aCache->Scope()); + return NS_OK; +} + +bool +DOMStorageDBChild::ShouldPreloadScope(const nsACString& aScope) +{ + // Return true if we didn't receive the aScope list yet. + // I tend to rather preserve a bit of early-after-start performance + // then a bit of memory here. + return !mScopesHavingData.IsInitialized() || + mScopesHavingData.Contains(aScope); +} + +bool +DOMStorageDBChild::RecvObserve(const nsCString& aTopic, + const nsCString& aScopePrefix) +{ + DOMStorageObserver::Self()->Notify(aTopic.get(), aScopePrefix); + return true; +} + +bool +DOMStorageDBChild::RecvScopesHavingData(const InfallibleTArray& aScopes) +{ + for (uint32_t i = 0; i < aScopes.Length(); ++i) { + ScopesHavingData().PutEntry(aScopes[i]); + } + + return true; +} + +bool +DOMStorageDBChild::RecvLoadItem(const nsCString& aScope, + const nsString& aKey, + const nsString& aValue) +{ + DOMStorageCache* aCache = mManager->GetCache(aScope); + if (aCache) { + aCache->LoadItem(aKey, aValue); + } + + return true; +} + +bool +DOMStorageDBChild::RecvLoadDone(const nsCString& aScope, const nsresult& aRv) +{ + DOMStorageCache* aCache = mManager->GetCache(aScope); + if (aCache) { + aCache->LoadDone(aRv); + + // Just drop reference to this cache now since the load is done. + mLoadingCaches.RemoveEntry(static_cast(aCache)); + } + + return true; +} + +bool +DOMStorageDBChild::RecvLoadUsage(const nsCString& aScope, const int64_t& aUsage) +{ + DOMStorageDBBridge* db = DOMStorageCache::GetDatabase(); + if (!db) { + return false; + } + + DOMStorageUsageBridge* scopeUsage = db->GetScopeUsage(aScope); + scopeUsage->LoadUsage(aUsage); + return true; +} + +bool +DOMStorageDBChild::RecvError(const nsresult& aRv) +{ + mStatus = aRv; + return true; +} + +// ---------------------------------------------------------------------------- +// Parent +// ---------------------------------------------------------------------------- + +NS_IMPL_THREADSAFE_ADDREF(DOMStorageDBParent) +NS_IMPL_THREADSAFE_RELEASE(DOMStorageDBParent) + +void +DOMStorageDBParent::AddIPDLReference() +{ + NS_ABORT_IF_FALSE(!mIPCOpen, "Attempting to retain multiple IPDL references"); + mIPCOpen = true; + AddRef(); +} + +void +DOMStorageDBParent::ReleaseIPDLReference() +{ + NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference"); + mIPCOpen = false; + Release(); +} + +namespace { // anon + +class SendScopesHavingDataRunnable : public nsRunnable +{ +public: + SendScopesHavingDataRunnable(DOMStorageDBParent* aParent) + : mParent(aParent) + {} + +private: + NS_IMETHOD Run() + { + if (!mParent->IPCOpen()) { + return NS_OK; + } + + DOMStorageDBBridge* db = DOMStorageCache::GetDatabase(); + if (db) { + InfallibleTArray scopes; + db->GetScopesHavingData(&scopes); + mozilla::unused << mParent->SendScopesHavingData(scopes); + } + + return NS_OK; + } + + nsRefPtr mParent; +}; + +} // anon + +DOMStorageDBParent::DOMStorageDBParent() +: mIPCOpen(false) +{ + DOMStorageObserver* observer = DOMStorageObserver::Self(); + if (observer) { + observer->AddSink(this); + } + + // We are always open by IPC only + AddIPDLReference(); + + // Cannot send directly from here since the channel + // is not completely built at this moment. + nsRefPtr r = + new SendScopesHavingDataRunnable(this); + NS_DispatchToCurrentThread(r); +} + +DOMStorageDBParent::~DOMStorageDBParent() +{ + DOMStorageObserver* observer = DOMStorageObserver::Self(); + if (observer) { + observer->RemoveSink(this); + } +} + +DOMStorageDBParent::CacheParentBridge* +DOMStorageDBParent::NewCache(const nsACString& aScope) +{ + return new CacheParentBridge(this, aScope); +} + +bool +DOMStorageDBParent::RecvAsyncPreload(const nsCString& aScope, const bool& aPriority) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + db->AsyncPreload(NewCache(aScope), aPriority); + return true; +} + +bool +DOMStorageDBParent::RecvAsyncGetUsage(const nsCString& aScope) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + // The object releases it self in LoadUsage method + UsageParentBridge* usage = new UsageParentBridge(this, aScope); + db->AsyncGetUsage(usage); + return true; +} + +namespace { // anon + +// We need another implementation of DOMStorageCacheBridge to do +// synchronous IPC preload. This class just receives Load* notifications +// and fills the returning arguments of RecvPreload with the database +// values for us. +class SyncLoadCacheHelper : public DOMStorageCacheBridge +{ +public: + SyncLoadCacheHelper(const nsCString& aScope, + uint32_t aAlreadyLoadedCount, + InfallibleTArray* aKeys, + InfallibleTArray* aValues, + nsresult* rv) + : mMonitor("DOM Storage SyncLoad IPC") + , mScope(aScope) + , mKeys(aKeys) + , mValues(aValues) + , mRv(rv) + , mLoaded(false) + , mLoadedCount(aAlreadyLoadedCount) + { + // Precaution + *mRv = NS_ERROR_UNEXPECTED; + } + + virtual const nsCString& Scope() const { return mScope; } + virtual bool Loaded() { return mLoaded; } + virtual uint32_t LoadedCount() { return mLoadedCount; } + virtual bool LoadItem(const nsAString& aKey, const nsString& aValue) + { + // Called on the aCache background thread + if (mLoaded) { + return false; + } + + ++mLoadedCount; + mKeys->AppendElement(aKey); + mValues->AppendElement(aValue); + return true; + } + + virtual void LoadDone(nsresult aRv) + { + // Called on the aCache background thread + MonitorAutoLock monitor(mMonitor); + mLoaded = true; + *mRv = aRv; + monitor.Notify(); + } + + virtual void LoadWait() + { + // Called on the main thread, exits after LoadDone() call + MonitorAutoLock monitor(mMonitor); + while (!mLoaded) { + monitor.Wait(); + } + } + +private: + Monitor mMonitor; + nsCString mScope; + InfallibleTArray* mKeys; + InfallibleTArray* mValues; + nsresult* mRv; + bool mLoaded; + uint32_t mLoadedCount; +}; + +} // anon + +bool +DOMStorageDBParent::RecvPreload(const nsCString& aScope, + const uint32_t& aAlreadyLoadedCount, + InfallibleTArray* aKeys, + InfallibleTArray* aValues, + nsresult* aRv) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + nsRefPtr cache( + new SyncLoadCacheHelper(aScope, aAlreadyLoadedCount, aKeys, aValues, aRv)); + + db->SyncPreload(cache, true); + return true; +} + +bool +DOMStorageDBParent::RecvAsyncAddItem(const nsCString& aScope, + const nsString& aKey, + const nsString& aValue) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + nsresult rv = db->AsyncAddItem(NewCache(aScope), aKey, aValue); + if (NS_FAILED(rv) && mIPCOpen) { + mozilla::unused << SendError(rv); + } + + return true; +} + +bool +DOMStorageDBParent::RecvAsyncUpdateItem(const nsCString& aScope, + const nsString& aKey, + const nsString& aValue) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + nsresult rv = db->AsyncUpdateItem(NewCache(aScope), aKey, aValue); + if (NS_FAILED(rv) && mIPCOpen) { + mozilla::unused << SendError(rv); + } + + return true; +} + +bool +DOMStorageDBParent::RecvAsyncRemoveItem(const nsCString& aScope, + const nsString& aKey) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + nsresult rv = db->AsyncRemoveItem(NewCache(aScope), aKey); + if (NS_FAILED(rv) && mIPCOpen) { + mozilla::unused << SendError(rv); + } + + return true; +} + +bool +DOMStorageDBParent::RecvAsyncClear(const nsCString& aScope) +{ + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + if (!db) { + return false; + } + + nsresult rv = db->AsyncClear(NewCache(aScope)); + if (NS_FAILED(rv) && mIPCOpen) { + mozilla::unused << SendError(rv); + } + + return true; +} + +bool +DOMStorageDBParent::RecvAsyncFlush() +{ + DOMStorageDBBridge* db = DOMStorageCache::GetDatabase(); + if (!db) { + return false; + } + + db->AsyncFlush(); + return true; +} + +// DOMStorageObserverSink + +nsresult +DOMStorageDBParent::Observe(const char* aTopic, + const nsACString& aScopePrefix) +{ + if (mIPCOpen) { + mozilla::unused << SendObserve(nsDependentCString(aTopic), + nsCString(aScopePrefix)); + } + + return NS_OK; +} + +namespace { // anon + +// Results must be sent back on the main thread +class LoadRunnable : public nsRunnable +{ +public: + enum TaskType { + loadItem, + loadDone + }; + + LoadRunnable(DOMStorageDBParent* aParent, + TaskType aType, + const nsACString& aScope, + const nsAString& aKey = EmptyString(), + const nsAString& aValue = EmptyString()) + : mParent(aParent) + , mType(aType) + , mScope(aScope) + , mKey(aKey) + , mValue(aValue) + { } + + LoadRunnable(DOMStorageDBParent* aParent, + TaskType aType, + const nsACString& aScope, + nsresult aRv) + : mParent(aParent) + , mType(aType) + , mScope(aScope) + , mRv(aRv) + { } + +private: + nsRefPtr mParent; + TaskType mType; + nsCString mScope; + nsString mKey; + nsString mValue; + nsresult mRv; + + NS_IMETHOD Run() + { + if (!mParent->IPCOpen()) { + return NS_OK; + } + + switch (mType) + { + case loadItem: + mozilla::unused << mParent->SendLoadItem(mScope, mKey, mValue); + break; + case loadDone: + mozilla::unused << mParent->SendLoadDone(mScope, mRv); + break; + } + + return NS_OK; + } +}; + +} // anon + +// DOMStorageDBParent::CacheParentBridge + +bool +DOMStorageDBParent::CacheParentBridge::LoadItem(const nsAString& aKey, const nsString& aValue) +{ + if (mLoaded) { + return false; + } + + ++mLoadedCount; + + nsRefPtr r = + new LoadRunnable(mParent, LoadRunnable::loadItem, mScope, aKey, aValue); + NS_DispatchToMainThread(r); + return true; +} + +void +DOMStorageDBParent::CacheParentBridge::LoadDone(nsresult aRv) +{ + // Prevent send of duplicate LoadDone. + if (mLoaded) { + return; + } + + mLoaded = true; + + nsRefPtr r = + new LoadRunnable(mParent, LoadRunnable::loadDone, mScope, aRv); + NS_DispatchToMainThread(r); +} + +void +DOMStorageDBParent::CacheParentBridge::LoadWait() +{ + // Should never be called on this implementation + MOZ_ASSERT(false); +} + +// DOMStorageDBParent::UsageParentBridge + +namespace { // anon + +class UsageRunnable : public nsRunnable +{ +public: + UsageRunnable(DOMStorageDBParent* aParent, const nsACString& aScope, const int64_t& aUsage) + : mParent(aParent) + , mScope(aScope) + , mUsage(aUsage) + {} + +private: + NS_IMETHOD Run() + { + if (!mParent->IPCOpen()) { + return NS_OK; + } + + mozilla::unused << mParent->SendLoadUsage(mScope, mUsage); + return NS_OK; + } + + nsRefPtr mParent; + nsCString mScope; + int64_t mUsage; +}; + +} // anon + +void +DOMStorageDBParent::UsageParentBridge::LoadUsage(const int64_t aUsage) +{ + nsRefPtr r = new UsageRunnable(mParent, mScope, aUsage); + NS_DispatchToMainThread(r); + delete this; +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorageIPC.h b/dom/src/storage/DOMStorageIPC.h new file mode 100644 index 000000000000..2a9c2342ccae --- /dev/null +++ b/dom/src/storage/DOMStorageIPC.h @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsDOMStorageIPC_h___ +#define nsDOMStorageIPC_h___ + +#include "mozilla/dom/PStorageChild.h" +#include "mozilla/dom/PStorageParent.h" +#include "DOMStorageDBThread.h" +#include "DOMStorageCache.h" +#include "DOMStorageObserver.h" +#include "mozilla/Mutex.h" + +namespace mozilla { +namespace dom { + +class DOMLocalStorageManager; + +// Child side of the IPC protocol, exposes as DB interface but +// is responsible to send all requests to the parent process +// and expects asynchronous answers. Those are then transparently +// forwarded back to consumers on the child process. +class DOMStorageDBChild MOZ_FINAL : public DOMStorageDBBridge + , public PStorageChild +{ +public: + DOMStorageDBChild(DOMLocalStorageManager* aManager); + virtual ~DOMStorageDBChild(); + + NS_IMETHOD_(nsrefcnt) AddRef(void); + NS_IMETHOD_(nsrefcnt) Release(void); + + void AddIPDLReference(); + void ReleaseIPDLReference(); + + virtual nsresult Init(); + virtual nsresult Shutdown(); + + virtual void AsyncPreload(DOMStorageCacheBridge* aCache, bool aPriority = false); + virtual void AsyncGetUsage(DOMStorageUsageBridge* aUsage); + + virtual void SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync = false); + + virtual nsresult AsyncAddItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue); + virtual nsresult AsyncUpdateItem(DOMStorageCacheBridge* aCache, const nsAString& aKey, const nsAString& aValue); + virtual nsresult AsyncRemoveItem(DOMStorageCacheBridge* aCache, const nsAString& aKey); + virtual nsresult AsyncClear(DOMStorageCacheBridge* aCache); + + virtual void AsyncClearAll() + { mScopesHavingData.Clear(); /* NO-OP on the child process otherwise */ } + + virtual void AsyncClearMatchingScope(const nsACString& aScope) + { /* NO-OP on the child process */ } + + virtual void AsyncFlush() + { SendAsyncFlush(); } + + virtual bool ShouldPreloadScope(const nsACString& aScope); + virtual void GetScopesHavingData(InfallibleTArray* aScopes) + { NS_NOTREACHED("Not implemented for child process"); } + +private: + bool RecvObserve(const nsCString& aTopic, + const nsCString& aScopePrefix); + bool RecvLoadItem(const nsCString& aScope, + const nsString& aKey, + const nsString& aValue); + bool RecvLoadDone(const nsCString& aScope, + const nsresult& aRv); + bool RecvScopesHavingData(const InfallibleTArray& aScopes); + bool RecvLoadUsage(const nsCString& aScope, + const int64_t& aUsage); + bool RecvError(const nsresult& aRv); + + nsTHashtable& ScopesHavingData(); + + nsAutoRefCnt mRefCnt; + + // Held to get caches to forward answers to. + nsRefPtr mManager; + + // Scopes having data hash, for optimization purposes only + nsTHashtable mScopesHavingData; + + // List of caches waiting for preload. This ensures the contract that + // AsyncPreload call references the cache for time of the preload. + nsTHashtable > mLoadingCaches; + + // Status of the remote database + nsresult mStatus; + + bool mIPCOpen; +}; + + +// Receives async requests from child processes and is responsible +// to send back responses from the DB thread. Exposes as a fake +// DOMStorageCache consumer. +// Also responsible for forwardning all chrome operation notifications +// such as cookie cleaning etc to the child process. +class DOMStorageDBParent MOZ_FINAL : public PStorageParent + , public DOMStorageObserverSink +{ +public: + DOMStorageDBParent(); + virtual ~DOMStorageDBParent(); + + NS_IMETHOD_(nsrefcnt) AddRef(void); + NS_IMETHOD_(nsrefcnt) Release(void); + + void AddIPDLReference(); + void ReleaseIPDLReference(); + + bool IPCOpen() { return mIPCOpen; } + +public: + // Fake cache class receiving async callbacks from DB thread, sending + // them back to appropriate cache object on the child process. + class CacheParentBridge : public DOMStorageCacheBridge { + public: + CacheParentBridge(DOMStorageDBParent* aParentDB, const nsACString& aScope) + : mParent(aParentDB), mScope(aScope), mLoaded(false), mLoadedCount(0) {} + virtual ~CacheParentBridge() {} + + // DOMStorageCacheBridge + virtual const nsCString& Scope() const + { return mScope; } + virtual bool Loaded() + { return mLoaded; } + virtual uint32_t LoadedCount() + { return mLoadedCount; } + + virtual bool LoadItem(const nsAString& aKey, const nsString& aValue); + virtual void LoadDone(nsresult aRv); + virtual void LoadWait(); + + private: + nsRefPtr mParent; + nsCString mScope; + bool mLoaded; + uint32_t mLoadedCount; + }; + + // Fake usage class receiving async callbacks from DB thread + class UsageParentBridge : public DOMStorageUsageBridge + { + public: + UsageParentBridge(DOMStorageDBParent* aParentDB, const nsACString& aScope) + : mParent(aParentDB), mScope(aScope) {} + virtual ~UsageParentBridge() {} + + // DOMStorageUsageBridge + virtual const nsCString& Scope() { return mScope; } + virtual void LoadUsage(const int64_t usage); + + private: + nsRefPtr mParent; + nsCString mScope; + }; + +private: + // IPC + bool RecvAsyncPreload(const nsCString& aScope, const bool& aPriority); + bool RecvPreload(const nsCString& aScope, const uint32_t& aAlreadyLoadedCount, + InfallibleTArray* aKeys, InfallibleTArray* aValues, + nsresult* aRv); + bool RecvAsyncGetUsage(const nsCString& aScope); + bool RecvAsyncAddItem(const nsCString& aScope, const nsString& aKey, const nsString& aValue); + bool RecvAsyncUpdateItem(const nsCString& aScope, const nsString& aKey, const nsString& aValue); + bool RecvAsyncRemoveItem(const nsCString& aScope, const nsString& aKey); + bool RecvAsyncClear(const nsCString& aScope); + bool RecvAsyncFlush(); + + // DOMStorageObserverSink + virtual nsresult Observe(const char* aTopic, const nsACString& aScopePrefix); + +private: + CacheParentBridge* NewCache(const nsACString& aScope); + + nsAutoRefCnt mRefCnt; + + // True when IPC channel is open and Send*() methods are OK to use. + bool mIPCOpen; +}; + +} // ::dom +} // ::mozilla + +#endif diff --git a/dom/src/storage/DOMStorageManager.cpp b/dom/src/storage/DOMStorageManager.cpp new file mode 100644 index 000000000000..0f605f9bc81e --- /dev/null +++ b/dom/src/storage/DOMStorageManager.cpp @@ -0,0 +1,631 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorageManager.h" +#include "DOMStorage.h" +#include "DOMStorageDBThread.h" + +#include "nsIScriptSecurityManager.h" +#include "nsIEffectiveTLDService.h" + +#include "nsNetUtil.h" +#include "nsPrintfCString.h" +#include "nsXULAppAPI.h" +#include "nsThreadUtils.h" +#include "nsIObserverService.h" +#include "mozilla/Services.h" +#include "mozilla/Preferences.h" + +// Only allow relatively small amounts of data since performance of +// the synchronous IO is very bad. +// We are enforcing simple per-origin quota only. +#define DEFAULT_QUOTA_LIMIT (5 * 1024) + +namespace mozilla { +namespace dom { + +namespace { // anon + +int32_t gQuotaLimit = DEFAULT_QUOTA_LIMIT; + +} // anon + +DOMLocalStorageManager* +DOMLocalStorageManager::sSelf = nullptr; + +// static +uint32_t +DOMStorageManager::GetQuota() +{ + static bool preferencesInitialized = false; + if (!preferencesInitialized) { + mozilla::Preferences::AddIntVarCache(&gQuotaLimit, "dom.storage.default_quota", + DEFAULT_QUOTA_LIMIT); + preferencesInitialized = true; + } + + return gQuotaLimit * 1024; // pref is in kBs +} + +void +ReverseString(const nsCSubstring& aSource, nsCSubstring& aResult) +{ + nsACString::const_iterator sourceBegin, sourceEnd; + aSource.BeginReading(sourceBegin); + aSource.EndReading(sourceEnd); + + aResult.SetLength(aSource.Length()); + nsACString::iterator destEnd; + aResult.EndWriting(destEnd); + + while (sourceBegin != sourceEnd) { + *(--destEnd) = *sourceBegin; + ++sourceBegin; + } +} + +nsresult +CreateReversedDomain(const nsACString& aAsciiDomain, + nsACString& aKey) +{ + if (aAsciiDomain.IsEmpty()) { + return NS_ERROR_NOT_AVAILABLE; + } + + ReverseString(aAsciiDomain, aKey); + + aKey.AppendLiteral("."); + return NS_OK; +} + +bool +PrincipalsEqual(nsIPrincipal* aObjectPrincipal, nsIPrincipal* aSubjectPrincipal) +{ + if (!aSubjectPrincipal) { + return true; + } + + if (!aObjectPrincipal) { + return false; + } + + bool equals; + nsresult rv = aSubjectPrincipal->EqualsIgnoringDomain(aObjectPrincipal, &equals); + + NS_ASSERTION(NS_SUCCEEDED(rv) && equals, + "Trying to get DOM storage for wrong principal!"); + + if (NS_FAILED(rv) || !equals) { + return false; + } + + return true; +} + +NS_IMPL_ISUPPORTS1(DOMStorageManager, + nsIDOMStorageManager) + +DOMStorageManager::DOMStorageManager(nsPIDOMStorage::StorageType aType) + : mType(aType) +{ + mCaches.Init(10); + DOMStorageObserver* observer = DOMStorageObserver::Self(); + NS_ASSERTION(observer, "No DOMStorageObserver, cannot observe private data delete notifications!"); + + if (observer) { + observer->AddSink(this); + } +} + +DOMStorageManager::~DOMStorageManager() +{ + DOMStorageObserver* observer = DOMStorageObserver::Self(); + if (observer) { + observer->RemoveSink(this); + } +} + +namespace { // anon + +nsresult +CreateScopeKey(nsIPrincipal* aPrincipal, + nsACString& aKey) +{ + nsCOMPtr uri; + nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + if (!uri) { + return NS_ERROR_UNEXPECTED; + } + + nsAutoCString domainScope; + rv = uri->GetAsciiHost(domainScope); + NS_ENSURE_SUCCESS(rv, rv); + + if (domainScope.IsEmpty()) { + // About pages have an empty host but a valid path. Since they are handled + // internally by our own redirector, we can trust them and use path as key. + // if file:/// protocol, let's make the exact directory the domain + bool isScheme = false; + if ((NS_SUCCEEDED(uri->SchemeIs("about", &isScheme)) && isScheme) || + (NS_SUCCEEDED(uri->SchemeIs("moz-safe-about", &isScheme)) && isScheme)) { + rv = uri->GetPath(domainScope); + NS_ENSURE_SUCCESS(rv, rv); + // While the host is always canonicalized to lowercase, the path is not, + // thus need to force the casing. + ToLowerCase(domainScope); + } else if (NS_SUCCEEDED(uri->SchemeIs("file", &isScheme)) && isScheme) { + nsCOMPtr url = do_QueryInterface(uri, &rv); + NS_ENSURE_SUCCESS(rv, rv); + rv = url->GetDirectory(domainScope); + NS_ENSURE_SUCCESS(rv, rv); + } + } + + nsAutoCString key; + + rv = CreateReversedDomain(domainScope, key); + if (NS_FAILED(rv)) { + return rv; + } + + nsAutoCString scheme; + rv = uri->GetScheme(scheme); + NS_ENSURE_SUCCESS(rv, rv); + + key.Append(NS_LITERAL_CSTRING(":") + scheme); + + int32_t port = NS_GetRealPort(uri); + if (port != -1) { + key.Append(nsPrintfCString(":%d", port)); + } + + bool unknownAppId; + rv = aPrincipal->GetUnknownAppId(&unknownAppId); + NS_ENSURE_SUCCESS(rv, rv); + + if (!unknownAppId) { + uint32_t appId; + rv = aPrincipal->GetAppId(&appId); + NS_ENSURE_SUCCESS(rv, rv); + + bool isInBrowserElement; + rv = aPrincipal->GetIsInBrowserElement(&isInBrowserElement); + NS_ENSURE_SUCCESS(rv, rv); + + if (appId == nsIScriptSecurityManager::NO_APP_ID && !isInBrowserElement) { + aKey.Assign(key); + return NS_OK; + } + + aKey.Truncate(); + aKey.AppendInt(appId); + aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? + NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + + NS_LITERAL_CSTRING(":") + key); + } + + return NS_OK; +} + +nsresult +CreateQuotaDBKey(nsIPrincipal* aPrincipal, + nsACString& aKey) +{ + nsresult rv; + + nsAutoCString subdomainsDBKey; + nsCOMPtr eTLDService(do_GetService( + NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr uri; + rv = aPrincipal->GetURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED); + + nsAutoCString eTLDplusOne; + rv = eTLDService->GetBaseDomain(uri, 0, eTLDplusOne); + if (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS == rv) { + // XXX bug 357323 - what to do for localhost/file exactly? + rv = uri->GetAsciiHost(eTLDplusOne); + } + NS_ENSURE_SUCCESS(rv, rv); + + CreateReversedDomain(eTLDplusOne, subdomainsDBKey); + + bool unknownAppId; + rv = aPrincipal->GetUnknownAppId(&unknownAppId); + NS_ENSURE_SUCCESS(rv, rv); + + if (!unknownAppId) { + uint32_t appId; + rv = aPrincipal->GetAppId(&appId); + NS_ENSURE_SUCCESS(rv, rv); + + bool isInBrowserElement; + rv = aPrincipal->GetIsInBrowserElement(&isInBrowserElement); + NS_ENSURE_SUCCESS(rv, rv); + + if (appId == nsIScriptSecurityManager::NO_APP_ID && !isInBrowserElement) { + aKey.Assign(subdomainsDBKey); + return NS_OK; + } + + aKey.Truncate(); + aKey.AppendInt(appId); + aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? + NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + + NS_LITERAL_CSTRING(":") + subdomainsDBKey); + } + + return NS_OK; +} + +} // anon + +DOMStorageCache* +DOMStorageManager::GetCache(const nsACString& aScope) const +{ + DOMStorageCacheHashKey* entry = mCaches.GetEntry(aScope); + if (!entry) { + return nullptr; + } + + return entry->cache(); +} + +already_AddRefed +DOMStorageManager::PutCache(const nsACString& aScope, + nsIPrincipal* aPrincipal) +{ + DOMStorageCacheHashKey* entry = mCaches.PutEntry(aScope); + nsRefPtr cache = entry->cache(); + + nsAutoCString quotaScope; + CreateQuotaDBKey(aPrincipal, quotaScope); + + switch (mType) { + case SessionStorage: + // Lifetime handled by the manager, don't persist + entry->HardRef(); + cache->Init(nullptr, false, aPrincipal, quotaScope); + break; + + case LocalStorage: + // Lifetime handled by the cache, do persist + cache->Init(this, true, aPrincipal, quotaScope); + break; + + default: + MOZ_ASSERT(false); + } + + return cache.forget(); +} + +void +DOMStorageManager::DropCache(DOMStorageCache* aCache) +{ + if (!NS_IsMainThread()) { + NS_WARNING("DOMStorageManager::DropCache called on a non-main thread, shutting down?"); + } + + mCaches.RemoveEntry(aCache->Scope()); +} + +nsresult +DOMStorageManager::GetStorageInternal(bool aCreate, + nsIPrincipal* aPrincipal, + const nsAString& aDocumentURI, + bool aPrivate, + nsIDOMStorage** aRetval) +{ + nsresult rv; + + nsAutoCString scope; + rv = CreateScopeKey(aPrincipal, scope); + if (NS_FAILED(rv)) { + return NS_ERROR_NOT_AVAILABLE; + } + + nsRefPtr cache = GetCache(scope); + + // Get or create a cache for the given scope + if (!cache) { + if (!aCreate) { + *aRetval = nullptr; + return NS_OK; + } + + if (!aRetval) { + // This is demand to just preload the cache, if the scope has + // no data stored, bypass creation and preload of the cache. + DOMStorageDBBridge* db = DOMStorageCache::GetDatabase(); + if (db) { + if (!db->ShouldPreloadScope(scope)) { + return NS_OK; + } + } else { + if (scope.Equals(NS_LITERAL_CSTRING("knalb.:about"))) { + return NS_OK; + } + } + } + + // There is always a single instance of a cache per scope + // in a single instance of a DOM storage manager. + cache = PutCache(scope, aPrincipal); + } else if (mType == SessionStorage) { + if (!cache->CheckPrincipal(aPrincipal)) { + return NS_ERROR_DOM_SECURITY_ERR; + } + } + + if (aRetval) { + *aRetval = new DOMStorage(this, cache, aDocumentURI, aPrincipal, aPrivate); + NS_ADDREF(*aRetval); + } + + return NS_OK; +} + +NS_IMETHODIMP +DOMStorageManager::PrecacheStorage(nsIPrincipal* aPrincipal) +{ + return GetStorageInternal(true, aPrincipal, EmptyString(), false, nullptr); +} + +NS_IMETHODIMP +DOMStorageManager::CreateStorage(nsIPrincipal* aPrincipal, + const nsAString& aDocumentURI, + bool aPrivate, + nsIDOMStorage** aRetval) +{ + return GetStorageInternal(true, aPrincipal, aDocumentURI, aPrivate, aRetval); +} + +NS_IMETHODIMP +DOMStorageManager::GetStorage(nsIPrincipal* aPrincipal, + bool aPrivate, + nsIDOMStorage** aRetval) +{ + return GetStorageInternal(false, aPrincipal, EmptyString(), aPrivate, aRetval); +} + +NS_IMETHODIMP +DOMStorageManager::CloneStorage(nsIDOMStorage* aStorage) +{ + if (mType != SessionStorage) { + // Cloning is supported only for sessionStorage + return NS_ERROR_NOT_IMPLEMENTED; + } + + nsCOMPtr pstorage = do_QueryInterface(aStorage); + if (!pstorage) { + return NS_ERROR_UNEXPECTED; + } + + const DOMStorageCache* origCache = pstorage->GetCache(); + + DOMStorageCache* existingCache = GetCache(origCache->Scope()); + if (existingCache) { + // Do not replace an existing sessionStorage. + return NS_ERROR_NOT_AVAILABLE; + } + + // Since this manager is sessionStorage manager, PutCache hard references + // the cache in our hashtable. + nsRefPtr newCache = PutCache(origCache->Scope(), + origCache->Principal()); + + newCache->CloneFrom(origCache); + return NS_OK; +} + +NS_IMETHODIMP +DOMStorageManager::CheckStorage(nsIPrincipal* aPrincipal, + nsIDOMStorage* aStorage, + bool* aRetval) +{ + nsCOMPtr pstorage = do_QueryInterface(aStorage); + if (!pstorage) { + return NS_ERROR_UNEXPECTED; + } + + *aRetval = false; + + if (!aPrincipal) { + return NS_ERROR_NOT_AVAILABLE; + } + + nsAutoCString scope; + nsresult rv = CreateScopeKey(aPrincipal, scope); + NS_ENSURE_SUCCESS(rv, rv); + + DOMStorageCache* cache = GetCache(scope); + if (cache != pstorage->GetCache()) { + return NS_OK; + } + + if (!pstorage->PrincipalEquals(aPrincipal)) { + return NS_OK; + } + + *aRetval = true; + return NS_OK; +} + +// Obsolete nsIDOMStorageManager methods + +NS_IMETHODIMP +DOMStorageManager::GetLocalStorageForPrincipal(nsIPrincipal* aPrincipal, + const nsAString& aDocumentURI, + bool aPrivate, + nsIDOMStorage** aRetval) +{ + if (mType != LocalStorage) { + return NS_ERROR_UNEXPECTED; + } + + return CreateStorage(aPrincipal, aDocumentURI, aPrivate, aRetval); +} + +namespace { // anon + +class ClearCacheEnumeratorData +{ +public: + ClearCacheEnumeratorData(uint32_t aFlags) + : mUnloadFlags(aFlags) + {} + + uint32_t mUnloadFlags; + nsCString mKeyPrefix; +}; + +} // anon + +PLDHashOperator +DOMStorageManager::ClearCacheEnumerator(DOMStorageCacheHashKey* aEntry, void* aClosure) +{ + DOMStorageCache* cache = aEntry->cache(); + nsCString& key = const_cast(cache->Scope()); + + ClearCacheEnumeratorData* data = static_cast(aClosure); + + if (data->mKeyPrefix.IsEmpty() || StringBeginsWith(key, data->mKeyPrefix)) { + cache->UnloadItems(data->mUnloadFlags); + } + + return PL_DHASH_NEXT; +} + +nsresult +DOMStorageManager::Observe(const char* aTopic, const nsACString& aScopePrefix) +{ + // Clear everything, caches + database + if (!strcmp(aTopic, "cookie-cleared")) { + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadComplete); + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + return NS_OK; + } + + // Clear from caches everything that has been stored + // while in session-only mode + if (!strcmp(aTopic, "session-only-cleared")) { + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadSession); + data.mKeyPrefix = aScopePrefix; + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + return NS_OK; + } + + // Clear everything (including so and pb data) from caches and database + // for the gived domain and subdomains. + if (!strcmp(aTopic, "domain-data-cleared")) { + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadComplete); + data.mKeyPrefix = aScopePrefix; + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + return NS_OK; + } + + // Clear all private-browsing caches + if (!strcmp(aTopic, "private-browsing-data-cleared")) { + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadPrivate); + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + return NS_OK; + } + + // Clear localStorage data beloging to an app. + if (!strcmp(aTopic, "app-data-cleared")) { + + // sessionStorage is expected to stay + if (mType == SessionStorage) { + return NS_OK; + } + + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadComplete); + data.mKeyPrefix = aScopePrefix; + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + return NS_OK; + } + + if (!strcmp(aTopic, "profile-change")) { + // For case caches are still referenced - clear them completely + ClearCacheEnumeratorData data(DOMStorageCache::kUnloadComplete); + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + + mCaches.Clear(); + return NS_OK; + } + +#ifdef DOM_STORAGE_TESTS + if (!strcmp(aTopic, "test-reload")) { + if (mType != LocalStorage) { + return NS_OK; + } + + // This immediately completely reloads all caches from the database. + ClearCacheEnumeratorData data(DOMStorageCache::kTestReload); + mCaches.EnumerateEntries(ClearCacheEnumerator, &data); + return NS_OK; + } + + if (!strcmp(aTopic, "test-flushed")) { + if (XRE_GetProcessType() != GeckoProcessType_Default) { + nsCOMPtr obs = mozilla::services::GetObserverService(); + if (obs) { + obs->NotifyObservers(nullptr, "domstorage-test-flushed", nullptr); + } + } + + return NS_OK; + } +#endif + + NS_ERROR("Unexpected topic"); + return NS_ERROR_UNEXPECTED; +} + +// DOMLocalStorageManager + +DOMLocalStorageManager::DOMLocalStorageManager() + : DOMStorageManager(LocalStorage) +{ + NS_ASSERTION(!sSelf, "Somebody is trying to do_CreateInstance(\"@mozilla/dom/localStorage-manager;1\""); + sSelf = this; + + if (XRE_GetProcessType() != GeckoProcessType_Default) { + // Do this only on the child process. The thread IPC bridge + // is also used to communicate chrome observer notifications. + // Note: must be called after we set sSelf + DOMStorageCache::StartDatabase(); + } +} + +DOMLocalStorageManager::~DOMLocalStorageManager() +{ + sSelf = nullptr; +} + +// DOMSessionStorageManager + +DOMSessionStorageManager::DOMSessionStorageManager() + : DOMStorageManager(SessionStorage) +{ + if (XRE_GetProcessType() != GeckoProcessType_Default) { + // Do this only on the child process. The thread IPC bridge + // is also used to communicate chrome observer notifications. + DOMStorageCache::StartDatabase(); + } +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorageManager.h b/dom/src/storage/DOMStorageManager.h new file mode 100644 index 000000000000..8ae1cf5ad1e5 --- /dev/null +++ b/dom/src/storage/DOMStorageManager.h @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsDOMStorageManager_h__ +#define nsDOMStorageManager_h__ + +#include "nsIDOMStorageManager.h" +#include "DOMStorageObserver.h" + +#include "nsPIDOMStorage.h" +#include "DOMStorageCache.h" + +#include "nsTHashtable.h" + +namespace mozilla { +namespace dom { + +const nsPIDOMStorage::StorageType SessionStorage = nsPIDOMStorage::SessionStorage; +const nsPIDOMStorage::StorageType LocalStorage = nsPIDOMStorage::LocalStorage; + +class DOMStorage; + +class DOMStorageManager : public nsIDOMStorageManager + , public DOMStorageObserverSink +{ + NS_DECL_ISUPPORTS + NS_DECL_NSIDOMSTORAGEMANAGER + +public: + virtual nsPIDOMStorage::StorageType Type() { return mType; } + + // Reads the preference for DOM storage quota + static uint32_t GetQuota(); + // Gets (but not ensures) cache for the given scope + DOMStorageCache* GetCache(const nsACString& aScope) const; + +protected: + DOMStorageManager(nsPIDOMStorage::StorageType aType); + virtual ~DOMStorageManager(); + +private: + // DOMStorageObserverSink, handler to various chrome clearing notification + virtual nsresult Observe(const char* aTopic, const nsACString& aScopePrefix); + + // Since nsTHashtable doesn't like multiple inheritance, we have to aggregate + // DOMStorageCache into the entry. + class DOMStorageCacheHashKey : public nsCStringHashKey + { + public: + DOMStorageCacheHashKey(const nsACString* aKey) + : nsCStringHashKey(aKey) + , mCache(new DOMStorageCache(aKey)) + {} + + DOMStorageCacheHashKey(const DOMStorageCacheHashKey& aOther) + : nsCStringHashKey(aOther) + { + NS_ERROR("Shouldn't be called"); + } + + DOMStorageCache* cache() { return mCache; } + // Keep the cache referenced forever, used for sessionStorage. + void HardRef() { mCacheRef = mCache; } + + private: + // weak ref only since cache references its manager. + DOMStorageCache* mCache; + // hard ref when this is sessionStorage to keep it alive forever. + nsRefPtr mCacheRef; + }; + + // Ensures cache for a scope, when it doesn't exist it is created and initalized, + // this also starts preload of persistent data. + already_AddRefed PutCache(const nsACString& aScope, + nsIPrincipal* aPrincipal); + + // Helper for creation of DOM storage objects + nsresult GetStorageInternal(bool aCreate, + nsIPrincipal* aPrincipal, + const nsAString& aDocumentURI, + bool aPrivate, + nsIDOMStorage** aRetval); + + // Scope->cache map + nsTHashtable mCaches; + const nsPIDOMStorage::StorageType mType; + + static PLDHashOperator ClearCacheEnumerator(DOMStorageCacheHashKey* aCache, + void* aClosure); + +protected: + friend class DOMStorageCache; + // Releases cache since it is no longer referrered by any DOMStorage object. + virtual void DropCache(DOMStorageCache* aCache); +}; + +// Derived classes to allow two different contract ids, one for localStorage and +// one for sessionStorage management. localStorage manager is used as service +// scoped to the application while sessionStorage managers are instantiated by each +// top doc shell in the application since sessionStorages are isolated per top level +// browsing context. The code may easily by shared by both. + +class DOMLocalStorageManager MOZ_FINAL : public DOMStorageManager +{ +public: + DOMLocalStorageManager(); + virtual ~DOMLocalStorageManager(); + + // Global getter of localStorage manager service + static DOMLocalStorageManager* Self() { return sSelf; } + +private: + static DOMLocalStorageManager* sSelf; +}; + +class DOMSessionStorageManager MOZ_FINAL : public DOMStorageManager +{ +public: + DOMSessionStorageManager(); +}; + +} // ::dom +} // ::mozilla + +#endif /* nsDOMStorageManager_h__ */ diff --git a/dom/src/storage/DOMStorageObserver.cpp b/dom/src/storage/DOMStorageObserver.cpp new file mode 100644 index 000000000000..8176bd799b2d --- /dev/null +++ b/dom/src/storage/DOMStorageObserver.cpp @@ -0,0 +1,332 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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 "DOMStorageObserver.h" + +#include "DOMStorageDBThread.h" +#include "DOMStorageCache.h" + +#include "nsIObserverService.h" +#include "nsIURI.h" +#include "nsIURL.h" +#include "nsIScriptSecurityManager.h" +#include "nsIPermission.h" +#include "nsIIDNService.h" +#include "mozIApplicationClearPrivateDataParams.h" +#include "nsICookiePermission.h" + +#include "nsPrintfCString.h" +#include "nsXULAppAPI.h" +#include "nsEscape.h" +#include "nsNetCID.h" +#include "mozilla/Services.h" +#include "nsServiceManagerUtils.h" + +namespace mozilla { +namespace dom { + +static const char kStartupTopic[] = "sessionstore-windows-restored"; +static const uint32_t kStartupDelay = 0; + +NS_IMPL_ISUPPORTS2(DOMStorageObserver, + nsIObserver, + nsISupportsWeakReference) + +DOMStorageObserver* DOMStorageObserver::sSelf = nullptr; + +extern nsresult +CreateReversedDomain(const nsACString& aAsciiDomain, nsACString& aKey); + +// static +nsresult +DOMStorageObserver::Init() +{ + if (sSelf) { + return NS_OK; + } + + nsCOMPtr obs = mozilla::services::GetObserverService(); + if (!obs) { + return NS_ERROR_UNEXPECTED; + } + + sSelf = new DOMStorageObserver(); + NS_ADDREF(sSelf); + + // Chrome clear operations. + obs->AddObserver(sSelf, kStartupTopic, true); + obs->AddObserver(sSelf, "cookie-changed", true); + obs->AddObserver(sSelf, "perm-changed", true); + obs->AddObserver(sSelf, "browser:purge-domain-data", true); + obs->AddObserver(sSelf, "last-pb-context-exited", true); + obs->AddObserver(sSelf, "webapps-clear-data", true); + + // Shutdown + obs->AddObserver(sSelf, "profile-after-change", true); + obs->AddObserver(sSelf, "profile-before-change", true); + obs->AddObserver(sSelf, "xpcom-shutdown", true); + +#ifdef DOM_STORAGE_TESTS + // Testing + obs->AddObserver(sSelf, "domstorage-test-flush-force", true); + if (XRE_GetProcessType() == GeckoProcessType_Default) { + // Only to forward to child process. + obs->AddObserver(sSelf, "domstorage-test-flushed", true); + } + + obs->AddObserver(sSelf, "domstorage-test-reload", true); +#endif + + return NS_OK; +} + +// static +nsresult +DOMStorageObserver::Shutdown() +{ + if (!sSelf) { + return NS_ERROR_NOT_INITIALIZED; + } + + NS_RELEASE(sSelf); + return NS_OK; +} + +void +DOMStorageObserver::AddSink(DOMStorageObserverSink* aObs) +{ + mSinks.AppendElement(aObs); +} + +void +DOMStorageObserver::RemoveSink(DOMStorageObserverSink* aObs) +{ + mSinks.RemoveElement(aObs); +} + +void +DOMStorageObserver::Notify(const char* aTopic, const nsACString& aData) +{ + for (uint32_t i = 0; i < mSinks.Length(); ++i) { + DOMStorageObserverSink* sink = mSinks[i]; + sink->Observe(aTopic, aData); + } +} + +NS_IMETHODIMP +DOMStorageObserver::Observe(nsISupports* aSubject, + const char* aTopic, + const PRUnichar* aData) +{ + nsresult rv; + + // Start the thread that opens the database. + if (!strcmp(aTopic, kStartupTopic)) { + nsCOMPtr obs = mozilla::services::GetObserverService(); + obs->RemoveObserver(this, kStartupTopic); + + mDBThreadStartDelayTimer = do_CreateInstance(NS_TIMER_CONTRACTID); + if (!mDBThreadStartDelayTimer) { + return NS_ERROR_UNEXPECTED; + } + + mDBThreadStartDelayTimer->Init(this, nsITimer::TYPE_ONE_SHOT, kStartupDelay); + + return NS_OK; + } + + // Timer callback used to start the database a short timer after startup + if (!strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC)) { + nsCOMPtr timer = do_QueryInterface(aSubject); + if (!timer) { + return NS_ERROR_UNEXPECTED; + } + + if (timer == mDBThreadStartDelayTimer) { + mDBThreadStartDelayTimer = nullptr; + + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + NS_ENSURE_TRUE(db, NS_ERROR_FAILURE); + } + + return NS_OK; + } + + // Clear everything, caches + database + if (!strcmp(aTopic, "cookie-changed")) { + if (!NS_LITERAL_STRING("cleared").Equals(aData)) { + return NS_OK; + } + + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + NS_ENSURE_TRUE(db, NS_ERROR_FAILURE); + + db->AsyncClearAll(); + + Notify("cookie-cleared"); + + return NS_OK; + } + + // Clear from caches everything that has been stored + // while in session-only mode + if (!strcmp(aTopic, "perm-changed")) { + // Check for cookie permission change + nsCOMPtr perm(do_QueryInterface(aSubject)); + if (!perm) { + return NS_OK; + } + + nsAutoCString type; + perm->GetType(type); + if (type != NS_LITERAL_CSTRING("cookie")) { + return NS_OK; + } + + uint32_t cap = 0; + perm->GetCapability(&cap); + if (!(cap & nsICookiePermission::ACCESS_SESSION) || + !NS_LITERAL_STRING("deleted").Equals(nsDependentString(aData))) { + return NS_OK; + } + + nsAutoCString host; + perm->GetHost(host); + if (host.IsEmpty()) { + return NS_OK; + } + + nsAutoCString scope; + rv = CreateReversedDomain(host, scope); + NS_ENSURE_SUCCESS(rv, rv); + + Notify("session-only-cleared", scope); + + return NS_OK; + } + + // Clear everything (including so and pb data) from caches and database + // for the gived domain and subdomains. + if (!strcmp(aTopic, "browser:purge-domain-data")) { + // Convert the domain name to the ACE format + nsAutoCString aceDomain; + nsCOMPtr converter = do_GetService(NS_IDNSERVICE_CONTRACTID); + if (converter) { + rv = converter->ConvertUTF8toACE(NS_ConvertUTF16toUTF8(aData), aceDomain); + NS_ENSURE_SUCCESS(rv, rv); + } else { + // In case the IDN service is not available, this is the best we can come up with! + NS_EscapeURL(NS_ConvertUTF16toUTF8(aData), + esc_OnlyNonASCII | esc_AlwaysCopy, + aceDomain); + } + + nsAutoCString scopePrefix; + rv = CreateReversedDomain(aceDomain, scopePrefix); + NS_ENSURE_SUCCESS(rv, rv); + + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + NS_ENSURE_TRUE(db, NS_ERROR_FAILURE); + + db->AsyncClearMatchingScope(scopePrefix); + + Notify("domain-data-cleared", scopePrefix); + + return NS_OK; + } + + // Clear all private-browsing caches + if (!strcmp(aTopic, "last-pb-context-exited")) { + Notify("private-browsing-data-cleared"); + + return NS_OK; + } + + // Clear data beloging to an app. + if (!strcmp(aTopic, "webapps-clear-data")) { + nsCOMPtr params = + do_QueryInterface(aSubject); + if (!params) { + NS_ERROR("'webapps-clear-data' notification's subject should be a mozIApplicationClearPrivateDataParams"); + return NS_ERROR_UNEXPECTED; + } + + uint32_t appId; + bool browserOnly; + + rv = params->GetAppId(&appId); + NS_ENSURE_SUCCESS(rv, rv); + + rv = params->GetBrowserOnly(&browserOnly); + NS_ENSURE_SUCCESS(rv, rv); + + MOZ_ASSERT(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID); + + DOMStorageDBBridge* db = DOMStorageCache::StartDatabase(); + NS_ENSURE_TRUE(db, NS_ERROR_FAILURE); + + nsAutoCString scope; + scope.AppendInt(appId); + scope.Append(NS_LITERAL_CSTRING(":t:")); + db->AsyncClearMatchingScope(scope); + Notify("app-data-cleared", scope); + + if (!browserOnly) { + scope.Truncate(); + scope.AppendInt(appId); + scope.Append(NS_LITERAL_CSTRING(":f:")); + db->AsyncClearMatchingScope(scope); + Notify("app-data-cleared", scope); + } + + return NS_OK; + } + + if (!strcmp(aTopic, "profile-after-change")) { + Notify("profile-change"); + + return NS_OK; + } + + if (!strcmp(aTopic, "profile-before-change") || + !strcmp(aTopic, "xpcom-shutdown")) { + rv = DOMStorageCache::StopDatabase(); + if (NS_FAILED(rv)) { + NS_WARNING("Error while stopping DOMStorage DB background thread"); + } + + return NS_OK; + } + +#ifdef DOM_STORAGE_TESTS + if (!strcmp(aTopic, "domstorage-test-flush-force")) { + DOMStorageDBBridge* db = DOMStorageCache::GetDatabase(); + if (db) { + db->AsyncFlush(); + } + + return NS_OK; + } + + if (!strcmp(aTopic, "domstorage-test-flushed")) { + // Only used to propagate to IPC children + Notify("test-flushed"); + + return NS_OK; + } + + if (!strcmp(aTopic, "domstorage-test-reload")) { + Notify("test-reload"); + + return NS_OK; + } +#endif + + NS_ERROR("Unexpected topic"); + return NS_ERROR_UNEXPECTED; +} + +} // ::dom +} // ::mozilla diff --git a/dom/src/storage/DOMStorageObserver.h b/dom/src/storage/DOMStorageObserver.h new file mode 100644 index 000000000000..24903e641c5b --- /dev/null +++ b/dom/src/storage/DOMStorageObserver.h @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef nsIDOMStorageObserver_h__ +#define nsIDOMStorageObserver_h__ + +#include "nsIObserver.h" +#include "nsITimer.h" +#include "nsWeakReference.h" +#include "nsTArray.h" +#include "nsString.h" + +namespace mozilla { +namespace dom { + +class DOMStorageObserver; + +// Implementers are DOMStorageManager and DOMStorageDBParent to forward to +// child processes. +class DOMStorageObserverSink +{ +public: + virtual ~DOMStorageObserverSink() {} + +private: + friend class DOMStorageObserver; + virtual nsresult Observe(const char* aTopic, const nsACString& aScopePrefix) = 0; +}; + +// Statically (though layout statics) initialized observer receiving and processing +// chrome clearing notifications, such as cookie deletion etc. +class DOMStorageObserver : public nsIObserver + , public nsSupportsWeakReference +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIOBSERVER + + virtual ~DOMStorageObserver() {} + + static nsresult Init(); + static nsresult Shutdown(); + static DOMStorageObserver* Self() { return sSelf; } + + void AddSink(DOMStorageObserverSink* aObs); + void RemoveSink(DOMStorageObserverSink* aObs); + void Notify(const char* aTopic, const nsACString& aData = EmptyCString()); + +private: + static DOMStorageObserver* sSelf; + + // Weak references + nsTArray mSinks; + nsCOMPtr mDBThreadStartDelayTimer; +}; + +} // ::dom +} // ::mozilla + +#endif diff --git a/dom/src/storage/Makefile.in b/dom/src/storage/Makefile.in index 5dbb19b37030..347c718fd273 100644 --- a/dom/src/storage/Makefile.in +++ b/dom/src/storage/Makefile.in @@ -15,18 +15,16 @@ LIBRARY_NAME = jsdomstorage_s LIBXUL_LIBRARY = 1 CPPSRCS = \ - nsDOMStorage.cpp \ - nsDOMStorageBaseDB.cpp \ - nsDOMStorageDBWrapper.cpp \ - nsLocalStorageCache.cpp \ - nsDOMStoragePersistentDB.cpp \ - nsDOMStorageMemoryDB.cpp \ - StorageChild.cpp \ - StorageParent.cpp \ + DOMStorage.cpp \ + DOMStorageCache.cpp \ + DOMStorageDBThread.cpp \ + DOMStorageObserver.cpp \ + DOMStorageManager.cpp \ + DOMStorageIPC.cpp \ $(NULL) EXPORTS_NAMESPACES = mozilla/dom -EXPORTS_mozilla/dom = StorageChild.h StorageParent.h +EXPORTS_mozilla/dom = DOMStorageIPC.h # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 @@ -37,6 +35,10 @@ LOCAL_INCLUDES = \ DEFINES += -D_IMPL_NS_LAYOUT +ifdef ENABLE_TESTS +DEFINES += -DDOM_STORAGE_TESTS +endif + include $(topsrcdir)/config/config.mk include $(topsrcdir)/ipc/chromium/chromium-config.mk include $(topsrcdir)/config/rules.mk diff --git a/dom/src/storage/PStorage.ipdl b/dom/src/storage/PStorage.ipdl index ff05e8f90c01..f9dbef797043 100644 --- a/dom/src/storage/PStorage.ipdl +++ b/dom/src/storage/PStorage.ipdl @@ -6,61 +6,37 @@ include protocol PContent; -using mozilla::null_t; - namespace mozilla { namespace dom { -struct ItemData -{ - nsString value; - bool secure; -}; - -// A cross-process GetValue result -- either null, or containing the parameters -// with which to initialize an nsIDOMStorageItem. -union StorageItem -{ - null_t; - ItemData; -}; - -// This protocol is little more than a thin wrapper around the DOMStorageBase -// class in nsDOMStorage.h. The child implementation simply forwards the -// arguments for any given call to the parent, and returns the result. +/* This protocol bridges async access to the database thread running on the parent process + * and caches running on the child process. + */ sync protocol PStorage { manager PContent; parent: - __delete__(); + async __delete__(); - Init(bool useDB, bool sessionOnly, bool isPrivate, - nsCString scopeDBKey, nsCString quotaDBKey, uint32_t storageType); + sync Preload(nsCString scope, uint32_t alreadyLoadedCount) + returns (nsString[] keys, nsString[] values, nsresult rv); + + async AsyncPreload(nsCString scope, bool priority); + async AsyncGetUsage(nsCString scope); + async AsyncAddItem(nsCString scope, nsString key, nsString value); + async AsyncUpdateItem(nsCString scope, nsString key, nsString value); + async AsyncRemoveItem(nsCString scope, nsString key); + async AsyncClear(nsCString scope); + async AsyncFlush(); - sync GetKeys(bool callerSecure) - returns (nsString[] keys); - sync GetLength(bool callerSecure, bool sessionOnly) - returns (uint32_t length, nsresult rv); - sync GetKey(bool callerSecure, bool sessionOnly, uint32_t index) - returns (nsString key, nsresult rv); - sync GetValue(bool callerSecure, bool sessionOnly, nsString key) - returns (StorageItem item, nsresult rv); - sync SetValue(bool callerSecure, bool sessionOnly, nsString key, nsString data) - returns (nsString oldValue, nsresult rv); - sync RemoveValue(bool callerSecure, bool sessionOnly, nsString key) - returns (nsString oldValue, nsresult rv); - sync Clear(bool callerSecure, bool sessionOnly) - returns (int32_t oldCount, nsresult rv); - - sync GetDBValue(nsString key) - returns (nsString value, bool secure, nsresult rv); - sync SetDBValue(nsString key, nsString value, bool secure) - returns (nsresult rv); - sync SetSecure(nsString key, bool secure) - returns (nsresult rv); - - UpdatePrivateState(bool enabled); +child: + async Observe(nsCString topic, nsCString scopePrefix); + async ScopesHavingData(nsCString[] scopes); + async LoadItem(nsCString scope, nsString key, nsString value); + async LoadDone(nsCString scope, nsresult rv); + async LoadUsage(nsCString scope, int64_t usage); + async Error(nsresult rv); }; } diff --git a/dom/src/storage/StorageChild.cpp b/dom/src/storage/StorageChild.cpp deleted file mode 100644 index 884267a2952a..000000000000 --- a/dom/src/storage/StorageChild.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ -/* 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 "StorageChild.h" -#include "mozilla/dom/ContentChild.h" -#include "nsError.h" - -#include "GeckoProfiler.h" - -namespace mozilla { -namespace dom { - -NS_IMPL_CYCLE_COLLECTION_1(StorageChild, mStorage) - -NS_IMPL_CYCLE_COLLECTING_ADDREF(StorageChild) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StorageChild) - NS_INTERFACE_MAP_ENTRY(nsIPrivacyTransitionObserver) - NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrivacyTransitionObserver) -NS_INTERFACE_MAP_END - -NS_IMETHODIMP_(nsrefcnt) StorageChild::Release(void) -{ - NS_PRECONDITION(0 != mRefCnt, "dup release"); - NS_ASSERT_OWNINGTHREAD(StorageChild); - nsISupports* base = NS_CYCLE_COLLECTION_CLASSNAME(StorageChild)::Upcast(this); - nsrefcnt count = mRefCnt.decr(base); - NS_LOG_RELEASE(this, count, "StorageChild"); - if (count == 1 && mIPCOpen) { - Send__delete__(this); - return 0; - } - if (count == 0) { - mRefCnt.stabilizeForDeletion(); - delete this; - return 0; - } - return count; -} - -StorageChild::StorageChild(nsDOMStorage* aOwner) -: mStorage(aOwner) -, mIPCOpen(false) -{ -} - -StorageChild::StorageChild(nsDOMStorage* aOwner, StorageChild& aOther) -: DOMStorageBase(aOther) -, mStorage(aOwner) -, mIPCOpen(false) -{ -} - -void -StorageChild::AddIPDLReference() -{ - NS_ABORT_IF_FALSE(!mIPCOpen, "Attempting to retain multiple IPDL references"); - mIPCOpen = true; - AddRef(); -} - -void -StorageChild::ReleaseIPDLReference() -{ - NS_ABORT_IF_FALSE(mIPCOpen, "Attempting to release non-existent IPDL reference"); - mIPCOpen = false; - Release(); -} - -bool -StorageChild::CacheStoragePermissions() -{ - nsDOMStorage* storage = static_cast(mStorage.get()); - return storage->CacheStoragePermissions(); -} - -void -StorageChild::InitRemote() -{ - ContentChild* child = ContentChild::GetSingleton(); - AddIPDLReference(); - child->SendPStorageConstructor(this, null_t()); - SendInit(mUseDB, mSessionOnly, mInPrivateBrowsing, mScopeDBKey, - mQuotaDBKey, mStorageType); -} - -void -StorageChild::InitAsSessionStorage(nsIPrincipal* aPrincipal, bool aPrivate) -{ - DOMStorageBase::InitAsSessionStorage(aPrincipal, aPrivate); - InitRemote(); -} - -void -StorageChild::InitAsLocalStorage(nsIPrincipal* aPrincipal, bool aPrivate) -{ - DOMStorageBase::InitAsLocalStorage(aPrincipal, aPrivate); - InitRemote(); -} - -nsTArray* -StorageChild::GetKeys(bool aCallerSecure) -{ - InfallibleTArray remoteKeys; - SendGetKeys(aCallerSecure, &remoteKeys); - nsTArray* keys = new nsTArray; - *keys = remoteKeys; - return keys; -} - -nsresult -StorageChild::GetLength(bool aCallerSecure, uint32_t* aLength) -{ - nsresult rv; - SendGetLength(aCallerSecure, mSessionOnly, aLength, &rv); - return rv; -} - -nsresult -StorageChild::GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey) -{ - nsresult rv; - nsString key; - SendGetKey(aCallerSecure, mSessionOnly, aIndex, &key, &rv); - if (NS_FAILED(rv)) - return rv; - aKey = key; - return NS_OK; -} - -// Unlike other cross-process forwarding methods, GetValue needs to replicate -// the following behaviour of DOMStorageImpl::GetValue: -// -// - if a security error occurs, or the item isn't found, return null without -// propogating the error. -// -// If DOMStorageImpl::GetValue ever changes its behaviour, this should be kept -// in sync. -nsIDOMStorageItem* -StorageChild::GetValue(bool aCallerSecure, const nsAString& aKey, nsresult* rv) -{ - PROFILER_LABEL("StorageChild", "GetValue"); - nsresult rv2 = *rv = NS_OK; - StorageItem storageItem; - SendGetValue(aCallerSecure, mSessionOnly, nsString(aKey), &storageItem, &rv2); - if (rv2 == NS_ERROR_DOM_SECURITY_ERR || rv2 == NS_ERROR_DOM_NOT_FOUND_ERR) - return nullptr; - *rv = rv2; - if (NS_FAILED(*rv) || storageItem.type() == StorageItem::Tnull_t) - return nullptr; - const ItemData& data = storageItem.get_ItemData(); - nsIDOMStorageItem* item = new nsDOMStorageItem(this, aKey, data.value(), - data.secure()); - return item; -} - -nsresult -StorageChild::SetValue(bool aCallerSecure, const nsAString& aKey, - const nsAString& aData, nsAString& aOldData) -{ - nsresult rv; - nsString oldData; - SendSetValue(aCallerSecure, mSessionOnly, nsString(aKey), nsString(aData), - &oldData, &rv); - if (NS_FAILED(rv)) - return rv; - aOldData = oldData; - return NS_OK; -} - -nsresult -StorageChild::RemoveValue(bool aCallerSecure, const nsAString& aKey, - nsAString& aOldData) -{ - nsresult rv; - nsString oldData; - SendRemoveValue(aCallerSecure, mSessionOnly, nsString(aKey), &oldData, &rv); - if (NS_FAILED(rv)) - return rv; - aOldData = oldData; - return NS_OK; -} - -nsresult -StorageChild::Clear(bool aCallerSecure, int32_t* aOldCount) -{ - nsresult rv; - int32_t oldCount; - SendClear(aCallerSecure, mSessionOnly, &oldCount, &rv); - if (NS_FAILED(rv)) - return rv; - *aOldCount = oldCount; - return NS_OK; -} - -nsresult -StorageChild::GetDBValue(const nsAString& aKey, nsAString& aValue, - bool* aSecure) -{ - nsresult rv; - nsString value; - SendGetDBValue(nsString(aKey), &value, aSecure, &rv); - aValue = value; - return rv; -} - -nsresult -StorageChild::SetDBValue(const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - nsresult rv; - SendSetDBValue(nsString(aKey), nsString(aValue), aSecure, &rv); - return rv; -} - -nsresult -StorageChild::SetSecure(const nsAString& aKey, bool aSecure) -{ - nsresult rv; - SendSetSecure(nsString(aKey), aSecure, &rv); - return rv; -} - -nsresult -StorageChild::CloneFrom(bool aCallerSecure, DOMStorageBase* aThat) -{ - StorageChild* other = static_cast(aThat); - ContentChild* child = ContentChild::GetSingleton(); - StorageClone clone(nullptr, other, aCallerSecure); - AddIPDLReference(); - child->SendPStorageConstructor(this, clone); - SendInit(mUseDB, mSessionOnly, mInPrivateBrowsing, - mScopeDBKey, mQuotaDBKey, mStorageType); - return NS_OK; -} - -NS_IMETHODIMP -StorageChild::PrivateModeChanged(bool enabled) -{ - mInPrivateBrowsing = enabled; - SendUpdatePrivateState(enabled); - return NS_OK; -} - -} -} diff --git a/dom/src/storage/StorageChild.h b/dom/src/storage/StorageChild.h deleted file mode 100644 index 4f922a32cf27..000000000000 --- a/dom/src/storage/StorageChild.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ -/* 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/. */ - -#ifndef mozilla_dom_StorageChild_h -#define mozilla_dom_StorageChild_h - -#include "mozilla/dom/PStorageChild.h" -#include "nsDOMStorage.h" -#include "nsCycleCollectionParticipant.h" - -namespace mozilla { -namespace dom { - -class StorageChild : public PStorageChild - , public DOMStorageBase - , public nsSupportsWeakReference -{ -public: - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(StorageChild, nsIPrivacyTransitionObserver) - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_NSIPRIVACYTRANSITIONOBSERVER - - StorageChild(nsDOMStorage* aOwner); - StorageChild(nsDOMStorage* aOwner, StorageChild& aOther); - - virtual void InitAsSessionStorage(nsIPrincipal* aPrincipal, bool aPrivate); - virtual void InitAsLocalStorage(nsIPrincipal* aPrincipal, bool aPrivate); - - virtual bool CacheStoragePermissions(); - - virtual nsTArray* GetKeys(bool aCallerSecure); - virtual nsresult GetLength(bool aCallerSecure, uint32_t* aLength); - virtual nsresult GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey); - virtual nsIDOMStorageItem* GetValue(bool aCallerSecure, const nsAString& aKey, - nsresult* rv); - virtual nsresult SetValue(bool aCallerSecure, const nsAString& aKey, - const nsAString& aData, nsAString& aOldValue); - virtual nsresult RemoveValue(bool aCallerSecure, const nsAString& aKey, - nsAString& aOldValue); - virtual nsresult Clear(bool aCallerSecure, int32_t* aOldCount); - - virtual nsresult GetDBValue(const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - virtual nsresult SetDBValue(const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - virtual nsresult SetSecure(const nsAString& aKey, bool aSecure); - - virtual nsresult CloneFrom(bool aCallerSecure, DOMStorageBase* aThat); - - void AddIPDLReference(); - void ReleaseIPDLReference(); - -private: - void InitRemote(); - - // Unimplemented - StorageChild(const StorageChild&); - - nsCOMPtr mStorage; - bool mIPCOpen; -}; - -} -} - -#endif diff --git a/dom/src/storage/StorageParent.cpp b/dom/src/storage/StorageParent.cpp deleted file mode 100644 index 87df1f909e06..000000000000 --- a/dom/src/storage/StorageParent.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ -/* 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 "StorageParent.h" -#include "mozilla/dom/PContentParent.h" -#include "mozilla/unused.h" -#include "nsDOMString.h" - -using mozilla::unused; - -namespace mozilla { -namespace dom { - -StorageParent::StorageParent(const StorageConstructData& aData) -{ - if (aData.type() == StorageConstructData::Tnull_t) { - mStorage = new DOMStorageImpl(nullptr); - } else { - const StorageClone& clone = aData.get_StorageClone(); - StorageParent* other = static_cast(clone.actorParent()); - mStorage = new DOMStorageImpl(nullptr, *other->mStorage.get()); - mStorage->CloneFrom(clone.callerSecure(), other->mStorage); - } -} - -bool -StorageParent::RecvInit(const bool& aUseDB, - const bool& aSessionOnly, - const bool& aPrivate, - const nsCString& aScopeDBKey, - const nsCString& aQuotaDBKey, - const uint32_t& aStorageType) -{ - mStorage->InitFromChild(aUseDB, aSessionOnly, aPrivate, - aScopeDBKey, aQuotaDBKey, - aStorageType); - return true; -} - -bool -StorageParent::RecvUpdatePrivateState(const bool& aEnabled) -{ - mStorage->PrivateModeChanged(aEnabled); - return true; -} - -bool -StorageParent::RecvGetKeys(const bool& aCallerSecure, InfallibleTArray* aKeys) -{ - // Callers are responsible for deallocating the array returned by mStorage->GetKeys - nsAutoPtr > keys(mStorage->GetKeys(aCallerSecure)); - aKeys->SwapElements(*keys); - return true; -} - -bool -StorageParent::RecvGetLength(const bool& aCallerSecure, const bool& aSessionOnly, - uint32_t* aLength, nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - *rv = mStorage->GetLength(aCallerSecure, aLength); - return true; -} - -bool -StorageParent::RecvGetKey(const bool& aCallerSecure, const bool& aSessionOnly, - const uint32_t& aIndex, nsString* aKey, nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - *rv = mStorage->GetKey(aCallerSecure, aIndex, *aKey); - return true; -} - -bool -StorageParent::RecvGetValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, StorageItem* aItem, - nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - - // We need to ensure that a proper null representation is sent to the child - // if no item is found or an error occurs. - - *rv = NS_OK; - nsCOMPtr item = mStorage->GetValue(aCallerSecure, aKey, rv); - if (NS_FAILED(*rv) || !item) { - *aItem = null_t(); - return true; - } - - ItemData data(EmptyString(), false); - nsDOMStorageItem* internalItem = static_cast(item.get()); - data.value() = internalItem->GetValueInternal(); - if (aCallerSecure) - data.secure() = internalItem->IsSecure(); - *aItem = data; - return true; -} - -bool -StorageParent::RecvSetValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, const nsString& aData, - nsString* aOldValue, nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - *rv = mStorage->SetValue(aCallerSecure, aKey, aData, *aOldValue); - return true; -} - -bool -StorageParent::RecvRemoveValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, nsString* aOldValue, - nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - *rv = mStorage->RemoveValue(aCallerSecure, aKey, *aOldValue); - return true; -} - -bool -StorageParent::RecvClear(const bool& aCallerSecure, const bool& aSessionOnly, - int32_t* aOldCount, nsresult* rv) -{ - mStorage->SetSessionOnly(aSessionOnly); - *rv = mStorage->Clear(aCallerSecure, aOldCount); - return true; -} - -bool -StorageParent::RecvGetDBValue(const nsString& aKey, nsString* aValue, - bool* aSecure, nsresult* rv) -{ - *rv = mStorage->GetDBValue(aKey, *aValue, aSecure); - return true; -} - -bool -StorageParent::RecvSetDBValue(const nsString& aKey, const nsString& aValue, - const bool& aSecure, nsresult* rv) -{ - *rv = mStorage->SetDBValue(aKey, aValue, aSecure); - return true; -} - -bool -StorageParent::RecvSetSecure(const nsString& aKey, const bool& aSecure, - nsresult* rv) -{ - *rv = mStorage->SetSecure(aKey, aSecure); - return true; -} - -} -} diff --git a/dom/src/storage/StorageParent.h b/dom/src/storage/StorageParent.h deleted file mode 100644 index 47f9ff5db15c..000000000000 --- a/dom/src/storage/StorageParent.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ -/* 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/. */ - -#ifndef mozilla_dom_StorageParent_h -#define mozilla_dom_StorageParent_h - -#include "mozilla/dom/PStorageParent.h" -#include "nsDOMStorage.h" - -namespace mozilla { -namespace dom { - -class StorageConstructData; - -class StorageParent : public PStorageParent -{ -public: - StorageParent(const StorageConstructData& aData); - -private: - bool RecvGetKeys(const bool& aCallerSecure, InfallibleTArray* aKeys); - bool RecvGetLength(const bool& aCallerSecure, const bool& aSessionOnly, - uint32_t* aLength, nsresult* rv); - bool RecvGetKey(const bool& aCallerSecure, const bool& aSessionOnly, - const uint32_t& aIndex,nsString* aKey, nsresult* rv); - bool RecvGetValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, StorageItem* aItem, nsresult* rv); - bool RecvSetValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, const nsString& aData, - nsString* aOldValue, nsresult* rv); - bool RecvRemoveValue(const bool& aCallerSecure, const bool& aSessionOnly, - const nsString& aKey, nsString* aOldData, nsresult* rv); - bool RecvClear(const bool& aCallerSecure, const bool& aSessionOnly, - int32_t* aOldCount, nsresult* rv); - - bool RecvGetDBValue(const nsString& aKey, nsString* aValue, bool* aSecure, - nsresult* rv); - bool RecvSetDBValue(const nsString& aKey, const nsString& aValue, - const bool& aSecure, nsresult* rv); - bool RecvSetSecure(const nsString& aKey, const bool& aSecure, nsresult* rv); - - bool RecvInit(const bool& aUseDB, - const bool& aSessionOnly, - const bool& aPrivate, - const nsCString& aScopeDBKey, - const nsCString& aQuotaDBKey, - const uint32_t& aStorageType); - - bool RecvUpdatePrivateState(const bool& aEnabled); - - nsRefPtr mStorage; -}; - -} -} - -#endif diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp deleted file mode 100644 index 028b0cd0e482..000000000000 --- a/dom/src/storage/nsDOMStorage.cpp +++ /dev/null @@ -1,1808 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "mozilla/DebugOnly.h" - -#include "StorageChild.h" -#include "StorageParent.h" -#include "mozilla/dom/ContentChild.h" -#include "nsXULAppAPI.h" -using mozilla::dom::StorageChild; -using mozilla::dom::ContentChild; - -#include "prnetdb.h" -#include "nsCOMPtr.h" -#include "nsError.h" -#include "nsDOMClassInfoID.h" -#include "nsDOMJSUtils.h" -#include "nsUnicharUtils.h" -#include "nsDOMStorage.h" -#include "nsEscape.h" -#include "nsContentUtils.h" -#include "nsIScriptSecurityManager.h" -#include "nsIPrincipal.h" -#include "nsIURI.h" -#include "nsReadableUtils.h" -#include "nsIObserverService.h" -#include "nsNetUtil.h" -#include "nsICookiePermission.h" -#include "nsIPermission.h" -#include "nsIPermissionManager.h" -#include "nsCycleCollectionParticipant.h" -#include "nsIJSContextStack.h" -#include "nsDOMString.h" -#include "nsNetCID.h" -#include "mozilla/Preferences.h" -#include "nsThreadUtils.h" -#include "mozilla/Telemetry.h" -#include "DictionaryHelpers.h" -#include "GeneratedEvents.h" -#include "mozIApplicationClearPrivateDataParams.h" - -// calls FlushAndEvictFromCache(false) -#define NS_DOMSTORAGE_FLUSH_TIMER_TOPIC "domstorage-flush-timer" - -// calls FlushAndEvictFromCache(false) -#define NS_DOMSTORAGE_FLUSH_FORCE_TOPIC "domstorage-flush-force" - -using namespace mozilla; - -static const uint32_t ASK_BEFORE_ACCEPT = 1; -static const uint32_t ACCEPT_SESSION = 2; -static const uint32_t BEHAVIOR_REJECT = 2; - -static const char kPermissionType[] = "cookie"; -static const char kStorageEnabled[] = "dom.storage.enabled"; -static const char kCookiesBehavior[] = "network.cookie.cookieBehavior"; -static const char kCookiesLifetimePolicy[] = "network.cookie.lifetimePolicy"; - -// -// Helper that tells us whether the caller is secure or not. -// - -static bool -IsCallerSecure() -{ - nsCOMPtr subjectPrincipal; - nsresult rv = nsContentUtils::GetSecurityManager()-> - GetSubjectPrincipal(getter_AddRefs(subjectPrincipal)); - NS_ENSURE_SUCCESS(rv, false); - - if (!subjectPrincipal) { - // No subject principal means no code is running. Default to not - // being secure in that case. - - return false; - } - - nsCOMPtr codebase; - subjectPrincipal->GetURI(getter_AddRefs(codebase)); - - if (!codebase) { - return false; - } - - nsCOMPtr innerUri = NS_GetInnermostURI(codebase); - - if (!innerUri) { - return false; - } - - bool isHttps = false; - rv = innerUri->SchemeIs("https", &isHttps); - - return NS_SUCCEEDED(rv) && isHttps; -} - -nsSessionStorageEntry::nsSessionStorageEntry(KeyTypePointer aStr) - : nsStringHashKey(aStr), mItem(nullptr) -{ -} - -nsSessionStorageEntry::nsSessionStorageEntry(const nsSessionStorageEntry& aToCopy) - : nsStringHashKey(aToCopy), mItem(nullptr) -{ - NS_ERROR("We're horked."); -} - -nsSessionStorageEntry::~nsSessionStorageEntry() -{ -} - -// -// nsDOMStorageManager -// - -nsDOMStorageManager* nsDOMStorageManager::gStorageManager; - -nsDOMStorageManager::nsDOMStorageManager() -{ -} - -NS_IMPL_ISUPPORTS3(nsDOMStorageManager, - nsIDOMStorageManager, - nsIObserver, - nsISupportsWeakReference) - -//static -nsresult -nsDOMStorageManager::Initialize() -{ - gStorageManager = new nsDOMStorageManager(); - if (!gStorageManager) - return NS_ERROR_OUT_OF_MEMORY; - - gStorageManager->mStorages.Init(); - NS_ADDREF(gStorageManager); - - // No observers needed in non-chrome - if (XRE_GetProcessType() != GeckoProcessType_Default) - return NS_OK; - - nsCOMPtr os = mozilla::services::GetObserverService(); - if (!os) - return NS_OK; - - nsresult rv; - rv = os->AddObserver(gStorageManager, "cookie-changed", true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, "profile-after-change", true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, "perm-changed", true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, "browser:purge-domain-data", true); - NS_ENSURE_SUCCESS(rv, rv); - // Used for temporary table flushing - rv = os->AddObserver(gStorageManager, "profile-before-change", true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, "last-pb-context-exited", true); - NS_ENSURE_SUCCESS(rv, rv); - rv = os->AddObserver(gStorageManager, "webapps-clear-data", true); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -//static -nsDOMStorageManager* -nsDOMStorageManager::GetInstance() -{ - NS_ASSERTION(gStorageManager, - "nsDOMStorageManager::GetInstance() called before Initialize()"); - NS_IF_ADDREF(gStorageManager); - return gStorageManager; -} - -//static -void -nsDOMStorageManager::Shutdown() -{ - NS_IF_RELEASE(gStorageManager); - gStorageManager = nullptr; - - ShutdownDB(); -} - -//static -void -nsDOMStorageManager::ShutdownDB() -{ - delete DOMStorageImpl::gStorageDB; - DOMStorageImpl::gStorageDB = nullptr; -} - -static PLDHashOperator -ClearStorage(nsDOMStorageEntry* aEntry, void* userArg) -{ - aEntry->mStorage->ClearAll(); - return PL_DHASH_REMOVE; -} - -static PLDHashOperator -ClearStorageIfDomainMatches(nsDOMStorageEntry* aEntry, void* userArg) -{ - nsAutoCString* aKey = static_cast (userArg); - if (StringBeginsWith(aEntry->mStorage->GetScopeDBKey(), *aKey)) { - aEntry->mStorage->ClearAll(); - } - return PL_DHASH_REMOVE; -} - -nsresult -nsDOMStorageManager::Observe(nsISupports *aSubject, - const char *aTopic, - const PRUnichar *aData) -{ - if (!strcmp(aTopic, "profile-after-change")) { - } else if (!strcmp(aTopic, "cookie-changed") && - !nsCRT::strcmp(aData, NS_LITERAL_STRING("cleared").get())) { - mStorages.EnumerateEntries(ClearStorage, nullptr); - - nsresult rv = DOMStorageImpl::InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - return DOMStorageImpl::gStorageDB->RemoveAll(); - } else if (!strcmp(aTopic, "perm-changed")) { - // Check for cookie permission change - nsCOMPtr perm(do_QueryInterface(aSubject)); - if (perm) { - nsAutoCString type; - perm->GetType(type); - if (type != NS_LITERAL_CSTRING("cookie")) - return NS_OK; - - uint32_t cap = 0; - perm->GetCapability(&cap); - if (!(cap & nsICookiePermission::ACCESS_SESSION) || - nsDependentString(aData) != NS_LITERAL_STRING("deleted")) - return NS_OK; - - nsAutoCString host; - perm->GetHost(host); - if (host.IsEmpty()) - return NS_OK; - - nsresult rv = DOMStorageImpl::InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - return DOMStorageImpl::gStorageDB->DropSessionOnlyStoragesForHost(host); - } - } else if (!strcmp(aTopic, "timer-callback")) { - nsCOMPtr obsserv = mozilla::services::GetObserverService(); - if (obsserv) - obsserv->NotifyObservers(nullptr, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, nullptr); - } else if (!strcmp(aTopic, "browser:purge-domain-data")) { - // Convert the domain name to the ACE format - nsAutoCString aceDomain; - nsresult rv; - nsCOMPtr converter = do_GetService(NS_IDNSERVICE_CONTRACTID); - if (converter) { - rv = converter->ConvertUTF8toACE(NS_ConvertUTF16toUTF8(aData), aceDomain); - NS_ENSURE_SUCCESS(rv, rv); - } else { - // In case the IDN service is not available, this is the best we can come up with! - NS_EscapeURL(NS_ConvertUTF16toUTF8(aData), - esc_OnlyNonASCII | esc_AlwaysCopy, - aceDomain); - } - - nsAutoCString key; - rv = nsDOMStorageDBWrapper::CreateReversedDomain(aceDomain, key); - NS_ENSURE_SUCCESS(rv, rv); - - // Clear the storage entries for matching domains - mStorages.EnumerateEntries(ClearStorageIfDomainMatches, &key); - - rv = DOMStorageImpl::InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - DOMStorageImpl::gStorageDB->RemoveOwner(aceDomain); - } else if (!strcmp(aTopic, "profile-before-change")) { - if (DOMStorageImpl::gStorageDB) { - DebugOnly rv = - DOMStorageImpl::gStorageDB->FlushAndEvictFromCache(true); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "DOMStorage: cache commit failed"); - DOMStorageImpl::gStorageDB->Close(); - nsDOMStorageManager::ShutdownDB(); - } - } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC)) { - if (DOMStorageImpl::gStorageDB) { - DebugOnly rv = - DOMStorageImpl::gStorageDB->FlushAndEvictFromCache(false); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "DOMStorage: cache commit failed"); - } - } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_FORCE_TOPIC)) { - if (DOMStorageImpl::gStorageDB) { - DebugOnly rv = - DOMStorageImpl::gStorageDB->FlushAndEvictFromCache(false); - NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), - "DOMStorage: cache commit failed"); - } - } else if (!strcmp(aTopic, "last-pb-context-exited")) { - if (DOMStorageImpl::gStorageDB) { - return DOMStorageImpl::gStorageDB->DropPrivateBrowsingStorages(); - } - } else if (!strcmp(aTopic, "webapps-clear-data")) { - if (!DOMStorageImpl::gStorageDB) { - return NS_OK; - } - - nsCOMPtr params = - do_QueryInterface(aSubject); - if (!params) { - NS_ERROR("'webapps-clear-data' notification's subject should be a mozIApplicationClearPrivateDataParams"); - return NS_ERROR_UNEXPECTED; - } - - uint32_t appId; - bool browserOnly; - - nsresult rv = params->GetAppId(&appId); - NS_ENSURE_SUCCESS(rv, rv); - - rv = params->GetBrowserOnly(&browserOnly); - NS_ENSURE_SUCCESS(rv, rv); - - MOZ_ASSERT(appId != nsIScriptSecurityManager::UNKNOWN_APP_ID); - - return DOMStorageImpl::gStorageDB->RemoveAllForApp(appId, browserOnly); - } - - return NS_OK; -} - -NS_IMETHODIMP -nsDOMStorageManager::GetUsage(const nsAString& aDomain, - int32_t *aUsage) -{ - nsresult rv = DOMStorageImpl::InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - return DOMStorageImpl::gStorageDB->GetUsage(NS_ConvertUTF16toUTF8(aDomain), - aUsage, false); -} - -NS_IMETHODIMP -nsDOMStorageManager::GetLocalStorageForPrincipal(nsIPrincipal *aPrincipal, - const nsSubstring &aDocumentURI, - bool aPrivate, - nsIDOMStorage **aResult) -{ - NS_ENSURE_ARG_POINTER(aPrincipal); - *aResult = nullptr; - - nsresult rv; - - nsRefPtr storage = new nsDOMStorage2(); - if (!storage) - return NS_ERROR_OUT_OF_MEMORY; - - rv = storage->InitAsLocalStorage(aPrincipal, aDocumentURI, aPrivate); - if (NS_FAILED(rv)) - return rv; - - *aResult = storage.get(); - storage.forget(); - - return NS_OK; -} - -void -nsDOMStorageManager::AddToStoragesHash(DOMStorageImpl* aStorage) -{ - nsDOMStorageEntry* entry = mStorages.PutEntry(aStorage); - if (entry) - entry->mStorage = aStorage; -} - -void -nsDOMStorageManager::RemoveFromStoragesHash(DOMStorageImpl* aStorage) -{ - nsDOMStorageEntry* entry = mStorages.GetEntry(aStorage); - if (entry) - mStorages.RemoveEntry(aStorage); -} - -// -// nsDOMStorage -// - -nsDOMStorageDBWrapper* DOMStorageImpl::gStorageDB = nullptr; - -nsDOMStorageEntry::nsDOMStorageEntry(KeyTypePointer aStr) - : nsPtrHashKey(aStr), mStorage(nullptr) -{ -} - -nsDOMStorageEntry::nsDOMStorageEntry(const nsDOMStorageEntry& aToCopy) - : nsPtrHashKey(aToCopy), mStorage(nullptr) -{ - NS_ERROR("DOMStorage horked."); -} - -nsDOMStorageEntry::~nsDOMStorageEntry() -{ -} - -NS_IMPL_CYCLE_COLLECTION_1(nsDOMStorage, mStorageImpl) - -DOMCI_DATA(StorageObsolete, nsDOMStorage) - -NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMStorage) -NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMStorage) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStorage) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorageObsolete) - NS_INTERFACE_MAP_ENTRY(nsIDOMStorageObsolete) - NS_INTERFACE_MAP_ENTRY(nsPIDOMStorage) - NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(StorageObsolete) -NS_INTERFACE_MAP_END - -NS_IMETHODIMP -nsDOMStorage::GetInterface(const nsIID & aIID, void **result) -{ - nsresult rv = mStorageImpl->QueryInterface(aIID, result); - if (NS_SUCCEEDED(rv)) - return rv; - return QueryInterface(aIID, result);; -} - -nsresult -NS_NewDOMStorage2(nsISupports* aOuter, REFNSIID aIID, void** aResult) -{ - nsDOMStorage2* storage = new nsDOMStorage2(); - return storage->QueryInterface(aIID, aResult); -} - -DOMStorageBase::DOMStorageBase() - : mStorageType(nsPIDOMStorage::Unknown) - , mUseDB(false) - , mSessionOnly(true) - , mInPrivateBrowsing(false) -{ -} - -DOMStorageBase::DOMStorageBase(DOMStorageBase& aThat) - : mStorageType(aThat.mStorageType) - , mUseDB(false) // Clones don't use the DB - , mSessionOnly(true) - , mScopeDBKey(aThat.mScopeDBKey) - , mQuotaDBKey(aThat.mQuotaDBKey) - , mInPrivateBrowsing(aThat.mInPrivateBrowsing) -{ -} - -void -DOMStorageBase::InitAsSessionStorage(nsIPrincipal* aPrincipal, bool aPrivate) -{ - MOZ_ASSERT(mQuotaDBKey.IsEmpty()); - mUseDB = false; - mScopeDBKey.Truncate(); - mStorageType = nsPIDOMStorage::SessionStorage; - mInPrivateBrowsing = aPrivate; -} - -void -DOMStorageBase::InitAsLocalStorage(nsIPrincipal* aPrincipal, bool aPrivate) -{ - nsDOMStorageDBWrapper::CreateScopeDBKey(aPrincipal, mScopeDBKey); - - // XXX Bug 357323, we have to solve the issue how to define - // origin for file URLs. In that case CreateOriginScopeDBKey - // fails (the result is empty) and we must avoid database use - // in that case because it produces broken entries w/o owner. - mUseDB = !mScopeDBKey.IsEmpty(); - - nsDOMStorageDBWrapper::CreateQuotaDBKey(aPrincipal, mQuotaDBKey); - mStorageType = nsPIDOMStorage::LocalStorage; - mInPrivateBrowsing = aPrivate; -} - -PLDHashOperator -SessionStorageTraverser(nsSessionStorageEntry* aEntry, void* userArg) { - nsCycleCollectionTraversalCallback *cb = - static_cast(userArg); - - cb->NoteXPCOMChild((nsIDOMStorageItem *) aEntry->mItem); - - return PL_DHASH_NEXT; -} - -NS_IMPL_CYCLE_COLLECTION_UNLINK_0(DOMStorageImpl) -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMStorageImpl) -{ - if (tmp->mItems.IsInitialized()) { - tmp->mItems.EnumerateEntries(SessionStorageTraverser, &cb); - } -} -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - -NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMStorageImpl) -NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMStorageImpl) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMStorageImpl) - NS_INTERFACE_MAP_ENTRY(nsIPrivacyTransitionObserver) - NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrivacyTransitionObserver) -NS_INTERFACE_MAP_END - -DOMStorageImpl::DOMStorageImpl(nsDOMStorage* aStorage) -{ - Init(aStorage); -} - -DOMStorageImpl::DOMStorageImpl(nsDOMStorage* aStorage, DOMStorageImpl& aThat) - : DOMStorageBase(aThat) -{ - Init(aStorage); -} - -void -DOMStorageImpl::Init(nsDOMStorage* aStorage) -{ - mItemsCachedVersion = 0; - mItems.Init(8); - mOwner = aStorage; - if (nsDOMStorageManager::gStorageManager) - nsDOMStorageManager::gStorageManager->AddToStoragesHash(this); -} - -DOMStorageImpl::~DOMStorageImpl() -{ - if (nsDOMStorageManager::gStorageManager) - nsDOMStorageManager::gStorageManager->RemoveFromStoragesHash(this); -} - -nsresult -DOMStorageImpl::InitDB() -{ - if (!gStorageDB) { - gStorageDB = new nsDOMStorageDBWrapper(); - if (!gStorageDB) - return NS_ERROR_OUT_OF_MEMORY; - - nsresult rv = gStorageDB->Init(); - if (NS_FAILED(rv)) { - // Failed to initialize the DB, delete it and null out the - // pointer so we don't end up attempting to use an - // un-initialized DB later on. - - delete gStorageDB; - gStorageDB = nullptr; - - return rv; - } - } - - return NS_OK; -} - -void -DOMStorageImpl::InitFromChild(bool aUseDB, - bool aSessionOnly, bool aPrivate, - const nsACString& aScopeDBKey, - const nsACString& aQuotaDBKey, - uint32_t aStorageType) -{ - mUseDB = aUseDB; - mSessionOnly = aSessionOnly; - mInPrivateBrowsing = aPrivate; - mScopeDBKey = aScopeDBKey; - mQuotaDBKey = aQuotaDBKey; - mStorageType = static_cast(aStorageType); -} - -void -DOMStorageImpl::SetSessionOnly(bool aSessionOnly) -{ - mSessionOnly = aSessionOnly; -} - -bool -DOMStorageImpl::CacheStoragePermissions() -{ - // If this is a cross-process situation, we don't have a real storage owner. - // All the correct checks have been done on the child, so we just need to - // make sure that our session-only status is correctly updated. - if (!mOwner) - return CanUseStorage(); - - return mOwner->CacheStoragePermissions(); -} - -nsresult -DOMStorageImpl::GetCachedValue(const nsAString& aKey, nsAString& aValue, - bool* aSecure) -{ - aValue.Truncate(); - *aSecure = false; - - nsSessionStorageEntry *entry = mItems.GetEntry(aKey); - if (!entry) - return NS_ERROR_NOT_AVAILABLE; - - aValue = entry->mItem->GetValueInternal(); - *aSecure = entry->mItem->IsSecure(); - - return NS_OK; -} - -nsresult -DOMStorageImpl::GetDBValue(const nsAString& aKey, nsAString& aValue, - bool* aSecure) -{ - aValue.Truncate(); - - if (!UseDB()) - return NS_OK; - - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoString value; - rv = gStorageDB->GetKeyValue(this, aKey, value, aSecure); - - if (rv == NS_ERROR_DOM_NOT_FOUND_ERR) { - SetDOMStringToNull(aValue); - } - - if (NS_FAILED(rv)) - return rv; - - aValue.Assign(value); - - return NS_OK; -} - -nsresult -DOMStorageImpl::SetDBValue(const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - if (!UseDB()) - return NS_OK; - - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - CacheKeysFromDB(); - - rv = gStorageDB->SetKey(this, aKey, aValue, aSecure); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -nsresult -DOMStorageImpl::SetSecure(const nsAString& aKey, bool aSecure) -{ - if (UseDB()) { - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - return gStorageDB->SetSecure(this, aKey, aSecure); - } - - nsSessionStorageEntry *entry = mItems.GetEntry(aKey); - NS_ASSERTION(entry, "Don't use SetSecure() with nonexistent keys!"); - - if (entry) { - entry->mItem->SetSecureInternal(aSecure); - } - - return NS_OK; -} - -static PLDHashOperator -ClearStorageItem(nsSessionStorageEntry* aEntry, void* userArg) -{ - aEntry->mItem->SetValueInternal(EmptyString()); - return PL_DHASH_NEXT; -} - -void -DOMStorageImpl::ClearAll() -{ - mItems.EnumerateEntries(ClearStorageItem, nullptr); - mItemsCachedVersion = 0; -} - -struct CopyArgs { - DOMStorageImpl* storage; - bool callerSecure; -}; - -static PLDHashOperator -CopyStorageItems(nsSessionStorageEntry* aEntry, void* userArg) -{ - // When copying items from one impl to another, we may not - // have an mOwner that we can call SetItem on. Therefore we need - // to replicate its behaviour. - - CopyArgs* args = static_cast(userArg); - - nsAutoString unused; - nsresult rv = args->storage->SetValue(args->callerSecure, aEntry->GetKey(), - aEntry->mItem->GetValueInternal(), unused); - if (NS_FAILED(rv)) - return PL_DHASH_NEXT; - - if (aEntry->mItem->IsSecure()) { - args->storage->SetSecure(aEntry->GetKey(), true); - } - - return PL_DHASH_NEXT; -} - -nsresult -DOMStorageImpl::CloneFrom(bool aCallerSecure, DOMStorageBase* aThat) -{ - // For various reasons, we no longer call SetItem in CopyStorageItems, - // so we need to ensure that the storage permissions are correct. - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - DOMStorageImpl* that = static_cast(aThat); - CopyArgs args = { this, aCallerSecure }; - that->mItems.EnumerateEntries(CopyStorageItems, &args); - return NS_OK; -} - -nsresult -DOMStorageImpl::CacheKeysFromDB() -{ - // cache all the keys in the hash. This is used by the Length and Key methods - // use this cache for better performance. The disadvantage is that the - // order may break if someone changes the keys in the database directly. - if (gStorageDB->IsScopeDirty(this)) { - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - mItems.Clear(); - - rv = gStorageDB->GetAllKeys(this, &mItems); - NS_ENSURE_SUCCESS(rv, rv); - - gStorageDB->MarkScopeCached(this); - } - - return NS_OK; -} - -struct KeysArrayBuilderStruct -{ - bool callerIsSecure; - nsTArray *keys; -}; - -static PLDHashOperator -KeysArrayBuilder(nsSessionStorageEntry* aEntry, void* userArg) -{ - KeysArrayBuilderStruct *keystruct = (KeysArrayBuilderStruct *)userArg; - - if (keystruct->callerIsSecure || !aEntry->mItem->IsSecure()) - keystruct->keys->AppendElement(aEntry->GetKey()); - - return PL_DHASH_NEXT; -} - -nsTArray* -DOMStorageImpl::GetKeys(bool aCallerSecure) -{ - if (UseDB()) - CacheKeysFromDB(); - - KeysArrayBuilderStruct keystruct; - keystruct.callerIsSecure = aCallerSecure; - keystruct.keys = new nsTArray(); - if (keystruct.keys) - mItems.EnumerateEntries(KeysArrayBuilder, &keystruct); - - return keystruct.keys; -} - -class ItemCounterState -{ - public: - ItemCounterState(bool aIsCallerSecure) - : mIsCallerSecure(aIsCallerSecure), mCount(0) - { - } - - bool mIsCallerSecure; - uint32_t mCount; - private: - ItemCounterState(); // Not to be implemented -}; - -static PLDHashOperator -ItemCounter(nsSessionStorageEntry* aEntry, void* userArg) -{ - ItemCounterState *state = (ItemCounterState *)userArg; - - if (state->mIsCallerSecure || !aEntry->mItem->IsSecure()) { - ++state->mCount; - } - - return PL_DHASH_NEXT; -} - -nsresult -DOMStorageImpl::GetLength(bool aCallerSecure, uint32_t* aLength) -{ - // Force reload of items from database. This ensures sync localStorages for - // same origins among different windows. - if (UseDB()) - CacheKeysFromDB(); - - ItemCounterState state(aCallerSecure); - - mItems.EnumerateEntries(ItemCounter, &state); - - *aLength = state.mCount; - return NS_OK; -} - -class IndexFinderData -{ - public: - IndexFinderData(bool aIsCallerSecure, uint32_t aWantedIndex) - : mIsCallerSecure(aIsCallerSecure), mIndex(0), mWantedIndex(aWantedIndex), - mItem(nullptr) - { - } - - bool mIsCallerSecure; - uint32_t mIndex; - uint32_t mWantedIndex; - nsSessionStorageEntry *mItem; - - private: - IndexFinderData(); // Not to be implemented -}; - -static PLDHashOperator -IndexFinder(nsSessionStorageEntry* aEntry, void* userArg) -{ - IndexFinderData *data = (IndexFinderData *)userArg; - - if (data->mIndex == data->mWantedIndex && - (data->mIsCallerSecure || !aEntry->mItem->IsSecure())) { - data->mItem = aEntry; - - return PL_DHASH_STOP; - } - - ++data->mIndex; - - return PL_DHASH_NEXT; -} - -nsresult -DOMStorageImpl::GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey) -{ - // XXX: This does a linear search for the key at index, which would - // suck if there's a large numer of indexes. Do we care? If so, - // maybe we need to have a lazily populated key array here or - // something? - - if (UseDB()) { - CacheKeysFromDB(); - } - - IndexFinderData data(aCallerSecure, aIndex); - mItems.EnumerateEntries(IndexFinder, &data); - - if (!data.mItem) { - // aIndex was larger than the number of accessible keys. Return null. - aKey.SetIsVoid(true); - return NS_OK; - } - - aKey = data.mItem->GetKey(); - return NS_OK; -} - -// The behaviour of this function must be kept in sync with StorageChild::GetValue. -// See the explanatory comment there for more details. -nsIDOMStorageItem* -DOMStorageImpl::GetValue(bool aCallerSecure, const nsAString& aKey, - nsresult* aResult) -{ - nsSessionStorageEntry *entry = mItems.GetEntry(aKey); - nsIDOMStorageItem* item = nullptr; - if (entry) { - if (aCallerSecure || !entry->mItem->IsSecure()) { - item = entry->mItem; - } - } - else if (UseDB()) { - bool secure; - nsAutoString value; - nsresult rv = GetDBValue(aKey, value, &secure); - // return null if access isn't allowed or the key wasn't found - if (rv == NS_ERROR_DOM_SECURITY_ERR || rv == NS_ERROR_DOM_NOT_FOUND_ERR || - (!aCallerSecure && secure)) - return nullptr; - - *aResult = rv; - NS_ENSURE_SUCCESS(rv, nullptr); - - nsRefPtr newitem = - new nsDOMStorageItem(this, aKey, value, secure); - if (newitem && (entry = mItems.PutEntry(aKey))) { - item = entry->mItem = newitem; - } - else { - *aResult = NS_ERROR_OUT_OF_MEMORY; - } - } - return item; -} - -nsresult -DOMStorageImpl::SetValue(bool aIsCallerSecure, const nsAString& aKey, - const nsAString& aData, nsAString& aOldValue) -{ - nsresult rv; - nsString oldValue; - SetDOMStringToNull(oldValue); - - // First store the value to the database, we need to do this before we update - // the mItems cache. SetDBValue is using the old cached value to decide - // on quota checking. - if (UseDB()) { - rv = SetDBValue(aKey, aData, aIsCallerSecure); - NS_ENSURE_SUCCESS(rv, rv); - } - - nsSessionStorageEntry *entry = mItems.GetEntry(aKey); - if (entry) { - if (entry->mItem->IsSecure() && !aIsCallerSecure) { - return NS_ERROR_DOM_SECURITY_ERR; - } - oldValue = entry->mItem->GetValueInternal(); - entry->mItem->SetValueInternal(aData); - } - else { - nsRefPtr newitem = - new nsDOMStorageItem(this, aKey, aData, aIsCallerSecure); - if (!newitem) - return NS_ERROR_OUT_OF_MEMORY; - entry = mItems.PutEntry(aKey); - NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY); - entry->mItem = newitem; - } - aOldValue = oldValue; - return NS_OK; -} - -nsresult -DOMStorageImpl::RemoveValue(bool aCallerSecure, const nsAString& aKey, - nsAString& aOldValue) -{ - nsString oldValue; - nsSessionStorageEntry *entry = mItems.GetEntry(aKey); - - if (entry && entry->mItem->IsSecure() && !aCallerSecure) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - if (UseDB()) { - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - CacheKeysFromDB(); - entry = mItems.GetEntry(aKey); - - nsAutoString value; - bool secureItem; - rv = GetDBValue(aKey, value, &secureItem); - NS_ENSURE_SUCCESS(rv, rv); - if (!aCallerSecure && secureItem) - return NS_ERROR_DOM_SECURITY_ERR; - - oldValue = value; - - rv = gStorageDB->RemoveKey(this, aKey); - NS_ENSURE_SUCCESS(rv, rv); - } - else if (entry) { - // clear string as StorageItems may be referencing this item - oldValue = entry->mItem->GetValueInternal(); - entry->mItem->ClearValue(); - } - - if (entry) { - mItems.RawRemoveEntry(entry); - } - aOldValue = oldValue; - return NS_OK; -} - -static PLDHashOperator -CheckSecure(nsSessionStorageEntry* aEntry, void* userArg) -{ - bool* secure = (bool*)userArg; - if (aEntry->mItem->IsSecure()) { - *secure = true; - return PL_DHASH_STOP; - } - - return PL_DHASH_NEXT; -} - -nsresult -DOMStorageImpl::Clear(bool aCallerSecure, int32_t* aOldCount) -{ - if (UseDB()) - CacheKeysFromDB(); - - int32_t oldCount = mItems.Count(); - - bool foundSecureItem = false; - mItems.EnumerateEntries(CheckSecure, &foundSecureItem); - - if (foundSecureItem && !aCallerSecure) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - if (UseDB()) { - nsresult rv = InitDB(); - NS_ENSURE_SUCCESS(rv, rv); - - rv = gStorageDB->ClearStorage(this); - NS_ENSURE_SUCCESS(rv, rv); - } - - *aOldCount = oldCount; - mItems.Clear(); - return NS_OK; -} - -NS_IMETHODIMP -DOMStorageImpl::PrivateModeChanged(bool enabled) -{ - mInPrivateBrowsing = enabled; - CanUseStorage(); // cause mSessionOnly to update as well - mItems.Clear(); - mItemsCachedVersion = 0; - return NS_OK; -} - -nsDOMStorage::nsDOMStorage() - : mStorageType(nsPIDOMStorage::Unknown) - , mEventBroadcaster(nullptr) -{ - if (XRE_GetProcessType() != GeckoProcessType_Default) - mStorageImpl = new StorageChild(this); - else - mStorageImpl = new DOMStorageImpl(this); -} - -nsDOMStorage::nsDOMStorage(nsDOMStorage& aThat) - : mStorageType(aThat.mStorageType) - , mPrincipal(aThat.mPrincipal) - , mEventBroadcaster(nullptr) -{ - if (XRE_GetProcessType() != GeckoProcessType_Default) { - StorageChild* other = static_cast(aThat.mStorageImpl.get()); - mStorageImpl = new StorageChild(this, *other); - } else { - DOMStorageImpl* other = static_cast(aThat.mStorageImpl.get()); - mStorageImpl = new DOMStorageImpl(this, *other); - } -} - -nsDOMStorage::~nsDOMStorage() -{ -} - -nsresult -nsDOMStorage::InitAsSessionStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) -{ - nsCOMPtr uri; - nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); - NS_ENSURE_SUCCESS(rv, rv); - - if (!uri) { - return NS_ERROR_NOT_AVAILABLE; - } - - mDocumentURI = aDocumentURI; - mPrincipal = aPrincipal; - - mStorageType = SessionStorage; - - mStorageImpl->InitAsSessionStorage(mPrincipal, aPrivate); - return NS_OK; -} - -nsresult -nsDOMStorage::InitAsLocalStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) -{ - nsCOMPtr uri; - nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); - NS_ENSURE_SUCCESS(rv, rv); - - if (!uri) { - return NS_ERROR_NOT_AVAILABLE; - } - - mDocumentURI = aDocumentURI; - mPrincipal = aPrincipal; - - mStorageType = LocalStorage; - - mStorageImpl->InitAsLocalStorage(aPrincipal, aPrivate); - return NS_OK; -} - -bool -DOMStorageBase::CanUseStorage() -{ - return nsDOMStorage::CanUseStorage(this); -} - -//static -bool -nsDOMStorage::CanUseStorage(DOMStorageBase* aStorage /* = NULL */) -{ - if (aStorage) { - // check if the calling domain can use storage. Downgrade to session - // only if only session storage may be used. - aStorage->mSessionOnly = false; - } - - if (!Preferences::GetBool(kStorageEnabled)) { - return false; - } - - // chrome can always use storage regardless of permission preferences - if (nsContentUtils::IsCallerChrome()) - return true; - - nsCOMPtr subjectPrincipal; - nsresult rv = nsContentUtils::GetSecurityManager()-> - GetSubjectPrincipal(getter_AddRefs(subjectPrincipal)); - NS_ENSURE_SUCCESS(rv, false); - - // if subjectPrincipal were null we'd have returned after - // IsCallerChrome(). - - nsCOMPtr permissionManager = - do_GetService(NS_PERMISSIONMANAGER_CONTRACTID); - if (!permissionManager) - return false; - - uint32_t perm; - permissionManager->TestPermissionFromPrincipal(subjectPrincipal, - kPermissionType, &perm); - - if (perm == nsIPermissionManager::DENY_ACTION) - return false; - - // In private browsing mode we ougth to behave as in session-only cookies - // mode to prevent detection of being in private browsing mode and ensuring - // that there will be no traces left. - if (perm == nsICookiePermission::ACCESS_SESSION || - (aStorage && aStorage->IsPrivate())) { - if (aStorage) - aStorage->mSessionOnly = true; - } - else if (perm != nsIPermissionManager::ALLOW_ACTION) { - uint32_t cookieBehavior = Preferences::GetUint(kCookiesBehavior); - uint32_t lifetimePolicy = Preferences::GetUint(kCookiesLifetimePolicy); - - // Treat "ask every time" as "reject always". - if ((cookieBehavior == BEHAVIOR_REJECT || lifetimePolicy == ASK_BEFORE_ACCEPT)) - return false; - - if (lifetimePolicy == ACCEPT_SESSION && aStorage) - aStorage->mSessionOnly = true; - } - - return true; -} - -bool -nsDOMStorage::CacheStoragePermissions() -{ - // Bug 488446, disallowing storage use when in session only mode. - // This is temporary fix before we find complete solution for storage - // behavior in private browsing mode or session-only cookies mode. - if (!mStorageImpl->CanUseStorage()) - return false; - - nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); - if (!ssm) - return false; - - nsCOMPtr subjectPrincipal; - nsresult rv = ssm->GetSubjectPrincipal(getter_AddRefs(subjectPrincipal)); - NS_ENSURE_SUCCESS(rv, false); - - return CanAccess(subjectPrincipal); -} - -NS_IMETHODIMP -nsDOMStorage::GetLength(uint32_t *aLength) -{ - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - return mStorageImpl->GetLength(IsCallerSecure(), aLength); -} - -NS_IMETHODIMP -nsDOMStorage::Key(uint32_t aIndex, nsAString& aKey) -{ - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - return mStorageImpl->GetKey(IsCallerSecure(), aIndex, aKey); -} - -nsIDOMStorageItem* -nsDOMStorage::GetNamedItem(const nsAString& aKey, nsresult* aResult) -{ - if (!CacheStoragePermissions()) { - *aResult = NS_ERROR_DOM_SECURITY_ERR; - return nullptr; - } - - *aResult = NS_OK; - return mStorageImpl->GetValue(IsCallerSecure(), aKey, aResult); -} - -nsresult -nsDOMStorage::GetItem(const nsAString& aKey, nsAString &aData) -{ - nsresult rv; - - // IMPORTANT: - // CacheStoragePermissions() is called inside of - // GetItem(nsAString, nsIDOMStorageItem) - // To call it particularly in this method would just duplicate - // the call. If the code changes, make sure that call to - // CacheStoragePermissions() is put here! - - nsCOMPtr item; - rv = GetItem(aKey, getter_AddRefs(item)); - if (NS_FAILED(rv)) - return rv; - - if (item) { - rv = item->GetValue(aData); - NS_ENSURE_SUCCESS(rv, rv); - } - else - SetDOMStringToNull(aData); - - return NS_OK; -} - -static Telemetry::ID -TelemetryIDForKey(nsPIDOMStorage::nsDOMStorageType type) -{ - switch (type) { - default: - MOZ_ASSERT(false); - // We need to return something to satisfy the compiler. - // Fallthrough. - case nsPIDOMStorage::LocalStorage: - return Telemetry::LOCALDOMSTORAGE_KEY_SIZE_BYTES; - case nsPIDOMStorage::SessionStorage: - return Telemetry::SESSIONDOMSTORAGE_KEY_SIZE_BYTES; - } -} - -static Telemetry::ID -TelemetryIDForValue(nsPIDOMStorage::nsDOMStorageType type) -{ - switch (type) { - default: - MOZ_ASSERT(false); - // We need to return something to satisfy the compiler. - // Fallthrough. - case nsPIDOMStorage::LocalStorage: - return Telemetry::LOCALDOMSTORAGE_VALUE_SIZE_BYTES; - case nsPIDOMStorage::SessionStorage: - return Telemetry::SESSIONDOMSTORAGE_VALUE_SIZE_BYTES; - } -} - -NS_IMETHODIMP -nsDOMStorage::GetItem(const nsAString& aKey, nsIDOMStorageItem **aItem) -{ - nsresult rv; - - NS_IF_ADDREF(*aItem = GetNamedItem(aKey, &rv)); - - return rv; -} - -NS_IMETHODIMP -nsDOMStorage::SetItem(const nsAString& aKey, const nsAString& aData) -{ - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - Telemetry::Accumulate(TelemetryIDForKey(mStorageType), aKey.Length()); - Telemetry::Accumulate(TelemetryIDForValue(mStorageType), aData.Length()); - - nsString oldValue; - nsresult rv = mStorageImpl->SetValue(IsCallerSecure(), aKey, aData, oldValue); - if (NS_FAILED(rv)) - return rv; - - if (oldValue != aData && mEventBroadcaster) - mEventBroadcaster->BroadcastChangeNotification(aKey, oldValue, aData); - - return NS_OK; -} - -NS_IMETHODIMP nsDOMStorage::RemoveItem(const nsAString& aKey) -{ - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - nsString oldValue; - nsresult rv = mStorageImpl->RemoveValue(IsCallerSecure(), aKey, oldValue); - if (rv == NS_ERROR_DOM_NOT_FOUND_ERR) - return NS_OK; - if (NS_FAILED(rv)) - return rv; - - if (!oldValue.IsEmpty() && mEventBroadcaster) { - nsAutoString nullString; - SetDOMStringToNull(nullString); - mEventBroadcaster->BroadcastChangeNotification(aKey, oldValue, nullString); - } - - return NS_OK; -} - -nsresult -nsDOMStorage::Clear() -{ - if (!CacheStoragePermissions()) - return NS_ERROR_DOM_SECURITY_ERR; - - int32_t oldCount; - nsresult rv = mStorageImpl->Clear(IsCallerSecure(), &oldCount); - if (NS_FAILED(rv)) - return rv; - - if (oldCount && mEventBroadcaster) { - nsAutoString nullString; - SetDOMStringToNull(nullString); - mEventBroadcaster->BroadcastChangeNotification(nullString, nullString, nullString); - } - - return NS_OK; -} - -already_AddRefed -nsDOMStorage::Clone() -{ - NS_ASSERTION(false, "Old DOMStorage doesn't implement cloning"); - return nullptr; -} - -already_AddRefed -nsDOMStorage::Fork(const nsSubstring &aDocumentURI) -{ - NS_ASSERTION(false, "Old DOMStorage doesn't implement forking"); - return nullptr; -} - -bool nsDOMStorage::IsForkOf(nsIDOMStorage* aThat) -{ - NS_ASSERTION(false, "Old DOMStorage doesn't implement forking"); - return false; -} - -nsresult -nsDOMStorage::CloneFrom(nsDOMStorage* aThat) -{ - return mStorageImpl->CloneFrom(IsCallerSecure(), aThat->mStorageImpl); -} - -nsTArray * -nsDOMStorage::GetKeys() -{ - return mStorageImpl->GetKeys(IsCallerSecure()); -} - -nsIPrincipal* -nsDOMStorage::Principal() -{ - return nullptr; -} - -bool -nsDOMStorage::CanAccessSystem(nsIPrincipal *aPrincipal) -{ - if (!aPrincipal) - return true; - - nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); - if (!ssm) - return false; - - bool isSystem; - nsresult rv = ssm->IsSystemPrincipal(aPrincipal, &isSystem); - - return NS_SUCCEEDED(rv) && isSystem; -} - -bool -nsDOMStorage::CanAccess(nsIPrincipal *aPrincipal) -{ - // Allow C++ callers to access the storage - if (!aPrincipal) - return true; - - // Allow more powerful principals (e.g. system) to access the storage - - // For content, either the code base or domain must be the same. When code - // base is the same, this is enough to say it is safe for a page to access - // this storage. - - bool subsumes; - nsresult rv = aPrincipal->SubsumesIgnoringDomain(mPrincipal, &subsumes); - if (NS_FAILED(rv)) - return false; - - if (!subsumes) { - nsresult rv = aPrincipal->Subsumes(mPrincipal, &subsumes); - if (NS_FAILED(rv)) - return false; - } - - return subsumes; -} - -nsPIDOMStorage::nsDOMStorageType -nsDOMStorage::StorageType() -{ - return mStorageType; -} - -// -// nsDOMStorage2 -// - -NS_IMPL_CYCLE_COLLECTION_1(nsDOMStorage2, mStorage) - -DOMCI_DATA(Storage, nsDOMStorage2) - -NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMStorage2) -NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMStorage2) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStorage2) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorage) - NS_INTERFACE_MAP_ENTRY(nsIDOMStorage) - NS_INTERFACE_MAP_ENTRY(nsPIDOMStorage) - NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Storage) -NS_INTERFACE_MAP_END - -NS_IMETHODIMP -nsDOMStorage2::GetInterface(const nsIID & aIID, void **result) -{ - nsresult rv = mStorage->GetInterface(aIID, result); - if (NS_SUCCEEDED(rv)) - return rv; - return QueryInterface(aIID, result);; -} - -nsDOMStorage2::nsDOMStorage2() -{ -} - -nsDOMStorage2::nsDOMStorage2(nsDOMStorage2& aThat) -{ - mStorage = new nsDOMStorage(*aThat.mStorage.get()); - mPrincipal = aThat.mPrincipal; -} - -nsresult -nsDOMStorage2::InitAsSessionStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) -{ - mStorage = new nsDOMStorage(); - if (!mStorage) - return NS_ERROR_OUT_OF_MEMORY; - - mPrincipal = aPrincipal; - mDocumentURI = aDocumentURI; - - return mStorage->InitAsSessionStorage(aPrincipal, aDocumentURI, aPrivate); -} - -nsresult -nsDOMStorage2::InitAsLocalStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate) -{ - mStorage = new nsDOMStorage(); - if (!mStorage) - return NS_ERROR_OUT_OF_MEMORY; - - mPrincipal = aPrincipal; - mDocumentURI = aDocumentURI; - - return mStorage->InitAsLocalStorage(aPrincipal, aDocumentURI, aPrivate); -} - -already_AddRefed -nsDOMStorage2::Clone() -{ - nsDOMStorage2* storage = new nsDOMStorage2(*this); - if (!storage) - return nullptr; - - storage->mStorage->CloneFrom(mStorage); - NS_ADDREF(storage); - - return storage; -} - -already_AddRefed -nsDOMStorage2::Fork(const nsSubstring &aDocumentURI) -{ - nsRefPtr storage = new nsDOMStorage2(); - storage->InitAsSessionStorageFork(mPrincipal, aDocumentURI, mStorage); - return storage.forget(); -} - -bool nsDOMStorage2::IsForkOf(nsIDOMStorage* aThat) -{ - if (!aThat) - return false; - - nsDOMStorage2* storage = static_cast(aThat); - return mStorage == storage->mStorage; -} - -void -nsDOMStorage2::InitAsSessionStorageFork(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, nsDOMStorage* aStorage) -{ - mPrincipal = aPrincipal; - mDocumentURI = aDocumentURI; - mStorage = aStorage; -} - -nsTArray * -nsDOMStorage2::GetKeys() -{ - return mStorage->GetKeys(); -} - -nsIPrincipal* -nsDOMStorage2::Principal() -{ - return mPrincipal; -} - -bool -nsDOMStorage2::CanAccess(nsIPrincipal *aPrincipal) -{ - return mStorage->CanAccess(aPrincipal); -} - -nsPIDOMStorage::nsDOMStorageType -nsDOMStorage2::StorageType() -{ - if (mStorage) - return mStorage->StorageType(); - - return nsPIDOMStorage::Unknown; -} - -bool -nsDOMStorage2::IsPrivate() -{ - return mStorage && mStorage->IsPrivate(); -} - -namespace { - -class StorageNotifierRunnable : public nsRunnable -{ -public: - StorageNotifierRunnable(nsISupports* aSubject) - : mSubject(aSubject) - { } - - NS_DECL_NSIRUNNABLE - -private: - nsCOMPtr mSubject; -}; - -NS_IMETHODIMP -StorageNotifierRunnable::Run() -{ - nsCOMPtr observerService = - mozilla::services::GetObserverService(); - if (observerService) { - observerService->NotifyObservers(mSubject, "dom-storage2-changed", nullptr); - } - return NS_OK; -} - -} // anonymous namespace - -void -nsDOMStorage2::BroadcastChangeNotification(const nsSubstring &aKey, - const nsSubstring &aOldValue, - const nsSubstring &aNewValue) -{ - nsresult rv; - nsCOMPtr domEvent; - // Note, this DOM event should never reach JS. It is cloned later in - // nsGlobalWindow. - NS_NewDOMStorageEvent(getter_AddRefs(domEvent), nullptr, nullptr, nullptr); - nsCOMPtr event = do_QueryInterface(domEvent); - rv = event->InitStorageEvent(NS_LITERAL_STRING("storage"), - false, - false, - aKey, - aOldValue, - aNewValue, - mDocumentURI, - static_cast(this)); - if (NS_FAILED(rv)) { - return; - } - - nsRefPtr r = new StorageNotifierRunnable(event); - NS_DispatchToMainThread(r); -} - -NS_IMETHODIMP -nsDOMStorage2::GetLength(uint32_t *aLength) -{ - return mStorage->GetLength(aLength); -} - -NS_IMETHODIMP -nsDOMStorage2::Key(uint32_t aIndex, nsAString& aKey) -{ - return mStorage->Key(aIndex, aKey); -} - -NS_IMETHODIMP -nsDOMStorage2::GetItem(const nsAString& aKey, nsAString &aData) -{ - return mStorage->GetItem(aKey, aData); -} - -NS_IMETHODIMP -nsDOMStorage2::SetItem(const nsAString& aKey, const nsAString& aData) -{ - mStorage->mEventBroadcaster = this; - return mStorage->SetItem(aKey, aData); -} - -NS_IMETHODIMP -nsDOMStorage2::RemoveItem(const nsAString& aKey) -{ - mStorage->mEventBroadcaster = this; - return mStorage->RemoveItem(aKey); -} - -NS_IMETHODIMP -nsDOMStorage2::Clear() -{ - mStorage->mEventBroadcaster = this; - return mStorage->Clear(); -} - -// -// nsDOMStorageItem -// - -NS_IMPL_CYCLE_COLLECTION_1(nsDOMStorageItem, mStorage) -NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMStorageItem) -NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMStorageItem) - -DOMCI_DATA(StorageItem, nsDOMStorageItem) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStorageItem) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorageItem) - NS_INTERFACE_MAP_ENTRY(nsIDOMStorageItem) - NS_INTERFACE_MAP_ENTRY(nsIDOMToString) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(StorageItem) -NS_INTERFACE_MAP_END - -nsDOMStorageItem::nsDOMStorageItem(DOMStorageBase* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure) - : mSecure(aSecure), - mKey(aKey), - mValue(aValue), - mStorage(aStorage) -{ -} - -nsDOMStorageItem::~nsDOMStorageItem() -{ -} - -NS_IMETHODIMP -nsDOMStorageItem::GetSecure(bool* aSecure) -{ - if (!mStorage->CacheStoragePermissions() || !IsCallerSecure()) { - return NS_ERROR_DOM_INVALID_ACCESS_ERR; - } - - if (mStorage->UseDB()) { - nsAutoString value; - return mStorage->GetDBValue(mKey, value, aSecure); - } - - *aSecure = IsSecure(); - return NS_OK; -} - -NS_IMETHODIMP -nsDOMStorageItem::SetSecure(bool aSecure) -{ - if (!mStorage->CacheStoragePermissions() || !IsCallerSecure()) { - return NS_ERROR_DOM_INVALID_ACCESS_ERR; - } - - if (mStorage->UseDB()) { - nsresult rv = mStorage->SetSecure(mKey, aSecure); - NS_ENSURE_SUCCESS(rv, rv); - } - - mSecure = aSecure; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMStorageItem::GetValue(nsAString& aValue) -{ - if (!mStorage->CacheStoragePermissions()) - return NS_ERROR_DOM_INVALID_ACCESS_ERR; - - if (mStorage->UseDB()) { - bool secure; - nsresult rv = mStorage->GetDBValue(mKey, aValue, &secure); - if (rv == NS_ERROR_DOM_NOT_FOUND_ERR) - return NS_OK; - if (NS_SUCCEEDED(rv) && !IsCallerSecure() && secure) - return NS_ERROR_DOM_SECURITY_ERR; - return rv; - } - - if (IsSecure() && !IsCallerSecure()) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - aValue = mValue; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMStorageItem::SetValue(const nsAString& aValue) -{ - if (!mStorage->CacheStoragePermissions()) - return NS_ERROR_DOM_INVALID_ACCESS_ERR; - - bool secureCaller = IsCallerSecure(); - - if (mStorage->UseDB()) { - // SetDBValue() does the security checks for us. - return mStorage->SetDBValue(mKey, aValue, secureCaller); - } - - bool secureItem = IsSecure(); - - if (!secureCaller && secureItem) { - // The item is secure, but the caller isn't. Throw. - return NS_ERROR_DOM_SECURITY_ERR; - } - - mValue = aValue; - mSecure = secureCaller; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMStorageItem::ToString(nsAString& aStr) -{ - return GetValue(aStr); -} - diff --git a/dom/src/storage/nsDOMStorage.h b/dom/src/storage/nsDOMStorage.h deleted file mode 100644 index d1387095d1e1..000000000000 --- a/dom/src/storage/nsDOMStorage.h +++ /dev/null @@ -1,486 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsDOMStorage_h___ -#define nsDOMStorage_h___ - -#include "nscore.h" -#include "nsAutoPtr.h" -#include "nsIDOMStorageObsolete.h" -#include "nsIDOMStorage.h" -#include "nsIDOMStorageItem.h" -#include "nsIPermissionManager.h" -#include "nsIPrivacyTransitionObserver.h" -#include "nsInterfaceHashtable.h" -#include "nsVoidArray.h" -#include "nsTArray.h" -#include "nsPIDOMStorage.h" -#include "nsIDOMToString.h" -#include "nsDOMEvent.h" -#include "nsIDOMStorageEvent.h" -#include "nsIDOMStorageManager.h" -#include "nsCycleCollectionParticipant.h" -#include "nsIObserver.h" -#include "nsITimer.h" -#include "nsWeakReference.h" -#include "nsIInterfaceRequestor.h" -#include "mozilla/Attributes.h" - -#include "nsDOMStorageDBWrapper.h" - -class nsDOMStorage; -class nsIDOMStorage; -class nsDOMStorageItem; -class nsDOMStoragePersistentDB; - -namespace mozilla { -namespace dom { -class StorageParent; -} -} -using mozilla::dom::StorageParent; - -class DOMStorageImpl; - -class nsDOMStorageEntry : public nsPtrHashKey -{ -public: - nsDOMStorageEntry(KeyTypePointer aStr); - nsDOMStorageEntry(const nsDOMStorageEntry& aToCopy); - ~nsDOMStorageEntry(); - - // weak reference so that it can be deleted when no longer used - DOMStorageImpl* mStorage; -}; - -class nsSessionStorageEntry : public nsStringHashKey -{ -public: - nsSessionStorageEntry(KeyTypePointer aStr); - nsSessionStorageEntry(const nsSessionStorageEntry& aToCopy); - ~nsSessionStorageEntry(); - - nsRefPtr mItem; -}; - -class nsDOMStorageManager MOZ_FINAL : public nsIDOMStorageManager - , public nsIObserver - , public nsSupportsWeakReference -{ -public: - // nsISupports - NS_DECL_ISUPPORTS - - // nsIDOMStorageManager - NS_DECL_NSIDOMSTORAGEMANAGER - - // nsIObserver - NS_DECL_NSIOBSERVER - - nsDOMStorageManager(); - - void AddToStoragesHash(DOMStorageImpl* aStorage); - void RemoveFromStoragesHash(DOMStorageImpl* aStorage); - - nsresult ClearAllStorages(); - - static nsresult Initialize(); - static nsDOMStorageManager* GetInstance(); - static void Shutdown(); - static void ShutdownDB(); - - /** - * Checks whether there is any data waiting to be flushed from a temp table. - */ - bool UnflushedDataExists(); - - static nsDOMStorageManager* gStorageManager; - -protected: - - nsTHashtable mStorages; -}; - -class DOMStorageBase : public nsIPrivacyTransitionObserver -{ -public: - DOMStorageBase(); - DOMStorageBase(DOMStorageBase&); - - virtual void InitAsSessionStorage(nsIPrincipal* aPrincipal, bool aPrivate); - virtual void InitAsLocalStorage(nsIPrincipal* aPrincipal, bool aPrivate); - - virtual nsTArray* GetKeys(bool aCallerSecure) = 0; - virtual nsresult GetLength(bool aCallerSecure, uint32_t* aLength) = 0; - virtual nsresult GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey) = 0; - virtual nsIDOMStorageItem* GetValue(bool aCallerSecure, const nsAString& aKey, - nsresult* rv) = 0; - virtual nsresult SetValue(bool aCallerSecure, const nsAString& aKey, - const nsAString& aData, nsAString& aOldValue) = 0; - virtual nsresult RemoveValue(bool aCallerSecure, const nsAString& aKey, - nsAString& aOldValue) = 0; - virtual nsresult Clear(bool aCallerSecure, int32_t* aOldCount) = 0; - - // Call nsDOMStorage::CanUseStorage with |this| - bool CanUseStorage(); - - // If true, the contents of the storage should be stored in the - // database, otherwise this storage should act like a session - // storage. - // This call relies on mSessionOnly, and should only be used - // after a CacheStoragePermissions() call. See the comments - // for mSessionOnly below. - bool UseDB() { - return mUseDB; - } - - bool IsPrivate() { - return mInPrivateBrowsing; - } - - // retrieve the value and secure state corresponding to a key out of storage. - virtual nsresult - GetDBValue(const nsAString& aKey, - nsAString& aValue, - bool* aSecure) = 0; - - // set the value corresponding to a key in the storage. If - // aSecure is false, then attempts to modify a secure value - // throw NS_ERROR_DOM_INVALID_ACCESS_ERR - virtual nsresult - SetDBValue(const nsAString& aKey, - const nsAString& aValue, - bool aSecure) = 0; - - // set the value corresponding to a key as secure. - virtual nsresult - SetSecure(const nsAString& aKey, bool aSecure) = 0; - - virtual nsresult - CloneFrom(bool aCallerSecure, DOMStorageBase* aThat) = 0; - - // e.g. "moc.rab.oof.:" or "moc.rab.oof.:http:80" depending - // on association with a domain (globalStorage) or - // an origin (localStorage). - nsCString& GetScopeDBKey() {return mScopeDBKey;} - - // e.g. "moc.rab.%" - reversed eTLD+1 subpart of the domain. - nsCString& GetQuotaDBKey() - { - return mQuotaDBKey; - } - - virtual bool CacheStoragePermissions() = 0; - -protected: - friend class nsDOMStorageManager; - friend class nsDOMStorage; - - nsPIDOMStorage::nsDOMStorageType mStorageType; - - // true if the storage database should be used for values - bool mUseDB; - - // true if the preferences indicates that this storage should be - // session only. This member is updated by - // CacheStoragePermissions(), using the current principal. - // CacheStoragePermissions() must be called at each entry point to - // make sure this stays up to date. - bool mSessionOnly; - - // keys are used for database queries. - // see comments of the getters bellow. - nsCString mScopeDBKey; - nsCString mQuotaDBKey; - - bool mInPrivateBrowsing; -}; - -class DOMStorageImpl MOZ_FINAL : public DOMStorageBase - , public nsSupportsWeakReference -{ -public: - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(DOMStorageImpl, nsIPrivacyTransitionObserver) - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_NSIPRIVACYTRANSITIONOBSERVER - - DOMStorageImpl(nsDOMStorage*); - DOMStorageImpl(nsDOMStorage*, DOMStorageImpl&); - ~DOMStorageImpl(); - - bool SessionOnly() { - return mSessionOnly; - } - - virtual nsTArray* GetKeys(bool aCallerSecure); - virtual nsresult GetLength(bool aCallerSecure, uint32_t* aLength); - virtual nsresult GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey); - virtual nsIDOMStorageItem* GetValue(bool aCallerSecure, const nsAString& aKey, - nsresult* rv); - virtual nsresult SetValue(bool aCallerSecure, const nsAString& aKey, - const nsAString& aData, nsAString& aOldValue); - virtual nsresult RemoveValue(bool aCallerSecure, const nsAString& aKey, - nsAString& aOldValue); - virtual nsresult Clear(bool aCallerSecure, int32_t* aOldCount); - - // cache the keys from the database for faster lookup - nsresult CacheKeysFromDB(); - - uint64_t CachedVersion() { return mItemsCachedVersion; } - void SetCachedVersion(uint64_t version) { mItemsCachedVersion = version; } - - // retrieve the value and secure state corresponding to a key out of storage - // that has been cached in mItems hash table. - nsresult - GetCachedValue(const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - - // retrieve the value and secure state corresponding to a key out of storage. - virtual nsresult - GetDBValue(const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - - // set the value corresponding to a key in the storage. If - // aSecure is false, then attempts to modify a secure value - // throw NS_ERROR_DOM_INVALID_ACCESS_ERR - virtual nsresult - SetDBValue(const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - - // set the value corresponding to a key as secure. - virtual nsresult - SetSecure(const nsAString& aKey, bool aSecure); - - // clear all values from the store - void ClearAll(); - - virtual nsresult - CloneFrom(bool aCallerSecure, DOMStorageBase* aThat); - - virtual bool CacheStoragePermissions(); - -private: - static nsDOMStorageDBWrapper* gStorageDB; - friend class nsDOMStorageManager; - friend class nsDOMStoragePersistentDB; - friend class StorageParent; - - void Init(nsDOMStorage*); - - // Cross-process storage implementations never have InitAs(Session|Local|Global)Storage - // called, so the appropriate initialization needs to happen from the child. - void InitFromChild(bool aUseDB, bool aSessionOnly, - bool aPrivate, - const nsACString& aScopeDBKey, - const nsACString& aQuotaDBKey, - uint32_t aStorageType); - void SetSessionOnly(bool aSessionOnly); - - static nsresult InitDB(); - - // 0 initially or a positive data version number assigned by gStorageDB - // after keys have been cached from the database - uint64_t mItemsCachedVersion; - - // the key->value item pairs - nsTHashtable mItems; - - // Weak reference to the owning storage instance - nsDOMStorage* mOwner; -}; - -class nsDOMStorage2; - -class nsDOMStorage : public nsIDOMStorageObsolete, - public nsPIDOMStorage, - public nsIInterfaceRequestor -{ -public: - nsDOMStorage(); - nsDOMStorage(nsDOMStorage& aThat); - virtual ~nsDOMStorage(); - - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMStorage, nsIDOMStorageObsolete) - - NS_DECL_NSIDOMSTORAGEOBSOLETE - NS_DECL_NSIINTERFACEREQUESTOR - - // Helpers for implementing nsIDOMStorage - nsresult GetItem(const nsAString& key, nsAString& aData); - nsresult Clear(); - - // nsPIDOMStorage - virtual nsresult InitAsSessionStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate); - virtual nsresult InitAsLocalStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate); - virtual already_AddRefed Clone(); - virtual already_AddRefed Fork(const nsSubstring &aDocumentURI); - virtual bool IsForkOf(nsIDOMStorage* aThat); - virtual nsTArray *GetKeys(); - virtual nsIPrincipal* Principal(); - virtual bool CanAccess(nsIPrincipal *aPrincipal); - virtual nsDOMStorageType StorageType(); - virtual bool IsPrivate() { - return mStorageImpl && mStorageImpl->IsPrivate(); - } - - // Check whether storage may be used by the caller, and whether it - // is session only. Returns true if storage may be used. - static bool - CanUseStorage(DOMStorageBase* aStorage = nullptr); - - // Check whether storage may be used. Updates mSessionOnly based on - // the result of CanUseStorage. - bool - CacheStoragePermissions(); - - nsIDOMStorageItem* GetNamedItem(const nsAString& aKey, nsresult* aResult); - - nsresult SetSecure(const nsAString& aKey, bool aSecure) - { - return mStorageImpl->SetSecure(aKey, aSecure); - } - - nsresult CloneFrom(nsDOMStorage* aThat); - - protected: - friend class nsDOMStorage2; - friend class nsDOMStoragePersistentDB; - - nsRefPtr mStorageImpl; - - bool CanAccessSystem(nsIPrincipal *aPrincipal); - - // document URI of the document this storage is bound to - nsString mDocumentURI; - - // true if this storage was initialized as a localStorage object. localStorage - // objects are scoped to scheme/host/port in the database, while globalStorage - // objects are scoped just to host. this flag also tells the manager to map - // this storage also in mLocalStorages hash table. - nsDOMStorageType mStorageType; - - friend class nsIDOMStorage2; - nsCOMPtr mPrincipal; - nsDOMStorage2* mEventBroadcaster; -}; - -class nsDOMStorage2 MOZ_FINAL : public nsIDOMStorage, - public nsPIDOMStorage, - public nsIInterfaceRequestor -{ -public: - // nsISupports - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMStorage2, nsIDOMStorage) - - nsDOMStorage2(nsDOMStorage2& aThat); - nsDOMStorage2(); - - NS_DECL_NSIDOMSTORAGE - NS_DECL_NSIINTERFACEREQUESTOR - - // nsPIDOMStorage - virtual nsresult InitAsSessionStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate); - virtual nsresult InitAsLocalStorage(nsIPrincipal *aPrincipal, const nsSubstring &aDocumentURI, - bool aPrivate); - virtual already_AddRefed Clone(); - virtual already_AddRefed Fork(const nsSubstring &aDocumentURI); - virtual bool IsForkOf(nsIDOMStorage* aThat); - virtual nsTArray *GetKeys(); - virtual nsIPrincipal* Principal(); - virtual bool CanAccess(nsIPrincipal *aPrincipal); - virtual nsDOMStorageType StorageType(); - virtual bool IsPrivate(); - - void BroadcastChangeNotification(const nsSubstring &aKey, - const nsSubstring &aOldValue, - const nsSubstring &aNewValue); - void InitAsSessionStorageFork(nsIPrincipal *aPrincipal, - const nsSubstring &aDocumentURI, - nsDOMStorage* aStorage); - -private: - // storages bound to an origin hold the principal to - // make security checks against it - nsCOMPtr mPrincipal; - - // Needed for the storage event, this is address of the document this storage - // is bound to - nsString mDocumentURI; - nsRefPtr mStorage; -}; - -class nsDOMStorageItem : public nsIDOMStorageItem, - public nsIDOMToString -{ -public: - nsDOMStorageItem(DOMStorageBase* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - virtual ~nsDOMStorageItem(); - - // nsISupports - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMStorageItem, nsIDOMStorageItem) - - // nsIDOMStorageObsolete - NS_DECL_NSIDOMSTORAGEITEM - - // nsIDOMToString - NS_DECL_NSIDOMTOSTRING - - bool IsSecure() - { - return mSecure; - } - - void SetSecureInternal(bool aSecure) - { - mSecure = aSecure; - } - - const nsAString& GetValueInternal() - { - return mValue; - } - - const void SetValueInternal(const nsAString& aValue) - { - mValue = aValue; - } - - void ClearValue() - { - mValue.Truncate(); - } - -protected: - - // true if this value is for secure sites only - bool mSecure; - - // key for the item - nsString mKey; - - // value of the item - nsString mValue; - - // If this item came from the db, mStorage points to the storage - // object where this item came from. - nsRefPtr mStorage; -}; - -nsresult -NS_NewDOMStorage2(nsISupports* aOuter, REFNSIID aIID, void** aResult); - -#endif /* nsDOMStorage_h___ */ diff --git a/dom/src/storage/nsDOMStorageBaseDB.cpp b/dom/src/storage/nsDOMStorageBaseDB.cpp deleted file mode 100644 index b7509a5f3d97..000000000000 --- a/dom/src/storage/nsDOMStorageBaseDB.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "nsDOMStorageBaseDB.h" -#include "nsDOMStorage.h" -#include "mozilla/Preferences.h" - -// Only allow relatively small amounts of data since performance of -// the synchronous IO is very bad. -#define DEFAULT_QUOTA_LIMIT (5 * 1024) - -uint64_t nsDOMStorageBaseDB::sGlobalVersion = 1; -int32_t nsDOMStorageBaseDB::gQuotaLimit = DEFAULT_QUOTA_LIMIT * 1024; - -using namespace mozilla; - -/* static */ -void -nsDOMStorageBaseDB::Init() -{ - Preferences::AddIntVarCache(&gQuotaLimit, "dom.storage.default_quota", - DEFAULT_QUOTA_LIMIT); -} - -nsDOMStorageBaseDB::nsDOMStorageBaseDB() -{ - mScopesVersion.Init(8); -} - -// public - -void -nsDOMStorageBaseDB::MarkScopeCached(DOMStorageImpl* aStorage) -{ - aStorage->SetCachedVersion(CachedScopeVersion(aStorage)); -} - -bool -nsDOMStorageBaseDB::IsScopeDirty(DOMStorageImpl* aStorage) -{ - return !aStorage->CachedVersion() || - (aStorage->CachedVersion() != CachedScopeVersion(aStorage)); -} - -// protected - -// static -uint64_t -nsDOMStorageBaseDB::NextGlobalVersion() -{ - sGlobalVersion++; - if (sGlobalVersion == 0) // Control overlap, never return 0 - sGlobalVersion = 1; - return sGlobalVersion; -} - -uint64_t -nsDOMStorageBaseDB::CachedScopeVersion(DOMStorageImpl* aStorage) -{ - uint64_t currentVersion; - if (mScopesVersion.Get(aStorage->GetScopeDBKey(), ¤tVersion)) - return currentVersion; - - mScopesVersion.Put(aStorage->GetScopeDBKey(), sGlobalVersion); - return sGlobalVersion; -} - -void -nsDOMStorageBaseDB::MarkScopeDirty(DOMStorageImpl* aStorage) -{ - uint64_t nextVersion = NextGlobalVersion(); - mScopesVersion.Put(aStorage->GetScopeDBKey(), nextVersion); - - // We may do this because the storage updates its cache along with - // updating the database. - aStorage->SetCachedVersion(nextVersion); -} - -void -nsDOMStorageBaseDB::MarkAllScopesDirty() -{ - mScopesVersion.Clear(); - NextGlobalVersion(); -} diff --git a/dom/src/storage/nsDOMStorageBaseDB.h b/dom/src/storage/nsDOMStorageBaseDB.h deleted file mode 100644 index 01019cde5fae..000000000000 --- a/dom/src/storage/nsDOMStorageBaseDB.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsDOMStorageBaseDB_h___ -#define nsDOMStorageBaseDB_h___ - -#include "nscore.h" -#include "nsDataHashtable.h" - -class DOMStorageImpl; - -class nsDOMStorageBaseDB -{ -public: - static void Init(); - - nsDOMStorageBaseDB(); - virtual ~nsDOMStorageBaseDB() {} - - /** - * Marks the storage as "cached" after the DOMStorageImpl object has loaded - * all items to its memory copy of the entries - IsScopeDirty returns false - * after call of this method for this storage. - * - * When a key is changed or deleted in the storage, the storage scope is - * marked as "dirty" again and makes the DOMStorageImpl object recache its - * keys on next access, because IsScopeDirty returns true again. - */ - void MarkScopeCached(DOMStorageImpl* aStorage); - - /** - * Test whether the storage for the scope (i.e. origin or host) has been - * changed since the last MarkScopeCached call. - */ - bool IsScopeDirty(DOMStorageImpl* aStorage); - - int32_t GetQuota() { - return gQuotaLimit * 1024; - } - -protected: - nsDataHashtable mScopesVersion; - - static uint64_t NextGlobalVersion(); - uint64_t CachedScopeVersion(DOMStorageImpl* aStorage); - - void MarkScopeDirty(DOMStorageImpl* aStorage); - void MarkAllScopesDirty(); - -private: - static uint64_t sGlobalVersion; - - static int32_t gQuotaLimit; -}; - -#endif /* nsDOMStorageDB_h___ */ diff --git a/dom/src/storage/nsDOMStorageDBWrapper.cpp b/dom/src/storage/nsDOMStorageDBWrapper.cpp deleted file mode 100644 index 1c16f67850b4..000000000000 --- a/dom/src/storage/nsDOMStorageDBWrapper.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "nsCOMPtr.h" -#include "nsError.h" -#include "nsDOMStorage.h" -#include "nsDOMStorageDBWrapper.h" -#include "nsIFile.h" -#include "nsIURL.h" -#include "nsIVariant.h" -#include "nsIEffectiveTLDService.h" -#include "nsIScriptSecurityManager.h" -#include "nsAppDirectoryServiceDefs.h" -#include "mozStorageCID.h" -#include "mozStorageHelper.h" -#include "mozIStorageService.h" -#include "mozIStorageValueArray.h" -#include "mozIStorageFunction.h" -#include "nsPrintfCString.h" -#include "nsNetUtil.h" -#include "nsIPrincipal.h" - -void ReverseString(const nsCSubstring& source, nsCSubstring& result) -{ - nsACString::const_iterator sourceBegin, sourceEnd; - source.BeginReading(sourceBegin); - source.EndReading(sourceEnd); - - result.SetLength(source.Length()); - nsACString::iterator destEnd; - result.EndWriting(destEnd); - - while (sourceBegin != sourceEnd) { - *(--destEnd) = *sourceBegin; - ++sourceBegin; - } -} - -nsDOMStorageDBWrapper::nsDOMStorageDBWrapper() -{ -} - -nsDOMStorageDBWrapper::~nsDOMStorageDBWrapper() -{ -} - -void -nsDOMStorageDBWrapper::Close() -{ - mPersistentDB.Close(); -} - -nsresult -nsDOMStorageDBWrapper::Init() -{ - nsresult rv; - - rv = mPersistentDB.Init(NS_LITERAL_STRING("webappsstore.sqlite")); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mSessionOnlyDB.Init(&mPersistentDB); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mPrivateBrowsingDB.Init(); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -nsresult -nsDOMStorageDBWrapper::FlushAndEvictFromCache(bool aIsShuttingDown) -{ - nsresult rv = mPersistentDB.FlushAndEvictFromCache(aIsShuttingDown); - - // Nothing in the cache? Then no need for a timer. - if (!mPersistentDB.IsFlushTimerNeeded()) { - StopCacheFlushTimer(); - } - - return rv; -} - -#define IMPL_FORWARDER_GUTS(_return, _code) \ - PR_BEGIN_MACRO \ - if (aStorage->IsPrivate()) \ - _return mPrivateBrowsingDB._code; \ - if (aStorage->SessionOnly()) \ - _return mSessionOnlyDB._code; \ - _return mPersistentDB._code; \ - PR_END_MACRO - -#define IMPL_FORWARDER(_code) \ - IMPL_FORWARDER_GUTS(return, _code) - -#define IMPL_VOID_FORWARDER(_code) \ - IMPL_FORWARDER_GUTS((void), _code) - -nsresult -nsDOMStorageDBWrapper::GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys) -{ - IMPL_FORWARDER(GetAllKeys(aStorage, aKeys)); -} - -nsresult -nsDOMStorageDBWrapper::GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure) -{ - IMPL_FORWARDER(GetKeyValue(aStorage, aKey, aValue, aSecure)); -} - -nsresult -nsDOMStorageDBWrapper::SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - IMPL_FORWARDER(SetKey(aStorage, aKey, aValue, aSecure)); -} - -nsresult -nsDOMStorageDBWrapper::SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure) -{ - IMPL_FORWARDER(SetSecure(aStorage, aKey, aSecure)); -} - -nsresult -nsDOMStorageDBWrapper::RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey) -{ - IMPL_FORWARDER(RemoveKey(aStorage, aKey)); -} - -nsresult -nsDOMStorageDBWrapper::ClearStorage(DOMStorageImpl* aStorage) -{ - IMPL_FORWARDER(ClearStorage(aStorage)); -} - -void -nsDOMStorageDBWrapper::MarkScopeCached(DOMStorageImpl* aStorage) -{ - IMPL_VOID_FORWARDER(MarkScopeCached(aStorage)); -} - -bool -nsDOMStorageDBWrapper::IsScopeDirty(DOMStorageImpl* aStorage) -{ - IMPL_FORWARDER(IsScopeDirty(aStorage)); -} - -nsresult -nsDOMStorageDBWrapper::DropSessionOnlyStoragesForHost(const nsACString& aHostName) -{ - return mSessionOnlyDB.RemoveOwner(aHostName); -} - -nsresult -nsDOMStorageDBWrapper::DropPrivateBrowsingStorages() -{ - return mPrivateBrowsingDB.RemoveAll(); -} - -nsresult -nsDOMStorageDBWrapper::RemoveOwner(const nsACString& aOwner) -{ - nsresult rv; - - rv = mPrivateBrowsingDB.RemoveOwner(aOwner); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mSessionOnlyDB.RemoveOwner(aOwner); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mPersistentDB.RemoveOwner(aOwner); - NS_ENSURE_SUCCESS(rv, rv); - - return rv; -} - - -nsresult -nsDOMStorageDBWrapper::RemoveAll() -{ - nsresult rv; - - rv = mPrivateBrowsingDB.RemoveAll(); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mSessionOnlyDB.RemoveAll(); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mPersistentDB.RemoveAll(); - NS_ENSURE_SUCCESS(rv, rv); - - return rv; -} - -nsresult -nsDOMStorageDBWrapper::RemoveAllForApp(uint32_t aAppId, bool aOnlyBrowserElement) -{ - // We only care about removing the permament storage. Temporary storage such - // as session storage or private browsing storage will not be re-used anyway - // and will be automatically deleted at some point. - return mPersistentDB.RemoveAllForApp(aAppId, aOnlyBrowserElement); -} - -nsresult -nsDOMStorageDBWrapper::GetUsage(DOMStorageImpl* aStorage, int32_t *aUsage) -{ - IMPL_FORWARDER(GetUsage(aStorage, aUsage)); -} - -nsresult -nsDOMStorageDBWrapper::GetUsage(const nsACString& aDomain, - int32_t *aUsage, bool aPrivate) -{ - if (aPrivate) - return mPrivateBrowsingDB.GetUsage(aDomain, aUsage); - -#if 0 - // XXX Check where from all this method gets called, not sure this should - // include any potential session-only data - nsresult rv; - rv = mSessionOnlyDB.GetUsage(aDomain, aUsage); - if (NS_SUECEEDED(rv)) - return rv; -#endif - - return mPersistentDB.GetUsage(aDomain, aUsage); -} - -nsresult -nsDOMStorageDBWrapper::CreateScopeDBKey(nsIPrincipal* aPrincipal, - nsACString& aKey) -{ - nsCOMPtr uri; - nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri)); - NS_ENSURE_SUCCESS(rv, rv); - NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED); - - nsAutoCString domainScope; - rv = uri->GetAsciiHost(domainScope); - NS_ENSURE_SUCCESS(rv, rv); - - if (domainScope.IsEmpty()) { - // About pages have an empty host but a valid path. Since they are handled - // internally by our own redirector, we can trust them and use path as key. - // if file:/// protocol, let's make the exact directory the domain - bool isScheme = false; - if ((NS_SUCCEEDED(uri->SchemeIs("about", &isScheme)) && isScheme) || - (NS_SUCCEEDED(uri->SchemeIs("moz-safe-about", &isScheme)) && isScheme)) { - rv = uri->GetPath(domainScope); - NS_ENSURE_SUCCESS(rv, rv); - // While the host is always canonicalized to lowercase, the path is not, - // thus need to force the casing. - ToLowerCase(domainScope); - } - else if (NS_SUCCEEDED(uri->SchemeIs("file", &isScheme)) && isScheme) { - nsCOMPtr url = do_QueryInterface(uri, &rv); - NS_ENSURE_SUCCESS(rv, rv); - rv = url->GetDirectory(domainScope); - NS_ENSURE_SUCCESS(rv, rv); - } - } - - nsAutoCString key; - - rv = CreateReversedDomain(domainScope, key); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoCString scheme; - rv = uri->GetScheme(scheme); - NS_ENSURE_SUCCESS(rv, rv); - - key.Append(NS_LITERAL_CSTRING(":") + scheme); - - int32_t port = NS_GetRealPort(uri); - if (port != -1) { - key.Append(nsPrintfCString(":%d", port)); - } - - uint32_t appId; - rv = aPrincipal->GetAppId(&appId); - NS_ENSURE_SUCCESS(rv, rv); - - bool isInBrowserElement; - rv = aPrincipal->GetIsInBrowserElement(&isInBrowserElement); - NS_ENSURE_SUCCESS(rv, rv); - - if (appId == nsIScriptSecurityManager::NO_APP_ID && !isInBrowserElement) { - aKey.Assign(key); - return NS_OK; - } - - aKey.Truncate(); - aKey.AppendInt(appId); - aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? - NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + - NS_LITERAL_CSTRING(":") + key); - - return NS_OK; -} - -nsresult -nsDOMStorageDBWrapper::CreateReversedDomain(const nsACString& aAsciiDomain, - nsACString& aKey) -{ - if (aAsciiDomain.IsEmpty()) - return NS_ERROR_NOT_AVAILABLE; - - ReverseString(aAsciiDomain, aKey); - - aKey.AppendLiteral("."); - return NS_OK; -} - -nsresult -nsDOMStorageDBWrapper::CreateQuotaDBKey(nsIPrincipal* aPrincipal, - nsACString& aKey) -{ - nsresult rv; - - nsAutoCString subdomainsDBKey; - nsCOMPtr eTLDService(do_GetService( - NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr uri; - rv = aPrincipal->GetURI(getter_AddRefs(uri)); - NS_ENSURE_SUCCESS(rv, rv); - NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED); - - nsAutoCString eTLDplusOne; - rv = eTLDService->GetBaseDomain(uri, 0, eTLDplusOne); - if (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS == rv) { - // XXX bug 357323 - what to do for localhost/file exactly? - rv = uri->GetAsciiHost(eTLDplusOne); - } - NS_ENSURE_SUCCESS(rv, rv); - - CreateReversedDomain(eTLDplusOne, subdomainsDBKey); - - uint32_t appId; - rv = aPrincipal->GetAppId(&appId); - NS_ENSURE_SUCCESS(rv, rv); - - bool isInBrowserElement; - rv = aPrincipal->GetIsInBrowserElement(&isInBrowserElement); - NS_ENSURE_SUCCESS(rv, rv); - - if (appId == nsIScriptSecurityManager::NO_APP_ID && !isInBrowserElement) { - aKey.Assign(subdomainsDBKey); - return NS_OK; - } - - aKey.Truncate(); - aKey.AppendInt(appId); - aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? - NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + - NS_LITERAL_CSTRING(":") + subdomainsDBKey); - - return NS_OK; -} - -void -nsDOMStorageDBWrapper::EnsureCacheFlushTimer() -{ - if (!mCacheFlushTimer) { - nsresult rv; - mCacheFlushTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv); - - if (!NS_SUCCEEDED(rv)) { - mCacheFlushTimer = nullptr; - return; - } - - mCacheFlushTimer->Init(nsDOMStorageManager::gStorageManager, 5000, - nsITimer::TYPE_REPEATING_SLACK); - } -} - -void -nsDOMStorageDBWrapper::StopCacheFlushTimer() -{ - if (mCacheFlushTimer) { - mCacheFlushTimer->Cancel(); - mCacheFlushTimer = nullptr; - } -} - diff --git a/dom/src/storage/nsDOMStorageDBWrapper.h b/dom/src/storage/nsDOMStorageDBWrapper.h deleted file mode 100644 index 6b760d846668..000000000000 --- a/dom/src/storage/nsDOMStorageDBWrapper.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsDOMStorageDB_h___ -#define nsDOMStorageDB_h___ - -#include "nscore.h" -#include "nsTHashtable.h" - -#include "nsDOMStoragePersistentDB.h" -#include "nsDOMStorageMemoryDB.h" - -extern void ReverseString(const nsCSubstring& source, nsCSubstring& result); - -class nsDOMStorage; -class nsSessionStorageEntry; - -/** - * For the purposes of quota checking, we want to be able to efficiently - * reference data items that belong to a host or its subhosts. We do this by - * using a reversed domain name as the key for an item. For example, a - * storage for foo.bar.com would use a key of 'moc.rab.oof.". - * - * Additionally, globalStorage and localStorage items must be distinguished. - * globalStorage items are scoped to the host, and localStorage are items are - * scoped to the scheme/host/port. To scope localStorage data, its port and - * scheme are appended to its key. http://foo.bar.com is stored as - * moc.rab.foo.:http:80. - * - * So the following queries can be used, for http://foo.bar.com: - * - * All data owned by globalStorage["foo.bar.com"] -> SELECT * WHERE Domain = - * "moc.rab.foo.:" - * - * All data owned by localStorage -> SELECT * WHERE Domain = - * "moc.rab.foo.:http:80" - * - * All data owned by foo.bar.com, in any storage -> - * SELECT * WHERE Domain GLOB "moc.rab.foo.:*" - * - * All data owned by foo.bar.com or any subdomain, in any storage -> - * SELECT * WHERE Domain GLOB "moc.rab.foo.*". - * - * This key is called the "scope DB key" throughout the code. So the scope DB - * key for localStorage at http://foo.bar.com is "moc.rab.foo.:http:80". - * - * When calculating quotas, we want to lump together everything in an ETLD+1. - * So we use a "quota key" during lookups to calculate the quota. So the - * quota key for localStorage at http://foo.bar.com is "moc.rab.". */ - -class nsDOMStorageDBWrapper -{ -public: - nsDOMStorageDBWrapper(); - ~nsDOMStorageDBWrapper(); - - /** - * Close the connections, finalizing all the cached statements. - */ - void Close(); - - nsresult - Init(); - - /** - * Retrieve a list of all the keys associated with a particular domain. - */ - nsresult - GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys); - - /** - * Retrieve a value and secure flag for a key from storage. - * - * @throws NS_ERROR_DOM_NOT_FOUND_ERR if key not found - */ - nsresult - GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - - /** - * Set the value and secure flag for a key in storage. - */ - nsresult - SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - - /** - * Set the secure flag for a key in storage. Does nothing if the key was - * not found. - */ - nsresult - SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure); - - /** - * Removes a key from storage. - */ - nsresult - RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey); - - /** - * Remove all keys belonging to this storage. - */ - nsresult - ClearStorage(DOMStorageImpl* aStorage); - - /** - * Drop session-only storage for a specific host and all it's subdomains - */ - nsresult - DropSessionOnlyStoragesForHost(const nsACString& aHostName); - - /** - * Drop everything we gathered to private browsing in-memory database - */ - nsresult - DropPrivateBrowsingStorages(); - - /** - * Removes all keys added by a given domain. - */ - nsresult - RemoveOwner(const nsACString& aOwner); - - /** - * Removes all keys from storage. Used when clearing storage. - */ - nsresult - RemoveAll(); - - /** - * Removes all keys from storage for a specific app. - * If aOnlyBrowserElement is true, it will remove only keys with the - * browserElement flag set. - * aAppId has to be a valid app id. It can't be NO_APP_ID or UNKNOWN_APP_ID. - */ - nsresult - RemoveAllForApp(uint32_t aAppId, bool aOnlyBrowserElement); - - /** - * Returns usage for a storage using its GetQuotaDBKey() as a key. - */ - nsresult - GetUsage(DOMStorageImpl* aStorage, int32_t *aUsage); - - /** - * Returns usage of the domain and optionaly by any subdomain. - */ - nsresult - GetUsage(const nsACString& aDomain, int32_t *aUsage, bool aPrivate); - - /** - * Marks the storage as "cached" after the DOMStorageImpl object has loaded - * all items to its memory copy of the entries - IsScopeDirty returns false - * after call of this method for this storage. - * - * When a key is changed or deleted in the storage, the storage scope is - * marked as "dirty" again and makes the DOMStorageImpl object recache its - * keys on next access, because IsScopeDirty returns true again. - */ - void - MarkScopeCached(DOMStorageImpl* aStorage); - - /** - * Test whether the storage for the scope (i.e. origin or host) has been - * changed since the last MarkScopeCached call. - */ - bool - IsScopeDirty(DOMStorageImpl* aStorage); - - /** - * Turns "http://foo.bar.com:80" to "moc.rab.oof.:http:80", - * i.e. reverses the host, appends a dot, appends the schema - * and a port number. - */ - static nsresult CreateScopeDBKey(nsIPrincipal* aPrincipal, nsACString& aKey); - - /** - * Turns "http://foo.bar.com" to "moc.rab.oof.", - * i.e. reverses the host and appends a dot. - */ - static nsresult CreateReversedDomain(nsIURI* aUri, nsACString& aKey); - static nsresult CreateReversedDomain(const nsACString& aAsciiDomain, nsACString& aKey); - - /** - * Turns "foo.bar.com" to "moc.rab.", - * i.e. extracts eTLD+1 from the host, reverses the result - * and appends a dot. - */ - static nsresult CreateQuotaDBKey(nsIPrincipal* aPrincipal, - nsACString& aKey); - - /** - * Turns "foo.bar.com" to "moc.rab.", - * i.e. extracts eTLD+1 from the host, reverses the result - * and appends a dot. - */ - static nsresult CreateQuotaDBKey(const nsACString& aDomain, - nsACString& aKey) - { - return CreateReversedDomain(aDomain, aKey); - } - - /** - * Ensures the cache flush timer is running. This is called when we add - * data that will need to be flushed. - */ - void EnsureCacheFlushTimer(); - - /** - * Called by the timer or on shutdown/profile change to evict scopes - * that have not been used in a long time and to flush new data to disk. - */ - nsresult FlushAndEvictFromCache(bool aIsShuttingDown); - - /** - * Stops the cache flush timer. - */ - void StopCacheFlushTimer(); - -protected: - nsDOMStoragePersistentDB mPersistentDB; - nsDOMStorageMemoryDB mSessionOnlyDB; - nsDOMStorageMemoryDB mPrivateBrowsingDB; - - nsCOMPtr mCacheFlushTimer; -}; - -#endif /* nsDOMStorageDB_h___ */ diff --git a/dom/src/storage/nsDOMStorageMemoryDB.cpp b/dom/src/storage/nsDOMStorageMemoryDB.cpp deleted file mode 100644 index 8c319cc4aa9d..000000000000 --- a/dom/src/storage/nsDOMStorageMemoryDB.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "nsCOMPtr.h" -#include "nsError.h" -#include "nsDOMStorage.h" -#include "nsDOMStorageMemoryDB.h" -#include "nsNetUtil.h" - -nsresult -nsDOMStorageMemoryDB::Init(nsDOMStoragePersistentDB* aPreloadDB) -{ - mData.Init(20); - - mPreloadDB = aPreloadDB; - return NS_OK; -} - -static PLDHashOperator -AllKeyEnum(nsSessionStorageEntry* aEntry, void* userArg) -{ - nsDOMStorageMemoryDB::nsStorageItemsTable *target = - (nsDOMStorageMemoryDB::nsStorageItemsTable *)userArg; - - nsDOMStorageMemoryDB::nsInMemoryItem* item = - new nsDOMStorageMemoryDB::nsInMemoryItem(); - if (!item) - return PL_DHASH_STOP; - - aEntry->mItem->GetValue(item->mValue); - nsresult rv = aEntry->mItem->GetSecure(&item->mSecure); - if (NS_FAILED(rv)) - item->mSecure = false; - - target->Put(aEntry->GetKey(), item); - return PL_DHASH_NEXT; -} - -nsresult -nsDOMStorageMemoryDB::GetItemsTable(DOMStorageImpl* aStorage, - nsInMemoryStorage** aMemoryStorage) -{ - if (mData.Get(aStorage->GetScopeDBKey(), aMemoryStorage)) - return NS_OK; - - *aMemoryStorage = nullptr; - - nsInMemoryStorage* storageData = new nsInMemoryStorage(); - if (!storageData) - return NS_ERROR_OUT_OF_MEMORY; - - storageData->mTable.Init(); - - if (mPreloadDB) { - nsresult rv; - - nsTHashtable keys; - keys.Init(); - - rv = mPreloadDB->GetAllKeys(aStorage, &keys); - NS_ENSURE_SUCCESS(rv, rv); - - mPreloading = true; - keys.EnumerateEntries(AllKeyEnum, &storageData->mTable); - mPreloading = false; - } - - mData.Put(aStorage->GetScopeDBKey(), storageData); - *aMemoryStorage = storageData; - - return NS_OK; -} - -struct GetAllKeysEnumStruc -{ - nsTHashtable* mTarget; - DOMStorageImpl* mStorage; -}; - -static PLDHashOperator -GetAllKeysEnum(const nsAString& keyname, - nsDOMStorageMemoryDB::nsInMemoryItem* item, - void *closure) -{ - GetAllKeysEnumStruc* struc = (GetAllKeysEnumStruc*)closure; - - nsSessionStorageEntry* entry = struc->mTarget->PutEntry(keyname); - if (!entry) - return PL_DHASH_STOP; - - entry->mItem = new nsDOMStorageItem(struc->mStorage, - keyname, - EmptyString(), - item->mSecure); - if (!entry->mItem) - return PL_DHASH_STOP; - - return PL_DHASH_NEXT; -} - -nsresult -nsDOMStorageMemoryDB::GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys) -{ - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - GetAllKeysEnumStruc struc; - struc.mTarget = aKeys; - struc.mStorage = aStorage; - storage->mTable.EnumerateRead(GetAllKeysEnum, &struc); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure) -{ - if (mPreloading) { - NS_PRECONDITION(mPreloadDB, "Must have a preload DB set when preloading"); - return mPreloadDB->GetKeyValue(aStorage, aKey, aValue, aSecure); - } - - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - nsInMemoryItem* item; - if (!storage->mTable.Get(aKey, &item)) - return NS_ERROR_DOM_NOT_FOUND_ERR; - - aValue = item->mValue; - *aSecure = item->mSecure; - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t usage = 0; - if (!aStorage->GetQuotaDBKey().IsEmpty()) { - rv = GetUsage(aStorage, &usage); - NS_ENSURE_SUCCESS(rv, rv); - } - - usage += aKey.Length() + aValue.Length(); - - nsInMemoryItem* item; - if (!storage->mTable.Get(aKey, &item)) { - if (usage > GetQuota()) { - return NS_ERROR_DOM_QUOTA_REACHED; - } - - item = new nsInMemoryItem(); - if (!item) - return NS_ERROR_OUT_OF_MEMORY; - - storage->mTable.Put(aKey, item); - storage->mUsageDelta += aKey.Length(); - } - else - { - if (!aSecure && item->mSecure) - return NS_ERROR_DOM_SECURITY_ERR; - usage -= aKey.Length() + item->mValue.Length(); - if (usage > GetQuota()) { - return NS_ERROR_DOM_QUOTA_REACHED; - } - } - - storage->mUsageDelta += aValue.Length() - item->mValue.Length(); - - item->mValue = aValue; - item->mSecure = aSecure; - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure) -{ - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - nsInMemoryItem* item; - if (!storage->mTable.Get(aKey, &item)) - return NS_ERROR_DOM_NOT_FOUND_ERR; - - item->mSecure = aSecure; - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey) -{ - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - nsInMemoryItem* item; - if (!storage->mTable.Get(aKey, &item)) - return NS_ERROR_DOM_NOT_FOUND_ERR; - - storage->mUsageDelta -= aKey.Length() + item->mValue.Length(); - storage->mTable.Remove(aKey); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -static PLDHashOperator -RemoveAllKeysEnum(const nsAString& keyname, - nsAutoPtr& item, - void *closure) -{ - nsDOMStorageMemoryDB::nsInMemoryStorage* storage = - (nsDOMStorageMemoryDB::nsInMemoryStorage*)closure; - - storage->mUsageDelta -= keyname.Length() + item->mValue.Length(); - return PL_DHASH_REMOVE; -} - -nsresult -nsDOMStorageMemoryDB::ClearStorage(DOMStorageImpl* aStorage) -{ - nsresult rv; - - nsInMemoryStorage* storage; - rv = GetItemsTable(aStorage, &storage); - NS_ENSURE_SUCCESS(rv, rv); - - storage->mTable.Enumerate(RemoveAllKeysEnum, storage); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::DropStorage(DOMStorageImpl* aStorage) -{ - mData.Remove(aStorage->GetScopeDBKey()); - MarkScopeDirty(aStorage); - return NS_OK; -} - -struct RemoveOwnersStruc -{ - nsCString* mSubDomain; - bool mMatch; -}; - -static PLDHashOperator -RemoveOwnersEnum(const nsACString& key, - nsAutoPtr& storage, - void *closure) -{ - RemoveOwnersStruc* struc = (RemoveOwnersStruc*)closure; - - if (StringBeginsWith(key, *(struc->mSubDomain)) == struc->mMatch) - return PL_DHASH_REMOVE; - - return PL_DHASH_NEXT; -} - -nsresult -nsDOMStorageMemoryDB::RemoveOwner(const nsACString& aOwner) -{ - nsAutoCString subdomainsDBKey; - nsDOMStorageDBWrapper::CreateReversedDomain(aOwner, subdomainsDBKey); - - RemoveOwnersStruc struc; - struc.mSubDomain = &subdomainsDBKey; - struc.mMatch = true; - mData.Enumerate(RemoveOwnersEnum, &struc); - - MarkAllScopesDirty(); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::RemoveAll() -{ - mData.Clear(); // XXX Check this releases all instances - - MarkAllScopesDirty(); - - return NS_OK; -} - -nsresult -nsDOMStorageMemoryDB::GetUsage(DOMStorageImpl* aStorage, int32_t *aUsage) -{ - return GetUsageInternal(aStorage->GetQuotaDBKey(), aUsage); -} - -nsresult -nsDOMStorageMemoryDB::GetUsage(const nsACString& aDomain, - int32_t *aUsage) -{ - nsresult rv; - - nsAutoCString quotaDBKey; - rv = nsDOMStorageDBWrapper::CreateQuotaDBKey(aDomain, quotaDBKey); - NS_ENSURE_SUCCESS(rv, rv); - - return GetUsageInternal(quotaDBKey, aUsage); -} - -struct GetUsageEnumStruc -{ - int32_t mUsage; - nsCString mSubdomain; -}; - -static PLDHashOperator -GetUsageEnum(const nsACString& key, - nsDOMStorageMemoryDB::nsInMemoryStorage* storageData, - void *closure) -{ - GetUsageEnumStruc* struc = (GetUsageEnumStruc*)closure; - - if (StringBeginsWith(key, struc->mSubdomain)) { - struc->mUsage += storageData->mUsageDelta; - } - - return PL_DHASH_NEXT; -} - -nsresult -nsDOMStorageMemoryDB::GetUsageInternal(const nsACString& aQuotaDBKey, - int32_t *aUsage) -{ - GetUsageEnumStruc struc; - struc.mUsage = 0; - struc.mSubdomain = aQuotaDBKey; - - if (mPreloadDB) { - nsresult rv; - - rv = mPreloadDB->GetUsageInternal(aQuotaDBKey, &struc.mUsage); - NS_ENSURE_SUCCESS(rv, rv); - } - - mData.EnumerateRead(GetUsageEnum, &struc); - - *aUsage = struc.mUsage; - return NS_OK; -} diff --git a/dom/src/storage/nsDOMStorageMemoryDB.h b/dom/src/storage/nsDOMStorageMemoryDB.h deleted file mode 100644 index da08ae2ea692..000000000000 --- a/dom/src/storage/nsDOMStorageMemoryDB.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsDOMStorageMemoryDB_h___ -#define nsDOMStorageMemoryDB_h___ - -#include "nscore.h" -#include "nsDOMStorageBaseDB.h" -#include "nsClassHashtable.h" -#include "nsDataHashtable.h" - -class nsDOMStoragePersistentDB; - -class nsDOMStorageMemoryDB : public nsDOMStorageBaseDB -{ -public: - nsDOMStorageMemoryDB() : mPreloading(false) {} - ~nsDOMStorageMemoryDB() {} - - class nsInMemoryItem - { - public: - bool mSecure; - nsString mValue; - }; - - typedef nsClassHashtable nsStorageItemsTable; - - class nsInMemoryStorage - { - public: - nsStorageItemsTable mTable; - int32_t mUsageDelta; - - nsInMemoryStorage() : mUsageDelta(0) {} - }; - - /** - * @param aPreloadDB - * If non-null, data for a domain/origin will be preloaded from - * the provided database. Used for session-only cookies mode to - * provide existing data from the persistent database. - */ - nsresult - Init(nsDOMStoragePersistentDB* aPreloadDB = nullptr); - - /** - * - */ - nsresult - GetItemsTable(DOMStorageImpl* aStorage, - nsInMemoryStorage** aMemoryStorage); - - /** - * Retrieve a list of all the keys associated with a particular domain. - */ - nsresult - GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys); - - /** - * Retrieve a value and secure flag for a key from storage. - * - * @throws NS_ERROR_DOM_NOT_FOUND_ERR if key not found - */ - nsresult - GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - - /** - * Set the value and secure flag for a key in storage. - */ - nsresult - SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - - /** - * Set the secure flag for a key in storage. Does nothing if the key was - * not found. - */ - nsresult - SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure); - - /** - * Removes a key from storage. - */ - nsresult - RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey); - - /** - * Remove all keys belonging to this storage. - */ - nsresult - ClearStorage(DOMStorageImpl* aStorage); - - /** - * If we have changed the persistent storage, drop any potential session storages - */ - nsresult - DropStorage(DOMStorageImpl* aStorage); - - /** - * Removes all keys added by a given domain. - */ - nsresult - RemoveOwner(const nsACString& aOwner); - - /** - * Removes all keys from storage. Used when clearing storage. - */ - nsresult - RemoveAll(); - - /** - * Returns usage for a storage using its GetQuotaDBKey() as a key. - */ - nsresult - GetUsage(DOMStorageImpl* aStorage, int32_t *aUsage); - - /** - * Returns usage of the domain and optionaly by any subdomain. - */ - nsresult - GetUsage(const nsACString& aDomain, int32_t *aUsage); - -protected: - - nsClassHashtable mData; - nsDOMStoragePersistentDB* mPreloadDB; - bool mPreloading; - - nsresult - GetUsageInternal(const nsACString& aQuotaDBKey, int32_t *aUsage); -}; - -#endif diff --git a/dom/src/storage/nsDOMStoragePersistentDB.cpp b/dom/src/storage/nsDOMStoragePersistentDB.cpp deleted file mode 100644 index 73169070ab1c..000000000000 --- a/dom/src/storage/nsDOMStoragePersistentDB.cpp +++ /dev/null @@ -1,1143 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "mozilla/Attributes.h" -#include "mozilla/DebugOnly.h" - -#include "nsError.h" -#include "nsDOMStorage.h" -#include "nsDOMStorageDBWrapper.h" -#include "nsDOMStoragePersistentDB.h" -#include "nsIFile.h" -#include "nsIVariant.h" -#include "nsAppDirectoryServiceDefs.h" -#include "mozStorageCID.h" -#include "mozStorageHelper.h" -#include "mozIStorageService.h" -#include "mozIStorageBindingParamsArray.h" -#include "mozIStorageBindingParams.h" -#include "mozIStorageValueArray.h" -#include "mozIStorageFunction.h" -#include "nsNetUtil.h" -#include "mozilla/Telemetry.h" -#include "nsThreadUtils.h" - -#include "GeckoProfiler.h" - -using namespace mozilla; - -// Write Ahead Log's maximum size is 512KB -#define MAX_WAL_SIZE_BYTES 512 * 1024 - -namespace { - -/** - * Notifier for asynchronous flushes - */ -class FlushCallbackTask : public nsRunnable -{ -public: - FlushCallbackTask(nsDOMStoragePersistentDB* aDB) - : mDB(aDB), mSuccess(true) - {} - NS_IMETHOD Run(); - void SetFlushResult(bool aSucceeded) - { - MOZ_ASSERT(!NS_IsMainThread()); - mSuccess = aSucceeded; - } -private: - nsDOMStoragePersistentDB* mDB; - bool mSuccess; -}; - -/** - * Task for off-main-thread flushes - */ -class FlushTask : public nsRunnable { -public: - FlushTask(nsDOMStoragePersistentDB* aDB, FlushCallbackTask* aCallback) - : mDB(aDB), mCallback(aCallback) - {} - NS_IMETHOD Run(); -private: - nsDOMStoragePersistentDB* mDB; - nsRefPtr mCallback; -}; - -/** - * The flush task runs on a helper thread to prevent main-thread jank. - * It dispatches a completion notifier to the main thread. - */ -nsresult -FlushTask::Run() -{ - MOZ_ASSERT(!NS_IsMainThread()); - - nsresult rv = mDB->Flush(); - mCallback->SetFlushResult(NS_SUCCEEDED(rv)); - - // Dispatch a notification event to the main thread - rv = NS_DispatchToMainThread(mCallback, NS_DISPATCH_NORMAL); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -/** - * FlushCallbackTask notifies the main thread of the results of - * asynchronous flush operations - */ -nsresult -FlushCallbackTask::Run() -{ - MOZ_ASSERT(NS_IsMainThread()); - mDB->HandleFlushComplete(mSuccess); - return NS_OK; -} - -} // anonymous namespace - -nsresult -nsDOMStoragePersistentDB::Flush() -{ - if (!mFlushStatements.Length()) { - return NS_OK; - } - - Telemetry::AutoTimer timer; - - // Make the flushes atomic - mozStorageTransaction transaction(mWriteConnection, false); - - nsresult rv; - for (uint32_t i = 0; i < mFlushStatements.Length(); ++i) { - if (mFlushStatementParams[i]) { - rv = mFlushStatements[i]->BindParameters(mFlushStatementParams[i]); - NS_ENSURE_SUCCESS(rv, rv); - } - rv = mFlushStatements[i]->Execute(); - NS_ENSURE_SUCCESS(rv, rv); - } - rv = transaction.Commit(); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -/** - * Succesful flushes clear the "pending" flags. - * Failed flushes cause the scopes involved in the flush to be marked dirty. - */ -void -nsDOMStoragePersistentDB::HandleFlushComplete(bool aSucceeded) -{ - MOZ_ASSERT(mIsFlushPending); - - if (aSucceeded) { - mCache.MarkScopesFlushed(); - } else { - mCache.MarkFlushFailed(); - mWasRemoveAllCalled |= mIsRemoveAllPending; - } - - mIsRemoveAllPending = false; - mIsFlushPending = false; - mFlushStatements.Clear(); - mFlushStatementParams.Clear(); -} - -class nsReverseStringSQLFunction MOZ_FINAL : public mozIStorageFunction -{ - NS_DECL_ISUPPORTS - NS_DECL_MOZISTORAGEFUNCTION -}; - -NS_IMPL_ISUPPORTS1(nsReverseStringSQLFunction, mozIStorageFunction) - -NS_IMETHODIMP -nsReverseStringSQLFunction::OnFunctionCall( - mozIStorageValueArray *aFunctionArguments, nsIVariant **aResult) -{ - nsAutoCString stringToReverse; - nsresult rv = aFunctionArguments->GetUTF8String(0, stringToReverse); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoCString result; - ReverseString(stringToReverse, result); - - nsCOMPtr outVar(do_CreateInstance( - NS_VARIANT_CONTRACTID, &rv)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = outVar->SetAsAUTF8String(result); - NS_ENSURE_SUCCESS(rv, rv); - - *aResult = outVar.get(); - outVar.forget(); - return NS_OK; -} - -nsDOMStoragePersistentDB::nsDOMStoragePersistentDB() -: mReadStatements(mReadConnection), mWriteStatements(mWriteConnection), - mWasRemoveAllCalled(false), mIsRemoveAllPending(false), mIsFlushPending(false) -{ - mQuotaUseByUncached.Init(16); -} - -nsresult -nsDOMStoragePersistentDB::Init(const nsString& aDatabaseName) -{ - nsCOMPtr storageFile; - nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, - getter_AddRefs(storageFile)); - NS_ENSURE_SUCCESS(rv, rv); - rv = storageFile->Append(aDatabaseName); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr service; - - service = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - rv = service->OpenUnsharedDatabase(storageFile, getter_AddRefs(mWriteConnection)); - if (rv == NS_ERROR_FILE_CORRUPTED) { - // delete the db and try opening again - rv = storageFile->Remove(false); - NS_ENSURE_SUCCESS(rv, rv); - rv = service->OpenUnsharedDatabase(storageFile, getter_AddRefs(mWriteConnection)); - } - NS_ENSURE_SUCCESS(rv, rv); - - // First try setting the DB's journal to WAL mode. - // WAL mode allows reads from the main thread to be concurrent with writes - // from the helper thread. - // - // Side note: The default sync mode for the DB is 'FULL' -- fsyncs after every - // transaction commit (very reliable). - if (NS_SUCCEEDED(SetJournalMode(true))) { - // Spawn helper thread - rv = ::NS_NewNamedThread("DOM Storage", getter_AddRefs(mFlushThread)); - NS_ENSURE_SUCCESS(rv, rv); - rv = ConfigureWalBehavior(); - NS_ENSURE_SUCCESS(rv, rv); - } else { - // Shared-memory WAL might not be supported on this platform, so fall back - // to truncate mode and reads+writes on the main thread. - rv = SetJournalMode(false); - NS_ENSURE_SUCCESS(rv, rv); - } - - // Create a read-only clone - (void)mWriteConnection->Clone(true, getter_AddRefs(mReadConnection)); - NS_ENSURE_TRUE(mReadConnection, NS_ERROR_FAILURE); - - mozStorageTransaction transaction(mWriteConnection, false); - - // Ensure Gecko 1.9.1 storage table - rv = mWriteConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( - "CREATE TABLE IF NOT EXISTS webappsstore2 (" - "scope TEXT, " - "key TEXT, " - "value TEXT, " - "secure INTEGER, " - "owner TEXT)")); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mWriteConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( - "CREATE UNIQUE INDEX IF NOT EXISTS scope_key_index" - " ON webappsstore2(scope, key)")); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr function1(new nsReverseStringSQLFunction()); - NS_ENSURE_TRUE(function1, NS_ERROR_OUT_OF_MEMORY); - - rv = mWriteConnection->CreateFunction(NS_LITERAL_CSTRING("REVERSESTRING"), 1, function1); - NS_ENSURE_SUCCESS(rv, rv); - - // Check if there is storage of Gecko 1.9.0 and if so, upgrade that storage - // to actual webappsstore2 table and drop the obsolete table. First process - // this newer table upgrade to priority potential duplicates from older - // storage table. - bool exists; - rv = mWriteConnection->TableExists(NS_LITERAL_CSTRING("webappsstore"), - &exists); - NS_ENSURE_SUCCESS(rv, rv); - - if (exists) { - rv = mWriteConnection->ExecuteSimpleSQL( - NS_LITERAL_CSTRING("INSERT OR IGNORE INTO " - "webappsstore2(scope, key, value, secure, owner) " - "SELECT REVERSESTRING(domain) || '.:', key, value, secure, owner " - "FROM webappsstore")); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mWriteConnection->ExecuteSimpleSQL( - NS_LITERAL_CSTRING("DROP TABLE webappsstore")); - NS_ENSURE_SUCCESS(rv, rv); - } - - // Check if there is storage of Gecko 1.8 and if so, upgrade that storage - // to actual webappsstore2 table and drop the obsolete table. Potential - // duplicates will be ignored. - rv = mWriteConnection->TableExists(NS_LITERAL_CSTRING("moz_webappsstore"), - &exists); - NS_ENSURE_SUCCESS(rv, rv); - - if (exists) { - rv = mWriteConnection->ExecuteSimpleSQL( - NS_LITERAL_CSTRING("INSERT OR IGNORE INTO " - "webappsstore2(scope, key, value, secure, owner) " - "SELECT REVERSESTRING(domain) || '.:', key, value, secure, domain " - "FROM moz_webappsstore")); - NS_ENSURE_SUCCESS(rv, rv); - - rv = mWriteConnection->ExecuteSimpleSQL( - NS_LITERAL_CSTRING("DROP TABLE moz_webappsstore")); - NS_ENSURE_SUCCESS(rv, rv); - } - - rv = transaction.Commit(); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::SetJournalMode(bool aIsWal) -{ - nsAutoCString stmtString( - MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA journal_mode = "); - if (aIsWal) { - stmtString.AppendLiteral("wal"); - } else { - stmtString.AppendLiteral("truncate"); - } - - nsCOMPtr stmt; - nsresult rv = mWriteConnection->CreateStatement(stmtString, getter_AddRefs(stmt)); - NS_ENSURE_SUCCESS(rv, rv); - - bool hasResult = false; - rv = stmt->ExecuteStep(&hasResult); - NS_ENSURE_SUCCESS(rv, rv); - if (!hasResult) { - return NS_ERROR_FAILURE; - } - - nsAutoCString journalMode; - rv = stmt->GetUTF8String(0, journalMode); - NS_ENSURE_SUCCESS(rv, rv); - if ((aIsWal && !journalMode.EqualsLiteral("wal")) || - (!aIsWal && !journalMode.EqualsLiteral("truncate"))) { - return NS_ERROR_FAILURE; - } - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::ConfigureWalBehavior() -{ - // Get the DB's page size - nsCOMPtr stmt; - nsresult rv = mWriteConnection->CreateStatement(NS_LITERAL_CSTRING( - MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size" - ), getter_AddRefs(stmt)); - NS_ENSURE_SUCCESS(rv, rv); - - bool hasResult = false; - rv = stmt->ExecuteStep(&hasResult); - NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && hasResult, NS_ERROR_FAILURE); - - int32_t pageSize = 0; - rv = stmt->GetInt32(0, &pageSize); - NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && pageSize > 0, NS_ERROR_UNEXPECTED); - - // Set the threshold for auto-checkpointing the WAL. - // We don't want giant logs slowing down reads & shutdown. - int32_t thresholdInPages = static_cast(MAX_WAL_SIZE_BYTES / pageSize); - nsAutoCString thresholdPragma("PRAGMA wal_autocheckpoint = "); - thresholdPragma.AppendInt(thresholdInPages); - rv = mWriteConnection->ExecuteSimpleSQL(thresholdPragma); - NS_ENSURE_SUCCESS(rv, rv); - - // Set the maximum WAL log size to reduce footprint on mobile (large empty - // WAL files will be truncated) - nsAutoCString journalSizePragma("PRAGMA journal_size_limit = "); - // bug 600307: mak recommends setting this to 3 times the auto-checkpoint threshold - journalSizePragma.AppendInt(MAX_WAL_SIZE_BYTES * 3); - rv = mWriteConnection->ExecuteSimpleSQL(journalSizePragma); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -void -nsDOMStoragePersistentDB::Close() -{ - if (mFlushThread) { - mFlushThread->Shutdown(); - mFlushThread = nullptr; - } - - mFlushStatements.Clear(); - mFlushStatementParams.Clear(); - mReadStatements.FinalizeStatements(); - mWriteStatements.FinalizeStatements(); - mReadConnection->Close(); - mWriteConnection->Close(); - - // The cache has already been force-flushed - DOMStorageImpl::gStorageDB->StopCacheFlushTimer(); -} - -bool -nsDOMStoragePersistentDB::IsFlushTimerNeeded() const -{ - // We need the flush timer to evict unused scopes, flush changes - // and retry failed flushes. - return (mCache.Count() > 0 || - mWasRemoveAllCalled || mIsRemoveAllPending || - mIsFlushPending); -} - -nsresult -nsDOMStoragePersistentDB::FetchScope(DOMStorageImpl* aStorage, - nsScopeCache* aScopeCache) -{ - if (mWasRemoveAllCalled || mIsRemoveAllPending) { - return NS_OK; - } - - Telemetry::AutoTimer timer; - - // Get the keys for the requested scope - nsCOMPtr keysStmt = mReadStatements.GetCachedStatement( - "SELECT key, value, secure FROM webappsstore2" - " WHERE scope = :scopeKey" - ); - NS_ENSURE_STATE(keysStmt); - mozStorageStatementScoper scope(keysStmt); - - nsresult rv = keysStmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scopeKey"), - aStorage->GetScopeDBKey()); - NS_ENSURE_SUCCESS(rv, rv); - - bool exists; - while (NS_SUCCEEDED(rv = keysStmt->ExecuteStep(&exists)) && exists) { - nsAutoString key; - rv = keysStmt->GetString(0, key); - NS_ENSURE_SUCCESS(rv, rv); - - nsAutoString value; - rv = keysStmt->GetString(1, value); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t secureInt = 0; - rv = keysStmt->GetInt32(2, &secureInt); - NS_ENSURE_SUCCESS(rv, rv); - - rv = aScopeCache->AddEntry(key, value, !!secureInt); - NS_ENSURE_SUCCESS(rv, rv); - } - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::EnsureScopeLoaded(DOMStorageImpl* aStorage) -{ - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - if (scopeCache) { - return NS_OK; - } - - scopeCache = new nsScopeCache(); - nsresult rv = FetchScope(aStorage, scopeCache); - if (NS_FAILED(rv)) { - delete scopeCache; - return rv; - } - mCache.AddScope(aStorage->GetScopeDBKey(), scopeCache); - - // Update amount of quota used by uncached data - nsAutoCString quotaKey(aStorage->GetQuotaDBKey()); - int32_t uncachedSizeOnDisk = 0; - if (!quotaKey.IsEmpty() && - mQuotaUseByUncached.Get(quotaKey, &uncachedSizeOnDisk)) { - uncachedSizeOnDisk -= scopeCache->GetQuotaUsage(); - MOZ_ASSERT(uncachedSizeOnDisk >= 0); - mQuotaUseByUncached.Put(quotaKey, uncachedSizeOnDisk); - } - - DOMStorageImpl::gStorageDB->EnsureCacheFlushTimer(); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::EnsureQuotaUsageLoaded(const nsACString& aQuotaKey) -{ - if (aQuotaKey.IsEmpty() || mQuotaUseByUncached.Get(aQuotaKey, nullptr)) { - return NS_OK; - } else if (mWasRemoveAllCalled || mIsRemoveAllPending) { - mQuotaUseByUncached.Put(aQuotaKey, 0); - return NS_OK; - } - - Telemetry::AutoTimer timer; - - // Fetch information about all the scopes belonging to this site - nsCOMPtr stmt; - stmt = mReadStatements.GetCachedStatement( - "SELECT scope, SUM(LENGTH(key) + LENGTH(value)) " - "FROM ( " - "SELECT scope, key, value FROM webappsstore2 " - "WHERE scope LIKE :quotaKey" - ") " - "GROUP BY scope" - ); - NS_ENSURE_STATE(stmt); - mozStorageStatementScoper scope(stmt); - - nsresult rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("quotaKey"), - aQuotaKey + NS_LITERAL_CSTRING("%")); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t uncachedSize = 0; - bool exists; - while (NS_SUCCEEDED(rv = stmt->ExecuteStep(&exists)) && exists) { - nsAutoCString scopeName; - rv = stmt->GetUTF8String(0, scopeName); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t quotaUsage; - rv = stmt->GetInt32(1, "aUsage); - NS_ENSURE_SUCCESS(rv, rv); - - if (!mCache.IsScopeCached(scopeName)) { - uncachedSize += quotaUsage; - } - } - mQuotaUseByUncached.Put(aQuotaKey, uncachedSize); - return NS_OK; -} - -struct UpdateQuotaEnumData -{ - nsCString& mEvictedScope; - int32_t mEvictedSize; -}; - -static PLDHashOperator -UpdateQuotaEnum(const nsACString& aQuotaKey, - int32_t& aUncachedSize, - void* aParams) -{ - UpdateQuotaEnumData* data = static_cast(aParams); - if (StringBeginsWith(data->mEvictedScope, aQuotaKey)) { - aUncachedSize += data->mEvictedSize; - return PL_DHASH_STOP; - } - return PL_DHASH_NEXT; -} - -void -nsDOMStoragePersistentDB::EvictUnusedScopes() -{ - MOZ_ASSERT(NS_IsMainThread()); - - nsTArray evictedScopes; - nsTArray evictedSize; - mCache.EvictScopes(evictedScopes, evictedSize); - - // Update quota use numbers - for (uint32_t i = 0; i < evictedScopes.Length(); ++i) { - UpdateQuotaEnumData data = { evictedScopes[i], evictedSize[i] }; - mQuotaUseByUncached.Enumerate(UpdateQuotaEnum, &data); - } -} - -/** - * These helper methods bind flush data to SQL statements. - */ -namespace { - -nsresult -BindScope(mozIStorageStatement* aStmt, - const nsACString& aScopeName, - mozIStorageBindingParamsArray** aParamArray) -{ - nsCOMPtr paramArray; - aStmt->NewBindingParamsArray(getter_AddRefs(paramArray)); - - nsCOMPtr params; - paramArray->NewBindingParams(getter_AddRefs(params)); - - nsresult rv = params->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), - aScopeName); - NS_ENSURE_SUCCESS(rv, rv); - - rv = paramArray->AddParams(params); - NS_ENSURE_SUCCESS(rv, rv); - - paramArray.forget(aParamArray); - - return NS_OK; -} - -nsresult -BindScopeAndKey(mozIStorageStatement* aStmt, - const nsACString& aScopeName, - const nsAString& aKey, - mozIStorageBindingParamsArray** aParamArray) -{ - nsCOMPtr paramArray; - aStmt->NewBindingParamsArray(getter_AddRefs(paramArray)); - - nsCOMPtr params; - paramArray->NewBindingParams(getter_AddRefs(params)); - - nsresult rv = params->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), - aScopeName); - NS_ENSURE_SUCCESS(rv, rv); - - rv = params->BindStringByName(NS_LITERAL_CSTRING("key"), - aKey); - NS_ENSURE_SUCCESS(rv, rv); - - rv = paramArray->AddParams(params); - NS_ENSURE_SUCCESS(rv, rv); - - paramArray.forget(aParamArray); - - return NS_OK; -} - -nsresult -BindInsertKey(mozIStorageStatement* aStmt, - const nsACString& aScopeName, - const nsAString& aKey, - const nsScopeCache::KeyEntry* aEntry, - mozIStorageBindingParamsArray** aParamArray) -{ - nsCOMPtr paramArray; - aStmt->NewBindingParamsArray(getter_AddRefs(paramArray)); - - nsCOMPtr params; - paramArray->NewBindingParams(getter_AddRefs(params)); - - nsresult rv = params->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), - aScopeName); - NS_ENSURE_SUCCESS(rv, rv); - - rv = params->BindStringByName(NS_LITERAL_CSTRING("key"), - aKey); - NS_ENSURE_SUCCESS(rv, rv); - - rv = params->BindStringByName(NS_LITERAL_CSTRING("value"), - aEntry->mValue); - NS_ENSURE_SUCCESS(rv, rv); - - rv = params->BindInt32ByName(NS_LITERAL_CSTRING("secure"), - aEntry->mIsSecure ? 1 : 0); - - rv = paramArray->AddParams(params); - NS_ENSURE_SUCCESS(rv, rv); - - paramArray.forget(aParamArray); - - return NS_OK; -} - -} // anonymous namespace (for binding helper functions) - -nsresult -nsDOMStoragePersistentDB::PrepareFlushStatements(const FlushData& aDirtyData) -{ - MOZ_ASSERT(NS_IsMainThread()); - - mFlushStatements.Clear(); - mFlushStatementParams.Clear(); - - nsCOMPtr removeAllStmt = mWriteStatements.GetCachedStatement( - NS_LITERAL_CSTRING("DELETE FROM webappsstore2")); - NS_ENSURE_STATE(removeAllStmt); - - nsCOMPtr deleteScopeStmt = mWriteStatements.GetCachedStatement( - NS_LITERAL_CSTRING("DELETE FROM webappsstore2" - " WHERE scope = :scope")); - NS_ENSURE_STATE(deleteScopeStmt); - - nsCOMPtr deleteKeyStmt = mWriteStatements.GetCachedStatement( - NS_LITERAL_CSTRING("DELETE FROM webappsstore2" - " WHERE scope = :scope AND key = :key")); - NS_ENSURE_STATE(deleteKeyStmt); - - nsCOMPtr insertKeyStmt = mWriteStatements.GetCachedStatement( - NS_LITERAL_CSTRING("INSERT OR REPLACE INTO webappsstore2 (scope, key, value, secure)" - " VALUES (:scope, :key, :value, :secure)")); - NS_ENSURE_STATE(insertKeyStmt); - - nsCOMPtr tempArray; - const size_t dirtyScopeCount = aDirtyData.mScopeNames.Length(); - - // Clear all of disk storage if RemoveAll was called - if (mWasRemoveAllCalled) { - mFlushStatements.AppendElement(removeAllStmt); - tempArray = nullptr; - mFlushStatementParams.AppendElement(tempArray); - } - - // A delete of the entire LocalStorage is a super-set of lesser deletes - if (!mWasRemoveAllCalled) { - // Delete individual scopes - nsresult rv; - for (uint32_t i = 0; i < dirtyScopeCount; ++i) { - if (aDirtyData.mChanged[i].mWasDeleted) { - rv = BindScope(deleteScopeStmt, - aDirtyData.mScopeNames[i], - getter_AddRefs(tempArray)); - NS_ENSURE_SUCCESS(rv, rv); - mFlushStatements.AppendElement(deleteScopeStmt); - mFlushStatementParams.AppendElement(tempArray); - } - } - - // Check if any deleted keys need to be flushed - for (uint32_t i = 0; i < dirtyScopeCount; ++i) { - const nsTArray& deleted = *(aDirtyData.mChanged[i].mDeletedKeys); - size_t deletedKeyCount = deleted.Length(); - for (uint32_t j = 0; j < deletedKeyCount; ++j) { - rv = BindScopeAndKey(deleteKeyStmt, - aDirtyData.mScopeNames[i], - deleted[j], - getter_AddRefs(tempArray)); - NS_ENSURE_SUCCESS(rv, rv); - mFlushStatements.AppendElement(deleteKeyStmt); - mFlushStatementParams.AppendElement(tempArray); - } - } - } - - // Check for dirty keys to flush - for (uint32_t i = 0; i < dirtyScopeCount; ++i) { - const nsTArray& dirtyKeys = aDirtyData.mChanged[i].mDirtyKeys; - const nsTArray& dirtyValues = - aDirtyData.mChanged[i].mDirtyValues; - size_t dirtyKeyCount = dirtyKeys.Length(); - for (uint32_t j = 0; j < dirtyKeyCount; ++j) { - nsresult rv = BindInsertKey(insertKeyStmt, - aDirtyData.mScopeNames[i], - dirtyKeys[j], - dirtyValues[j], - getter_AddRefs(tempArray)); - NS_ENSURE_SUCCESS(rv, rv); - mFlushStatements.AppendElement(insertKeyStmt); - mFlushStatementParams.AppendElement(tempArray); - } - } - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::PrepareForFlush() -{ - // Get data to be flushed - FlushData dirtyData; - mCache.GetFlushData(&dirtyData); - if (!dirtyData.mChanged.Length() && !mWasRemoveAllCalled) { - return NS_OK; - } - - // Convert the dirty data to SQL statements and parameters - nsresult rv = PrepareFlushStatements(dirtyData); - NS_ENSURE_SUCCESS(rv, rv); - - // Mark the dirty scopes as being flushed - // i.e. clear dirty flags and set pending flag - mCache.MarkScopesPending(); - mIsRemoveAllPending = mWasRemoveAllCalled; - mWasRemoveAllCalled = false; - mIsFlushPending = true; - - return NS_OK; -} - -/** - * Flushes dirty data and evicts unused scopes. - * This is the top-level method called by timer & shutdown code. - */ -nsresult -nsDOMStoragePersistentDB::FlushAndEvictFromCache(bool aIsShuttingDown) -{ - MOZ_ASSERT(NS_IsMainThread()); - - // Evict any scopes that were idle for more than the maximum idle time - EvictUnusedScopes(); - - // Don't flush again if there is a flush outstanding, except on shutdown - if (mIsFlushPending && !aIsShuttingDown) { - return NS_OK; - } - - if (mFlushThread && aIsShuttingDown && mIsFlushPending) { - // Wait for the helper thread to finish flushing - // This will spin the event loop and cause the callback event to be - // handled on the main thread. - mFlushThread->Shutdown(); - mFlushThread = nullptr; - - // Get any remaining uncommitted data and flush it synchronously - nsresult rv = PrepareForFlush(); - NS_ENSURE_SUCCESS(rv, rv); - - // The helper thread is guaranteed to not be using the DB at this point - // as the flush thread has been shut down. - rv = Flush(); - NS_ENSURE_SUCCESS(rv, rv); - } else if (mFlushThread && !aIsShuttingDown) { - // Perform a regular flush on the helper thread - nsresult rv = PrepareForFlush(); - NS_ENSURE_SUCCESS(rv, rv); - - // If no dirty data found, just return - if (!mIsFlushPending) { - return NS_OK; - } - - // Allocate objects before async operations begin in case of OOM - nsRefPtr callbackTask = new FlushCallbackTask(this); - nsRefPtr flushTask = new FlushTask(this, callbackTask); - - rv = mFlushThread->Dispatch(flushTask, NS_DISPATCH_NORMAL); - if (NS_FAILED(rv)) { - // Very unlikely error case - HandleFlushComplete(false); - } - } else { - // Two scenarios lead to flushing on the main thread: - // 1) WAL mode unsupported by DB, preventing reads concurrent with writes - // OR - // 2) This is the last flush before exit and no other flushes are pending - nsresult rv = PrepareForFlush(); - NS_ENSURE_SUCCESS(rv, rv); - - // If no dirty data found, just return - if (!mIsFlushPending) { - return NS_OK; - } - - rv = Flush(); - HandleFlushComplete(NS_SUCCEEDED(rv)); - } - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys) -{ - Telemetry::AutoTimer timer; - - nsresult rv = EnsureScopeLoaded(aStorage); - NS_ENSURE_SUCCESS(rv, rv); - - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - MOZ_ASSERT(scopeCache); - rv = scopeCache->GetAllKeys(aStorage, aKeys); - NS_ENSURE_SUCCESS(rv, rv); - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure) -{ - Telemetry::AutoTimer timer; - PROFILER_LABEL("nsDOMStoragePersistentDB", "GetKeyValue"); - - nsresult rv = EnsureScopeLoaded(aStorage); - NS_ENSURE_SUCCESS(rv, rv); - - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - MOZ_ASSERT(scopeCache); - if (scopeCache->GetKey(aKey, aValue, aSecure)) { - return NS_OK; - } else { - return NS_ERROR_DOM_NOT_FOUND_ERR; - } -} - -nsresult -nsDOMStoragePersistentDB::SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - Telemetry::AutoTimer timer; - - nsresult rv = EnsureScopeLoaded(aStorage); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t usage = 0; - if (!aStorage->GetQuotaDBKey().IsEmpty()) { - rv = GetUsage(aStorage, &usage); - NS_ENSURE_SUCCESS(rv, rv); - } - - usage += aKey.Length() + aValue.Length(); - - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - MOZ_ASSERT(scopeCache); - - nsAutoString previousValue; - bool secure; - bool keyExists = scopeCache->GetKey(aKey, previousValue, &secure); - if (keyExists) { - if (!aSecure && secure) { - return NS_ERROR_DOM_SECURITY_ERR; - } - usage -= aKey.Length() + previousValue.Length(); - } - - if (usage > GetQuota()) { - return NS_ERROR_DOM_QUOTA_REACHED; - } - - rv = scopeCache->SetKey(aKey, aValue, aSecure); - NS_ENSURE_SUCCESS(rv, rv); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure) -{ - nsresult rv = EnsureScopeLoaded(aStorage); - NS_ENSURE_SUCCESS(rv, rv); - - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - MOZ_ASSERT(scopeCache); - - scopeCache->SetSecure(aKey, aSecure); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey) -{ - Telemetry::AutoTimer timer; - - nsresult rv = EnsureScopeLoaded(aStorage); - NS_ENSURE_SUCCESS(rv, rv); - - nsScopeCache* scopeCache = mCache.GetScope(aStorage->GetScopeDBKey()); - MOZ_ASSERT(scopeCache); - - scopeCache->RemoveKey(aKey); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::ClearStorage(DOMStorageImpl* aStorage) -{ - nsAutoCString scopeKey(aStorage->GetScopeDBKey()); - nsAutoCString quotaKey(aStorage->GetQuotaDBKey()); - - // Invalidate the SITE's quota use if this SCOPE wasn't cached; - // we don't know the size of the scope we're deleting from disk - bool isScopeCached = mCache.IsScopeCached(scopeKey); - - int32_t usage; - bool isSiteUsageCached = !quotaKey.IsEmpty() && - mQuotaUseByUncached.Get(quotaKey, &usage); - - if (!isScopeCached && isSiteUsageCached) { - mQuotaUseByUncached.Remove(quotaKey); - } - - nsScopeCache* scopeCache = mCache.GetScope(scopeKey); - if (!scopeCache) { - // Ensure there is a dirty scope that will remove this data from disk - scopeCache = new nsScopeCache(); - mCache.AddScope(scopeKey, scopeCache); - DOMStorageImpl::gStorageDB->EnsureCacheFlushTimer(); - } - - // Mark scope deleted in the cache - scopeCache->DeleteScope(); - - MarkScopeDirty(aStorage); - - return NS_OK; -} - -static PLDHashOperator -InvalidateMatchingQuotaEnum(const nsACString& aQuotaKey, - int32_t&, - void* aPattern) -{ - const nsACString* pattern = static_cast(aPattern); - if (StringBeginsWith(*pattern, aQuotaKey)) { - return PL_DHASH_REMOVE; - } else { - return PL_DHASH_NEXT; - } -} - -nsresult -nsDOMStoragePersistentDB::FetchMatchingScopeNames(const nsACString& aPattern) -{ - nsCOMPtr stmt = mReadStatements.GetCachedStatement( - "SELECT DISTINCT(scope) FROM webappsstore2" - " WHERE scope LIKE :scope" - ); - NS_ENSURE_STATE(stmt); - mozStorageStatementScoper scope(stmt); - - nsresult rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("scope"), - aPattern + NS_LITERAL_CSTRING("%")); - NS_ENSURE_SUCCESS(rv, rv); - - bool exists; - while (NS_SUCCEEDED(rv = stmt->ExecuteStep(&exists)) && exists) { - nsAutoCString scopeName; - rv = stmt->GetUTF8String(0, scopeName); - NS_ENSURE_SUCCESS(rv, rv); - - nsScopeCache* scopeCache = mCache.GetScope(scopeName); - if (!scopeCache) { - scopeCache = new nsScopeCache(); - mCache.AddScope(scopeName, scopeCache); - } - } - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::RemoveOwner(const nsACString& aOwner) -{ - nsAutoCString subdomainsDBKey; - nsDOMStorageDBWrapper::CreateReversedDomain(aOwner, subdomainsDBKey); - - // Find matching scopes on disk first and set up placeholders - // for them in the cache - nsresult rv = FetchMatchingScopeNames(subdomainsDBKey); - NS_ENSURE_SUCCESS(rv, rv); - - // Remove any matching scopes from cache - mCache.MarkMatchingScopesDeleted(subdomainsDBKey); - - // Remove quota info, it may no longer be valid - mQuotaUseByUncached.Enumerate(InvalidateMatchingQuotaEnum, &subdomainsDBKey); - - MarkAllScopesDirty(); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::RemoveAllForApp(uint32_t aAppId, bool aOnlyBrowserElement) -{ - nsAutoCString appIdString; - appIdString.AppendInt(aAppId); - - nsAutoCString scopePattern = appIdString; - if (aOnlyBrowserElement) { - scopePattern.AppendLiteral(":t:"); - } else { - scopePattern.AppendLiteral(":_:"); - } - - // Find matching scopes on disk first and create placeholders for them - // in the cache - nsresult rv = FetchMatchingScopeNames(scopePattern); - NS_ENSURE_SUCCESS(rv, rv); - - // Remove any matching scopes from the cache that were not on disk - scopePattern = appIdString; - if (aOnlyBrowserElement) { - scopePattern.AppendLiteral(":t:"); - } else { - scopePattern.AppendLiteral(":"); - } - mCache.MarkMatchingScopesDeleted(scopePattern); - - // Remove quota info, it may no longer be valid - mQuotaUseByUncached.Enumerate(InvalidateMatchingQuotaEnum, &scopePattern); - - MarkAllScopesDirty(); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::RemoveAll() -{ - Telemetry::AutoTimer timer; - - mCache.ForgetAllScopes(); - mQuotaUseByUncached.Clear(); - mWasRemoveAllCalled = true; - - MarkAllScopesDirty(); - - DOMStorageImpl::gStorageDB->EnsureCacheFlushTimer(); - - return NS_OK; -} - -nsresult -nsDOMStoragePersistentDB::GetUsage(DOMStorageImpl* aStorage, - int32_t *aUsage) -{ - return GetUsageInternal(aStorage->GetQuotaDBKey(), aUsage); -} - -nsresult -nsDOMStoragePersistentDB::GetUsage(const nsACString& aDomain, - int32_t *aUsage) -{ - nsAutoCString quotaKey; - nsresult rv = nsDOMStorageDBWrapper::CreateQuotaDBKey(aDomain, quotaKey); - NS_ENSURE_SUCCESS(rv, rv); - - return GetUsageInternal(quotaKey, aUsage); -} - -nsresult -nsDOMStoragePersistentDB::GetUsageInternal(const nsACString& aQuotaKey, - int32_t *aUsage) -{ - nsresult rv = EnsureQuotaUsageLoaded(aQuotaKey); - NS_ENSURE_SUCCESS(rv, rv); - - int32_t uncachedSize = 0; - DebugOnly found = mQuotaUseByUncached.Get(aQuotaKey, &uncachedSize); - MOZ_ASSERT(found); - - int32_t cachedSize = mCache.GetQuotaUsage(aQuotaKey); - - *aUsage = uncachedSize + cachedSize; - - return NS_OK; -} - diff --git a/dom/src/storage/nsDOMStoragePersistentDB.h b/dom/src/storage/nsDOMStoragePersistentDB.h deleted file mode 100644 index 618425305aba..000000000000 --- a/dom/src/storage/nsDOMStoragePersistentDB.h +++ /dev/null @@ -1,265 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsDOMStoragePersistentDB_h___ -#define nsDOMStoragePersistentDB_h___ - -#include "nscore.h" -#include "nsDOMStorageBaseDB.h" -#include "mozIStorageConnection.h" -#include "mozIStorageStatement.h" -#include "mozilla/storage/StatementCache.h" -#include "mozIStorageBindingParamsArray.h" -#include "nsTHashtable.h" -#include "nsDataHashtable.h" -#include "nsIThread.h" - -#include "nsLocalStorageCache.h" - -class DOMStorageImpl; -class nsSessionStorageEntry; - -class nsDOMStoragePersistentDB : public nsDOMStorageBaseDB -{ - typedef mozilla::storage::StatementCache StatementCache; - typedef nsLocalStorageCache::FlushData FlushData; - -public: - nsDOMStoragePersistentDB(); - ~nsDOMStoragePersistentDB() {} - - nsresult - Init(const nsString& aDatabaseName); - - /** - * Close the connection, finalizing all the cached statements. - */ - void - Close(); - - /** - * Indicates whether any data is cached that might need to be - * flushed or evicted. - */ - bool - IsFlushTimerNeeded() const; - - /** - * Retrieve a list of all the keys associated with a particular domain. - */ - nsresult - GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys); - - /** - * Retrieve a value and secure flag for a key from storage. - * - * @throws NS_ERROR_DOM_NOT_FOUND_ERR if key not found - */ - nsresult - GetKeyValue(DOMStorageImpl* aStorage, - const nsAString& aKey, - nsAString& aValue, - bool* aSecure); - - /** - * Set the value and secure flag for a key in storage. - */ - nsresult - SetKey(DOMStorageImpl* aStorage, - const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - - /** - * Set the secure flag for a key in storage. Does nothing if the key was - * not found. - */ - nsresult - SetSecure(DOMStorageImpl* aStorage, - const nsAString& aKey, - const bool aSecure); - - /** - * Removes a key from storage. - */ - nsresult - RemoveKey(DOMStorageImpl* aStorage, - const nsAString& aKey); - - /** - * Remove all keys belonging to this storage. - */ - nsresult - ClearStorage(DOMStorageImpl* aStorage); - - /** - * Removes all keys added by a given domain. - */ - nsresult - RemoveOwner(const nsACString& aOwner); - - /** - * Removes all keys from storage. Used when clearing storage. - */ - nsresult - RemoveAll(); - - /** - * Removes all keys from storage for a specific app. - * If aOnlyBrowserElement is true, it will remove only keys with the - * browserElement flag set. - * aAppId has to be a valid app id. It can't be NO_APP_ID or UNKNOWN_APP_ID. - */ - nsresult - RemoveAllForApp(uint32_t aAppId, bool aOnlyBrowserElement); - - /** - * Returns usage for a storage using its GetQuotaDBKey() as a key. - */ - nsresult - GetUsage(DOMStorageImpl* aStorage, int32_t *aUsage); - - /** - * Returns usage of the domain and optionaly by any subdomain. - */ - nsresult - GetUsage(const nsACString& aDomain, int32_t *aUsage); - - /** - * Clears all in-memory data from private browsing mode - */ - nsresult - ClearAllPrivateBrowsingData(); - - /** - * This is the top-level method called by timer & shutdown code. - * - * LocalStorage now flushes dirty items off the main thread to reduce - * main thread jank. - * - * When the flush timer fires, pointers to changed data are retrieved from - * nsLocalStorageCache on the main thread and are used to build an SQLite - * statement array with bound parameters that is then executed on a - * background thread. Only one flush operation is outstanding at once. - * After the flush operation completes, a notification task - * is enqueued on the main thread which updates the cache state. - * - * Cached scopes are evicted if they aren't dirty and haven't been used for - * the maximum idle time. - */ - nsresult - FlushAndEvictFromCache(bool aMainThread); - - /** - * Executes SQL statements for flushing dirty data to disk. - */ - nsresult - Flush(); - - /** - * The notifier task calls this method to update cache state after a - * flush operation completes. - */ - void - HandleFlushComplete(bool aSucceeded); - -private: - - friend class nsDOMStorageMemoryDB; - - /** - * Sets the database's journal mode to WAL or TRUNCATE. - */ - nsresult - SetJournalMode(bool aIsWal); - - /** - * Sets the threshold for auto-checkpointing the WAL. - */ - nsresult - ConfigureWalBehavior(); - - /** - * Ensures that the scope's keys are cached. - */ - nsresult - EnsureScopeLoaded(DOMStorageImpl* aStorage); - - /** - * Fetches the scope's data from the database. - */ - nsresult - FetchScope(DOMStorageImpl* aStorage, nsScopeCache* aScopeCache); - - /** - * Ensures that the quota usage information for the site is known. - * - * The current quota usage is calculated from the space occupied by - * the cached scopes + the size of the uncached scopes on disk. - * This method ensures that the size of the site's uncached scopes - * on disk is known. - */ - nsresult - EnsureQuotaUsageLoaded(const nsACString& aQuotaKey); - - /** - * Fetches the size of scopes matching aQuotaDBKey from the database. - */ - nsresult - FetchQuotaUsage(const nsACString& aQuotaDBKey); - - nsresult - GetUsageInternal(const nsACString& aQuotaDBKey, int32_t *aUsage); - - /** - * Helper function for RemoveOwner and RemoveAllForApp. - */ - nsresult - FetchMatchingScopeNames(const nsACString& aPattern); - - nsresult - PrepareFlushStatements(const FlushData& aFlushData); - - /** - * Gathers the dirty data from the cache, prepares SQL statements and - * updates state flags - */ - nsresult - PrepareForFlush(); - - /** - * Removes non-dirty scopes that haven't been used in X seconds. - */ - void - EvictUnusedScopes(); - - /** - * DB data structures - */ - nsTArray > mFlushStatements; - nsTArray > mFlushStatementParams; - StatementCache mReadStatements; - StatementCache mWriteStatements; - nsCOMPtr mReadConnection; - nsCOMPtr mWriteConnection; - - /** - * Cache state data - */ - nsLocalStorageCache mCache; - nsDataHashtable mQuotaUseByUncached; - // Set if the DB needs to be emptied on next flush - bool mWasRemoveAllCalled; - // Set if the DB is currently getting emptied in an async flush - bool mIsRemoveAllPending; - // Set if a flush operation has been enqueued in the async thread - bool mIsFlushPending; - - // Helper thread for flushing - nsCOMPtr mFlushThread; -}; - -#endif /* nsDOMStorageDB_h___ */ diff --git a/dom/src/storage/nsLocalStorageCache.cpp b/dom/src/storage/nsLocalStorageCache.cpp deleted file mode 100644 index 58db8a39d03a..000000000000 --- a/dom/src/storage/nsLocalStorageCache.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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 "nsDOMStorage.h" - -#include "nsLocalStorageCache.h" - -using namespace mozilla; - -// Scopes will be evicted from memory if not accessed (read or written) -// for MAX_IDLE_TIME seconds -#define MAX_IDLE_TIME (30) // seconds - -/** - * Anonymous namespace holding helper enum functions - */ -namespace { - -struct GetUsageEnumData -{ - const nsACString& mQuotaKey; - int32_t mUsage; -}; - -PLDHashOperator -GetUsageEnum(const nsACString& aScopeName, - nsScopeCache* aScopeCache, - void* aParams) -{ - GetUsageEnumData* data = static_cast(aParams); - if (StringBeginsWith(aScopeName, data->mQuotaKey)) { - data->mUsage += aScopeCache->GetQuotaUsage(); - } - return PL_DHASH_NEXT; -} - -struct EvictEnumData -{ - nsTArray& mEvicted; - nsTArray& mEvictedSize; -}; - -struct GetAllKeysEnumData -{ - nsTHashtable& mKeys; - DOMStorageImpl* mStorage; -}; - -PLDHashOperator -GetAllKeysEnum(const nsAString& aKey, - nsScopeCache::KeyEntry* aEntry, - void* aParams) -{ - GetAllKeysEnumData* data = static_cast(aParams); - nsSessionStorageEntry* keyEntry = data->mKeys.PutEntry(aKey); - keyEntry->mItem = new nsDOMStorageItem(data->mStorage, - aKey, - aEntry->mValue, - aEntry->mIsSecure); - return PL_DHASH_NEXT; -} - -PLDHashOperator -MarkMatchingDeletedEnum(const nsACString& aScopeName, - nsAutoPtr& aScopeCache, - void* aPattern) -{ - const nsACString* pattern = static_cast(aPattern); - if (!StringBeginsWith(aScopeName, *pattern)) { - return PL_DHASH_NEXT; - } - - aScopeCache->DeleteScope(); - - return PL_DHASH_NEXT; -} - -PLDHashOperator -MarkKeysEnum(const nsAString& aKey, - nsAutoPtr& aEntry, - void* aDirtyState) -{ - aEntry->mIsDirty = *(static_cast(aDirtyState)); - return PL_DHASH_NEXT; -} - -PLDHashOperator -GetChangedKeysEnum(const nsAString& aKey, - nsAutoPtr& aEntry, - void* aParams) -{ - if (!aEntry->mIsDirty) { - return PL_DHASH_NEXT; - } - - nsLocalStorageCache::FlushData::ChangeSet* changeSet = - static_cast(aParams); - - changeSet->mDirtyKeys.AppendElement(aKey); - changeSet->mDirtyValues.AppendElement(aEntry.get()); - - return PL_DHASH_NEXT; -} - -PLDHashOperator -GetEntrySize(const nsAString& aKey, - nsScopeCache::KeyEntry* aEntry, - void* aParam) -{ - int32_t* usage = static_cast(aParam); - *usage += aKey.Length() + aEntry->mValue.Length(); - return PL_DHASH_NEXT; -} - -} // anonymous namespace - - -nsLocalStorageCache::nsLocalStorageCache() -{ - mScopeCaches.Init(16); -} - -nsScopeCache* -nsLocalStorageCache::GetScope(const nsACString& aScopeName) -{ - nsScopeCache* scopeCache = nullptr; - if (mScopeCaches.Get(aScopeName, &scopeCache)) { - scopeCache->mAccessTime = PR_IntervalNow(); - } - return scopeCache; -} - -void -nsLocalStorageCache::AddScope(const nsACString& aScopeName, - nsScopeCache* aScopeCache) -{ - aScopeCache->mAccessTime = PR_IntervalNow(); - mScopeCaches.Put(aScopeName, aScopeCache); -} - -bool -nsLocalStorageCache::IsScopeCached(const nsACString& aScopeName) const -{ - return mScopeCaches.Get(aScopeName, nullptr); -} - -uint32_t -nsLocalStorageCache::Count() const -{ - return mScopeCaches.Count(); -} - -int32_t -nsLocalStorageCache::GetQuotaUsage(const nsACString& aQuotaKey) const -{ - GetUsageEnumData data = { aQuotaKey , 0 }; - mScopeCaches.EnumerateRead(GetUsageEnum, &data); - return data.mUsage; -} - -void -nsLocalStorageCache::MarkMatchingScopesDeleted(const nsACString& aPattern) -{ - mScopeCaches.Enumerate(MarkMatchingDeletedEnum, (void*)&aPattern); -} - -void -nsLocalStorageCache::ForgetAllScopes() -{ - mScopeCaches.Clear(); -} - -/* static */ -PLDHashOperator -nsLocalStorageCache::GetDirtyDataEnum(const nsACString& aScopeName, - nsScopeCache* aScopeCache, - void* aParams) -{ - if (!aScopeCache->mIsDirty) { - return PL_DHASH_NEXT; - } - - FlushData* flushData = static_cast(aParams); - FlushData::ChangeSet changeSet; - - changeSet.mWasDeleted = aScopeCache->mWasScopeDeleted; - changeSet.mDeletedKeys = &aScopeCache->mDeletedKeys; - - aScopeCache->mTable.Enumerate(GetChangedKeysEnum, &changeSet); - - flushData->mScopeNames.AppendElement(aScopeName); - flushData->mChanged.AppendElement(changeSet); - - return PL_DHASH_NEXT; -} - -void -nsLocalStorageCache::GetFlushData(FlushData* aData) const -{ - mScopeCaches.EnumerateRead(GetDirtyDataEnum, aData); -} - -/* static */ -PLDHashOperator -nsLocalStorageCache::SetFlushStateEnum(const nsACString& aScopeName, - nsAutoPtr& aScopeCache, - void* aParams) -{ - FlushState* newState = static_cast(aParams); - if (*newState == FLUSH_PENDING && aScopeCache->mIsDirty) { - // Mark all data clean before a flush to allow further changes during flush - bool isDirty = false; - aScopeCache->mTable.Enumerate(MarkKeysEnum, &isDirty); - aScopeCache->mDeletedKeys.Clear(); - aScopeCache->mWasScopeDeleted = false; - aScopeCache->mIsDirty = false; - aScopeCache->mIsFlushPending = true; - } else if (*newState == FLUSHED && aScopeCache->mIsFlushPending) { - aScopeCache->mIsFlushPending = false; - } else if (*newState == FLUSH_FAILED && aScopeCache->mIsFlushPending) { - // After a flush fails, disk state is unchanged (thanks to transaction - // rollback) and the cache contains the correct current state. - // So to bring disk back in sync with cache, we simply delete all scope - // data from disk on next flush and write out *ALL* the scope's cached keys. - // To trigger this behavior, we mark mWasScopeDeleted = true and mark all - // keys dirty. Note that scope cache will not be evicted or re-fetched since - // it's marked dirty. - bool isDirty = true; - aScopeCache->mWasScopeDeleted = true; - aScopeCache->mTable.Enumerate(MarkKeysEnum, &isDirty); - aScopeCache->mIsFlushPending = false; - aScopeCache->mIsDirty = true; - } - return PL_DHASH_NEXT; -} - -void -nsLocalStorageCache::MarkScopesPending() -{ - FlushState newState = FLUSH_PENDING; - mScopeCaches.Enumerate(SetFlushStateEnum, &newState); -} - -void -nsLocalStorageCache::MarkScopesFlushed() -{ - FlushState newState = FLUSHED; - mScopeCaches.Enumerate(SetFlushStateEnum, &newState); -} - -void -nsLocalStorageCache::MarkFlushFailed() -{ - FlushState newState = FLUSH_FAILED; - mScopeCaches.Enumerate(SetFlushStateEnum, &newState); -} - -/* static */ -PLDHashOperator -nsLocalStorageCache::EvictEnum(const nsACString& aScopeName, - nsAutoPtr& aScopeCache, - void* aParams) -{ - EvictEnumData* data = static_cast(aParams); - - // We can't evict scopes currently getting flushed in case the flush fails - if (aScopeCache->mIsDirty || aScopeCache->mIsFlushPending) { - return PL_DHASH_NEXT; - } - - static const PRIntervalTime kMaxIdleTime = PR_SecondsToInterval(MAX_IDLE_TIME); - bool evict = (PR_IntervalNow() - aScopeCache->mAccessTime) > kMaxIdleTime; - - if (evict) { - data->mEvicted.AppendElement(aScopeName); - data->mEvictedSize.AppendElement(aScopeCache->GetQuotaUsage()); - return PL_DHASH_REMOVE; - } - - return PL_DHASH_NEXT; -} - -void -nsLocalStorageCache::EvictScopes(nsTArray& aEvicted, - nsTArray& aEvictedSize) -{ - EvictEnumData data = { aEvicted, aEvictedSize }; - mScopeCaches.Enumerate(EvictEnum, &data); -} - -/////////////////////////////////// - -nsScopeCache::nsScopeCache() - : mWasScopeDeleted(false), mIsDirty(false), mIsFlushPending(false) -{ - mTable.Init(); -} - -nsresult -nsScopeCache::AddEntry(const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - KeyEntry* entry = new KeyEntry(); - entry->mValue = aValue; - entry->mIsSecure = aSecure; - entry->mIsDirty = false; - - mTable.Put(aKey, entry); - - return NS_OK; -} - -nsresult -nsScopeCache::GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys) const -{ - GetAllKeysEnumData data = { *aKeys, aStorage }; - mTable.EnumerateRead(GetAllKeysEnum, &data); - return NS_OK; -} - -bool -nsScopeCache::GetKey(const nsAString& aKey, - nsAString& aValue, - bool* aSecure) const -{ - KeyEntry* entry = nullptr; - if (mTable.Get(aKey, &entry)) { - aValue = entry->mValue; - *aSecure = entry->mIsSecure; - return true; - } - - return false; -} - -nsresult -nsScopeCache::SetKey(const nsAString& aKey, - const nsAString& aValue, - bool aSecure) -{ - KeyEntry* entry = nullptr; - if (!mTable.Get(aKey, &entry)) { - entry = new KeyEntry(); - mTable.Put(aKey, entry); - } else if (entry->mValue == aValue) { - // Don't mark the cache dirty if nothing changed - return NS_OK; - } - - entry->mValue = aValue; - entry->mIsSecure = aSecure; - entry->mIsDirty = true; - - mDeletedKeys.RemoveElement(aKey); - - mIsDirty = true; - - return NS_OK; -} - -void -nsScopeCache::SetSecure(const nsAString& aKey, - bool aSecure) -{ - KeyEntry* entry = nullptr; - if (!mTable.Get(aKey, &entry)) { - return; - } - - entry->mIsSecure = aSecure; - entry->mIsDirty = true; - - mIsDirty = true; -} - -void -nsScopeCache::RemoveKey(const nsAString& aKey) -{ - KeyEntry* entry = nullptr; - if (!mTable.Get(aKey, &entry)) { - return; - } - - nsAutoString key(aKey); - if (!mWasScopeDeleted) { - if (!mDeletedKeys.Contains(key)) { - mDeletedKeys.AppendElement(key); - } - } - mTable.Remove(key); - - mIsDirty = true; -} - -void -nsScopeCache::DeleteScope() -{ - mTable.Clear(); - mDeletedKeys.Clear(); - mWasScopeDeleted = true; - - mIsDirty = true; -} - -int32_t -nsScopeCache::GetQuotaUsage() const -{ - int32_t usage = 0; - mTable.EnumerateRead(GetEntrySize, &usage); - return usage; -} - diff --git a/dom/src/storage/nsLocalStorageCache.h b/dom/src/storage/nsLocalStorageCache.h deleted file mode 100644 index 56e5d02c6c3d..000000000000 --- a/dom/src/storage/nsLocalStorageCache.h +++ /dev/null @@ -1,184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef nsLocalStorageCache_h___ -#define nsLocalStorageCache_h___ - -#include "nscore.h" -#include "nsClassHashtable.h" -#include "nsTHashtable.h" -#include "nsTArray.h" - -class DOMStorageImpl; -class nsSessionStorageEntry; - -/** - * nsScopeCache is the representation of a single scope's contents - * and its flush state. - * - * Typical state progression for a scope: - * - * 1. Scope is loaded into memory from disk: - * mIsDirty = false; - * mIsFlushPending = false; - * - * 2. A key is modified/deleted in the scope, or the entire scope is deleted: - * mIsDirty = *true*; - * mIsFlushPending = false; - * - * 3. Flush timer fires and dirty data is collected: - * mIsDirty = *false*; - * mIsFlushPending = *true*; - * - * 4a. If the flush succeds: - * mIsDirty = false; - * mIsFlushPending = *false*; - * - * 4b. If the flush fails for some reason - * e.g. profile dir is on network storage and the network is flaky - * - * mIsDirty = *true*; - * mIsFlushPending = *false*; - * - * Note that in this case, no data would be lost. - * On next flush, the scope would get deleted from the DB to bring - * the DB back to a known state and then ALL the cached keys would - * get written out. - * Failed flushes ought to be very rare. - */ -class nsScopeCache -{ -public: - nsScopeCache(); - nsresult AddEntry(const nsAString& aKey, - const nsAString& aValue, - bool aSecure); - nsresult GetAllKeys(DOMStorageImpl* aStorage, - nsTHashtable* aKeys) const; - bool GetKey(const nsAString& aKey, nsAString& aValue, bool* aSecure) const; - nsresult SetKey(const nsAString& aKey, const nsAString& aValue, bool aSecure); - void SetSecure(const nsAString& aKey, bool aSecure); - void RemoveKey(const nsAString& aKey); - void DeleteScope(); - int32_t GetQuotaUsage() const; - - /** - * A single key/value pair in a scope. - */ - class KeyEntry - { - public: - KeyEntry() : mIsSecure(false), mIsDirty(false) {} - nsString mValue; - bool mIsSecure; - bool mIsDirty; - }; - -private: - friend class nsLocalStorageCache; - - // Scope data - // -- Whether a scope should be deleted from DB first before any DB inserts - bool mWasScopeDeleted; - // -- Keys to be deleted from DB on next flush - nsTArray mDeletedKeys; - // -- Mapping of scope keys to scope values - nsClassHashtable mTable; - - // Scope state: - // -- The last time the scope was used, helps decide whether to evict scope - PRIntervalTime mAccessTime; - // -- Whether the scope needs to be flushed to disk - // Note that dirty scopes can't be evicted - bool mIsDirty; - // -- Prevents eviction + is used to recover from bad flushes - bool mIsFlushPending; -}; - -/** - * nsLocalStorageCache manages all the cached LocalStorage scopes. - */ -class nsLocalStorageCache -{ -public: - nsLocalStorageCache(); - - nsScopeCache* GetScope(const nsACString& aScopeName); - void AddScope(const nsACString& aScopeName, nsScopeCache* aScopeCache); - bool IsScopeCached(const nsACString& aScopeName) const; - uint32_t Count() const; - - int32_t GetQuotaUsage(const nsACString& aQuotaKey) const; - void MarkMatchingScopesDeleted(const nsACString& aPattern); - void ForgetAllScopes(); - - /** - * Collection of all the dirty data across all scopes. - */ - struct FlushData - { - public: - struct ChangeSet - { - bool mWasDeleted; - nsTArray* mDeletedKeys; - nsTArray mDirtyKeys; - nsTArray mDirtyValues; - }; - // A scope's name in mScopeNames has the same index as the - // scope's ChangeSet in mChanged - nsTArray mScopeNames; - nsTArray mChanged; - }; - - /** - * Fills the FlushData structure with the dirty items in the cache. - */ - void GetFlushData(FlushData* aData) const; - - /** - * These methods update the state of each cached scope and - * its keys. See description in nsScopeCache. - */ - void MarkScopesPending(); - void MarkScopesFlushed(); - void MarkFlushFailed(); - - /** - * Evicts scopes not accessed since aMinAccessTime. - * Returns info about evicted scopes in aEvicted & aEvictedSize. - */ - void EvictScopes(nsTArray& aEvicted, - nsTArray& aEvictedSize); - -private: - - static PLDHashOperator - GetDirtyDataEnum(const nsACString& aScopeName, - nsScopeCache* aScopeCache, - void* aParams); - - enum FlushState { - FLUSH_PENDING, - FLUSHED, - FLUSH_FAILED - }; - static PLDHashOperator - SetFlushStateEnum(const nsACString& aScopeName, - nsAutoPtr& aScopeCache, - void* aParams); - - static PLDHashOperator - EvictEnum(const nsACString& aScopeName, - nsAutoPtr& aScopeCache, - void* aParams); - -private: - // Scopes currently cached in memory - // Maps: scope name -> scope's cache info - nsClassHashtable mScopeCaches; -}; - -#endif diff --git a/dom/tests/mochitest/localstorage/Makefile.in b/dom/tests/mochitest/localstorage/Makefile.in index 95ac1ef0940c..c21e19510371 100644 --- a/dom/tests/mochitest/localstorage/Makefile.in +++ b/dom/tests/mochitest/localstorage/Makefile.in @@ -13,7 +13,6 @@ include $(DEPTH)/config/autoconf.mk MOCHITEST_FILES = \ frameAppIsolation.html \ - frameBug624047.html \ frameChromeSlave.html \ frameKeySync.html \ frameMasterEqual.html \ @@ -27,9 +26,10 @@ MOCHITEST_FILES = \ interOriginFrame.js \ interOriginTest.js \ interOriginTest2.js \ + localStorageCommon.js \ test_appIsolation.html \ test_brokenUTF-16.html \ - test_bug624047.html \ + test_bug600307-DBOps.html \ test_bug746272-1.html \ test_bug746272-2.html \ test_cookieBlock.html \ diff --git a/dom/tests/mochitest/localstorage/frameBug624047.html b/dom/tests/mochitest/localstorage/frameBug624047.html deleted file mode 100644 index 692bcf19a440..000000000000 --- a/dom/tests/mochitest/localstorage/frameBug624047.html +++ /dev/null @@ -1,30 +0,0 @@ - - -slave for bug 624047 test - - - - - - - - - diff --git a/dom/tests/mochitest/localstorage/localStorageCommon.js b/dom/tests/mochitest/localstorage/localStorageCommon.js new file mode 100644 index 000000000000..3c314f1b351f --- /dev/null +++ b/dom/tests/mochitest/localstorage/localStorageCommon.js @@ -0,0 +1,46 @@ +function localStorageFlush(cb) +{ + var ob = { + observe : function(sub, top, dat) + { + os().removeObserver(ob, "domstorage-test-flushed"); + cb(); + } + }; + os().addObserver(ob, "domstorage-test-flushed", false); + notify("domstorage-test-flush-force"); +} + +function localStorageReload() +{ + notify("domstorage-test-reload"); +} + +function localStorageFlushAndReload(cb) +{ + localStorageFlush(function() { + localStorageReload(); + cb(); + }); +} + +function localStorageClearAll() +{ + os().notifyObservers(null, "cookie-changed", "cleared"); +} + +function localStorageClearDomain(domain) +{ + os().notifyObservers(null, "browser:purge-domain-data", domain); +} + +function os() +{ + return SpecialPowers.Cc["@mozilla.org/observer-service;1"] + .getService(SpecialPowers.Ci.nsIObserverService); +} + +function notify(top) +{ + os().notifyObservers(null, top, null); +} diff --git a/dom/tests/mochitest/localstorage/test_bug600307-DBOps.html b/dom/tests/mochitest/localstorage/test_bug600307-DBOps.html new file mode 100644 index 000000000000..8d539288b007 --- /dev/null +++ b/dom/tests/mochitest/localstorage/test_bug600307-DBOps.html @@ -0,0 +1,166 @@ + + +bug 600307 + + + + + + + + + + + + diff --git a/dom/tests/mochitest/localstorage/test_bug624047.html b/dom/tests/mochitest/localstorage/test_bug624047.html deleted file mode 100644 index c071fd58b48c..000000000000 --- a/dom/tests/mochitest/localstorage/test_bug624047.html +++ /dev/null @@ -1,64 +0,0 @@ - - -bug 624047 - - - - - - - - - - - This test takes about 15s to complete... Please wait... -
- - - diff --git a/dom/tests/mochitest/localstorage/test_localStorageBase.html b/dom/tests/mochitest/localstorage/test_localStorageBase.html index ed8ffc57a009..451d69b6a0b9 100644 --- a/dom/tests/mochitest/localstorage/test_localStorageBase.html +++ b/dom/tests/mochitest/localstorage/test_localStorageBase.html @@ -7,7 +7,31 @@ + + + + + + + + + + diff --git a/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html b/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html index e23aba011e91..a00d50bbf599 100644 --- a/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html +++ b/dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html @@ -7,7 +7,18 @@ + + + + + + + + + + diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index 952d6fbc546b..e17b0544d522 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -48,9 +48,8 @@ #include "nsIWindowProvider.h" #include "nsIMutableArray.h" #include "nsISupportsArray.h" -#include "nsIDOMStorageObsolete.h" #include "nsIDOMStorage.h" -#include "nsPIDOMStorage.h" +#include "nsIDOMStorageManager.h" #include "nsIWidget.h" #include "nsFocusManager.h" #include "nsIPresShell.h" @@ -1000,17 +999,14 @@ nsWindowWatcher::OpenWindowInternal(nsIDOMWindow *aParent, parentDocShell = piWindow->GetDocShell(); if (subjectPrincipal && parentDocShell) { - nsCOMPtr storage; - parentDocShell->GetSessionStorageForPrincipal(subjectPrincipal, - EmptyString(), false, - getter_AddRefs(storage)); - nsCOMPtr piStorage = - do_QueryInterface(storage); - if (piStorage){ - storage = piStorage->Clone(); - newDocShell->AddSessionStorage( - piStorage->Principal(), - storage); + nsCOMPtr parentStorageManager = do_QueryInterface(parentDocShell); + nsCOMPtr newStorageManager = do_QueryInterface(newDocShell); + + if (parentStorageManager && newStorageManager) { + nsCOMPtr storage; + parentStorageManager->GetStorage(subjectPrincipal, isPrivateBrowsingWindow, getter_AddRefs(storage)); + if (storage) + newStorageManager->CloneStorage(storage); } } diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf index 456b18023eeb..84d44122b8a7 100644 --- a/js/xpconnect/src/dom_quickstubs.qsconf +++ b/js/xpconnect/src/dom_quickstubs.qsconf @@ -91,7 +91,6 @@ members = [ 'nsIDOMStorage.key', 'nsIDOMStorage.removeItem', 'nsIDOMStorage.clear', - 'nsIDOMStorageItem.value', # dom/interfaces/xpath 'nsIDOMXPathExpression.evaluate', diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h index f44bdadce45f..140a320a7084 100644 --- a/layout/build/nsLayoutCID.h +++ b/layout/build/nsLayoutCID.h @@ -63,17 +63,13 @@ #define NS_CANVASRENDERINGCONTEXTWEBGL_CID \ { 0x2fe88332, 0x31c6, 0x4829, { 0xb2, 0x47, 0xa0, 0x7d, 0x8a, 0x7e, 0xe8, 0x0fe } } -// {8b449142-1eab-4bfa-9830-fab6ebb09774} -#define NS_DOMSTORAGE_CID \ -{ 0x8b449142, 0x1eab, 0x4bfa, { 0x98, 0x30, 0xfa, 0xb6, 0xeb, 0xb0, 0x97, 0x74 } } +// {A746DECD-AE74-4d86-8E75-4FDA81A9BE90} +#define NS_DOMSESSIONSTORAGEMANAGER_CID \ +{ 0xa746decd, 0xae74, 0x4d86, { 0x8e, 0x75, 0x4f, 0xda, 0x81, 0xa9, 0xbe, 0x90 } } -// {27AECC62-7777-428e-B34C-5973A47B8298} -#define NS_DOMSTORAGE2_CID \ -{ 0x27aecc62, 0x7777, 0x428e, { 0xb3, 0x4c, 0x59, 0x73, 0xa4, 0x7b, 0x82, 0x98 } } - -// {b88a4712-eb52-4c10-9b85-bf5894b510f0} -#define NS_DOMSTORAGEMANAGER_CID \ -{ 0xb88a4712, 0xeb52, 0x4c10, { 0x9b, 0x85, 0xbf, 0x58, 0x94, 0xb5, 0x10, 0xf0 } } +// {656DB07C-AA80-49e4-BCE8-E431BAAE697D} +#define NS_DOMLOCALSTORAGEMANAGER_CID \ +{ 0x656db07c, 0xaa80, 0x49e4, { 0xbc, 0xe8, 0xe4, 0x31, 0xba, 0xae, 0x69, 0x7d } } // {93ad72a6-02cd-4716-9626-d47d5ec275ec} #define NS_DOMJSON_CID \ diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 8b1bc562f49d..48d68de84dae 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -80,7 +80,7 @@ #include "nsScriptNameSpaceManager.h" #include "nsIControllerContext.h" #include "nsDOMScriptObjectFactory.h" -#include "nsDOMStorage.h" +#include "DOMStorageManager.h" #include "nsJSON.h" #include "mozIApplicationClearPrivateDataParams.h" #include "mozilla/Attributes.h" @@ -275,8 +275,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlobProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaStreamProtocolHandler) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURI) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMParser) -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDOMStorageManager, - nsDOMStorageManager::GetInstance) +NS_GENERIC_FACTORY_CONSTRUCTOR(DOMSessionStorageManager) +NS_GENERIC_FACTORY_CONSTRUCTOR(DOMLocalStorageManager) NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(IndexedDatabaseManager, IndexedDatabaseManager::FactoryCreate) @@ -768,8 +768,8 @@ NS_DEFINE_NAMED_CID(NS_XMLHTTPREQUEST_CID); NS_DEFINE_NAMED_CID(NS_EVENTSOURCE_CID); NS_DEFINE_NAMED_CID(NS_DOMACTIVITY_CID); NS_DEFINE_NAMED_CID(NS_DOMPARSER_CID); -NS_DEFINE_NAMED_CID(NS_DOMSTORAGE2_CID); -NS_DEFINE_NAMED_CID(NS_DOMSTORAGEMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_DOMSESSIONSTORAGEMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID); NS_DEFINE_NAMED_CID(NS_DOMJSON_CID); NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID); NS_DEFINE_NAMED_CID(INDEXEDDB_MANAGER_CID); @@ -1054,8 +1054,8 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNS_EVENTSOURCE_CID, false, NULL, EventSourceConstructor }, { &kNS_DOMACTIVITY_CID, false, NULL, ActivityConstructor }, { &kNS_DOMPARSER_CID, false, NULL, nsDOMParserConstructor }, - { &kNS_DOMSTORAGE2_CID, false, NULL, NS_NewDOMStorage2 }, - { &kNS_DOMSTORAGEMANAGER_CID, false, NULL, nsDOMStorageManagerConstructor }, + { &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, NULL, DOMSessionStorageManagerConstructor }, + { &kNS_DOMLOCALSTORAGEMANAGER_CID, false, NULL, DOMLocalStorageManagerConstructor }, { &kNS_DOMJSON_CID, false, NULL, NS_NewJSON }, { &kNS_TEXTEDITOR_CID, false, NULL, nsPlaintextEditorConstructor }, { &kINDEXEDDB_MANAGER_CID, false, NULL, IndexedDatabaseManagerConstructor }, @@ -1204,8 +1204,8 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { NS_EVENTSOURCE_CONTRACTID, &kNS_EVENTSOURCE_CID }, { NS_DOMACTIVITY_CONTRACTID, &kNS_DOMACTIVITY_CID }, { NS_DOMPARSER_CONTRACTID, &kNS_DOMPARSER_CID }, - { "@mozilla.org/dom/storage;2", &kNS_DOMSTORAGE2_CID }, - { "@mozilla.org/dom/storagemanager;1", &kNS_DOMSTORAGEMANAGER_CID }, + { "@mozilla.org/dom/localStorage-manager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID }, + { "@mozilla.org/dom/sessionStorage-manager;1", &kNS_DOMSESSIONSTORAGEMANAGER_CID }, { "@mozilla.org/dom/json;1", &kNS_DOMJSON_CID }, { "@mozilla.org/editor/texteditor;1", &kNS_TEXTEDITOR_CID }, { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID }, diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index f52985d6f336..c262e267f749 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -41,7 +41,6 @@ #include "nsXBLWindowKeyHandler.h" #include "nsXBLService.h" #include "txMozillaXSLTProcessor.h" -#include "nsDOMStorage.h" #include "nsTreeSanitizer.h" #include "nsCellMap.h" #include "nsTextFrameTextRunCache.h" @@ -59,7 +58,7 @@ #include "nsMathMLAtoms.h" #include "nsMathMLOperators.h" #include "Navigator.h" -#include "nsDOMStorageBaseDB.h" +#include "DOMStorageObserver.h" #include "DisplayItemClip.h" #include "AudioChannelService.h" @@ -217,9 +216,9 @@ nsLayoutStatics::Initialize() return rv; } - rv = nsDOMStorageManager::Initialize(); + rv = DOMStorageObserver::Init(); if (NS_FAILED(rv)) { - NS_ERROR("Could not initialize nsDOMStorageManager"); + NS_ERROR("Could not initialize DOMStorageObserver"); return rv; } @@ -272,8 +271,6 @@ nsLayoutStatics::Initialize() nsCookieService::AppClearDataObserverInit(); nsApplicationCacheService::AppClearDataObserverInit(); - nsDOMStorageBaseDB::Init(); - InitializeDateCacheCleaner(); return NS_OK; @@ -290,7 +287,7 @@ nsLayoutStatics::Shutdown() #ifdef MOZ_XUL nsXULPopupManager::Shutdown(); #endif - nsDOMStorageManager::Shutdown(); + DOMStorageObserver::Shutdown(); txMozillaXSLTProcessor::Shutdown(); Attr::Shutdown(); nsEventListenerManager::Shutdown(); diff --git a/testing/mochitest/b2g.json b/testing/mochitest/b2g.json index bd8e2915f094..bdb7b1f61ba1 100644 --- a/testing/mochitest/b2g.json +++ b/testing/mochitest/b2g.json @@ -412,7 +412,9 @@ "dom/tests/mochitest/localstorage/test_localStorageReplace.html":"", "dom/tests/mochitest/pointerlock/test_pointerlock-api.html":"", + "dom/tests/mochitest/sessionstorage/test_cookieSession.html":"", "dom/tests/mochitest/sessionstorage/test_sessionStorageBase.html":"", + "dom/tests/mochitest/sessionstorage/test_sessionStorageBaseSessionOnly.html":"", "dom/tests/mochitest/sessionstorage/test_sessionStorageClone.html":"", "dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html":"", "dom/tests/mochitest/sessionstorage/test_sessionStorageReplace.html":"", diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 53a492fb813d..07f6cfe4627a 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -2554,6 +2554,24 @@ "kind": "boolean", "description": "DOM: Ranges that are detached on destruction (bug 702948)" }, + "LOCALDOMSTORAGE_INIT_DATABASE_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to open the localStorage database (ms)" + }, + "LOCALDOMSTORAGE_SHUTDOWN_DATABASE_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to flush and close the localStorage database (ms)" + }, + "LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS": { + "kind": "boolean", + "description": "True when we had to wait for a pending preload on first access to localStorage data, false otherwise" + }, "LOCALDOMSTORAGE_GETALLKEYS_MS": { "kind": "exponential", "high": "3000", @@ -2561,6 +2579,41 @@ "extended_statistics_ok": true, "description": "Time to return a list of all keys in domain's LocalStorage (ms)" }, + "LOCALDOMSTORAGE_GETALLKEYS_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we return a list of all keys in domain's LocalStorage (ms)" + }, + "LOCALDOMSTORAGE_GETKEY_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to return a key name in domain's LocalStorage (ms)" + }, + "LOCALDOMSTORAGE_GETKEY_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we return a key name in domain's LocalStorage (ms)" + }, + "LOCALDOMSTORAGE_GETLENGTH_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to return number of keys in domain's LocalStorage (ms)" + }, + "LOCALDOMSTORAGE_GETLENGTH_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we return number of keys in domain's LocalStorage (ms)" + }, "LOCALDOMSTORAGE_GETVALUE_MS": { "kind": "exponential", "high": "3000", @@ -2568,6 +2621,13 @@ "extended_statistics_ok": true, "description": "Time to return a value for a key in LocalStorage (ms)" }, + "LOCALDOMSTORAGE_GETVALUE_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we return a value for a key in LocalStorage (ms)" + }, "LOCALDOMSTORAGE_SETVALUE_MS": { "kind": "exponential", "high": "3000", @@ -2575,6 +2635,13 @@ "extended_statistics_ok": true, "description": "Time to set a single key's value in LocalStorage (ms)" }, + "LOCALDOMSTORAGE_SETVALUE_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we set a single key's value in LocalStorage (ms)" + }, "LOCALDOMSTORAGE_REMOVEKEY_MS": { "kind": "exponential", "high": "3000", @@ -2582,33 +2649,40 @@ "extended_statistics_ok": true, "description": "Time to remove a single key from LocalStorage (ms)" }, - "LOCALDOMSTORAGE_REMOVEALL_MS": { + "LOCALDOMSTORAGE_REMOVEKEY_BLOCKING_MS": { + "kind": "exponential", + "high": "3000", + "n_buckets": 10, + "extended_statistics_ok": true, + "description": "Time to block before we remove a single key from LocalStorage (ms)" + }, + "LOCALDOMSTORAGE_CLEAR_MS": { "kind": "exponential", "high": "3000", "n_buckets": 10, "extended_statistics_ok": true, "description": "Time to clear LocalStorage for all domains (ms)" }, - "LOCALDOMSTORAGE_FETCH_DOMAIN_MS": { + "LOCALDOMSTORAGE_CLEAR_BLOCKING_MS": { "kind": "exponential", "high": "3000", "n_buckets": 10, "extended_statistics_ok": true, - "description": "Time to fetch LocalStorage data for a domain (ms)" + "description": "Time to block before we clear LocalStorage for all domains (ms)" }, - "LOCALDOMSTORAGE_FETCH_QUOTA_USE_MS": { + "LOCALDOMSTORAGE_UNLOAD_BLOCKING_MS": { "kind": "exponential", "high": "3000", "n_buckets": 10, "extended_statistics_ok": true, - "description": "Time to fetch quota use stats for a TLD (ms)" + "description": "Time to fetch LocalStorage data before we can clean the cache (ms)" }, - "LOCALDOMSTORAGE_TIMER_FLUSH_MS": { + "LOCALDOMSTORAGE_SESSIONONLY_PRELOAD_BLOCKING_MS": { "kind": "exponential", "high": "3000", "n_buckets": 10, "extended_statistics_ok": true, - "description": "Time to flush dirty entries from the cache (ms)" + "description": "Time to fetch LocalStorage data before we can expose them as session only data (ms)" }, "LOCALDOMSTORAGE_KEY_SIZE_BYTES": { "kind": "exponential", diff --git a/toolkit/content/Services.jsm b/toolkit/content/Services.jsm index 93e78ddae128..6adb26965425 100644 --- a/toolkit/content/Services.jsm +++ b/toolkit/content/Services.jsm @@ -50,7 +50,7 @@ let initTable = [ ["search", "@mozilla.org/browser/search-service;1", "nsIBrowserSearchService"], #endif ["storage", "@mozilla.org/storage/service;1", "mozIStorageService"], - ["domStorageManager", "@mozilla.org/dom/storagemanager;1", "nsIDOMStorageManager"], + ["domStorageManager", "@mozilla.org/dom/localStorage-manager;1", "nsIDOMStorageManager"], ["strings", "@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"], ["telemetry", "@mozilla.org/base/telemetry;1", "nsITelemetry"], ["tm", "@mozilla.org/thread-manager;1", "nsIThreadManager"], diff --git a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js index 9674f56db88b..ab10e8a598e2 100644 --- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js +++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js @@ -659,9 +659,9 @@ function test_storage_cleared() let principal = Cc["@mozilla.org/scriptsecuritymanager;1"]. getService(Ci.nsIScriptSecurityManager). getNoAppCodebasePrincipal(aURI); - let dsm = Cc["@mozilla.org/dom/storagemanager;1"]. + let dsm = Cc["@mozilla.org/dom/localStorage-manager;1"]. getService(Ci.nsIDOMStorageManager); - return dsm.getLocalStorageForPrincipal(principal, ""); + return dsm.createStorage(principal, ""); } let s = [ diff --git a/xpcom/base/ErrorList.h b/xpcom/base/ErrorList.h index 16ebf38db78f..12e02ea419d2 100644 --- a/xpcom/base/ErrorList.h +++ b/xpcom/base/ErrorList.h @@ -500,6 +500,12 @@ ERROR(NS_ERROR_DOM_RETVAL_UNDEFINED, FAILURE(1013)), ERROR(NS_ERROR_DOM_QUOTA_REACHED, FAILURE(1014)), ERROR(NS_ERROR_DOM_JS_EXCEPTION, FAILURE(1015)), + + /* May be used to indicate when e.g. setting a property value didn't + * actually change the value, like for obj.foo = "bar"; obj.foo = "bar"; + * the second assignment throws NS_SUCCESS_DOM_NO_OPERATION. + */ + ERROR(NS_SUCCESS_DOM_NO_OPERATION, SUCCESS(1)), #undef MODULE From 53ca4cbef732425bbad9309db056dfc628132d75 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Mon, 15 Apr 2013 14:38:58 +0200 Subject: [PATCH 156/438] Bug 850362 - reintroduce bug 842852 - localStorage optimizations, r=mak77 --- dom/src/storage/DOMStorageDBThread.cpp | 85 ++++++++++++++++++++------ dom/src/storage/DOMStorageDBThread.h | 3 + 2 files changed, 68 insertions(+), 20 deletions(-) diff --git a/dom/src/storage/DOMStorageDBThread.cpp b/dom/src/storage/DOMStorageDBThread.cpp index 3a18cb0ebdd3..db9845a711aa 100644 --- a/dom/src/storage/DOMStorageDBThread.cpp +++ b/dom/src/storage/DOMStorageDBThread.cpp @@ -27,6 +27,9 @@ // In milliseconds. #define FLUSHING_INTERVAL_MS 5000 +// Write Ahead Log's maximum size is 512KB +#define MAX_WAL_SIZE_BYTES 512 * 1024 + namespace mozilla { namespace dom { @@ -118,12 +121,6 @@ DOMStorageDBThread::Shutdown() monitor.Notify(); } - mReaderStatements.FinalizeStatements(); - if (mReaderConnection) { - mReaderConnection->Close(); - mReaderConnection = nullptr; - } - PR_JoinThread(mThread); mThread = nullptr; @@ -396,26 +393,22 @@ DOMStorageDBThread::OpenDatabaseConnection() { nsresult rv; + MOZ_ASSERT(!NS_IsMainThread()); + nsCOMPtr service = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr connection; - rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(connection)); + rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(mWorkerConnection)); if (rv == NS_ERROR_FILE_CORRUPTED) { // delete the db and try opening again rv = mDatabaseFile->Remove(false); NS_ENSURE_SUCCESS(rv, rv); - rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(connection)); + rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(mWorkerConnection)); } NS_ENSURE_SUCCESS(rv, rv); - if (NS_IsMainThread()) { - connection.swap(mReaderConnection); - } else { - connection.swap(mWorkerConnection); - } - return NS_OK; } @@ -435,6 +428,10 @@ DOMStorageDBThread::InitDatabase() rv = TryJournalMode(); NS_ENSURE_SUCCESS(rv, rv); + // Create a read-only clone + (void)mWorkerConnection->Clone(true, getter_AddRefs(mReaderConnection)); + NS_ENSURE_TRUE(mReaderConnection, NS_ERROR_FAILURE); + mozStorageTransaction transaction(mWorkerConnection, false); // Ensure Gecko 1.9.1 storage table @@ -578,18 +575,72 @@ DOMStorageDBThread::TryJournalMode() NS_ENSURE_SUCCESS(rv, rv); } else { mWALModeEnabled = true; + + rv = ConfigureWALBehavior(); + NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } +nsresult +DOMStorageDBThread::ConfigureWALBehavior() +{ + // Get the DB's page size + nsCOMPtr stmt; + nsresult rv = mWorkerConnection->CreateStatement(NS_LITERAL_CSTRING( + MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size" + ), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + bool hasResult = false; + rv = stmt->ExecuteStep(&hasResult); + NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && hasResult, NS_ERROR_FAILURE); + + int32_t pageSize = 0; + rv = stmt->GetInt32(0, &pageSize); + NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && pageSize > 0, NS_ERROR_UNEXPECTED); + + // Set the threshold for auto-checkpointing the WAL. + // We don't want giant logs slowing down reads & shutdown. + int32_t thresholdInPages = static_cast(MAX_WAL_SIZE_BYTES / pageSize); + nsAutoCString thresholdPragma("PRAGMA wal_autocheckpoint = "); + thresholdPragma.AppendInt(thresholdInPages); + rv = mWorkerConnection->ExecuteSimpleSQL(thresholdPragma); + NS_ENSURE_SUCCESS(rv, rv); + + // Set the maximum WAL log size to reduce footprint on mobile (large empty + // WAL files will be truncated) + nsAutoCString journalSizePragma("PRAGMA journal_size_limit = "); + // bug 600307: mak recommends setting this to 3 times the auto-checkpoint threshold + journalSizePragma.AppendInt(MAX_WAL_SIZE_BYTES * 3); + rv = mWorkerConnection->ExecuteSimpleSQL(journalSizePragma); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + nsresult DOMStorageDBThread::ShutdownDatabase() { + // Has to be called on the worker thread. + MOZ_ASSERT(!NS_IsMainThread()); + nsresult rv = mStatus; + mDBReady = false; + // Finalize the cached statements. + mReaderStatements.FinalizeStatements(); mWorkerStatements.FinalizeStatements(); + + if (mReaderConnection) { + // No need to sync access to mReaderConnection since the main thread + // is right now joining this thread, unable to execute any events. + mReaderConnection->Close(); + mReaderConnection = nullptr; + } + if (mWorkerConnection) { rv = mWorkerConnection->Close(); mWorkerConnection = nullptr; @@ -744,12 +795,6 @@ DOMStorageDBThread::DBOperation::Perform(DOMStorageDBThread* aThread) StatementCache* statements; if (MOZ_UNLIKELY(NS_IsMainThread())) { - if (MOZ_UNLIKELY(!aThread->mReaderConnection)) { - // Do lazy main thread connection opening - rv = aThread->OpenDatabaseConnection(); - NS_ENSURE_SUCCESS(rv, rv); - } - statements = &aThread->mReaderStatements; } else { statements = &aThread->mWorkerStatements; diff --git a/dom/src/storage/DOMStorageDBThread.h b/dom/src/storage/DOMStorageDBThread.h index d6c6bda4a9d3..7e930c1e7ed0 100644 --- a/dom/src/storage/DOMStorageDBThread.h +++ b/dom/src/storage/DOMStorageDBThread.h @@ -315,6 +315,9 @@ private: nsresult SetJournalMode(bool aIsWal); nsresult TryJournalMode(); + // Sets the threshold for auto-checkpointing the WAL. + nsresult ConfigureWALBehavior(); + void SetHigherPriority(); void SetDefaultPriority(); From fe05965115730b4b182d207bc602f8ddafaf3e05 Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Mon, 15 Apr 2013 12:20:48 +0800 Subject: [PATCH 157/438] Bug 855190 - Use new async getCharsetForURI in /toolkit/components/places/tests/unit/test_bookmarks_json.js. r=mak --- .../places/tests/unit/test_bookmarks_html.js | 7 +- .../places/tests/unit/test_bookmarks_json.js | 167 ++++++++++-------- 2 files changed, 91 insertions(+), 83 deletions(-) diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html.js b/toolkit/components/places/tests/unit/test_bookmarks_html.js index e1402f484e9d..a050a548f118 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html.js @@ -306,9 +306,8 @@ function testImportedBookmarksToFolder(aFolder) function checkItem(aExpected, aNode) { let id = aNode.itemId; - let deferred = Promise.defer(); - Task.spawn(function() { + return Task.spawn(function() { for (prop in aExpected) { switch (prop) { case "type": @@ -401,7 +400,5 @@ function checkItem(aExpected, aNode) throw new Error("Unknown property"); } } - }).then(deferred.resolve); - - return deferred.promise; + }); } diff --git a/toolkit/components/places/tests/unit/test_bookmarks_json.js b/toolkit/components/places/tests/unit/test_bookmarks_json.js index 42bac7754e80..09a97186ecff 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_json.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_json.js @@ -78,7 +78,7 @@ add_task(function test_import_bookmarks() { bookmarksFile = do_get_file("bookmarks.json"); yield BookmarkJSONUtils.importFromFile(bookmarksFile, true); - testImportedBookmarks(); + yield testImportedBookmarks(); }); add_task(function test_export_bookmarks() { @@ -90,7 +90,7 @@ add_task(function test_export_bookmarks() { add_task(function test_import_exported_bookmarks() { remove_all_bookmarks(); yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true); - testImportedBookmarks(); + yield testImportedBookmarks(); }); add_task(function test_import_ontop() { @@ -98,7 +98,7 @@ add_task(function test_import_ontop() { yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true); yield BookmarkJSONUtils.exportToFile(bookmarksExportedFile); yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true); - testImportedBookmarks(); + yield testImportedBookmarks(); }); add_task(function test_clean() { @@ -128,7 +128,9 @@ function testImportedBookmarks() { let items = test_bookmarks[group]; do_check_eq(root.childCount, items.length); - items.forEach(function (item, index) checkItem(item, root.getChild(index))); + for (let key in items) { + yield checkItem(items[key], root.getChild(key)); + } root.containerOpen = false; } @@ -136,85 +138,94 @@ function testImportedBookmarks() { function checkItem(aExpected, aNode) { let id = aNode.itemId; - for (prop in aExpected) { - switch (prop) { - case "type": - do_check_eq(aNode.type, aExpected.type); - break; - case "title": - do_check_eq(aNode.title, aExpected.title); - break; - case "description": - do_check_eq(PlacesUtils.annotations.getItemAnnotation( - id, DESCRIPTION_ANNO), aExpected.description); - break; - case "dateAdded": + + return Task.spawn(function() { + for (prop in aExpected) { + switch (prop) { + case "type": + do_check_eq(aNode.type, aExpected.type); + break; + case "title": + do_check_eq(aNode.title, aExpected.title); + break; + case "description": + do_check_eq(PlacesUtils.annotations.getItemAnnotation( + id, DESCRIPTION_ANNO), aExpected.description); + break; + case "dateAdded": do_check_eq(PlacesUtils.bookmarks.getItemDateAdded(id), aExpected.dateAdded); - break; - case "lastModified": + break; + case "lastModified": do_check_eq(PlacesUtils.bookmarks.getItemLastModified(id), aExpected.lastModified); - break; - case "url": - PlacesUtils.livemarks.getLivemark( - { id: id }, - function (aStatus, aLivemark) { - if (!Components.isSuccessCode(aStatus)) { - do_check_eq(aNode.uri, aExpected.url); - } - } - ); - break; - case "icon": - let deferred = Promise.defer(); - PlacesUtils.favicons.getFaviconDataForPage( - NetUtil.newURI(aExpected.url), - function (aURI, aDataLen, aData, aMimeType) { - let base64Icon = "data:image/png;base64," + - base64EncodeString(String.fromCharCode.apply(String, aData)); - do_check_true(base64Icon == aExpected.icon); - deferred.resolve(); - }); - return deferred.promise; - break; - case "keyword": - break; - case "sidebar": - do_check_eq(PlacesUtils.annotations.itemHasAnnotation( - id, LOAD_IN_SIDEBAR_ANNO), aExpected.sidebar); - break; - case "postData": - do_check_eq(PlacesUtils.annotations.getItemAnnotation( - id, PlacesUtils.POST_DATA_ANNO), aExpected.postData); - break; - case "charset": - do_check_eq(PlacesUtils.history.getCharsetForURI( - NetUtil.newURI(aNode.uri)), aExpected.charset); - break; - case "feedUrl": - PlacesUtils.livemarks.getLivemark( - { id: id }, - function (aStatus, aLivemark) { - do_check_true(Components.isSuccessCode(aStatus)); - do_check_eq(aLivemark.siteURI.spec, aExpected.url); - do_check_eq(aLivemark.feedURI.spec, Expected.feedUrl); - } - ); - break; - case "children": - let folder = aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode); - do_check_eq(folder.hasChildren, aExpected.children.length > 0); - folder.containerOpen = true; - do_check_eq(folder.childCount, aExpected.children.length); + break; + case "url": + yield function() { + let deferred = Promise.defer(); + PlacesUtils.livemarks.getLivemark( + { id: id }, + function (aStatus, aLivemark) { + if (!Components.isSuccessCode(aStatus)) { + do_check_eq(aNode.uri, aExpected.url); + } + deferred.resolve(); + }); + return deferred.promise; }(); + break; + case "icon": + yield function() { + let deferred = Promise.defer(); + PlacesUtils.favicons.getFaviconDataForPage( + NetUtil.newURI(aExpected.url), + function (aURI, aDataLen, aData, aMimeType) { + let base64Icon = "data:image/png;base64," + + base64EncodeString(String.fromCharCode.apply(String, aData)); + do_check_true(base64Icon == aExpected.icon); + deferred.resolve(); + }); + return deferred.promise; }(); + break; + case "keyword": + break; + case "sidebar": + do_check_eq(PlacesUtils.annotations.itemHasAnnotation( + id, LOAD_IN_SIDEBAR_ANNO), aExpected.sidebar); + break; + case "postData": + do_check_eq(PlacesUtils.annotations.getItemAnnotation( + id, PlacesUtils.POST_DATA_ANNO), aExpected.postData); + break; + case "charset": + let testURI = NetUtil.newURI(aNode.uri); + do_check_eq((yield PlacesUtils.getCharsetForURI(testURI)), aExpected.charset); + break; + case "feedUrl": + yield function() { + let deferred = Promise.defer(); + PlacesUtils.livemarks.getLivemark( + { id: id }, + function (aStatus, aLivemark) { + do_check_true(Components.isSuccessCode(aStatus)); + do_check_eq(aLivemark.siteURI.spec, aExpected.url); + do_check_eq(aLivemark.feedURI.spec, aExpected.feedUrl); + deferred.resolve(); + }); + return deferred.promise; }(); + break; + case "children": + let folder = aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode); + do_check_eq(folder.hasChildren, aExpected.children.length > 0); + folder.containerOpen = true; + do_check_eq(folder.childCount, aExpected.children.length); - aExpected.children.forEach( - function (item, index) checkItem(item, folder.getChild(index))); + aExpected.children.forEach(function (item, index) checkItem(item, folder.getChild(index))); - folder.containerOpen = false; - break; - default: - throw new Error("Unknown property"); + folder.containerOpen = false; + break; + default: + throw new Error("Unknown property"); + } } - }; + }); } From 2793bc2a0e46d6c2ab59e63e46f5d70c4d97b584 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Mon, 15 Apr 2013 08:50:35 -0400 Subject: [PATCH 158/438] bug 819734 - Token Bucket for Network Bursts part 1/2 [base] r=honzab --- modules/libpref/src/init/all.js | 5 + netwerk/base/src/EventTokenBucket.cpp | 313 ++++++++++++++++++ netwerk/base/src/EventTokenBucket.h | 127 +++++++ netwerk/base/src/Makefile.in | 1 + netwerk/protocol/http/nsHttpConnection.cpp | 2 +- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 64 +++- netwerk/protocol/http/nsHttpConnectionMgr.h | 14 + netwerk/protocol/http/nsHttpHandler.cpp | 56 ++++ netwerk/protocol/http/nsHttpHandler.h | 42 ++- netwerk/protocol/http/nsHttpTransaction.cpp | 45 +++ netwerk/protocol/http/nsHttpTransaction.h | 28 ++ 11 files changed, 689 insertions(+), 8 deletions(-) create mode 100644 netwerk/base/src/EventTokenBucket.cpp create mode 100644 netwerk/base/src/EventTokenBucket.h diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index f20a542c0988..64eba14d90a4 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -1003,6 +1003,11 @@ pref("network.http.spdy.send-buffer-size", 131072); pref("network.http.diagnostics", false); +pref("network.http.pacing.requests.enabled", false); +pref("network.http.pacing.requests.min-parallelism", 6); +pref("network.http.pacing.requests.hz", 100); +pref("network.http.pacing.requests.burst", 32); + // default values for FTP // in a DSCP environment this should be 40 (0x28, or AF11), per RFC-4594, // Section 4.8 "High-Throughput Data Service Class", and 80 (0x50, or AF22) diff --git a/netwerk/base/src/EventTokenBucket.cpp b/netwerk/base/src/EventTokenBucket.cpp new file mode 100644 index 000000000000..cb0a3c826a86 --- /dev/null +++ b/netwerk/base/src/EventTokenBucket.cpp @@ -0,0 +1,313 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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 "EventTokenBucket.h" + +#include "nsNetUtil.h" +#include "nsSocketTransportService2.h" + +extern PRThread *gSocketThread; + +namespace mozilla { +namespace net { + +//////////////////////////////////////////// +// EventTokenBucketCancelable +//////////////////////////////////////////// + +class TokenBucketCancelable : public nsICancelable +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSICANCELABLE + + TokenBucketCancelable(class ATokenBucketEvent *event); + virtual ~TokenBucketCancelable() {} + void Fire(); + +private: + friend class EventTokenBucket; + ATokenBucketEvent *mEvent; +}; + +NS_IMPL_THREADSAFE_ISUPPORTS1(TokenBucketCancelable, nsICancelable) + +TokenBucketCancelable::TokenBucketCancelable(ATokenBucketEvent *event) + : mEvent(event) +{ +} + +NS_IMETHODIMP +TokenBucketCancelable::Cancel(nsresult reason) +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + mEvent = nullptr; + return NS_OK; +} + +void +TokenBucketCancelable::Fire() +{ + if (!mEvent) + return; + + ATokenBucketEvent *event = mEvent; + mEvent = nullptr; + event->OnTokenBucketAdmitted(); +} + +//////////////////////////////////////////// +// EventTokenBucket +//////////////////////////////////////////// + +NS_IMPL_THREADSAFE_ISUPPORTS1(EventTokenBucket, nsITimerCallback) + +// by default 1hz with no burst +EventTokenBucket::EventTokenBucket(uint32_t eventsPerSecond, + uint32_t burstSize) + : mUnitCost(kUsecPerSec) + , mMaxCredit(kUsecPerSec) + , mCredit(kUsecPerSec) + , mPaused(false) + , mStopped(false) + , mTimerArmed(false) +{ + MOZ_COUNT_CTOR(EventTokenBucket); + mLastUpdate = TimeStamp::Now(); + + MOZ_ASSERT(NS_IsMainThread()); + + nsresult rv; + nsCOMPtr sts; + nsCOMPtr ioService = do_GetIOService(&rv); + if (NS_SUCCEEDED(rv)) + sts = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv); + if (NS_SUCCEEDED(rv)) + mTimer = do_CreateInstance("@mozilla.org/timer;1"); + if (mTimer) + mTimer->SetTarget(sts); + SetRate(eventsPerSecond, burstSize); +} + +EventTokenBucket::~EventTokenBucket() +{ + SOCKET_LOG(("EventTokenBucket::dtor %p events=%d\n", + this, mEvents.GetSize())); + + MOZ_COUNT_DTOR(EventTokenBucket); + if (mTimer && mTimerArmed) + mTimer->Cancel(); + + // Complete any queued events to prevent hangs + while (mEvents.GetSize()) { + nsRefPtr cancelable = + dont_AddRef(static_cast(mEvents.PopFront())); + cancelable->Fire(); + } +} + +void +EventTokenBucket::SetRate(uint32_t eventsPerSecond, + uint32_t burstSize) +{ + SOCKET_LOG(("EventTokenBucket::SetRate %p %u %u\n", + this, eventsPerSecond, burstSize)); + + if (eventsPerSecond > kMaxHz) { + eventsPerSecond = kMaxHz; + SOCKET_LOG((" eventsPerSecond out of range\n")); + } + + if (!eventsPerSecond) { + eventsPerSecond = 1; + SOCKET_LOG((" eventsPerSecond out of range\n")); + } + + mUnitCost = kUsecPerSec / eventsPerSecond; + mMaxCredit = mUnitCost * burstSize; + if (mMaxCredit > kUsecPerSec * 60 * 15) { + SOCKET_LOG((" burstSize out of range\n")); + mMaxCredit = kUsecPerSec * 60 * 15; + } + mCredit = mMaxCredit; + mLastUpdate = TimeStamp::Now(); +} + +void +EventTokenBucket::ClearCredits() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::ClearCredits %p\n", this)); + mCredit = 0; +} + +uint32_t +EventTokenBucket::BurstEventsAvailable() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + return static_cast(mCredit / mUnitCost); +} + +uint32_t +EventTokenBucket::QueuedEvents() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + return mEvents.GetSize(); +} + +void +EventTokenBucket::Pause() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::Pause %p\n", this)); + if (mPaused || mStopped) + return; + + mPaused = true; + if (mTimerArmed) { + mTimer->Cancel(); + mTimerArmed = false; + } +} + +void +EventTokenBucket::UnPause() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::UnPause %p\n", this)); + if (!mPaused || mStopped) + return; + + mPaused = false; + DispatchEvents(); + UpdateTimer(); +} + +nsresult +EventTokenBucket::SubmitEvent(ATokenBucketEvent *event, nsICancelable **cancelable) +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::SubmitEvent %p\n", this)); + + if (mStopped || !mTimer) + return NS_ERROR_FAILURE; + + UpdateCredits(); + + nsRefPtr cancelEvent = new TokenBucketCancelable(event); + // When this function exits the cancelEvent needs 2 references, one for the + // mEvents queue and one for the caller of SubmitEvent() + + NS_ADDREF(*cancelable = cancelEvent.get()); + + if (mPaused || !TryImmediateDispatch(cancelEvent.get())) { + // queue it + SOCKET_LOG((" queued\n")); + mEvents.Push(cancelEvent.forget().get()); + UpdateTimer(); + } + else { + SOCKET_LOG((" dispatched synchronously\n")); + } + + return NS_OK; +} + +bool +EventTokenBucket::TryImmediateDispatch(TokenBucketCancelable *cancelable) +{ + if (mCredit < mUnitCost) + return false; + + mCredit -= mUnitCost; + cancelable->Fire(); + return true; +} + +void +EventTokenBucket::DispatchEvents() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::DispatchEvents %p %d\n", this, mPaused)); + if (mPaused || mStopped) + return; + + while (mEvents.GetSize() && mUnitCost <= mCredit) { + nsRefPtr cancelable = + dont_AddRef(static_cast(mEvents.PopFront())); + if (cancelable->mEvent) { + SOCKET_LOG(("EventTokenBucket::DispachEvents [%p] " + "Dispatching queue token bucket event cost=%lu credit=%lu\n", + this, mUnitCost, mCredit)); + mCredit -= mUnitCost; + cancelable->Fire(); + } + } +} + +void +EventTokenBucket::UpdateTimer() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + if (mTimerArmed || mPaused || mStopped || !mEvents.GetSize() || !mTimer) + return; + + if (mCredit >= mUnitCost) + return; + + // determine the time needed to wait to accumulate enough credits to admit + // one more event and set the timer for that point. Always round it + // up because firing early doesn't help. + // + uint64_t deficit = mUnitCost - mCredit; + uint64_t msecWait = (deficit + (kUsecPerMsec - 1)) / kUsecPerMsec; + + if (msecWait < 4) // minimum wait + msecWait = 4; + else if (msecWait > 60000) // maximum wait + msecWait = 60000; + + SOCKET_LOG(("EventTokenBucket::UpdateTimer %p for %dms\n", + this, msecWait)); + nsresult rv = mTimer->InitWithCallback(this, static_cast(msecWait), + nsITimer::TYPE_ONE_SHOT); + mTimerArmed = NS_SUCCEEDED(rv); +} + +NS_IMETHODIMP +EventTokenBucket::Notify(nsITimer *timer) +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + SOCKET_LOG(("EventTokenBucket::Notify() %p\n", this)); + mTimerArmed = false; + if (mStopped) + return NS_OK; + + UpdateCredits(); + DispatchEvents(); + UpdateTimer(); + + return NS_OK; +} + +void +EventTokenBucket::UpdateCredits() +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + + TimeStamp now = TimeStamp::Now(); + TimeDuration elapsed = now - mLastUpdate; + mLastUpdate = now; + + mCredit += static_cast(elapsed.ToMicroseconds()); + if (mCredit > mMaxCredit) + mCredit = mMaxCredit; + SOCKET_LOG(("EventTokenBucket::UpdateCredits %p to %lu (%lu each.. %3.2f)\n", + this, mCredit, mUnitCost, (double)mCredit / mUnitCost)); +} + +} // mozilla::net +} // mozilla diff --git a/netwerk/base/src/EventTokenBucket.h b/netwerk/base/src/EventTokenBucket.h new file mode 100644 index 000000000000..c7d86798ccf1 --- /dev/null +++ b/netwerk/base/src/EventTokenBucket.h @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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/. */ + +#ifndef NetEventTokenBucket_h__ +#define NetEventTokenBucket_h__ + +#include "nsCOMPtr.h" +#include "nsDeque.h" +#include "nsICancelable.h" +#include "nsITimer.h" + +#include "mozilla/TimeStamp.h" + +namespace mozilla { +namespace net { + +/* A token bucket is used to govern the maximum rate a series of events + can be executed at. For instance if your event was "eat a piece of cake" + then a token bucket configured to allow "1 piece per day" would spread + the eating of a 8 piece cake over 8 days even if you tried to eat the + whole thing up front. In a practical sense it 'costs' 1 token to execute + an event and tokens are 'earned' at a particular rate as time goes by. + + The token bucket can be perfectly smooth or allow a configurable amount of + burstiness. A bursty token bucket allows you to save up unused credits, while + a perfectly smooth one would not. A smooth "1 per day" cake token bucket + would require 9 days to eat that cake if you skipped a slice on day 4 + (use the token or lose it), while a token bucket configured with a burst + of 2 would just let you eat 2 slices on day 5 (the credits for day 4 and day + 5) and finish the cake in the usual 8 days. + + EventTokenBucket(hz=20, burst=5) creates a token bucket with the following properties: + + + events from an infinite stream will be admitted 20 times per second (i.e. + hz=20 means 1 event per 50 ms). Timers will be used to space things evenly down to + 5ms gaps (i.e. up to 200hz). Token buckets with rates greater than 200hz will admit + multiple events with 5ms gaps between them. 10000hz is the maximum rate and 1hz is + the minimum rate. + + + The burst size controls the limit of 'credits' that a token bucket can accumulate + when idle. For our (20,5) example each event requires 50ms of credit (again, 20hz = 50ms + per event). a burst size of 5 means that the token bucket can accumulate a + maximum of 250ms (5 * 50ms) for this bucket. If no events have been admitted for the + last full second the bucket can still only accumulate 250ms of credit - but that credit + means that 5 events can be admitted without delay. A burst size of 1 is the minimum. + The EventTokenBucket is created with maximum credits already applied, but they + can be cleared with the ClearCredits() method. The maximum burst size is + 15 minutes worth of events. + + + An event is submitted to the token bucket asynchronously through SubmitEvent(). + The OnTokenBucketAdmitted() method of the submitted event is used as a callback + when the event is ready to run. A cancelable event is returned to the SubmitEvent() caller + for use in the case they do not wish to wait for the callback. +*/ + +class EventTokenBucket; + +class ATokenBucketEvent +{ +public: + virtual void OnTokenBucketAdmitted() = 0; +}; + +class TokenBucketCancelable; + +class EventTokenBucket : public nsITimerCallback +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSITIMERCALLBACK + + // This should be constructed on the main thread + EventTokenBucket(uint32_t eventsPerSecond, uint32_t burstSize); + virtual ~EventTokenBucket(); + + // These public methods are all meant to be called from the socket thread + void ClearCredits(); + uint32_t BurstEventsAvailable(); + uint32_t QueuedEvents(); + + // a paused token bucket will not process any events, but it will accumulate + // credits. ClearCredits can be used before unpausing if desired. + void Pause(); + void UnPause(); + void Stop() { mStopped = true; } + + // The returned cancelable event can only be canceled from the socket thread + nsresult SubmitEvent(ATokenBucketEvent *event, nsICancelable **cancelable); + +private: + friend class RunNotifyEvent; + friend class SetTimerEvent; + + bool TryImmediateDispatch(TokenBucketCancelable *event); + void SetRate(uint32_t eventsPerSecond, uint32_t burstSize); + + void DispatchEvents(); + void UpdateTimer(); + void UpdateCredits(); + + const static uint64_t kUsecPerSec = 1000000; + const static uint64_t kUsecPerMsec = 1000; + const static uint64_t kMaxHz = 10000; + + uint64_t mUnitCost; // usec of credit needed for 1 event (from eventsPerSecond) + uint64_t mMaxCredit; // usec mCredit limit (from busrtSize) + uint64_t mCredit; // usec of accumulated credit. + + bool mPaused; + bool mStopped; + nsDeque mEvents; + bool mTimerArmed; + TimeStamp mLastUpdate; + + // The timer is created on the main thread, but is armed and executes Notify() + // callbacks on the socket thread in order to maintain low latency of event + // delivery. + nsCOMPtr mTimer; +}; + +} // ::mozilla::net +} // ::mozilla + +#endif diff --git a/netwerk/base/src/Makefile.in b/netwerk/base/src/Makefile.in index 6280bafa8283..6adaf024c112 100644 --- a/netwerk/base/src/Makefile.in +++ b/netwerk/base/src/Makefile.in @@ -79,6 +79,7 @@ CPPSRCS = \ ProxyAutoConfig.cpp \ Dashboard.cpp \ NetworkActivityMonitor.cpp \ + EventTokenBucket.cpp \ $(NULL) LOCAL_INCLUDES += -I$(topsrcdir)/dom/base diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index a315d7adb9b3..88cc877226e3 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -1247,7 +1247,7 @@ nsHttpConnection::OnSocketWritable() else { if (!mReportedSpdy) { mReportedSpdy = true; - gHttpHandler->ConnMgr()->ReportSpdyConnection(this, mUsingSpdyVersion); + gHttpHandler->ConnMgr()->ReportSpdyConnection(this, mEverUsedSpdy); } LOG((" writing transaction request stream\n")); diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 5a8ccb3f8fd0..08fccd0f5863 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -63,6 +63,7 @@ nsHttpConnectionMgr::nsHttpConnectionMgr() , mIsShuttingDown(false) , mNumActiveConns(0) , mNumIdleConns(0) + , mNumSpdyActiveConns(0) , mNumHalfOpenConns(0) , mTimeOfNextWakeUp(UINT64_MAX) , mTimeoutTickArmed(false) @@ -413,6 +414,28 @@ nsHttpConnectionMgr::ProcessPendingQ() return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, nullptr); } +void +nsHttpConnectionMgr::OnMsgUpdateRequestTokenBucket(int32_t, void *param) +{ + nsRefPtr tokenBucket = + dont_AddRef(static_cast(param)); + gHttpHandler->SetRequestTokenBucket(tokenBucket); +} + +nsresult +nsHttpConnectionMgr::UpdateRequestTokenBucket(EventTokenBucket *aBucket) +{ + nsRefPtr bucket(aBucket); + + // Call From main thread when a new EventTokenBucket has been made in order + // to post the new value to the socket thread. + nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgUpdateRequestTokenBucket, + 0, bucket.get()); + if (NS_SUCCEEDED(rv)) + bucket.forget(); + return rv; +} + // Given a nsHttpConnectionInfo find the connection entry object that // contains either the nshttpconnection or nshttptransaction parameter. // Normally this is done by the hashkey lookup of connectioninfo, @@ -502,8 +525,9 @@ nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn, if (!usingSpdy) return; - + ent->mUsingSpdy = true; + mNumSpdyActiveConns++; uint32_t ttl = conn->TimeToLive(); uint64_t timeOfExpire = NowInSeconds() + ttl; @@ -957,7 +981,7 @@ nsHttpConnectionMgr::ShutdownPassCB(const nsACString &key, conn = ent->mActiveConns[0]; ent->mActiveConns.RemoveElementAt(0); - self->mNumActiveConns--; + self->DecrementActiveConnCount(conn); conn->Close(NS_ERROR_ABORT); NS_RELEASE(conn); @@ -1588,6 +1612,23 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent, } } + // Subject most transactions at high parallelism to rate pacing. + // It will only be actually submitted to the + // token bucket once, and if possible it is granted admission synchronously. + // It is important to leave a transaction in the pending queue when blocked by + // pacing so it can be found on cancel if necessary. + // Transactions that cause blocking or bypass it (e.g. js/css) are not rate + // limited. + if (gHttpHandler->UseRequestTokenBucket() && + (mNumActiveConns >= mNumSpdyActiveConns) && // just check for robustness sake + ((mNumActiveConns - mNumSpdyActiveConns) >= gHttpHandler->RequestTokenBucketMinParallelism()) && + !(caps & (NS_HTTP_LOAD_AS_BLOCKING | NS_HTTP_LOAD_UNBLOCKED))) { + if (!trans->TryToRunPacedRequest()) { + LOG((" blocked due to rate pacing\n")); + return NS_ERROR_NOT_AVAILABLE; + } + } + // step 2 // consider an idle persistent connection if (caps & NS_HTTP_ALLOW_KEEPALIVE) { @@ -1678,6 +1719,11 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent, "[ci=%s trans=%x caps=%x conn=%x priority=%d]\n", ent->mConnInfo->HashKey().get(), trans, caps, conn, priority)); + // It is possible for a rate-paced transaction to be dispatched independent + // of the token bucket when the amount of parallelization has changed or + // when a muxed connection (e.g. spdy or pipelines) becomes available. + trans->CancelPacing(NS_OK); + if (conn->UsingSpdy()) { LOG(("Spdy Dispatch Transaction via Activate(). Transaction host = %s," "Connection host = %s\n", @@ -1765,7 +1811,7 @@ nsHttpConnectionMgr::DispatchAbstractTransaction(nsConnectionEntry *ent, ent->mActiveConns.RemoveElement(conn); if (conn == ent->mYellowConnection) ent->OnYellowComplete(); - mNumActiveConns--; + DecrementActiveConnCount(conn); ConditionallyStopTimeoutTick(); // sever back references to connection, and do so without triggering @@ -1901,6 +1947,14 @@ nsHttpConnectionMgr::AddActiveConn(nsHttpConnection *conn, ActivateTimeoutTick(); } +void +nsHttpConnectionMgr::DecrementActiveConnCount(nsHttpConnection *conn) +{ + mNumActiveConns--; + if (conn->EverUsedSpdy()) + mNumSpdyActiveConns--; +} + void nsHttpConnectionMgr::StartedConnect() { @@ -2213,13 +2267,13 @@ nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, void *param) // reused. conn->DontReuse(); } - + if (ent->mActiveConns.RemoveElement(conn)) { if (conn == ent->mYellowConnection) ent->OnYellowComplete(); nsHttpConnection *temp = conn; NS_RELEASE(temp); - mNumActiveConns--; + DecrementActiveConnCount(conn); ConditionallyStopTimeoutTick(); } diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h index c3c39b9c18f3..97614d600f2a 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.h +++ b/netwerk/protocol/http/nsHttpConnectionMgr.h @@ -29,6 +29,12 @@ class nsHttpPipeline; class nsIHttpUpgradeListener; +namespace mozilla { +namespace net { +class EventTokenBucket; +} +} + //----------------------------------------------------------------------------- class nsHttpConnectionMgr : public nsIObserver @@ -124,6 +130,10 @@ public: // been initialized. nsresult UpdateParam(nsParamName name, uint16_t value); + // called from main thread to post a new request token bucket + // to the socket thread + nsresult UpdateRequestTokenBucket(mozilla::net::EventTokenBucket *aBucket); + // Lookup/Cancel HTTP->SPDY redirections bool GetSpdyAlternateProtocol(nsACString &key); void ReportSpdyAlternateProtocol(nsHttpConnection *); @@ -517,6 +527,7 @@ private: nsresult CreateTransport(nsConnectionEntry *, nsAHttpTransaction *, uint32_t, bool); void AddActiveConn(nsHttpConnection *, nsConnectionEntry *); + void DecrementActiveConnCount(nsHttpConnection *); void StartedConnect(); void RecvdConnect(); @@ -605,6 +616,7 @@ private: void OnMsgClosePersistentConnections (int32_t, void *); void OnMsgProcessFeedback (int32_t, void *); void OnMsgProcessAllSpdyPendingQ (int32_t, void *); + void OnMsgUpdateRequestTokenBucket (int32_t, void *); // Total number of active connections in all of the ConnectionEntry objects // that are accessed from mCT connection table. @@ -612,6 +624,8 @@ private: // Total number of idle connections in all of the ConnectionEntry objects // that are accessed from mCT connection table. uint16_t mNumIdleConns; + // Total number of spdy connections which are a subset of the active conns + uint16_t mNumSpdyActiveConns; // Total number of connections in mHalfOpens ConnectionEntry objects // that are accessed from mCT connection table uint32_t mNumHalfOpenConns; diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index c617ef394529..4e520a7cebad 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -37,6 +37,8 @@ #include "nsAlgorithm.h" #include "ASpdySession.h" #include "mozIApplicationClearPrivateDataParams.h" +#include "nsICancelable.h" +#include "EventTokenBucket.h" #include "nsIXULAppInfo.h" @@ -186,6 +188,10 @@ nsHttpHandler::nsHttpHandler() , mSpdyPingTimeout(PR_SecondsToInterval(8)) , mConnectTimeout(90000) , mParallelSpeculativeConnectLimit(6) + , mRequestTokenBucketEnabled(false) + , mRequestTokenBucketMinParallelism(6) + , mRequestTokenBucketHz(100) + , mRequestTokenBucketBurst(32) , mCritialRequestPrioritization(true) { #if defined(PR_LOGGING) @@ -331,9 +337,22 @@ nsHttpHandler::Init() mObserverService->AddObserver(this, "webapps-clear-data", true); } + MakeNewRequestTokenBucket(); return NS_OK; } +void +nsHttpHandler::MakeNewRequestTokenBucket() +{ + if (!mConnMgr) + return; + + nsRefPtr tokenBucket = + new mozilla::net::EventTokenBucket(mRequestTokenBucketHz, + mRequestTokenBucketBurst); + mConnMgr->UpdateRequestTokenBucket(tokenBucket); +} + nsresult nsHttpHandler::InitConnectionMgr() { @@ -1197,6 +1216,40 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } } + if (PREF_CHANGED(HTTP_PREF("pacing.requests.enabled"))) { + rv = prefs->GetBoolPref(HTTP_PREF("pacing.requests.enabled"), + &cVar); + if (NS_SUCCEEDED(rv)) + mRequestTokenBucketEnabled = cVar; + } + + if (PREF_CHANGED(HTTP_PREF("pacing.requests.min-parallelism"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.min-parallelism"), &val); + if (NS_SUCCEEDED(rv)) + mRequestTokenBucketMinParallelism = static_cast(clamped(val, 1, 1024)); + } + + bool requestTokenBucketUpdated = false; + if (PREF_CHANGED(HTTP_PREF("pacing.requests.hz"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.hz"), &val); + if (NS_SUCCEEDED(rv)) { + mRequestTokenBucketHz = static_cast(clamped(val, 1, 10000)); + requestTokenBucketUpdated = true; + } + } + if (PREF_CHANGED(HTTP_PREF("pacing.requests.burst"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.burst"), &val); + if (NS_SUCCEEDED(rv)) { + mRequestTokenBucketBurst = val ? val : 1; + requestTokenBucketUpdated = true; + } + } + if (requestTokenBucketUpdated) { + mRequestTokenBucket = + new mozilla::net::EventTokenBucket(mRequestTokenBucketHz, + mRequestTokenBucketBurst); + } + // // Tracking options // @@ -1270,6 +1323,9 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } } } + if (requestTokenBucketUpdated) { + MakeNewRequestTokenBucket(); + } #undef PREF_CHANGED #undef MULTI_PREF_CHANGED diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index 80a9ffca8fb0..0d39080269c0 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -35,6 +35,14 @@ class nsHttpTransaction; class nsAHttpTransaction; class nsIHttpChannel; class nsIPrefBranch; +class nsICancelable; + +namespace mozilla { +namespace net { +class ATokenBucketEvent; +class EventTokenBucket; +} +} //----------------------------------------------------------------------------- // nsHttpHandler - protocol handler for HTTP and HTTPS @@ -99,6 +107,9 @@ public: uint32_t ParallelSpeculativeConnectLimit() { return mParallelSpeculativeConnectLimit; } bool CritialRequestPrioritization() { return mCritialRequestPrioritization; } + bool UseRequestTokenBucket() { return mRequestTokenBucketEnabled; } + uint16_t RequestTokenBucketMinParallelism() { return mRequestTokenBucketMinParallelism; } + bool PromptTempRedirect() { return mPromptTempRedirect; } nsHttpAuthCache *AuthCache(bool aPrivate) { @@ -408,12 +419,39 @@ private: // when starting a new speculative connection. uint32_t mParallelSpeculativeConnectLimit; + // For Rate Pacing of HTTP/1 requests through a netwerk/base/src/EventTokenBucket + // Active requests <= *MinParallelism are not subject to the rate pacing + bool mRequestTokenBucketEnabled; + uint16_t mRequestTokenBucketMinParallelism; + uint32_t mRequestTokenBucketHz; // EventTokenBucket HZ + uint32_t mRequestTokenBucketBurst; // EventTokenBucket Burst + // Whether or not to block requests for non head js/css items (e.g. media) // while those elements load. bool mCritialRequestPrioritization; -}; -//----------------------------------------------------------------------------- +private: + // For Rate Pacing Certain Network Events. Only assign this pointer on + // socket thread. + void MakeNewRequestTokenBucket(); + nsRefPtr mRequestTokenBucket; + +public: + // Socket thread only + nsresult SubmitPacedRequest(mozilla::net::ATokenBucketEvent *event, + nsICancelable **cancel) + { + if (!mRequestTokenBucket) + return NS_ERROR_UNEXPECTED; + return mRequestTokenBucket->SubmitEvent(event, cancel); + } + + // Socket thread only + void SetRequestTokenBucket(mozilla::net::EventTokenBucket *aTokenBucket) + { + mRequestTokenBucket = aTokenBucket; + } +}; extern nsHttpHandler *gHttpHandler; diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index cea4aef408a0..8d772f9b2173 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -115,6 +115,9 @@ nsHttpTransaction::nsHttpTransaction() , mReportedResponseHeader(false) , mForTakeResponseHead(nullptr) , mResponseHeadTaken(false) + , mSubmittedRatePacing(false) + , mPassedRatePacing(false) + , mSynchronousRatePaceRequest(false) { LOG(("Creating nsHttpTransaction @%x\n", this)); gHttpHandler->GetMaxPipelineObjectSize(&mMaxPipelineObjectSize); @@ -124,6 +127,11 @@ nsHttpTransaction::~nsHttpTransaction() { LOG(("Destroying nsHttpTransaction @%x\n", this)); + if (mTokenBucketCancel) { + mTokenBucketCancel->Cancel(NS_ERROR_ABORT); + mTokenBucketCancel = nullptr; + } + // Force the callbacks to be released right now mCallbacks = nullptr; @@ -688,6 +696,11 @@ nsHttpTransaction::Close(nsresult reason) return; } + if (mTokenBucketCancel) { + mTokenBucketCancel->Cancel(reason); + mTokenBucketCancel = nullptr; + } + if (mActivityDistributor) { // report the reponse is complete if not already reported if (!mResponseIsComplete) @@ -1616,6 +1629,38 @@ nsHttpTransaction::DeleteSelfOnConsumerThread() } } +bool +nsHttpTransaction::TryToRunPacedRequest() +{ + if (mSubmittedRatePacing) + return mPassedRatePacing; + + mSubmittedRatePacing = true; + mSynchronousRatePaceRequest = true; + gHttpHandler->SubmitPacedRequest(this, getter_AddRefs(mTokenBucketCancel)); + mSynchronousRatePaceRequest = false; + return mPassedRatePacing; +} + +void +nsHttpTransaction::OnTokenBucketAdmitted() +{ + mPassedRatePacing = true; + mTokenBucketCancel = nullptr; + + if (!mSynchronousRatePaceRequest) + gHttpHandler->ConnMgr()->ProcessPendingQ(mConnInfo); +} + +void +nsHttpTransaction::CancelPacing(nsresult reason) +{ + if (mTokenBucketCancel) { + mTokenBucketCancel->Cancel(reason); + mTokenBucketCancel = nullptr; + } +} + //----------------------------------------------------------------------------- // nsHttpTransaction::nsISupports //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/nsHttpTransaction.h b/netwerk/protocol/http/nsHttpTransaction.h index df3187068a5a..0131442b9906 100644 --- a/netwerk/protocol/http/nsHttpTransaction.h +++ b/netwerk/protocol/http/nsHttpTransaction.h @@ -10,6 +10,7 @@ #include "nsHttpHeaderArray.h" #include "nsAHttpTransaction.h" #include "nsAHttpConnection.h" +#include "EventTokenBucket.h" #include "nsCOMPtr.h" #include "nsIPipe.h" @@ -37,6 +38,7 @@ class UpdateSecurityCallbacks; //----------------------------------------------------------------------------- class nsHttpTransaction : public nsAHttpTransaction + , public mozilla::net::ATokenBucketEvent , public nsIInputStreamCallback , public nsIOutputStreamCallback { @@ -309,6 +311,32 @@ private: // true when ::Set has been called with a response header bool mSetup; } mRestartInProgressVerifier; + +// For Rate Pacing via an EventTokenBucket +public: + // called by the connection manager to run this transaction through the + // token bucket. If the token bucket admits the transaction immediately it + // returns true. The function is called repeatedly until it returns true. + bool TryToRunPacedRequest(); + + // ATokenBucketEvent pure virtual implementation. Called by the token bucket + // when the transaction is ready to run. If this happens asynchrounously to + // token bucket submission the transaction just posts an event that causes + // the pending transaction queue to be rerun (and TryToRunPacedRequest() to + // be run again. + void OnTokenBucketAdmitted(); // ATokenBucketEvent + + // CancelPacing() can be used to tell the token bucket to remove this + // transaction from the list of pending transactions. This is used when a + // transaction is believed to be HTTP/1 (and thus subject to rate pacing) + // but later can be dispatched via spdy (not subject to rate pacing). + void CancelPacing(nsresult reason); + +private: + bool mSubmittedRatePacing; + bool mPassedRatePacing; + bool mSynchronousRatePaceRequest; + nsCOMPtr mTokenBucketCancel; }; #endif // nsHttpTransaction_h__ From 3cdb8b8d5f5a529b12c9801c30b16a18c0441da2 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Mon, 15 Apr 2013 09:40:53 -0400 Subject: [PATCH 159/438] bug 819734 - Token Bucket for Network Bursts part 2/2 [windows timers] r=honzab --- netwerk/base/src/EventTokenBucket.cpp | 119 ++++++++++++++++++++++++++ netwerk/base/src/EventTokenBucket.h | 18 ++++ 2 files changed, 137 insertions(+) diff --git a/netwerk/base/src/EventTokenBucket.cpp b/netwerk/base/src/EventTokenBucket.cpp index cb0a3c826a86..ea3a7888e9be 100644 --- a/netwerk/base/src/EventTokenBucket.cpp +++ b/netwerk/base/src/EventTokenBucket.cpp @@ -9,6 +9,11 @@ #include "nsNetUtil.h" #include "nsSocketTransportService2.h" +#ifdef XP_WIN +#include +#include +#endif + extern PRThread *gSocketThread; namespace mozilla { @@ -74,6 +79,10 @@ EventTokenBucket::EventTokenBucket(uint32_t eventsPerSecond, , mPaused(false) , mStopped(false) , mTimerArmed(false) +#ifdef XP_WIN + , mFineGrainTimerInUse(false) + , mFineGrainResetTimerArmed(false) +#endif { MOZ_COUNT_CTOR(EventTokenBucket); mLastUpdate = TimeStamp::Now(); @@ -101,6 +110,14 @@ EventTokenBucket::~EventTokenBucket() if (mTimer && mTimerArmed) mTimer->Cancel(); +#ifdef XP_WIN + NormalTimers(); + if (mFineGrainResetTimerArmed) { + mFineGrainResetTimerArmed = false; + mFineGrainResetTimer->Cancel(); + } +#endif + // Complete any queued events to prevent hangs while (mEvents.GetSize()) { nsRefPtr cancelable = @@ -246,6 +263,11 @@ EventTokenBucket::DispatchEvents() cancelable->Fire(); } } + +#ifdef XP_WIN + if (!mEvents.GetSize()) + WantNormalTimers(); +#endif } void @@ -270,6 +292,10 @@ EventTokenBucket::UpdateTimer() else if (msecWait > 60000) // maximum wait msecWait = 60000; +#ifdef XP_WIN + FineGrainTimers(); +#endif + SOCKET_LOG(("EventTokenBucket::UpdateTimer %p for %dms\n", this, msecWait)); nsresult rv = mTimer->InitWithCallback(this, static_cast(msecWait), @@ -281,6 +307,14 @@ NS_IMETHODIMP EventTokenBucket::Notify(nsITimer *timer) { MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); + +#ifdef XP_WIN + if (timer == mFineGrainResetTimer) { + FineGrainResetTimerNotify(); + return NS_OK; + } +#endif + SOCKET_LOG(("EventTokenBucket::Notify() %p\n", this)); mTimerArmed = false; if (mStopped) @@ -309,5 +343,90 @@ EventTokenBucket::UpdateCredits() this, mCredit, mUnitCost, (double)mCredit / mUnitCost)); } +#ifdef XP_WIN +void +EventTokenBucket::FineGrainTimers() +{ + SOCKET_LOG(("EventTokenBucket::FineGrainTimers %p mFineGrainTimerInUse=%d\n", + this, mFineGrainTimerInUse)); + + mLastFineGrainTimerUse = TimeStamp::Now(); + + if (mFineGrainTimerInUse) + return; + + if (mUnitCost > kCostFineGrainThreshold) + return; + + SOCKET_LOG(("EventTokenBucket::FineGrainTimers %p timeBeginPeriod()\n", + this)); + + mFineGrainTimerInUse = true; + timeBeginPeriod(1); +} + +void +EventTokenBucket::NormalTimers() +{ + if (!mFineGrainTimerInUse) + return; + mFineGrainTimerInUse = false; + + SOCKET_LOG(("EventTokenBucket::NormalTimers %p timeEndPeriod()\n", this)); + timeEndPeriod(1); +} + +void +EventTokenBucket::WantNormalTimers() +{ + if (!mFineGrainTimerInUse) + return; + if (mFineGrainResetTimerArmed) + return; + + TimeDuration elapsed(TimeStamp::Now() - mLastFineGrainTimerUse); + static const TimeDuration fiveSeconds = TimeDuration::FromSeconds(5); + + if (elapsed >= fiveSeconds) { + NormalTimers(); + return; + } + + if (!mFineGrainResetTimer) + mFineGrainResetTimer = do_CreateInstance("@mozilla.org/timer;1"); + + // if we can't delay the reset, just do it now + if (!mFineGrainResetTimer) { + NormalTimers(); + return; + } + + // pad the callback out 100ms to avoid having to round trip this again if the + // timer calls back just a tad early. + SOCKET_LOG(("EventTokenBucket::WantNormalTimers %p " + "Will reset timer granularity after delay", this)); + + mFineGrainResetTimer->InitWithCallback( + this, + static_cast((fiveSeconds - elapsed).ToMilliseconds()) + 100, + nsITimer::TYPE_ONE_SHOT); + mFineGrainResetTimerArmed = true; +} + +void +EventTokenBucket::FineGrainResetTimerNotify() +{ + SOCKET_LOG(("EventTokenBucket::FineGrainResetTimerNotify() events = %d\n", + this, mEvents.GetSize())); + mFineGrainResetTimerArmed = false; + + // If we are currently processing events then wait for the queue to drain + // before trying to reset back to normal timers again + if (!mEvents.GetSize()) + WantNormalTimers(); +} + +#endif + } // mozilla::net } // mozilla diff --git a/netwerk/base/src/EventTokenBucket.h b/netwerk/base/src/EventTokenBucket.h index c7d86798ccf1..7cd303fd36ec 100644 --- a/netwerk/base/src/EventTokenBucket.h +++ b/netwerk/base/src/EventTokenBucket.h @@ -119,6 +119,24 @@ private: // callbacks on the socket thread in order to maintain low latency of event // delivery. nsCOMPtr mTimer; + +#ifdef XP_WIN + // Windows timers are 15ms granularity by default. When we have active events + // that need to be dispatched at 50ms or less granularity we change the OS + // granularity to 1ms. 90 seconds after that need has elapsed we will change it + // back + const static uint64_t kCostFineGrainThreshold = 50 * kUsecPerMsec; + + void FineGrainTimers(); // get 1ms granularity + void NormalTimers(); // reset to default granularity + void WantNormalTimers(); // reset after 90 seconds if not needed in interim + void FineGrainResetTimerNotify(); // delayed callback to reset + + TimeStamp mLastFineGrainTimerUse; + bool mFineGrainTimerInUse; + bool mFineGrainResetTimerArmed; + nsCOMPtr mFineGrainResetTimer; +#endif }; } // ::mozilla::net From 7acac25401d917af6b26a17cb59ceaf87c7751b5 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Mon, 15 Apr 2013 09:41:27 -0400 Subject: [PATCH 160/438] bug 819734 - Token Bucket for Network Requests [a/b test] r=honzab --- docshell/base/nsDocShell.cpp | 9 +- modules/libpref/src/init/all.js | 6 + netwerk/base/public/moz.build | 1 + netwerk/base/public/nsPILoadGroupInternal.idl | 28 ++++ netwerk/base/src/nsLoadGroup.cpp | 55 ++++++- netwerk/base/src/nsLoadGroup.h | 8 +- netwerk/protocol/http/HttpBaseChannel.cpp | 11 ++ netwerk/protocol/http/HttpBaseChannel.h | 1 + netwerk/protocol/http/nsHttpAtomList.h | 1 + netwerk/protocol/http/nsHttpHandler.cpp | 143 +++++++++++++----- netwerk/protocol/http/nsHttpHandler.h | 7 +- .../protocol/http/nsIHttpChannelInternal.idl | 10 +- toolkit/components/telemetry/Histograms.json | 56 +++++++ 13 files changed, 293 insertions(+), 43 deletions(-) create mode 100644 netwerk/base/public/nsPILoadGroupInternal.idl diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 783c4ba44001..f39e88c4a2c9 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -94,7 +94,7 @@ // so we can associate the document URI with the load group. // until this point, we have an evil hack: #include "nsIHttpChannelInternal.h" - +#include "nsPILoadGroupInternal.h" // Local Includes #include "nsDocShellLoadInfo.h" @@ -6548,10 +6548,15 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, if (timingChannel) { TimeStamp channelCreationTime; rv = timingChannel->GetChannelCreation(&channelCreationTime); - if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull()) + if (NS_SUCCEEDED(rv) && !channelCreationTime.IsNull()) { Telemetry::AccumulateTimeDelta( Telemetry::TOTAL_CONTENT_PAGE_LOAD_TIME, channelCreationTime); + nsCOMPtr internalLoadGroup = + do_QueryInterface(mLoadGroup); + if (internalLoadGroup) + internalLoadGroup->OnEndPageLoad(aChannel); + } } // Timing is picked up by the window, we don't need it anymore diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 64eba14d90a4..fb3d341b8cc8 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -1003,7 +1003,13 @@ pref("network.http.spdy.send-buffer-size", 131072); pref("network.http.diagnostics", false); +#ifdef RELEASE_BUILD pref("network.http.pacing.requests.enabled", false); +pref("network.http.pacing.requests.abtest", false); +#else +pref("network.http.pacing.requests.enabled", true); +pref("network.http.pacing.requests.abtest", true); +#endif pref("network.http.pacing.requests.min-parallelism", 6); pref("network.http.pacing.requests.hz", 100); pref("network.http.pacing.requests.burst", 32); diff --git a/netwerk/base/public/moz.build b/netwerk/base/public/moz.build index 590e6b0b943b..1a0535538b36 100644 --- a/netwerk/base/public/moz.build +++ b/netwerk/base/public/moz.build @@ -108,6 +108,7 @@ XPIDL_SOURCES += [ 'nsIUploadChannel.idl', 'nsIUploadChannel2.idl', 'nsPISocketTransportService.idl', + 'nsPILoadGroupInternal.idl', ] if CONFIG['MOZ_TOOLKIT_SEARCH']: diff --git a/netwerk/base/public/nsPILoadGroupInternal.idl b/netwerk/base/public/nsPILoadGroupInternal.idl new file mode 100644 index 000000000000..6b12304a4f60 --- /dev/null +++ b/netwerk/base/public/nsPILoadGroupInternal.idl @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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 nsIChannel; + +/** + * Dumping ground for load group experimental work. + * This interface will never be frozen. If you are + * using any feature exposed by this interface, be aware that this interface + * will change and you will be broken. You have been warned. + */ +[scriptable, uuid(6ef2f8ac-9584-48f3-957a-0c94fff0c8c7)] +interface nsPILoadGroupInternal : nsISupports +{ + + /** + * Called when the load group has loaded main page and + * subresources. (i.e.essentially DOMComplete) + * + * @param aDefaultChanel + * The request channel for the base apge + */ + void OnEndPageLoad(in nsIChannel aDefaultChannel); +}; diff --git a/netwerk/base/src/nsLoadGroup.cpp b/netwerk/base/src/nsLoadGroup.cpp index af4f9992ae20..64c18523f9a2 100644 --- a/netwerk/base/src/nsLoadGroup.cpp +++ b/netwerk/base/src/nsLoadGroup.cpp @@ -21,6 +21,7 @@ #include "nsReadableUtils.h" #include "nsString.h" #include "nsTArray.h" +#include "nsIHttpChannelInternal.h" #include "mozilla/Telemetry.h" using namespace mozilla; @@ -117,6 +118,7 @@ nsLoadGroup::nsLoadGroup(nsISupports* outer) , mDefaultLoadIsTimed(false) , mTimedRequests(0) , mCachedRequests(0) + , mTimedNonCachedRequestsUntilOnEndPageLoad(0) { NS_INIT_AGGREGATED(outer); @@ -155,6 +157,7 @@ nsLoadGroup::~nsLoadGroup() NS_IMPL_AGGREGATED(nsLoadGroup) NS_INTERFACE_MAP_BEGIN_AGGREGATED(nsLoadGroup) NS_INTERFACE_MAP_ENTRY(nsILoadGroup) + NS_INTERFACE_MAP_ENTRY(nsPILoadGroupInternal) NS_INTERFACE_MAP_ENTRY(nsILoadGroupChild) NS_INTERFACE_MAP_ENTRY(nsIRequest) NS_INTERFACE_MAP_ENTRY(nsISupportsPriority) @@ -631,8 +634,12 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, ++mTimedRequests; TimeStamp timeStamp; rv = timedChannel->GetCacheReadStart(&timeStamp); - if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) + if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) { ++mCachedRequests; + } + else { + mTimedNonCachedRequestsUntilOnEndPageLoad++; + } rv = timedChannel->GetAsyncOpen(&timeStamp); if (NS_SUCCEEDED(rv) && !timeStamp.IsNull()) { @@ -812,6 +819,52 @@ nsLoadGroup::GetRootLoadGroup(nsILoadGroup * *aRootLoadGroup) return NS_OK; } +//////////////////////////////////////////////////////////////////////////////// +// nsPILoadGroupInternal methods: + +NS_IMETHODIMP +nsLoadGroup::OnEndPageLoad(nsIChannel *aDefaultChannel) +{ + // On page load of a page with at least 32 resources we want to record + // telemetry on which rate pacing algorithm was used to load the page and + // the page load time. + uint32_t requests = mTimedNonCachedRequestsUntilOnEndPageLoad; + mTimedNonCachedRequestsUntilOnEndPageLoad = 0; + + nsCOMPtr timedChannel = + do_QueryInterface(aDefaultChannel); + if (!timedChannel) + return NS_OK; + + nsCOMPtr internalHttpChannel = + do_QueryInterface(timedChannel); + if (!internalHttpChannel) + return NS_OK; + + TimeStamp cacheReadStart; + TimeStamp asyncOpen; + uint32_t telemetryID; + nsresult rv = timedChannel->GetCacheReadStart(&cacheReadStart); + if (NS_SUCCEEDED(rv)) + rv = timedChannel->GetAsyncOpen(&asyncOpen); + if (NS_SUCCEEDED(rv)) + rv = internalHttpChannel->GetPacingTelemetryID(&telemetryID); + if (NS_FAILED(rv)) + return NS_OK; + + // Nothing to do if we don't have a start time or this was + // from the cache or we don't know what profile was used + if (asyncOpen.IsNull() || !cacheReadStart.IsNull() || !telemetryID) + return NS_OK; + + if (requests < 32) + return NS_OK; + + Telemetry::AccumulateTimeDelta(static_cast(telemetryID), + asyncOpen); + return NS_OK; +} + //////////////////////////////////////////////////////////////////////////////// // nsISupportsPriority methods: diff --git a/netwerk/base/src/nsLoadGroup.h b/netwerk/base/src/nsLoadGroup.h index 918d59a21a06..e4d4d55dbbe4 100644 --- a/netwerk/base/src/nsLoadGroup.h +++ b/netwerk/base/src/nsLoadGroup.h @@ -8,6 +8,7 @@ #include "nsILoadGroup.h" #include "nsILoadGroupChild.h" +#include "nsPILoadGroupInternal.h" #include "nsIChannel.h" #include "nsIStreamListener.h" #include "nsAgg.h" @@ -26,7 +27,8 @@ class nsILoadGroupConnectionInfo; class nsLoadGroup : public nsILoadGroup, public nsILoadGroupChild, public nsISupportsPriority, - public nsSupportsWeakReference + public nsSupportsWeakReference, + public nsPILoadGroupInternal { public: NS_DECL_AGGREGATED @@ -38,6 +40,7 @@ public: //////////////////////////////////////////////////////////////////////////// // nsILoadGroup methods: NS_DECL_NSILOADGROUP + NS_DECL_NSPILOADGROUPINTERNAL //////////////////////////////////////////////////////////////////////////// // nsILoadGroupChild methods: @@ -87,6 +90,9 @@ protected: bool mDefaultLoadIsTimed; uint32_t mTimedRequests; uint32_t mCachedRequests; + + /* For nsPILoadGroupInternal */ + uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; }; #endif // nsLoadGroup_h__ diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 3c9f034eb563..c9f56fbb46aa 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1399,6 +1399,17 @@ HttpBaseChannel::SetLoadUnblocked(bool aLoadUnblocked) return NS_OK; } +NS_IMETHODIMP +HttpBaseChannel::GetPacingTelemetryID(uint32_t *aID) +{ + *aID = 0; + // Don't record pacing algorithm for spdy because it is effectively + // bypassed by the protocol mux + if (!mResponseHead || !mResponseHead->PeekHeader(nsHttp::X_Firefox_Spdy)) + *aID = gHttpHandler->PacingTelemetryID(); + return NS_OK; +} + //----------------------------------------------------------------------------- // HttpBaseChannel::nsISupportsPriority //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index 638a8ec328c3..c359e98e07bc 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -149,6 +149,7 @@ public: NS_IMETHOD SetLoadAsBlocking(bool aLoadAsBlocking); NS_IMETHOD GetLoadUnblocked(bool *aLoadUnblocked); NS_IMETHOD SetLoadUnblocked(bool aLoadUnblocked); + NS_IMETHOD GetPacingTelemetryID(uint32_t *aID); inline void CleanRedirectCacheChainIfNecessary() { diff --git a/netwerk/protocol/http/nsHttpAtomList.h b/netwerk/protocol/http/nsHttpAtomList.h index 4a63a45c996e..62e425a73684 100644 --- a/netwerk/protocol/http/nsHttpAtomList.h +++ b/netwerk/protocol/http/nsHttpAtomList.h @@ -85,6 +85,7 @@ HTTP_ATOM(Vary, "Vary") HTTP_ATOM(Version, "Version") HTTP_ATOM(WWW_Authenticate, "WWW-Authenticate") HTTP_ATOM(Warning, "Warning") +HTTP_ATOM(X_Firefox_Spdy, "X-Firefox-Spdy") // methods are atoms too. // diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 4e520a7cebad..4fe9d0e987a4 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -43,6 +43,7 @@ #include "nsIXULAppInfo.h" #include "mozilla/net/NeckoChild.h" +#include "mozilla/Telemetry.h" #if defined(XP_UNIX) #include @@ -189,6 +190,8 @@ nsHttpHandler::nsHttpHandler() , mConnectTimeout(90000) , mParallelSpeculativeConnectLimit(6) , mRequestTokenBucketEnabled(false) + , mRequestTokenBucketABTestEnabled(false) + , mRequestTokenBucketABTestProfile(0) , mRequestTokenBucketMinParallelism(6) , mRequestTokenBucketHz(100) , mRequestTokenBucketBurst(32) @@ -348,8 +351,8 @@ nsHttpHandler::MakeNewRequestTokenBucket() return; nsRefPtr tokenBucket = - new mozilla::net::EventTokenBucket(mRequestTokenBucketHz, - mRequestTokenBucketBurst); + new mozilla::net::EventTokenBucket(RequestTokenBucketHz(), + RequestTokenBucketBurst()); mConnMgr->UpdateRequestTokenBucket(tokenBucket); } @@ -774,6 +777,53 @@ nsHttpHandler::MaxSocketCount() return maxCount; } +// Different profiles for when the Token Bucket ABTest is enabled +static const uint32_t sNumberTokenBucketProfiles = 7; +static const uint32_t sTokenBucketProfiles[sNumberTokenBucketProfiles][4] = { + // burst, hz, min-parallelism + { 32, 100, 6, Telemetry::HTTP_PLT_RATE_PACING_0 }, // balanced + { 16, 100, 6, Telemetry::HTTP_PLT_RATE_PACING_1 }, // start earlier + { 32, 200, 6, Telemetry::HTTP_PLT_RATE_PACING_2 }, // run faster + { 32, 50, 6, Telemetry::HTTP_PLT_RATE_PACING_3 }, // run slower + { 32, 1, 8, Telemetry::HTTP_PLT_RATE_PACING_4 }, // allow only min-parallelism + { 32, 1, 16, Telemetry::HTTP_PLT_RATE_PACING_5 }, // allow only min-parallelism (larger) + { 1000, 1000, 1000, Telemetry::HTTP_PLT_RATE_PACING_6 }, // unlimited +}; + +uint32_t +nsHttpHandler::RequestTokenBucketBurst() +{ + return AllowExperiments() && mRequestTokenBucketABTestEnabled ? + sTokenBucketProfiles[mRequestTokenBucketABTestProfile][0] : + mRequestTokenBucketBurst; +} + +uint32_t +nsHttpHandler::RequestTokenBucketHz() +{ + return AllowExperiments() && mRequestTokenBucketABTestEnabled ? + sTokenBucketProfiles[mRequestTokenBucketABTestProfile][1] : + mRequestTokenBucketHz; +} + +uint16_t +nsHttpHandler::RequestTokenBucketMinParallelism() +{ + uint32_t rv = + AllowExperiments() && mRequestTokenBucketABTestEnabled ? + sTokenBucketProfiles[mRequestTokenBucketABTestProfile][2] : + mRequestTokenBucketMinParallelism; + return static_cast(rv); +} + +uint32_t +nsHttpHandler::PacingTelemetryID() +{ + if (!mRequestTokenBucketEnabled || !mRequestTokenBucketABTestEnabled) + return 0; + return sTokenBucketProfiles[mRequestTokenBucketABTestProfile][3]; +} + void nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) { @@ -1216,40 +1266,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } } - if (PREF_CHANGED(HTTP_PREF("pacing.requests.enabled"))) { - rv = prefs->GetBoolPref(HTTP_PREF("pacing.requests.enabled"), - &cVar); - if (NS_SUCCEEDED(rv)) - mRequestTokenBucketEnabled = cVar; - } - - if (PREF_CHANGED(HTTP_PREF("pacing.requests.min-parallelism"))) { - rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.min-parallelism"), &val); - if (NS_SUCCEEDED(rv)) - mRequestTokenBucketMinParallelism = static_cast(clamped(val, 1, 1024)); - } - - bool requestTokenBucketUpdated = false; - if (PREF_CHANGED(HTTP_PREF("pacing.requests.hz"))) { - rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.hz"), &val); - if (NS_SUCCEEDED(rv)) { - mRequestTokenBucketHz = static_cast(clamped(val, 1, 10000)); - requestTokenBucketUpdated = true; - } - } - if (PREF_CHANGED(HTTP_PREF("pacing.requests.burst"))) { - rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.burst"), &val); - if (NS_SUCCEEDED(rv)) { - mRequestTokenBucketBurst = val ? val : 1; - requestTokenBucketUpdated = true; - } - } - if (requestTokenBucketUpdated) { - mRequestTokenBucket = - new mozilla::net::EventTokenBucket(mRequestTokenBucketHz, - mRequestTokenBucketBurst); - } - // // Tracking options // @@ -1269,12 +1285,17 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } } + // toggle to true anytime a token bucket related pref is changed.. that + // includes telemetry and allow-experiments because of the abtest profile + bool requestTokenBucketUpdated = false; + // // Telemetry // if (PREF_CHANGED(TELEMETRY_ENABLED)) { cVar = false; + requestTokenBucketUpdated = true; rv = prefs->GetBoolPref(TELEMETRY_ENABLED, &cVar); if (NS_SUCCEEDED(rv)) { mTelemetryEnabled = cVar; @@ -1284,9 +1305,9 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) // // network.allow-experiments // - if (PREF_CHANGED(ALLOW_EXPERIMENTS)) { cVar = true; + requestTokenBucketUpdated = true; rv = prefs->GetBoolPref(ALLOW_EXPERIMENTS, &cVar); if (NS_SUCCEEDED(rv)) { mAllowExperiments = cVar; @@ -1327,6 +1348,54 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) MakeNewRequestTokenBucket(); } + if (PREF_CHANGED(HTTP_PREF("pacing.requests.enabled"))) { + rv = prefs->GetBoolPref(HTTP_PREF("pacing.requests.enabled"), + &cVar); + if (NS_SUCCEEDED(rv)){ + requestTokenBucketUpdated = true; + mRequestTokenBucketEnabled = cVar; + } + } + + if (PREF_CHANGED(HTTP_PREF("pacing.requests.abtest"))) { + rv = prefs->GetBoolPref(HTTP_PREF("pacing.requests.abtest"), + &cVar); + if (NS_SUCCEEDED(rv)) { + mRequestTokenBucketABTestEnabled = cVar; + requestTokenBucketUpdated = true; + if (mRequestTokenBucketABTestEnabled) { + // just taking the remainder is not perfectly uniform but it doesn't + // matter here. + mRequestTokenBucketABTestProfile = rand() % sNumberTokenBucketProfiles; + } + } + } + + if (PREF_CHANGED(HTTP_PREF("pacing.requests.min-parallelism"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.min-parallelism"), &val); + if (NS_SUCCEEDED(rv)) + mRequestTokenBucketMinParallelism = static_cast(clamped(val, 1, 1024)); + } + if (PREF_CHANGED(HTTP_PREF("pacing.requests.hz"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.hz"), &val); + if (NS_SUCCEEDED(rv)) { + mRequestTokenBucketHz = static_cast(clamped(val, 1, 10000)); + requestTokenBucketUpdated = true; + } + } + if (PREF_CHANGED(HTTP_PREF("pacing.requests.burst"))) { + rv = prefs->GetIntPref(HTTP_PREF("pacing.requests.burst"), &val); + if (NS_SUCCEEDED(rv)) { + mRequestTokenBucketBurst = val ? val : 1; + requestTokenBucketUpdated = true; + } + } + if (requestTokenBucketUpdated) { + mRequestTokenBucket = + new mozilla::net::EventTokenBucket(RequestTokenBucketHz(), + RequestTokenBucketBurst()); + } + #undef PREF_CHANGED #undef MULTI_PREF_CHANGED } diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index 0d39080269c0..6c5178594635 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -108,7 +108,10 @@ public: bool CritialRequestPrioritization() { return mCritialRequestPrioritization; } bool UseRequestTokenBucket() { return mRequestTokenBucketEnabled; } - uint16_t RequestTokenBucketMinParallelism() { return mRequestTokenBucketMinParallelism; } + uint16_t RequestTokenBucketMinParallelism(); + uint32_t RequestTokenBucketHz(); + uint32_t RequestTokenBucketBurst(); + uint32_t PacingTelemetryID(); bool PromptTempRedirect() { return mPromptTempRedirect; } @@ -422,6 +425,8 @@ private: // For Rate Pacing of HTTP/1 requests through a netwerk/base/src/EventTokenBucket // Active requests <= *MinParallelism are not subject to the rate pacing bool mRequestTokenBucketEnabled; + bool mRequestTokenBucketABTestEnabled; + uint32_t mRequestTokenBucketABTestProfile; uint16_t mRequestTokenBucketMinParallelism; uint32_t mRequestTokenBucketHz; // EventTokenBucket HZ uint32_t mRequestTokenBucketBurst; // EventTokenBucket Burst diff --git a/netwerk/protocol/http/nsIHttpChannelInternal.idl b/netwerk/protocol/http/nsIHttpChannelInternal.idl index bdfc0bb9bdca..d9f92fec8745 100644 --- a/netwerk/protocol/http/nsIHttpChannelInternal.idl +++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl @@ -34,7 +34,7 @@ interface nsIHttpUpgradeListener : nsISupports * using any feature exposed by this interface, be aware that this interface * will change and you will be broken. You have been warned. */ -[scriptable, uuid(74d13d41-85cd-490f-9942-300d0c01c726)] +[scriptable, uuid(68074a18-49a8-44d8-852c-320ad4b1d308)] interface nsIHttpChannelInternal : nsISupports { /** @@ -171,4 +171,12 @@ interface nsIHttpChannelInternal : nsISupports * exclusivity. Default false. */ attribute boolean loadUnblocked; + + /** + * bug 819734 we implement experimental rate pacing strategies for pages + * with large numbers of subresources. Several experimental profiles are + * available and this attribute corresponds to the profile used for this + * channel. (or at least the one active when it is queried.) + */ + readonly attribute uint32_t pacingTelemetryID; }; diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 07f6cfe4627a..34a5a2679dd3 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -1976,6 +1976,62 @@ "extended_statistics_ok": true, "description": "Time spent in nsDiskCacheStreamIO::Close() on the main thread (ms)" }, + "HTTP_PLT_RATE_PACING_0": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 0 (burst=32, hz=100, par=6)" + }, + "HTTP_PLT_RATE_PACING_1": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 1 (burst=16, hz=100, par=6)" + }, + "HTTP_PLT_RATE_PACING_2": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 2 (burst=32, hz=200, par=6)" + }, + "HTTP_PLT_RATE_PACING_3": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 3 (burst=32, hz=50, par=6)" + }, + "HTTP_PLT_RATE_PACING_4": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 4 (burst=32, hz=1, par=8)" + }, + "HTTP_PLT_RATE_PACING_5": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 5 (burst=32, hz=1, par=16)" + }, + "HTTP_PLT_RATE_PACING_6": { + "kind": "exponential", + "low": 100, + "high": "30000", + "n_buckets": 100, + "extended_statistics_ok": true, + "description": "HTTP: Total page load time (ms) with rate pacing algorithm 6 (burst=1000, hz=1000, par=1000)" + }, "IDLE_NOTIFY_BACK_MS": { "kind": "exponential", "high": "5000", From 3be2bb313f60f030a3388d54c999c1517e068550 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Mon, 15 Apr 2013 16:32:28 +0200 Subject: [PATCH 161/438] Bug 861857: TI: Fix testing the intersection between two types, r=jandem --- js/src/jsinfer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index bae334abc56d..508eb23b1413 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -378,7 +378,7 @@ TypeSet::intersectionEmpty(TypeSet *other) if (unknown() || other->unknown()) return false; - if (unknownObject() && unknownObject()) + if (unknownObject() && other->unknownObject()) return false; if (unknownObject() && other->getObjectCount() > 0) @@ -392,12 +392,14 @@ TypeSet::intersectionEmpty(TypeSet *other) return false; // Test if there are object that are in both TypeSets - for (unsigned i = 0; i < getObjectCount(); i++) { - TypeObjectKey *obj = getObject(i); - if (!obj) - continue; - if (other->hasType(Type::ObjectType(obj))) - return false; + if (!unknownObject()) { + for (unsigned i = 0; i < getObjectCount(); i++) { + TypeObjectKey *obj = getObject(i); + if (!obj) + continue; + if (other->hasType(Type::ObjectType(obj))) + return false; + } } return true; From 1f8653bbbc5e81c7ebe123f58dc2c166efe09e87 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 15 Apr 2013 16:46:43 +0200 Subject: [PATCH 162/438] Bug 861141 - Connect Breakpad on Android to faulty.lib's mmap interface. r=glandium,ted --- .../11-readsymboldatainternal-proto.patch | 50 ++++++++ .../src/common/linux/dump_symbols.h | 9 ++ tools/profiler/local_debug_info_symbolizer.cc | 117 +++++++++++++++++- 3 files changed, 172 insertions(+), 4 deletions(-) create mode 100644 toolkit/crashreporter/breakpad-patches/11-readsymboldatainternal-proto.patch diff --git a/toolkit/crashreporter/breakpad-patches/11-readsymboldatainternal-proto.patch b/toolkit/crashreporter/breakpad-patches/11-readsymboldatainternal-proto.patch new file mode 100644 index 000000000000..b91f9dced067 --- /dev/null +++ b/toolkit/crashreporter/breakpad-patches/11-readsymboldatainternal-proto.patch @@ -0,0 +1,50 @@ +# HG changeset patch +# User Julian Seward +# Date 1365953823 -7200 +# Node ID 21d2964d1337c0fce7375025610298a818ddbd0f +# Parent ef802a6418f25841880359e6dab3e8240bfd0821 +Bug 861141 - Connect Breakpad on Android to faulty.lib's mmap interface. r=ted. +Adds a prototype for ReadSymbolDataInternal so it can be called from +outside breakpad. + +diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h +--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h ++++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h +@@ -36,16 +36,17 @@ + #define COMMON_LINUX_DUMP_SYMBOLS_H__ + + #include + #include + #include + + #include "common/symbol_data.h" + #include "common/using_std_string.h" ++#include "google_breakpad/common/breakpad_types.h" + + namespace google_breakpad { + + class Module; + + // Find all the debugging information in OBJ_FILE, an ELF executable + // or shared library, and write it to SYM_STREAM in the Breakpad symbol + // file format. +@@ -60,11 +61,19 @@ bool WriteSymbolFile(const string &obj_f + // As above, but simply return the debugging information in MODULE + // instead of writing it to a stream. The caller owns the resulting + // Module object and must delete it when finished. + bool ReadSymbolData(const string& obj_file, + const std::vector& debug_dirs, + SymbolData symbol_data, + Module** module); + ++// Same as ReadSymbolData, except don't try to open the file; instead ++// just use the in-memory data (mapped image of it) located at OBJ_FILE. ++bool ReadSymbolDataInternal(const uint8_t* obj_file, ++ const string& obj_filename, ++ const std::vector& debug_dirs, ++ SymbolData symbol_data, ++ Module** module); ++ + } // namespace google_breakpad + + #endif // COMMON_LINUX_DUMP_SYMBOLS_H__ diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h index f3c92cd5005c..229657117361 100644 --- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h +++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h @@ -41,6 +41,7 @@ #include "common/symbol_data.h" #include "common/using_std_string.h" +#include "google_breakpad/common/breakpad_types.h" namespace google_breakpad { @@ -65,6 +66,14 @@ bool ReadSymbolData(const string& obj_file, SymbolData symbol_data, Module** module); +// Same as ReadSymbolData, except don't try to open the file; instead +// just use the in-memory data (mapped image of it) located at OBJ_FILE. +bool ReadSymbolDataInternal(const uint8_t* obj_file, + const string& obj_filename, + const std::vector& debug_dirs, + SymbolData symbol_data, + Module** module); + } // namespace google_breakpad #endif // COMMON_LINUX_DUMP_SYMBOLS_H__ diff --git a/tools/profiler/local_debug_info_symbolizer.cc b/tools/profiler/local_debug_info_symbolizer.cc index cbe8520aa4ba..650b9599378e 100644 --- a/tools/profiler/local_debug_info_symbolizer.cc +++ b/tools/profiler/local_debug_info_symbolizer.cc @@ -26,6 +26,16 @@ # error "Unknown platform" #endif +#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) +# include "mozilla/Types.h" +# include "ElfLoader.h" +# include +# include +# include "nsString.h" +# include "nsDirectoryServiceUtils.h" +# include "nsDirectoryServiceDefs.h" +#endif + #include "local_debug_info_symbolizer.h" namespace google_breakpad { @@ -40,6 +50,98 @@ LocalDebugInfoSymbolizer::~LocalDebugInfoSymbolizer() { # endif } +#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) + +// Find out where the installation's lib directory is, since we'll +// have to look in there to get hold of libmozglue.so. Returned +// C string is heap allocated and the caller must deallocate it. +static char* get_installation_lib_dir ( void ) +{ + nsCOMPtr + directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID)); + if (!directoryService) return NULL; + nsCOMPtr greDir; + nsresult rv = directoryService->Get(NS_GRE_DIR, NS_GET_IID(nsIFile), + getter_AddRefs(greDir)); + if (NS_FAILED(rv)) return NULL; + nsCString path; + rv = greDir->GetNativePath(path); + if (NS_FAILED(rv)) return NULL; + return strdup(path.get()); +} + +// Read symbol data from a file on Android. OBJ_FILENAME has +// three possible cases: +// +// (1) /foo/bar/xyzzy/blah.apk!/libwurble.so +// We hand it as-is to faulty.lib and let it fish the relevant +// bits out of the APK. +// +// (2) libmozglue.so +// This is part of the Fennec installation, but is not in the +// APK. Instead we have to figure out the installation path +// and look for it there. +// +// (3) libanythingelse.so +// faulty.lib assumes this is a system library, and prepends +// "/system/lib/" to the path. So as in (1), we can give it +// as-is to faulty.lib. +// +// Hence only (2) requires special-casing here. +// +static bool ReadSymbolData_ANDROID(const string& obj_filename, + const std::vector& debug_dirs, + SymbolData symbol_data, + Module** module) +{ + string obj_file_to_use = obj_filename; + + // Do (2) in the comment above. + if (obj_file_to_use == "libmozglue.so") { + char* libdir = get_installation_lib_dir(); + if (libdir) { + obj_file_to_use = string(libdir) + "/lib/" + obj_file_to_use; + free(libdir); + } + } + + // Regardless of whether the file is inside an APK or not, we ask + // faulty.lib to map it, then call ReadSymbolDataInternal, then + // unmap and dlclose it. + void* hdl = dlopen(obj_file_to_use.c_str(), RTLD_GLOBAL | RTLD_LAZY); + if (!hdl) { + BPLOG(INFO) << "ReadSymbolData_APK: Failed to get handle for ELF file \'" + << obj_file_to_use << "\'"; + return false; + } + + size_t sz = __dl_get_mappable_length(hdl); + if (sz == 0) { + dlclose(hdl); + BPLOG(INFO) << "ReadSymbolData_APK: Unable to get size for ELF file \'" + << obj_file_to_use << "\'"; + return false; + } + + void* image = __dl_mmap(hdl, NULL, sz, 0); + if (image == MAP_FAILED) { + dlclose(hdl); + BPLOG(INFO) << "ReadSymbolData_APK: Failed to mmap ELF file \'" + << obj_file_to_use << "\'"; + return false; + } + + bool ok = ReadSymbolDataInternal((const uint8_t*)image, + obj_file_to_use, debug_dirs, + symbol_data, module); + __dl_munmap(hdl, image, sz); + dlclose(hdl); + + return ok; +} +#endif /* defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) */ + + StackFrameSymbolizer::SymbolizerResult LocalDebugInfoSymbolizer::FillSourceLineInfo(const CodeModules* modules, const SystemInfo* system_info, @@ -61,10 +163,17 @@ LocalDebugInfoSymbolizer::FillSourceLineInfo(const CodeModules* modules, no_symbol_modules_.end()) { return kNoError; } - if (!ReadSymbolData(module->code_file(), - debug_dirs_, - ONLY_CFI, - &debug_info_module)) { + + bool ok = false; +# if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) + ok = ReadSymbolData_ANDROID(module->code_file(), debug_dirs_, + ONLY_CFI, &debug_info_module); +# else + ok = ReadSymbolData(module->code_file(), debug_dirs_, + ONLY_CFI, &debug_info_module); +# endif + + if (!ok) { if (debug_info_module) delete debug_info_module; no_symbol_modules_.insert(module->code_file()); From 32bc2e5c590b93767a45d3755a0179b7d126289c Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 15 Apr 2013 15:29:37 +0100 Subject: [PATCH 163/438] Bug 861269 - GC: Continuing the rooting of XPConnect - Convert id_ to idArg style arguments r=bholley --HG-- extra : rebase_source : a0a88749928f3f622b5626adfc8aa23382d06611 --- js/xpconnect/src/XPCComponents.cpp | 4 ++-- js/xpconnect/src/XPCRuntimeService.cpp | 18 +++++++++--------- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 4 ++-- js/xpconnect/src/XPCWrappedNativeScope.cpp | 4 ++-- js/xpconnect/wrappers/XrayWrapper.cpp | 10 +++++----- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index fb971190b4d3..3253644d1b70 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -4450,12 +4450,12 @@ nsXPCComponents_Utils::GetComponentsForScope(const jsval &vscope, JSContext *cx, } NS_IMETHODIMP -nsXPCComponents_Utils::Dispatch(const jsval &runnable_, const jsval &scope, +nsXPCComponents_Utils::Dispatch(const jsval &runnableArg, const jsval &scope, JSContext *cx) { // Enter the given compartment, if any, and rewrap runnable. Maybe ac; - RootedValue runnable(cx, runnable_); + RootedValue runnable(cx, runnableArg); if (scope.isObject()) { JSObject *scopeObj = js::UncheckedUnwrap(&scope.toObject()); if (!scopeObj) diff --git a/js/xpconnect/src/XPCRuntimeService.cpp b/js/xpconnect/src/XPCRuntimeService.cpp index cb4dd16de0c0..aef22cadb4ac 100644 --- a/js/xpconnect/src/XPCRuntimeService.cpp +++ b/js/xpconnect/src/XPCRuntimeService.cpp @@ -43,29 +43,29 @@ NS_IMPL_THREADSAFE_RELEASE(BackstagePass) /* bool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval id, in uint32_t flags, out JSObjectPtr objp); */ NS_IMETHODIMP BackstagePass::NewResolve(nsIXPConnectWrappedNative *wrapper, - JSContext * cx, JSObject * obj_, - jsid id_, uint32_t flags, - JSObject * *objp_, bool *_retval) + JSContext * cx, JSObject * objArg, + jsid idArg, uint32_t flags, + JSObject * *objpArg, bool *_retval) { - JS::RootedObject obj(cx, obj_); - JS::RootedId id(cx, id_); + JS::RootedObject obj(cx, objArg); + JS::RootedId id(cx, idArg); JSBool resolved; *_retval = !!JS_ResolveStandardClass(cx, obj, id, &resolved); if (!*_retval) { - *objp_ = nullptr; + *objpArg = nullptr; return NS_OK; } if (resolved) { - *objp_ = obj; + *objpArg = obj; return NS_OK; } - JS::RootedObject objp(cx, *objp_); + JS::RootedObject objp(cx, *objpArg); *_retval = !!ResolveWorkerClasses(cx, obj, id, flags, &objp); - *objp_ = objp; + *objpArg = objp; return NS_OK; } diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index b2a5753b4c71..35125019ffeb 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -715,9 +715,9 @@ XPC_WN_NoHelper_Resolve(JSContext *cx, JSHandleObject obj, JSHandleId id) } static JSObject * -XPC_WN_OuterObject(JSContext *cx, JSHandleObject obj_) +XPC_WN_OuterObject(JSContext *cx, JSHandleObject objArg) { - JSObject *obj = obj_; + JSObject *obj = objArg; XPCWrappedNative *wrapper = static_cast(js::GetObjectPrivate(obj)); diff --git a/js/xpconnect/src/XPCWrappedNativeScope.cpp b/js/xpconnect/src/XPCWrappedNativeScope.cpp index 80354fa02c09..488b8a4eace3 100644 --- a/js/xpconnect/src/XPCWrappedNativeScope.cpp +++ b/js/xpconnect/src/XPCWrappedNativeScope.cpp @@ -268,9 +268,9 @@ XPCWrappedNativeScope::EnsureXBLScope(JSContext *cx) } namespace xpc { -JSObject *GetXBLScope(JSContext *cx, JSObject *contentScope_) +JSObject *GetXBLScope(JSContext *cx, JSObject *contentScopeArg) { - JS::RootedObject contentScope(cx, contentScope_); + JS::RootedObject contentScope(cx, contentScopeArg); JSAutoCompartment ac(cx, contentScope); JSObject *scope = EnsureCompartmentPrivate(contentScope)->scope->EnsureXBLScope(cx); NS_ENSURE_TRUE(scope, nullptr); // See bug 858642. diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 61c2acd2db67..b3e6098e1fbf 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -362,11 +362,11 @@ XrayTraits::expandoObjectMatchesConsumer(JSContext *cx, JSObject * XrayTraits::getExpandoObjectInternal(JSContext *cx, HandleObject target, nsIPrincipal *origin, - JSObject *exclusiveGlobal_) + JSObject *exclusiveGlobalArg) { // The expando object lives in the compartment of the target, so all our // work needs to happen there. - RootedObject exclusiveGlobal(cx, exclusiveGlobal_); + RootedObject exclusiveGlobal(cx, exclusiveGlobalArg); JSAutoCompartment ac(cx, target); if (!JS_WrapObject(cx, exclusiveGlobal.address())) return NULL; @@ -477,10 +477,10 @@ XrayTraits::cloneExpandoChain(JSContext *cx, HandleObject dst, HandleObject src) } namespace XrayUtils { -bool CloneExpandoChain(JSContext *cx, JSObject *dst_, JSObject *src_) +bool CloneExpandoChain(JSContext *cx, JSObject *dstArg, JSObject *srcArg) { - RootedObject dst(cx, dst_); - RootedObject src(cx, src_); + RootedObject dst(cx, dstArg); + RootedObject src(cx, srcArg); return GetXrayTraits(src)->cloneExpandoChain(cx, dst, src); } } From af1f7cbb11cc87579ebe9be44c22476c2452c60d Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 15 Apr 2013 15:29:51 +0100 Subject: [PATCH 164/438] Bug 861269 - GC: Continuing the rooting of XPConnect - Root nsXPConnect.cpp r=bholley --HG-- extra : rebase_source : 4bbe3cc3891cb4b3f820454f0f73acea99b36378 --- js/xpconnect/src/nsXPConnect.cpp | 83 +++++++++++++++++++------------- 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index a740d86a8551..84136594fc6e 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -43,6 +43,7 @@ using namespace mozilla::dom; using namespace xpc; +using namespace JS; NS_IMPL_THREADSAFE_ISUPPORTS7(nsXPConnect, nsIXPConnect, @@ -931,7 +932,7 @@ nsXPConnect::InitClasses(JSContext * aJSContext, JSObject * aGlobalJSObj) { NS_ASSERTION(aJSContext, "bad param"); NS_ASSERTION(aGlobalJSObj, "bad param"); - JS::RootedObject globalJSObj(aJSContext, aGlobalJSObj); + RootedObject globalJSObj(aJSContext, aGlobalJSObj); // Nest frame chain save/restore in request created by XPCCallContext. XPCCallContext ccx(NATIVE_CALLER, aJSContext); @@ -1038,8 +1039,8 @@ CreateGlobalObject(JSContext *cx, JSClass *clasp, nsIPrincipal *principal, NS_ABORT_IF_FALSE(NS_IsMainThread(), "using a principal off the main thread?"); MOZ_ASSERT(principal); - JS::RootedObject global(cx, - JS_NewGlobalObject(cx, clasp, nsJSPrincipals::get(principal), zoneSpec)); + RootedObject global(cx, + JS_NewGlobalObject(cx, clasp, nsJSPrincipals::get(principal), zoneSpec)); if (!global) return nullptr; JSAutoCompartment ac(cx, global); @@ -1101,7 +1102,7 @@ nsXPConnect::InitClassesWithNewWrappedGlobal(JSContext * aJSContext, NS_ENSURE_SUCCESS(rv, rv); // Grab a copy of the global and enter its compartment. - JSObject *global = wrappedGlobal->GetFlatJSObject(); + RootedObject global(ccx, wrappedGlobal->GetFlatJSObject()); MOZ_ASSERT(!js::GetObjectParent(global)); JSAutoCompartment ac(ccx, global); @@ -1137,7 +1138,7 @@ xpc_MorphSlimWrapper(JSContext *cx, nsISupports *tomorph) if (!cache) return NS_OK; - JS::RootedObject obj(cx, cache->GetWrapper()); + RootedObject obj(cx, cache->GetWrapper()); if (!obj || !IS_SLIM_WRAPPER(obj)) return NS_OK; NS_ENSURE_STATE(MorphSlimWrapper(cx, obj)); @@ -1146,7 +1147,7 @@ xpc_MorphSlimWrapper(JSContext *cx, nsISupports *tomorph) static nsresult NativeInterface2JSObject(XPCLazyCallContext & lccx, - JSObject * aScope, + HandleObject aScope, nsISupports *aCOMObj, nsWrapperCache *aCache, const nsIID * aIID, @@ -1175,16 +1176,17 @@ NativeInterface2JSObject(XPCLazyCallContext & lccx, /* nsIXPConnectJSObjectHolder wrapNative (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID); */ NS_IMETHODIMP nsXPConnect::WrapNative(JSContext * aJSContext, - JSObject * aScope, + JSObject * aScopeArg, nsISupports *aCOMObj, const nsIID & aIID, nsIXPConnectJSObjectHolder **aHolder) { NS_ASSERTION(aHolder, "bad param"); NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aScope, "bad param"); + NS_ASSERTION(aScopeArg, "bad param"); NS_ASSERTION(aCOMObj, "bad param"); + RootedObject aScope(aJSContext, aScopeArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1198,7 +1200,7 @@ nsXPConnect::WrapNative(JSContext * aJSContext, /* void wrapNativeToJSVal (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDPtr aIID, out jsval aVal, out nsIXPConnectJSObjectHolder aHolder); */ NS_IMETHODIMP nsXPConnect::WrapNativeToJSVal(JSContext * aJSContext, - JSObject * aScope, + JSObject * aScopeArg, nsISupports *aCOMObj, nsWrapperCache *aCache, const nsIID * aIID, @@ -1207,12 +1209,13 @@ nsXPConnect::WrapNativeToJSVal(JSContext * aJSContext, nsIXPConnectJSObjectHolder **aHolder) { NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aScope, "bad param"); + NS_ASSERTION(aScopeArg, "bad param"); NS_ASSERTION(aCOMObj, "bad param"); if (aHolder) *aHolder = nullptr; + RootedObject aScope(aJSContext, aScopeArg); XPCLazyCallContext lccx(NATIVE_CALLER, aJSContext); return NativeInterface2JSObject(lccx, aScope, aCOMObj, aCache, aIID, @@ -1222,16 +1225,17 @@ nsXPConnect::WrapNativeToJSVal(JSContext * aJSContext, /* void wrapJS (in JSContextPtr aJSContext, in JSObjectPtr aJSObj, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */ NS_IMETHODIMP nsXPConnect::WrapJS(JSContext * aJSContext, - JSObject * aJSObj, + JSObject * aJSObjArg, const nsIID & aIID, void * *result) { NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aJSObj, "bad param"); + NS_ASSERTION(aJSObjArg, "bad param"); NS_ASSERTION(result, "bad param"); *result = nullptr; + RootedObject aJSObj(aJSContext, aJSObjArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1268,17 +1272,18 @@ nsXPConnect::JSValToVariant(JSContext *cx, NS_IMETHODIMP nsXPConnect::WrapJSAggregatedToNative(nsISupports *aOuter, JSContext * aJSContext, - JSObject * aJSObj, + JSObject * aJSObjArg, const nsIID & aIID, void * *result) { NS_ASSERTION(aOuter, "bad param"); NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aJSObj, "bad param"); + NS_ASSERTION(aJSObjArg, "bad param"); NS_ASSERTION(result, "bad param"); *result = nullptr; + RootedObject aJSObj(aJSContext, aJSObjArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1293,13 +1298,14 @@ nsXPConnect::WrapJSAggregatedToNative(nsISupports *aOuter, /* nsIXPConnectWrappedNative getWrappedNativeOfJSObject (in JSContextPtr aJSContext, in JSObjectPtr aJSObj); */ NS_IMETHODIMP nsXPConnect::GetWrappedNativeOfJSObject(JSContext * aJSContext, - JSObject * aJSObj, + JSObject * aJSObjArg, nsIXPConnectWrappedNative **_retval) { NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aJSObj, "bad param"); + NS_ASSERTION(aJSObjArg, "bad param"); NS_ASSERTION(_retval, "bad param"); + RootedObject aJSObj(aJSContext, aJSObjArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1354,18 +1360,19 @@ nsXPConnect::GetNativeOfWrapper(JSContext * aJSContext, /* nsIXPConnectWrappedNative getWrappedNativeOfNativeObject (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsISupports aCOMObj, in nsIIDRef aIID); */ NS_IMETHODIMP nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext, - JSObject * aScope, + JSObject * aScopeArg, nsISupports *aCOMObj, const nsIID & aIID, nsIXPConnectWrappedNative **_retval) { NS_ASSERTION(aJSContext, "bad param"); - NS_ASSERTION(aScope, "bad param"); + NS_ASSERTION(aScopeArg, "bad param"); NS_ASSERTION(aCOMObj, "bad param"); NS_ASSERTION(_retval, "bad param"); *_retval = nullptr; + RootedObject aScope(aJSContext, aScopeArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1395,10 +1402,12 @@ nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext, * in nsISupports aCOMObj); */ NS_IMETHODIMP nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext, - JSObject * aScope, - JSObject * aNewParent, + JSObject * aScopeArg, + JSObject * aNewParentArg, nsISupports *aCOMObj) { + RootedObject aScope(aJSContext, aScopeArg); + RootedObject aNewParent(aJSContext, aNewParentArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1408,7 +1417,7 @@ nsXPConnect::ReparentWrappedNativeIfFound(JSContext * aJSContext, if (!scope || !scope2) return UnexpectedFailure(NS_ERROR_FAILURE); - JS::RootedObject newParent(ccx, aNewParent); + RootedObject newParent(ccx, aNewParent); return XPCWrappedNative:: ReparentWrapperIfFound(ccx, scope, scope2, newParent, aCOMObj); @@ -1431,8 +1440,9 @@ MoveableWrapperFinder(JSDHashTable *table, JSDHashEntryHdr *hdr, /* void rescueOrphansInScope(in JSContextPtr aJSContext, in JSObjectPtr aScope); */ NS_IMETHODIMP -nsXPConnect::RescueOrphansInScope(JSContext *aJSContext, JSObject *aScope) +nsXPConnect::RescueOrphansInScope(JSContext *aJSContext, JSObject *aScopeArg) { + RootedObject aScope(aJSContext, aScopeArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1641,11 +1651,11 @@ nsXPConnect::CreateSandbox(JSContext *cx, nsIPrincipal *principal, *_retval = nullptr; - jsval rval = JSVAL_VOID; - AUTO_MARK_JSVAL(ccx, &rval); + RootedValue rval(cx, JSVAL_VOID); + AUTO_MARK_JSVAL(ccx, rval.address()); SandboxOptions options(cx); - nsresult rv = xpc_CreateSandboxObject(cx, &rval, principal, options); + nsresult rv = xpc_CreateSandboxObject(cx, rval.address(), principal, options); NS_ASSERTION(NS_FAILED(rv) || !JSVAL_IS_PRIMITIVE(rval), "Bad return value from xpc_CreateSandboxObject()!"); @@ -1667,8 +1677,8 @@ nsXPConnect::EvalInSandboxObject(const nsAString& source, const char *filename, if (!sandboxArg) return NS_ERROR_INVALID_ARG; - JS::RootedObject sandbox(cx, sandboxArg); - JS::RootedValue rval(cx); + RootedObject sandbox(cx, sandboxArg); + RootedValue rval(cx); nsresult rv = xpc_EvalInSandbox(cx, sandbox, source, filename ? filename : "x-bogus://XPConnect/Sandbox", 1, JSVERSION_DEFAULT, returnStringOnly, &rval); @@ -1680,10 +1690,11 @@ nsXPConnect::EvalInSandboxObject(const nsAString& source, const char *filename, /* nsIXPConnectJSObjectHolder getWrappedNativePrototype (in JSContextPtr aJSContext, in JSObjectPtr aScope, in nsIClassInfo aClassInfo); */ NS_IMETHODIMP nsXPConnect::GetWrappedNativePrototype(JSContext * aJSContext, - JSObject * aScope, + JSObject * aScopeArg, nsIClassInfo *aClassInfo, nsIXPConnectJSObjectHolder **_retval) { + RootedObject aScope(aJSContext, aScopeArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); if (!ccx.IsValid()) return UnexpectedFailure(NS_ERROR_FAILURE); @@ -1867,13 +1878,15 @@ nsXPConnect::DebugDumpEvalInJSStackFrame(uint32_t aFrameNumber, const char *aSou /* jsval variantToJS (in JSContextPtr ctx, in JSObjectPtr scope, in nsIVariant value); */ NS_IMETHODIMP -nsXPConnect::VariantToJS(JSContext* ctx, JSObject* scope, nsIVariant* value, jsval* _retval) +nsXPConnect::VariantToJS(JSContext* ctx, JSObject* scopeArg, nsIVariant* value, + jsval* _retval) { NS_PRECONDITION(ctx, "bad param"); - NS_PRECONDITION(scope, "bad param"); + NS_PRECONDITION(scopeArg, "bad param"); NS_PRECONDITION(value, "bad param"); NS_PRECONDITION(_retval, "bad param"); + RootedObject scope(ctx, scopeArg); XPCCallContext ccx(NATIVE_CALLER, ctx); if (!ccx.IsValid()) return NS_ERROR_FAILURE; @@ -2201,9 +2214,10 @@ nsXPConnect::GetPrincipal(JSObject* obj, bool allowShortCircuit) const } NS_IMETHODIMP -nsXPConnect::HoldObject(JSContext *aJSContext, JSObject *aObject, +nsXPConnect::HoldObject(JSContext *aJSContext, JSObject *aObjectArg, nsIXPConnectJSObjectHolder **aHolder) { + RootedObject aObject(aJSContext, aObjectArg); XPCCallContext ccx(NATIVE_CALLER, aJSContext); XPCJSObjectHolder* objHolder = XPCJSObjectHolder::newHolder(ccx, aObject); if (!objHolder) @@ -2467,7 +2481,7 @@ const uint8_t HAS_ORIGIN_PRINCIPALS_FLAG = 2; static nsresult WriteScriptOrFunction(nsIObjectOutputStream *stream, JSContext *cx, - JSScript *script, JSObject *functionObj) + JSScript *script, HandleObject functionObj) { // Exactly one of script or functionObj must be given MOZ_ASSERT(!script != !functionObj); @@ -2592,7 +2606,7 @@ ReadScriptOrFunction(nsIObjectInputStream *stream, JSContext *cx, NS_IMETHODIMP nsXPConnect::WriteScript(nsIObjectOutputStream *stream, JSContext *cx, JSScript *script) { - return WriteScriptOrFunction(stream, cx, script, nullptr); + return WriteScriptOrFunction(stream, cx, script, NullPtr()); } NS_IMETHODIMP @@ -2602,8 +2616,9 @@ nsXPConnect::ReadScript(nsIObjectInputStream *stream, JSContext *cx, JSScript ** } NS_IMETHODIMP -nsXPConnect::WriteFunction(nsIObjectOutputStream *stream, JSContext *cx, JSObject *functionObj) +nsXPConnect::WriteFunction(nsIObjectOutputStream *stream, JSContext *cx, JSObject *functionObjArg) { + RootedObject functionObj(cx, functionObjArg); return WriteScriptOrFunction(stream, cx, nullptr, functionObj); } From b2767312e0d21f00d74feb4f0609fe47bf9213ff Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Mon, 15 Apr 2013 15:30:05 +0100 Subject: [PATCH 165/438] Bug 861269 - GC: Continuing the rooting of XPConnect - Root XPCJSID.cpp r=bholley --HG-- extra : rebase_source : 3702d37309dd711a6db9173d0c6ab6142ce78544 --- js/xpconnect/src/XPCConvert.cpp | 3 ++- js/xpconnect/src/XPCJSID.cpp | 47 +++++++++++++++++++-------------- js/xpconnect/src/xpcprivate.h | 2 +- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 6a6e2ed70c2f..a201d126a3ec 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -169,8 +169,9 @@ XPCConvert::NativeData2JS(XPCLazyCallContext& lccx, jsval* d, const void* s, nsID* iid2 = *((nsID**)s); if (!iid2) break; + JS::RootedObject scope(cx, lccx.GetScopeForNewJSObjects()); JSObject* obj; - if (!(obj = xpc_NewIDObject(cx, lccx.GetScopeForNewJSObjects(), *iid2))) + if (!(obj = xpc_NewIDObject(cx, scope, *iid2))) return false; *d = OBJECT_TO_JSVAL(obj); break; diff --git a/js/xpconnect/src/XPCJSID.cpp b/js/xpconnect/src/XPCJSID.cpp index 461d6ba0d8b9..15ff3efb0a59 100644 --- a/js/xpconnect/src/XPCJSID.cpp +++ b/js/xpconnect/src/XPCJSID.cpp @@ -13,6 +13,7 @@ #include "XPCWrapper.h" using namespace mozilla::dom; +using namespace JS; /***************************************************************************/ // nsJSID @@ -388,10 +389,12 @@ nsJSIID::NewID(nsIInterfaceInfo* aInfo) /* bool resolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval id); */ NS_IMETHODIMP nsJSIID::NewResolve(nsIXPConnectWrappedNative *wrapper, - JSContext * cx, JSObject * obj, - jsid id, uint32_t flags, + JSContext * cx, JSObject * objArg, + jsid idArg, uint32_t flags, JSObject * *objp, bool *_retval) { + RootedObject obj(cx, objArg); + RootedId id(cx, idArg); XPCCallContext ccx(JS_CALLER, cx); AutoMarkingNativeInterfacePtr iface(ccx); @@ -422,10 +425,11 @@ nsJSIID::NewResolve(nsIXPConnectWrappedNative *wrapper, /* bool enumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */ NS_IMETHODIMP nsJSIID::Enumerate(nsIXPConnectWrappedNative *wrapper, - JSContext * cx, JSObject * obj, bool *_retval) + JSContext * cx, JSObject * objArg, bool *_retval) { // In this case, let's just eagerly resolve... + RootedObject obj(cx, objArg); XPCCallContext ccx(JS_CALLER, cx); AutoMarkingNativeInterfacePtr iface(ccx); @@ -470,13 +474,14 @@ nsJSIID::Enumerate(nsIXPConnectWrappedNative *wrapper, * from |cx|. */ static JSObject * -FindObjectForHasInstance(JSContext *cx, JSObject *obj) +FindObjectForHasInstance(JSContext *cx, HandleObject objArg) { + RootedObject obj(cx, objArg); while (obj && !IS_WRAPPER_CLASS(js::GetObjectClass(obj)) && !IsDOMObject(obj)) { if (js::IsWrapper(obj)) obj = js::CheckedUnwrap(obj, /* stopAtOuter = */ false); - else if (!js::GetObjectProto(cx, obj, &obj)) + else if (!js::GetObjectProto(cx, obj, obj.address())) return nullptr; } return obj; @@ -494,7 +499,7 @@ nsJSIID::HasInstance(nsIXPConnectWrappedNative *wrapper, if (!JSVAL_IS_PRIMITIVE(val)) { // we have a JSObject - JS::RootedObject obj(cx, JSVAL_TO_OBJECT(val)); + RootedObject obj(cx, JSVAL_TO_OBJECT(val)); NS_ASSERTION(obj, "when is an object not an object?"); @@ -703,23 +708,22 @@ GetIIDArg(uint32_t argc, const JS::Value& val, JSContext* cx) return iid; } -static JSObject* -GetWrapperObject() +static void +GetWrapperObject(MutableHandleObject obj) { + obj.set(NULL); nsXPConnect* xpc = nsXPConnect::GetXPConnect(); if (!xpc) - return NULL; + return; nsAXPCNativeCallContext *ccxp = NULL; xpc->GetCurrentNativeCallContext(&ccxp); if (!ccxp) - return NULL; + return; nsCOMPtr wrapper; ccxp->GetCalleeWrapper(getter_AddRefs(wrapper)); - JSObject* obj; - wrapper->GetJSObject(&obj); - return obj; + wrapper->GetJSObject(obj.address()); } /* nsISupports createInstance (); */ @@ -730,7 +734,8 @@ nsJSCID::CreateInstance(const JS::Value& iidval, JSContext* cx, if (!mDetails.IsValid()) return NS_ERROR_XPC_BAD_CID; - JSObject* obj = GetWrapperObject(); + RootedObject obj(cx); + GetWrapperObject(&obj); if (!obj) { return NS_ERROR_UNEXPECTED; } @@ -776,7 +781,8 @@ nsJSCID::GetService(const JS::Value& iidval, JSContext* cx, if (!mDetails.IsValid()) return NS_ERROR_XPC_BAD_CID; - JSObject* obj = GetWrapperObject(); + RootedObject obj(cx); + GetWrapperObject(&obj); if (!obj) { return NS_ERROR_UNEXPECTED; } @@ -808,10 +814,10 @@ nsJSCID::GetService(const JS::Value& iidval, JSContext* cx, if (NS_FAILED(rv) || !srvc) return NS_ERROR_XPC_GS_RETURNED_FAILURE; - JSObject* instJSObj; + RootedObject instJSObj(cx); nsCOMPtr holder; rv = nsXPConnect::GetXPConnect()->WrapNative(cx, obj, srvc, *iid, getter_AddRefs(holder)); - if (NS_FAILED(rv) || !holder || NS_FAILED(holder->GetJSObject(&instJSObj))) + if (NS_FAILED(rv) || !holder || NS_FAILED(holder->GetJSObject(instJSObj.address()))) return NS_ERROR_XPC_CANT_CREATE_WN; *retval = OBJECT_TO_JSVAL(instJSObj); @@ -821,10 +827,11 @@ nsJSCID::GetService(const JS::Value& iidval, JSContext* cx, /* bool construct (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in uint32_t argc, in JSValPtr argv, in JSValPtr vp); */ NS_IMETHODIMP nsJSCID::Construct(nsIXPConnectWrappedNative *wrapper, - JSContext * cx, JSObject * obj, + JSContext * cx, JSObject * objArg, uint32_t argc, jsval * argv, jsval * vp, bool *_retval) { + RootedObject obj(cx, objArg); XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance(); if (!rt) return NS_ERROR_FAILURE; @@ -849,7 +856,7 @@ nsJSCID::HasInstance(nsIXPConnectWrappedNative *wrapper, if (!JSVAL_IS_PRIMITIVE(val)) { // we have a JSObject - JSObject* obj = JSVAL_TO_OBJECT(val); + RootedObject obj(cx, &val.toObject()); NS_ASSERTION(obj, "when is an object not an object?"); @@ -878,7 +885,7 @@ nsJSCID::HasInstance(nsIXPConnectWrappedNative *wrapper, // additional utilities... JSObject * -xpc_NewIDObject(JSContext *cx, JSObject* jsobj, const nsID& aID) +xpc_NewIDObject(JSContext *cx, HandleObject jsobj, const nsID& aID) { JSObject *obj = nullptr; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 0fc8a91963f9..78f86b4acce2 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -3731,7 +3731,7 @@ private: /***************************************************************************/ extern JSObject* -xpc_NewIDObject(JSContext *cx, JSObject* jsobj, const nsID& aID); +xpc_NewIDObject(JSContext *cx, JS::HandleObject jsobj, const nsID& aID); extern const nsID* xpc_JSObjectToID(JSContext *cx, JSObject* obj); From f7e974613d6223324db335be3abe9bfc61b2483f Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 15 Apr 2013 17:25:16 +0200 Subject: [PATCH 166/438] Bug 861800 - Make UnwinderThread2 a bit less verbose. r=bgirard --- tools/profiler/UnwinderThread2.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/profiler/UnwinderThread2.cpp b/tools/profiler/UnwinderThread2.cpp index c88f318fde78..a48bc64f045e 100644 --- a/tools/profiler/UnwinderThread2.cpp +++ b/tools/profiler/UnwinderThread2.cpp @@ -866,6 +866,10 @@ static void* unwind_thr_fn(void* exit_nowV) */ int* exit_now = (int*)exit_nowV; int ms_to_sleep_if_empty = 1; + + const int longest_sleep_ms = 1000; + bool show_sleep_message = true; + while (1) { if (*exit_now != 0) break; @@ -889,15 +893,21 @@ static void* unwind_thr_fn(void* exit_nowV) MOZ_ASSERT(oldest_seqNo == ~0ULL); spinLock_release(&g_spinLock); if (ms_to_sleep_if_empty > 100 && LOGLEVEL >= 2) { - LOGF("BPUnw: unwinder: sleep for %d ms", ms_to_sleep_if_empty); + if (show_sleep_message) + LOGF("BPUnw: unwinder: sleep for %d ms", ms_to_sleep_if_empty); + /* If we've already shown the message for the longest sleep, + don't show it again, until the next round of sleeping + starts. */ + if (ms_to_sleep_if_empty == longest_sleep_ms) + show_sleep_message = false; } sleep_ms(ms_to_sleep_if_empty); if (ms_to_sleep_if_empty < 20) { ms_to_sleep_if_empty += 2; } else { ms_to_sleep_if_empty = (15 * ms_to_sleep_if_empty) / 10; - if (ms_to_sleep_if_empty > 1000) - ms_to_sleep_if_empty = 1000; + if (ms_to_sleep_if_empty > longest_sleep_ms) + ms_to_sleep_if_empty = longest_sleep_ms; } continue; } @@ -1246,6 +1256,7 @@ static void* unwind_thr_fn(void* exit_nowV) buff->state = S_EMPTY; spinLock_release(&g_spinLock); ms_to_sleep_if_empty = 1; + show_sleep_message = true; } return NULL; } From ff40ac36dbd1d46d01f8b165cda1a42e4af52d1a Mon Sep 17 00:00:00 2001 From: Vladan Djeric Date: Mon, 15 Apr 2013 12:08:04 -0400 Subject: [PATCH 167/438] Bug 860544 - Typo in field name in Telemetry ping. r=froydnj --- toolkit/components/telemetry/TelemetryPing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js index 26baa4d2b87b..ea56e3bcdd3a 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -419,7 +419,7 @@ TelemetryPing.prototype = { "adapterDriverDate", "adapterDescription2", "adapterVendorID2", "adapterDeviceID2", "adapterRAM2", "adapterDriver2", "adapterDriverVersion2", - "adapterDriverDate2", "isGPU2Active", "D2DEnabled;", + "adapterDriverDate2", "isGPU2Active", "D2DEnabled", "DWriteEnabled", "DWriteVersion" ]; From fb4a3fd5b1d3c3ae21d217d15388fbf7e4cf9257 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 15 Apr 2013 12:28:38 -0400 Subject: [PATCH 168/438] Bug 446041 - Force sharing printer settings in Linux because GTK doesn't have support for per printer settings. r=roc --- widget/xpwidgets/nsPrintOptionsImpl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/widget/xpwidgets/nsPrintOptionsImpl.cpp b/widget/xpwidgets/nsPrintOptionsImpl.cpp index af814e4d00c9..fd71ffaf290f 100644 --- a/widget/xpwidgets/nsPrintOptionsImpl.cpp +++ b/widget/xpwidgets/nsPrintOptionsImpl.cpp @@ -1047,6 +1047,9 @@ nsPrintOptions::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS, nsresult rv = ReadPrefs(aPS, prtName, aFlags); NS_ENSURE_SUCCESS(rv, rv); + // Do not use printer name in Linux because GTK backend does not support + // per printer settings. +#ifndef MOZ_X11 // Get the Printer Name from the PrintSettings // to use as a prefix for Pref Names rv = GetAdjustedPrinterName(aPS, aUsePNP, prtName); @@ -1061,6 +1064,7 @@ nsPrintOptions::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS, rv = ReadPrefs(aPS, prtName, aFlags); if (NS_SUCCEEDED(rv)) aPS->SetIsInitializedFromPrefs(true); +#endif return NS_OK; } @@ -1077,9 +1081,13 @@ nsPrintOptions::SavePrintSettingsToPrefs(nsIPrintSettings *aPS, NS_ENSURE_ARG_POINTER(aPS); nsAutoString prtName; + // Do not use printer name in Linux because GTK backend does not support + // per printer settings. +#ifndef MOZ_X11 // Get the printer name from the PrinterSettings for an optional prefix. nsresult rv = GetAdjustedPrinterName(aPS, aUsePrinterNamePrefix, prtName); NS_ENSURE_SUCCESS(rv, rv); +#endif // Write the prefs, with or without a printer name prefix. return WritePrefs(aPS, prtName, aFlags); From 5d442bca1200629f56f684abe7b7c07fc1a436a1 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 15 Apr 2013 18:36:13 +0200 Subject: [PATCH 169/438] Bug 861796 - Fix crash in LibHandle::~LibHandle. r=nfroyd --- mozglue/linker/ElfLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mozglue/linker/ElfLoader.cpp b/mozglue/linker/ElfLoader.cpp index aad2829ea7e1..41600bdc0544 100644 --- a/mozglue/linker/ElfLoader.cpp +++ b/mozglue/linker/ElfLoader.cpp @@ -181,7 +181,7 @@ LeafName(const char *path) LibHandle::~LibHandle() { free(path); - if (mappable->GetKind() != Mappable::MAPPABLE_EXTRACT_FILE) + if (mappable && mappable->GetKind() != Mappable::MAPPABLE_EXTRACT_FILE) delete mappable; } From 9593d34ccec92076466d0c88cf2596218c481215 Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Thu, 11 Apr 2013 15:43:40 -0700 Subject: [PATCH 170/438] bug 859715 protect against migration failures of social providers, r=markh --- toolkit/components/social/SocialService.jsm | 43 ++++++++++++++++--- .../xpcshell/test_SocialServiceMigration22.js | 5 +++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/toolkit/components/social/SocialService.jsm b/toolkit/components/social/SocialService.jsm index 29a1b88f7b35..ab0e249b4935 100644 --- a/toolkit/components/social/SocialService.jsm +++ b/toolkit/components/social/SocialService.jsm @@ -126,20 +126,38 @@ let ActiveProviders = { function migrateSettings() { let activeProviders; try { - // we don't care what the value is, if it is set, we've already migrated activeProviders = Services.prefs.getCharPref("social.activeProviders"); } catch(e) { - // do nothing + // not set, we'll check if we need to migrate older prefs } if (activeProviders) { // migration from fx21 to fx22 or later // ensure any *builtin* provider in activeproviders is in user level prefs for (let origin in ActiveProviders._providers) { - let prefname = getPrefnameFromOrigin(origin); + let prefname; + try { + prefname = getPrefnameFromOrigin(origin); + } catch(e) { + // Our preference is missing or bad, remove from ActiveProviders and + // continue. This is primarily an error-case and should only be + // reached by either messing with preferences or hitting the one or + // two days of nightly that ran into it, so we'll flush right away. + ActiveProviders.delete(origin); + ActiveProviders.flush(); + continue; + } if (!Services.prefs.prefHasUserValue(prefname)) { // if we've got an active *builtin* provider, ensure that the pref // is set at a user-level as that will signify *installed* status. - let manifest = JSON.parse(Services.prefs.getComplexValue(prefname, Ci.nsISupportsString).data); + let manifest; + try { + manifest = JSON.parse(Services.prefs.getComplexValue(prefname, Ci.nsISupportsString).data); + } catch(e) { + // see comment in the delete/flush code above. + ActiveProviders.delete(origin); + ActiveProviders.flush(); + continue; + } // our default manifests have been updated with the builtin flags as of // fx22, delete it so we can set the user-pref delete manifest.builtin; @@ -167,7 +185,13 @@ function migrateSettings() { let prefs = manifestPrefs.getChildList("", []); for (let pref of prefs) { try { - let manifest = JSON.parse(manifestPrefs.getComplexValue(pref, Ci.nsISupportsString).data); + let manifest; + try { + manifest = JSON.parse(manifestPrefs.getComplexValue(pref, Ci.nsISupportsString).data); + } catch(e) { + // bad or missing preference, we wont update this one. + continue; + } if (manifest && typeof(manifest) == "object" && manifest.origin) { // our default manifests have been updated with the builtin flags as of // fx22, delete it so we can set the user-pref @@ -196,7 +220,14 @@ function initService() { Services.obs.removeObserver(xpcomShutdown, "xpcom-shutdown"); }, "xpcom-shutdown", false); - migrateSettings(); + try { + migrateSettings(); + } catch(e) { + // no matter what, if migration fails we do not want to render social + // unusable. Worst case scenario is that, when upgrading Firefox, previously + // enabled providers are not migrated. + Cu.reportError("Error migrating social settings: " + e); + } // Initialize the MozSocialAPI if (SocialServiceInternal.enabled) MozSocialAPI.enabled = true; diff --git a/toolkit/components/social/test/xpcshell/test_SocialServiceMigration22.js b/toolkit/components/social/test/xpcshell/test_SocialServiceMigration22.js index b36489c729ba..af84c3b21e5a 100644 --- a/toolkit/components/social/test/xpcshell/test_SocialServiceMigration22.js +++ b/toolkit/components/social/test/xpcshell/test_SocialServiceMigration22.js @@ -26,6 +26,8 @@ function run_test() { createInstance(Ci.nsISupportsString); let active = {}; active[manifest.origin] = 1; + // bad.origin tests that a missing manifest does not break migration, bug 859715 + active["bad.origin"] = 1; activeVal.data = JSON.stringify(active); Services.prefs.setComplexValue("social.activeProviders", Ci.nsISupportsString, activeVal); @@ -57,4 +59,7 @@ function testMigration(manifest, next) { do_check_true(activeProviders[manifest.origin]); do_check_true(MANIFEST_PREFS.prefHasUserValue(manifest.origin)); do_check_true(JSON.parse(DEFAULT_PREFS.getCharPref(manifest.origin)).builtin); + + // bug 859715, this should have been removed during migration + do_check_false(!!activeProviders["bad.origin"]); } From c03ee3b90503fad4a6a420297da61af66bd5948e Mon Sep 17 00:00:00 2001 From: Stephen Pohl Date: Mon, 15 Apr 2013 13:04:55 -0400 Subject: [PATCH 171/438] Bug 861748 - Disable synchronous scroll to top or bottom of the page when page bounce behavior is turned off. r=smichaud --- .../base/content/browser-gestureSupport.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/browser/base/content/browser-gestureSupport.js b/browser/base/content/browser-gestureSupport.js index d7cd75d9a4f2..31e75f849eb4 100644 --- a/browser/base/content/browser-gestureSupport.js +++ b/browser/base/content/browser-gestureSupport.js @@ -192,15 +192,17 @@ let gGestureSupport = { aEvent.DIRECTION_LEFT; let isVerticalSwipe = false; - if (aEvent.direction == aEvent.DIRECTION_UP) { - isVerticalSwipe = true; - // Force a synchronous scroll to the top of the page. - content.scrollTo(content.scrollX, 0); - } - else if (aEvent.direction == aEvent.DIRECTION_DOWN) { - isVerticalSwipe = true; - // Force a synchronous scroll to the bottom of the page. - content.scrollTo(content.scrollX, content.scrollMaxY); + if (gHistorySwipeAnimation.active) { + if (aEvent.direction == aEvent.DIRECTION_UP) { + isVerticalSwipe = true; + // Force a synchronous scroll to the top of the page. + content.scrollTo(content.scrollX, 0); + } + else if (aEvent.direction == aEvent.DIRECTION_DOWN) { + isVerticalSwipe = true; + // Force a synchronous scroll to the bottom of the page. + content.scrollTo(content.scrollX, content.scrollMaxY); + } } gHistorySwipeAnimation.startAnimation(isVerticalSwipe); From eb73453fff2e29358c2acfe6d95b0268b3469265 Mon Sep 17 00:00:00 2001 From: Allison Naaktgeboren Date: Mon, 15 Apr 2013 10:42:20 -0700 Subject: [PATCH 172/438] Bug 85955 -Don't thumbnail capture when in snapped view.r=rsilveira --- browser/metro/base/content/browser-ui.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/browser/metro/base/content/browser-ui.js b/browser/metro/base/content/browser-ui.js index 7a375e0d36a2..7614892947e8 100644 --- a/browser/metro/base/content/browser-ui.js +++ b/browser/metro/base/content/browser-ui.js @@ -884,6 +884,13 @@ var BrowserUI = { return false; } + // Don't capture pages in snapped mode, this produces 2/3 black + // thumbs or stretched out ones + // Ci.nsIWinMetroUtils.snapped is inaccessible on + // desktop/nonwindows systems + if(Elements.windowState.getAttribute("viewstate") == "snapped") { + return false; + } // There's no point in taking screenshot of loading pages. if (aBrowser.docShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE) { return false; From 1cda4edae8a6670215adaa9fab45fbdb462e66aa Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 15 Apr 2013 18:53:03 +0100 Subject: [PATCH 173/438] bug 857192 - use float instead of integer CSS pixels to track available space for image. r=bz --- content/html/document/src/ImageDocument.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/html/document/src/ImageDocument.cpp b/content/html/document/src/ImageDocument.cpp index 21ad4ed64f63..b95cf153f6ce 100644 --- a/content/html/document/src/ImageDocument.cpp +++ b/content/html/document/src/ImageDocument.cpp @@ -113,8 +113,8 @@ protected: nsresult ScrollImageTo(int32_t aX, int32_t aY, bool restoreImage); float GetRatio() { - return std::min((float)mVisibleWidth / mImageWidth, - (float)mVisibleHeight / mImageHeight); + return std::min(mVisibleWidth / mImageWidth, + mVisibleHeight / mImageHeight); } void ResetZoomLevel(); @@ -132,8 +132,8 @@ protected: nsCOMPtr mImageContent; - int32_t mVisibleWidth; - int32_t mVisibleHeight; + float mVisibleWidth; + float mVisibleHeight; int32_t mImageWidth; int32_t mImageHeight; @@ -728,8 +728,8 @@ ImageDocument::CheckOverflowing(bool changeState) nsPresContext *context = shell->GetPresContext(); nsRect visibleArea = context->GetVisibleArea(); - mVisibleWidth = nsPresContext::AppUnitsToIntCSSPixels(visibleArea.width); - mVisibleHeight = nsPresContext::AppUnitsToIntCSSPixels(visibleArea.height); + mVisibleWidth = nsPresContext::AppUnitsToFloatCSSPixels(visibleArea.width); + mVisibleHeight = nsPresContext::AppUnitsToFloatCSSPixels(visibleArea.height); } bool imageWasOverflowing = mImageIsOverflowing; From a811ad45635d7949dbfe1be4cb75cb6fd1919d67 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Mon, 15 Apr 2013 19:59:55 +0200 Subject: [PATCH 174/438] Bug 768288: IonMonkey: Enable inlining of functions with loops, r=djvj --- js/src/ion/IonBuilder.cpp | 89 +++++++++++++++++++++++++++------------ js/src/ion/TypeOracle.cpp | 6 --- js/src/jsanalyze.cpp | 2 +- js/src/jsscript.cpp | 1 + js/src/jsscript.h | 28 ++++++++++-- 5 files changed, 90 insertions(+), 36 deletions(-) diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index e41193c06496..3fd3b2cea121 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -203,7 +203,8 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript inlineScript(cx, target->nonLazyScript()); ExecutionMode executionMode = info().executionMode(); if (!CanIonCompile(inlineScript, executionMode)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to disable Ion compilation"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to disable Ion compilation", + inlineScript->filename(), inlineScript->lineno); return false; } @@ -212,7 +213,8 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) ion::IsBaselineEnabled(cx) && !inlineScript->hasBaselineScript()) { - IonSpew(IonSpew_Inlining, "Cannot inline target with no baseline jitcode"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline target with no baseline jitcode", + inlineScript->filename(), inlineScript->lineno); return false; } @@ -220,7 +222,8 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) IonBuilder *builder = callerBuilder_; while (builder) { if (builder->script() == inlineScript) { - IonSpew(IonSpew_Inlining, "Not inlining recursive call"); + IonSpew(IonSpew_Inlining, "%s:%d Not inlining recursive call", + inlineScript->filename(), inlineScript->lineno); return false; } builder = builder->callerBuilder_; @@ -229,12 +232,15 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript callerScript(cx, script()); if (!oracle->canEnterInlinedFunction(target)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to oracle veto %d", script()->lineno); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to oracle veto %d", + inlineScript->filename(), inlineScript->lineno, + script()->lineno); return false; } if (!oracle->callReturnTypeSetMatches(callerScript, pc, target)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to return typeset mismatch"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to return typeset mismatch", + inlineScript->filename(), inlineScript->lineno); return false; } @@ -243,7 +249,8 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // For constructing calls the typeset of caller should intersect the callee's typeset. // Except for the |this| type, because that is created during execution depending on target. if (!oracle->callArgsTypeSetIntersects(NULL, callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", + inlineScript->filename(), inlineScript->lineno); return false; } } else if (JSOp(*pc) == JSOP_FUNAPPLY) { @@ -252,18 +259,25 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // of fun.apply. Seeing a new type will only be noticed in the inlined call and // result in missed types in TI. if (!oracle->callArgsTypeSetMatches(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", + inlineScript->filename(), inlineScript->lineno); return false; } } else { // For normal calls the typeset of caller should intersect the callee's typeset. if (!oracle->callArgsTypeSetIntersects(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", + inlineScript->filename(), inlineScript->lineno); return false; } } - IonSpew(IonSpew_Inlining, "Inlining good to go!"); + if (inlineScript->hasIonScript() && inlineScript->ionScript()->bailoutExpected()) { + IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to known bailing script", + inlineScript->filename(), inlineScript->lineno); + return false; + } + return true; } @@ -3226,24 +3240,17 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) // Heuristics! - // Cap the inlining depth. - if (IsSmallFunction(targetScript)) { - if (inliningDepth_ >= js_IonOptions.smallFunctionMaxInlineDepth) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", - targetScript->filename(), targetScript->lineno); - return false; - } - } else { - if (inliningDepth_ >= js_IonOptions.maxInlineDepth) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", - targetScript->filename(), targetScript->lineno); - return false; - } - } + IonBuilder *baseBuilder = this; + while (baseBuilder->callerBuilder_) + baseBuilder = baseBuilder->callerBuilder_; - // Always inline the empty script up to the inlining depth. - if (targetScript->length == 1) - return true; + // When caller is excessively large only inline small functions. + if (script()->length > js_IonOptions.inlineMaxTotalBytecodeLength && + !IsSmallFunction(targetScript)) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: caller excessively large.", + targetScript->filename(), targetScript->lineno); + return false; + } // Callee must not be excessively large. // This heuristic also applies to the callsite as a whole. @@ -3268,6 +3275,36 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) return false; } + // Cap the inlining depth. + uint32_t scriptMaxInlineDepth = targetScript->maxInlineDepth(); + uint32_t globalMaxInlineDepth = js_IonOptions.maxInlineDepth; + if (IsSmallFunction(targetScript)) + globalMaxInlineDepth = js_IonOptions.smallFunctionMaxInlineDepth; + + // Cap the global inline depth. + if (inliningDepth_ >= globalMaxInlineDepth) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding global inline depth", + targetScript->filename(), targetScript->lineno); + baseBuilder->script()->disableInlineDepthCheck(); + return false; + } + + // Cap on scripts inline depth. + if (inliningDepth_ >= scriptMaxInlineDepth) + { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding script inline depth.", + targetScript->filename(), targetScript->lineno); + return false; + } + + // Update scripts max inline depth + // I.e. make sure that all known scripts that get inlined by this script still get inlined. + if (!baseBuilder->script()->isInlineDepthCheckDisabled()) { + uint32_t updatedInlineDepth = globalMaxInlineDepth - inliningDepth_ - 1; + if (updatedInlineDepth < baseBuilder->script()->maxInlineDepth()) + baseBuilder->script()->setMaxInlineDepth(updatedInlineDepth); + } + return true; } diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index 6e67e7956079..35aa88e63e26 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -703,12 +703,6 @@ TypeInferenceOracle::canEnterInlinedFunction(RawFunction target) { RootedScript targetScript(cx, target->nonLazyScript()); - // Make sure empty script has type information, to allow inlining in more cases. - if (targetScript->length == 1) { - if (!targetScript->ensureRanInference(cx)) - return false; - } - if (!targetScript->hasAnalysis() || !targetScript->analysis()->ranInference() || !targetScript->analysis()->ranSSA()) diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index 0e5312f58ce2..64eec6de4443 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -77,7 +77,7 @@ ScriptAnalysis::addJump(JSContext *cx, unsigned offset, if (offset < *currentOffset) { /* Scripts containing loops are never inlined. */ - isJaegerInlineable = isIonInlineable = false; + isJaegerInlineable = false; hasLoops_ = true; if (code->analyzed) { diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index ed61d59d663b..c978f3d2c967 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1688,6 +1688,7 @@ JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun script->sourceStart = bufStart; script->sourceEnd = bufEnd; script->userBit = options.userBit; + script->maxInlineDepth_ = uint8_t(-1); return script; } diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 595287a6b12b..34cd5055602b 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -427,9 +427,6 @@ class JSScript : public js::gc::Cell // 16-bit fields. - private: - uint16_t PADDING16; - uint16_t version; /* JS version under which script was compiled */ public: @@ -445,6 +442,11 @@ class JSScript : public js::gc::Cell uint16_t staticLevel;/* static level for display maintenance */ // 8-bit fields. + private: + uint8_t maxInlineDepth_; /* script max inline depth (IonMonkey) + uint8_t(-1): unitialized + uint8_t(-2): disabled */ + uint8_t PADDING8; public: // The kinds of the optional arrays. @@ -808,6 +810,26 @@ class JSScript : public js::gc::Cell return maxLoopCount; } + void setMaxInlineDepth(uint32_t maxInlineDepth) { + if (maxInlineDepth >= uint8_t(-2)) { + disableInlineDepthCheck(); + return; + } + maxInlineDepth_ = maxInlineDepth; + } + + uint8_t maxInlineDepth() const { + return maxInlineDepth_; + } + + void disableInlineDepthCheck() { + maxInlineDepth_ = uint8_t(-2); + } + + bool isInlineDepthCheckDisabled() { + return maxInlineDepth_ == uint8_t(-2); + } + /* * Size of the JITScript and all sections. If |mallocSizeOf| is NULL, the * size is computed analytically. (This method is implemented in From 37b411dd6a8fad0d6e491c7a6f9ffc14ddea5eb1 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 12 Apr 2013 16:39:24 -0400 Subject: [PATCH 175/438] Bug 861372 - delete checks for FPU_IS_ARM_FPA; r=mjrosenb --- js/src/assembler/assembler/AssemblerBufferWithConstantPool.h | 2 +- js/src/ion/arm/MacroAssembler-arm.cpp | 2 +- js/src/vm/NumericConversions.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h index 72bf57f95041..467f9c9e8cbe 100644 --- a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h +++ b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h @@ -240,7 +240,7 @@ public: union DoublePun { struct { -#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA) +#if defined(IS_LITTLE_ENDIAN) uint32_t lo, hi; #else uint32_t hi, lo; diff --git a/js/src/ion/arm/MacroAssembler-arm.cpp b/js/src/ion/arm/MacroAssembler-arm.cpp index 651bbf4035e2..561a0b358802 100644 --- a/js/src/ion/arm/MacroAssembler-arm.cpp +++ b/js/src/ion/arm/MacroAssembler-arm.cpp @@ -1282,7 +1282,7 @@ MacroAssemblerARM::ma_vimm(double value, FloatRegister dest, Condition cc) { union DoublePun { struct { -#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA) +#if defined(IS_LITTLE_ENDIAN) uint32_t lo, hi; #else uint32_t hi, lo; diff --git a/js/src/vm/NumericConversions.h b/js/src/vm/NumericConversions.h index fd4c79417f89..42e69d63dd75 100644 --- a/js/src/vm/NumericConversions.h +++ b/js/src/vm/NumericConversions.h @@ -23,7 +23,7 @@ namespace detail { union DoublePun { struct { -#if defined(IS_LITTLE_ENDIAN) && !defined(FPU_IS_ARM_FPA) +#if defined(IS_LITTLE_ENDIAN) uint32_t lo, hi; #else uint32_t hi, lo; From 82ad423a28fbda2cdff64842e8da7b29351100a3 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 15 Apr 2013 11:52:07 -0400 Subject: [PATCH 176/438] Bug 861909 - only add ARM support for clang and llvm on linux; r=glandium DONTBUILD because NPOTB --- build/unix/build-clang/build-clang.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/unix/build-clang/build-clang.py b/build/unix/build-clang/build-clang.py index d89b70af8b2e..ba1323269afa 100755 --- a/build/unix/build-clang/build-clang.py +++ b/build/unix/build-clang/build-clang.py @@ -98,8 +98,16 @@ def build_one_stage_aux(stage_dir, is_stage_one): build_dir = stage_dir + "/build" inst_dir = stage_dir + "/clang" + targets = ["x86", "x86_64"] + # The Darwin equivalents of binutils appear to have intermittent problems + # with objects in compiler-rt that are compiled for arm. Since the arm + # support is only necessary for iOS (which we don't support), only enable + # arm support on Linux. + if not isDarwin: + targets.append("arm") + configure_opts = ["--enable-optimized", - "--enable-targets=x86,x86_64,arm", + "--enable-targets=" + ",".join(targets), "--disable-assertions", "--prefix=%s" % inst_dir, "--with-gcc-toolchain=/tools/gcc-4.7.2-0moz1"] From 37468489459833f740899cad02bd83d229b28b13 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 15 Apr 2013 14:21:20 -0400 Subject: [PATCH 177/438] bug 733712 - don't call atk_object_set_name() r=tbsaunde --- accessible/src/atk/AccessibleWrap.cpp | 44 +++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/accessible/src/atk/AccessibleWrap.cpp b/accessible/src/atk/AccessibleWrap.cpp index 916c739d0f9e..2d28a2d022da 100644 --- a/accessible/src/atk/AccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -141,6 +141,8 @@ struct MaiAtkObjectClass static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, }; +static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName); + G_BEGIN_DECLS /* callbacks for MaiAtkObject */ static void classInitCB(AtkObjectClass *aClass); @@ -600,16 +602,41 @@ getNameCB(AtkObject* aAtkObj) if (!accWrap) return nullptr; - nsAutoString uniName; - accWrap->Name(uniName); + nsAutoString name; + accWrap->Name(name); - NS_ConvertUTF8toUTF16 objName(aAtkObj->name); - if (!uniName.Equals(objName)) - atk_object_set_name(aAtkObj, NS_ConvertUTF16toUTF8(uniName).get()); + // XXX Firing an event from here does not seem right + MaybeFireNameChange(aAtkObj, name); return aAtkObj->name; } +static void +MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName) +{ + NS_ConvertUTF16toUTF8 newNameUTF8(aNewName); + if (newNameUTF8.Equals(aAtkObj->name)) + return; + + // Below we duplicate the functionality of atk_object_set_name(), + // but without calling atk_object_get_name(). Instead of + // atk_object_get_name() we directly access aAtkObj->name. This is because + // atk_object_get_name() would call getNameCB() which would call + // MaybeFireNameChange() (or atk_object_set_name() before this problem was + // fixed) and we would get an infinite recursion. + // See http://bugzilla.mozilla.org/733712 + + // Do not notify for initial name setting. + // See bug http://bugzilla.gnome.org/665870 + bool notify = !!aAtkObj->name; + + free(aAtkObj->name); + aAtkObj->name = strdup(newNameUTF8.get()); + + if (notify) + g_object_notify(G_OBJECT(aAtkObj), "accessible-name"); +} + const gchar * getDescriptionCB(AtkObject *aAtkObj) { @@ -617,7 +644,7 @@ getDescriptionCB(AtkObject *aAtkObj) if (!accWrap || accWrap->IsDefunct()) return nullptr; - /* nsIAccessible is responsible for the non-nullptr description */ + /* nsIAccessible is responsible for the nonnull description */ nsAutoString uniDesc; accWrap->Description(uniDesc); @@ -975,9 +1002,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent) { nsAutoString newName; accessible->Name(newName); - NS_ConvertUTF16toUTF8 utf8Name(newName); - if (!atkObj->name || !utf8Name.Equals(atkObj->name)) - atk_object_set_name(atkObj, utf8Name.get()); + + MaybeFireNameChange(atkObj, newName); break; } From d3d051361876c1d41d1d5c4c9dafaffc3d1cd868 Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Mon, 15 Apr 2013 11:33:03 -0700 Subject: [PATCH 178/438] Bug 860029 - Standardize Modelines in the JS Module. r=njn --- js/ipc/CPOWTypes.h | 3 +- js/ipc/ContextWrapperChild.h | 3 +- js/ipc/ContextWrapperParent.h | 3 +- js/ipc/ObjectWrapperChild.cpp | 3 +- js/ipc/ObjectWrapperChild.h | 3 +- js/ipc/ObjectWrapperParent.cpp | 5 +-- js/ipc/ObjectWrapperParent.h | 3 +- js/jsd/jsd.h | 5 ++- js/jsd/jsd_atom.cpp | 5 ++- js/jsd/jsd_high.cpp | 5 ++- js/jsd/jsd_hook.cpp | 5 ++- js/jsd/jsd_java.cpp | 5 ++- js/jsd/jsd_lock.cpp | 5 ++- js/jsd/jsd_lock.h | 5 ++- js/jsd/jsd_obj.cpp | 5 ++- js/jsd/jsd_scpt.cpp | 5 ++- js/jsd/jsd_stak.cpp | 5 ++- js/jsd/jsd_step.cpp | 5 ++- js/jsd/jsd_text.cpp | 5 ++- js/jsd/jsd_val.cpp | 5 ++- js/jsd/jsd_xpc.cpp | 4 +- js/jsd/jsd_xpc.h | 4 +- js/jsd/jsdebug.cpp | 5 ++- js/jsd/jsdebug.h | 5 ++- js/jsd/jsdstubs.cpp | 5 ++- js/jsd/jshash.cpp | 2 +- js/jsd/jshash.h | 4 +- js/jsd/resource.h | 5 ++- js/public/Anchor.h | 5 +-- js/public/CallArgs.h | 5 +-- js/public/CharacterEncoding.h | 3 +- js/public/GCAPI.h | 8 ++-- js/public/HashTable.h | 5 +-- js/public/HeapAPI.h | 8 ++-- js/public/LegacyIntTypes.h | 5 ++- js/public/MemoryMetrics.h | 5 +-- js/public/PropertyKey.h | 5 +-- js/public/RequiredDefines.h | 3 +- js/public/RootingAPI.h | 3 +- js/public/TemplateLib.h | 5 +-- js/public/Utility.h | 5 +-- js/public/Value.h | 5 +-- js/public/Vector.h | 5 +-- js/src/TraceLogging.cpp | 10 ++--- js/src/TraceLogging.h | 10 ++--- js/src/assembler/assembler/ARMAssembler.cpp | 2 +- js/src/assembler/assembler/ARMAssembler.h | 2 +- js/src/assembler/assembler/ARMv7Assembler.h | 2 +- .../assembler/AbstractMacroAssembler.h | 2 +- js/src/assembler/assembler/AssemblerBuffer.h | 2 +- .../AssemblerBufferWithConstantPool.h | 2 +- js/src/assembler/assembler/CodeLocation.h | 2 +- js/src/assembler/assembler/LinkBuffer.h | 2 +- js/src/assembler/assembler/MacroAssembler.h | 2 +- .../assembler/assembler/MacroAssemblerARM.cpp | 2 +- .../assembler/assembler/MacroAssemblerARM.h | 2 +- .../assembler/assembler/MacroAssemblerARMv7.h | 2 +- .../assembler/MacroAssemblerCodeRef.h | 2 +- .../assembler/assembler/MacroAssemblerSparc.h | 4 +- .../assembler/assembler/MacroAssemblerX86.h | 2 +- .../assembler/MacroAssemblerX86Common.cpp | 4 +- .../assembler/MacroAssemblerX86Common.h | 2 +- .../assembler/MacroAssemblerX86_64.h | 2 +- js/src/assembler/assembler/RepatchBuffer.h | 2 +- js/src/assembler/assembler/SparcAssembler.h | 4 +- js/src/assembler/assembler/X86Assembler.h | 2 +- js/src/assembler/jit/ExecutableAllocator.cpp | 4 +- js/src/assembler/moco/MocoStubs.h | 5 +-- js/src/builtin/Eval.cpp | 3 +- js/src/builtin/Eval.h | 5 +-- js/src/builtin/Intl.cpp | 2 +- js/src/builtin/Intl.h | 2 +- js/src/builtin/Iterator-inl.h | 9 ++-- js/src/builtin/MapObject.cpp | 5 +-- js/src/builtin/MapObject.h | 5 +-- js/src/builtin/Module.cpp | 6 +++ js/src/builtin/Module.h | 6 +++ js/src/builtin/Object.cpp | 5 +-- js/src/builtin/Object.h | 5 +-- js/src/builtin/ParallelArray.cpp | 5 +-- js/src/builtin/ParallelArray.h | 5 +-- js/src/builtin/Profilers.cpp | 9 ++-- js/src/builtin/Profilers.h | 3 +- js/src/builtin/RegExp.cpp | 5 +-- js/src/builtin/RegExp.h | 5 +-- js/src/builtin/TestingFunctions.cpp | 9 ++-- js/src/builtin/TestingFunctions.h | 9 ++-- js/src/ctypes/CTypes.cpp | 5 ++- js/src/ctypes/Library.cpp | 5 ++- js/src/devtools/jint/treesearch.py | 3 +- js/src/devtools/sharkctl.cpp | 3 +- js/src/devtools/sharkctl.h | 3 +- js/src/ds/BitArray.h | 5 +-- js/src/ds/InlineMap.h | 5 +-- js/src/ds/LifoAlloc.cpp | 5 +-- js/src/ds/LifoAlloc.h | 5 +-- js/src/ds/PriorityQueue.h | 5 +-- js/src/ds/Sort.h | 5 +-- js/src/ds/SplayTree.h | 5 +-- js/src/editline/editline.c | 1 - js/src/editline/editline.h | 1 - js/src/editline/sysunix.c | 1 - js/src/editline/unix.h | 1 - js/src/frontend/BytecodeCompiler.cpp | 3 +- js/src/frontend/BytecodeCompiler.h | 3 +- js/src/frontend/BytecodeEmitter.cpp | 3 +- js/src/frontend/BytecodeEmitter.h | 3 +- js/src/frontend/FoldConstants.cpp | 3 +- js/src/frontend/FoldConstants.h | 3 +- js/src/frontend/FullParseHandler.h | 3 +- js/src/frontend/NameFunctions.cpp | 3 +- js/src/frontend/NameFunctions.h | 3 +- js/src/frontend/ParseMaps-inl.h | 5 +-- js/src/frontend/ParseMaps.cpp | 5 +-- js/src/frontend/ParseMaps.h | 5 +-- js/src/frontend/ParseNode-inl.h | 2 +- js/src/frontend/ParseNode.cpp | 3 +- js/src/frontend/ParseNode.h | 3 +- js/src/frontend/Parser-inl.h | 3 +- js/src/frontend/Parser.cpp | 3 +- js/src/frontend/Parser.h | 3 +- js/src/frontend/SharedContext-inl.h | 3 +- js/src/frontend/SharedContext.h | 3 +- js/src/frontend/SyntaxParseHandler.h | 3 +- js/src/frontend/TokenStream.cpp | 3 +- js/src/frontend/TokenStream.h | 4 +- js/src/gc/Barrier-inl.h | 3 +- js/src/gc/Barrier.h | 3 +- js/src/gc/FindSCCs-inl.h | 8 ++-- js/src/gc/FindSCCs.h | 8 ++-- js/src/gc/GCInternals.h | 3 +- js/src/gc/Heap.h | 8 ++-- js/src/gc/Iteration.cpp | 3 +- js/src/gc/Marking.cpp | 9 ++-- js/src/gc/Marking.h | 11 +++-- js/src/gc/Memory.cpp | 7 ++- js/src/gc/Memory.h | 7 ++- js/src/gc/RootMarking.cpp | 3 +- js/src/gc/Statistics.cpp | 3 +- js/src/gc/Statistics.h | 3 +- js/src/gc/StoreBuffer.cpp | 9 ++-- js/src/gc/StoreBuffer.h | 7 ++- js/src/gc/Verifier.cpp | 3 +- js/src/gc/Zone.cpp | 3 +- js/src/gc/Zone.h | 5 +-- js/src/gdb/gdb-tests.h | 2 +- js/src/ion/AliasAnalysis.cpp | 5 +-- js/src/ion/AliasAnalysis.h | 5 +-- js/src/ion/AsmJS.cpp | 5 +-- js/src/ion/AsmJS.h | 5 +-- js/src/ion/AsmJSLink.cpp | 5 +-- js/src/ion/AsmJSModule.h | 5 +-- js/src/ion/AsmJSSignalHandlers.cpp | 5 +-- js/src/ion/BacktrackingAllocator.cpp | 5 +-- js/src/ion/BacktrackingAllocator.h | 5 +-- js/src/ion/Bailouts.cpp | 5 +-- js/src/ion/Bailouts.h | 5 +-- js/src/ion/BaselineBailouts.cpp | 5 +-- js/src/ion/BaselineCompiler.cpp | 5 +-- js/src/ion/BaselineCompiler.h | 5 +-- js/src/ion/BaselineFrame-inl.h | 5 +-- js/src/ion/BaselineFrame.cpp | 5 +-- js/src/ion/BaselineFrame.h | 5 +-- js/src/ion/BaselineFrameInfo.cpp | 5 +-- js/src/ion/BaselineFrameInfo.h | 5 +-- js/src/ion/BaselineHelpers.h | 5 +-- js/src/ion/BaselineIC.cpp | 5 +-- js/src/ion/BaselineIC.h | 5 +-- js/src/ion/BaselineInspector.cpp | 5 +-- js/src/ion/BaselineInspector.h | 5 +-- js/src/ion/BaselineJIT.cpp | 5 +-- js/src/ion/BaselineJIT.h | 5 +-- js/src/ion/BaselineRegisters.h | 5 +-- js/src/ion/BitSet.cpp | 5 +-- js/src/ion/BitSet.h | 5 +-- js/src/ion/C1Spewer.cpp | 5 +-- js/src/ion/C1Spewer.h | 5 +-- js/src/ion/CodeGenerator.cpp | 5 +-- js/src/ion/CodeGenerator.h | 5 +-- js/src/ion/CompactBuffer.h | 5 +-- js/src/ion/CompileInfo-inl.h | 5 +-- js/src/ion/CompileInfo.h | 5 +-- js/src/ion/CompilerRoot.h | 5 +-- js/src/ion/EdgeCaseAnalysis.cpp | 5 +-- js/src/ion/EdgeCaseAnalysis.h | 5 +-- js/src/ion/EffectiveAddressAnalysis.cpp | 5 +-- js/src/ion/EffectiveAddressAnalysis.h | 5 +-- js/src/ion/ExecutionModeInlines.h | 5 +-- js/src/ion/FixedArityList.h | 5 +-- js/src/ion/FixedList.h | 5 +-- js/src/ion/InlineList.h | 5 +-- js/src/ion/Ion.cpp | 5 +-- js/src/ion/Ion.h | 5 +-- js/src/ion/IonAllocPolicy.h | 5 +-- js/src/ion/IonAnalysis.cpp | 5 +-- js/src/ion/IonAnalysis.h | 5 +-- js/src/ion/IonBuilder.cpp | 5 +-- js/src/ion/IonBuilder.h | 5 +-- js/src/ion/IonCaches.cpp | 5 +-- js/src/ion/IonCaches.h | 5 +-- js/src/ion/IonCode.h | 5 +-- js/src/ion/IonCompartment.h | 5 +-- js/src/ion/IonFrameIterator-inl.h | 5 +-- js/src/ion/IonFrameIterator.h | 5 +-- js/src/ion/IonFrames-inl.h | 5 +-- js/src/ion/IonFrames.cpp | 5 +-- js/src/ion/IonFrames.h | 5 +-- js/src/ion/IonInstrumentation.h | 5 +-- js/src/ion/IonLinker.h | 5 +-- js/src/ion/IonMacroAssembler.cpp | 5 +-- js/src/ion/IonMacroAssembler.h | 5 +-- js/src/ion/IonSpewer.cpp | 5 +-- js/src/ion/IonSpewer.h | 5 +-- js/src/ion/IonTypes.h | 5 +-- js/src/ion/JSONSpewer.cpp | 5 +-- js/src/ion/JSONSpewer.h | 5 +-- js/src/ion/LICM.cpp | 5 +-- js/src/ion/LICM.h | 5 +-- js/src/ion/LIR-Common.h | 5 +-- js/src/ion/LIR-inl.h | 5 +-- js/src/ion/LIR.cpp | 5 +-- js/src/ion/LIR.h | 5 +-- js/src/ion/LOpcodes.h | 5 +-- js/src/ion/LinearScan.cpp | 5 +-- js/src/ion/LinearScan.h | 5 +-- js/src/ion/LiveRangeAllocator.cpp | 5 +-- js/src/ion/LiveRangeAllocator.h | 5 +-- js/src/ion/Lowering.cpp | 5 +-- js/src/ion/Lowering.h | 5 +-- js/src/ion/MCallOptimize.cpp | 5 +-- js/src/ion/MIR.cpp | 5 +-- js/src/ion/MIR.h | 5 +-- js/src/ion/MIRGenerator.h | 5 +-- js/src/ion/MIRGraph.cpp | 5 +-- js/src/ion/MIRGraph.h | 5 +-- js/src/ion/MOpcodes.h | 5 +-- js/src/ion/MoveEmitter.h | 5 +-- js/src/ion/MoveResolver.cpp | 5 +-- js/src/ion/MoveResolver.h | 5 +-- js/src/ion/ParallelArrayAnalysis.cpp | 5 +-- js/src/ion/ParallelArrayAnalysis.h | 5 +-- js/src/ion/ParallelFunctions.cpp | 5 +-- js/src/ion/ParallelFunctions.h | 5 +-- js/src/ion/PcScriptCache-inl.h | 5 +-- js/src/ion/PcScriptCache.h | 5 +-- js/src/ion/RangeAnalysis.cpp | 5 +-- js/src/ion/RangeAnalysis.h | 5 +-- js/src/ion/RegisterAllocator.cpp | 5 +-- js/src/ion/RegisterAllocator.h | 5 +-- js/src/ion/RegisterSets.h | 5 +-- js/src/ion/Registers.h | 5 +-- js/src/ion/Safepoints.cpp | 5 +-- js/src/ion/Safepoints.h | 5 +-- js/src/ion/SnapshotReader.h | 5 +-- js/src/ion/SnapshotWriter.h | 5 +-- js/src/ion/Snapshots.cpp | 5 +-- js/src/ion/StackSlotAllocator.h | 5 +-- js/src/ion/StupidAllocator.cpp | 5 +-- js/src/ion/StupidAllocator.h | 5 +-- js/src/ion/TypeOracle.cpp | 5 +-- js/src/ion/TypeOracle.h | 5 +-- js/src/ion/TypePolicy.cpp | 5 +-- js/src/ion/TypePolicy.h | 5 +-- js/src/ion/UnreachableCodeElimination.cpp | 5 +-- js/src/ion/UnreachableCodeElimination.h | 5 +-- js/src/ion/VMFunctions.cpp | 5 +-- js/src/ion/VMFunctions.h | 5 +-- js/src/ion/ValueNumbering.cpp | 5 +-- js/src/ion/ValueNumbering.h | 5 +-- js/src/ion/arm/Architecture-arm.cpp | 6 +-- js/src/ion/arm/Architecture-arm.h | 5 +-- js/src/ion/arm/Assembler-arm.cpp | 5 +-- js/src/ion/arm/Assembler-arm.h | 5 +-- js/src/ion/arm/Bailouts-arm.cpp | 5 +-- js/src/ion/arm/BaselineCompiler-arm.cpp | 5 +-- js/src/ion/arm/BaselineCompiler-arm.h | 5 +-- js/src/ion/arm/BaselineHelpers-arm.h | 5 +-- js/src/ion/arm/BaselineIC-arm.cpp | 5 +-- js/src/ion/arm/BaselineRegisters-arm.h | 5 +-- js/src/ion/arm/CodeGenerator-arm.cpp | 5 +-- js/src/ion/arm/CodeGenerator-arm.h | 5 +-- js/src/ion/arm/IonFrames-arm.cpp | 5 +-- js/src/ion/arm/IonFrames-arm.h | 5 +-- js/src/ion/arm/LIR-arm.h | 5 +-- js/src/ion/arm/LOpcodes-arm.h | 5 +-- js/src/ion/arm/Lowering-arm.cpp | 5 +-- js/src/ion/arm/Lowering-arm.h | 5 +-- js/src/ion/arm/MacroAssembler-arm.cpp | 5 +-- js/src/ion/arm/MacroAssembler-arm.h | 5 +-- js/src/ion/arm/MoveEmitter-arm.cpp | 5 +-- js/src/ion/arm/MoveEmitter-arm.h | 5 +-- js/src/ion/arm/Trampoline-arm.cpp | 5 +-- js/src/ion/shared/Assembler-shared.h | 5 +-- js/src/ion/shared/Assembler-x86-shared.cpp | 5 +-- js/src/ion/shared/Assembler-x86-shared.h | 5 +-- js/src/ion/shared/BaselineCompiler-shared.cpp | 5 +-- js/src/ion/shared/BaselineCompiler-shared.h | 5 +-- .../shared/BaselineCompiler-x86-shared.cpp | 5 +-- .../ion/shared/BaselineCompiler-x86-shared.h | 5 +-- js/src/ion/shared/BaselineIC-x86-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-shared-inl.h | 5 +-- js/src/ion/shared/CodeGenerator-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-shared.h | 5 +-- .../ion/shared/CodeGenerator-x86-shared.cpp | 5 +-- js/src/ion/shared/CodeGenerator-x86-shared.h | 5 +-- js/src/ion/shared/IonAssemblerBuffer.h | 5 +-- .../IonAssemblerBufferWithConstantPools.h | 5 +-- js/src/ion/shared/IonFrames-shared.h | 44 +++---------------- js/src/ion/shared/IonFrames-x86-shared.cpp | 5 +-- js/src/ion/shared/IonFrames-x86-shared.h | 5 +-- js/src/ion/shared/LIR-x86-shared.h | 5 +-- js/src/ion/shared/Lowering-shared-inl.h | 5 +-- js/src/ion/shared/Lowering-shared.cpp | 5 +-- js/src/ion/shared/Lowering-shared.h | 5 +-- js/src/ion/shared/Lowering-x86-shared.cpp | 5 +-- js/src/ion/shared/Lowering-x86-shared.h | 5 +-- js/src/ion/shared/MacroAssembler-x86-shared.h | 5 +-- js/src/ion/shared/MoveEmitter-x86-shared.cpp | 5 +-- js/src/ion/shared/MoveEmitter-x86-shared.h | 5 +-- js/src/ion/x64/Architecture-x64.h | 5 +-- js/src/ion/x64/Assembler-x64.cpp | 5 +-- js/src/ion/x64/Assembler-x64.h | 5 +-- js/src/ion/x64/Bailouts-x64.cpp | 5 +-- js/src/ion/x64/BaselineCompiler-x64.cpp | 5 +-- js/src/ion/x64/BaselineCompiler-x64.h | 5 +-- js/src/ion/x64/BaselineHelpers-x64.h | 5 +-- js/src/ion/x64/BaselineIC-x64.cpp | 5 +-- js/src/ion/x64/BaselineRegisters-x64.h | 5 +-- js/src/ion/x64/CodeGenerator-x64.cpp | 5 +-- js/src/ion/x64/CodeGenerator-x64.h | 5 +-- js/src/ion/x64/LIR-x64.h | 5 +-- js/src/ion/x64/LOpcodes-x64.h | 5 +-- js/src/ion/x64/Lowering-x64.cpp | 5 +-- js/src/ion/x64/Lowering-x64.h | 5 +-- js/src/ion/x64/MacroAssembler-x64.cpp | 5 +-- js/src/ion/x64/MacroAssembler-x64.h | 5 +-- js/src/ion/x64/Trampoline-x64.cpp | 5 +-- js/src/ion/x86/Architecture-x86.h | 5 +-- js/src/ion/x86/Assembler-x86.cpp | 5 +-- js/src/ion/x86/Assembler-x86.h | 5 +-- js/src/ion/x86/Bailouts-x86.cpp | 5 +-- js/src/ion/x86/BaselineCompiler-x86.cpp | 5 +-- js/src/ion/x86/BaselineCompiler-x86.h | 5 +-- js/src/ion/x86/BaselineHelpers-x86.h | 5 +-- js/src/ion/x86/BaselineIC-x86.cpp | 5 +-- js/src/ion/x86/BaselineRegisters-x86.h | 5 +-- js/src/ion/x86/CodeGenerator-x86.cpp | 5 +-- js/src/ion/x86/CodeGenerator-x86.h | 5 +-- js/src/ion/x86/LIR-x86.h | 5 +-- js/src/ion/x86/LOpcodes-x86.h | 5 +-- js/src/ion/x86/Lowering-x86.cpp | 5 +-- js/src/ion/x86/Lowering-x86.h | 5 +-- js/src/ion/x86/MacroAssembler-x86.cpp | 5 +-- js/src/ion/x86/MacroAssembler-x86.h | 5 +-- js/src/ion/x86/Trampoline-x86.cpp | 5 +-- .../jit-test/tests/auto-regress/bug557946.js | 2 +- .../jit-test/tests/auto-regress/bug558618.js | 2 +- js/src/jit-test/tests/basic/bug535760.js | 2 +- js/src/jit-test/tests/basic/bug541191-1.js | 2 +- js/src/jit-test/tests/basic/bug541191-2.js | 2 +- js/src/jit-test/tests/basic/bug541191-3.js | 2 +- js/src/jit-test/tests/basic/bug541191-4.js | 2 +- js/src/jit-test/tests/basic/bug541191-5.js | 2 +- js/src/jit-test/tests/basic/bug592927.js | 2 +- js/src/jit-test/tests/basic/bug602088.js | 2 +- js/src/jit-test/tests/basic/bug606083.js | 2 +- js/src/jit-test/tests/basic/bug616762.js | 2 +- js/src/jit-test/tests/basic/bug633409-1.js | 2 +- js/src/jit-test/tests/basic/bug633409-2.js | 2 +- js/src/jit-test/tests/ion/bug674664-3.js | 2 +- js/src/jit-test/tests/ion/bug684362.js | 2 +- js/src/jit-test/tests/ion/bug747271.js | 2 +- js/src/jit-test/tests/ion/bug750588.js | 2 +- js/src/jit-test/tests/ion/bug772901.js | 2 +- js/src/jit-test/tests/ion/testPos.js | 2 +- js/src/jit-test/tests/ion/testSubtract.js | 2 +- js/src/jit-test/tests/ion/testVAndBranch.js | 2 +- js/src/jit-test/tests/ion/truncateToInt32.js | 2 +- js/src/jit-test/tests/ion/valueToInt32.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-1.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-3.js | 2 +- js/src/jit-test/tests/jaeger/bug597378.js | 2 +- js/src/jit-test/tests/jaeger/bug600139.js | 2 +- js/src/jit-test/tests/jaeger/bug600424.js | 2 +- js/src/jit-test/tests/jaeger/bug601982.js | 2 +- js/src/jit-test/tests/jaeger/bug604381.js | 2 +- js/src/jit-test/tests/jaeger/bug616508.js | 2 +- js/src/jit-test/tests/jaeger/bug625438.js | 2 +- js/src/jit-test/tests/jaeger/bug627486.js | 2 +- .../jit-test/tests/jaeger/floatTypedArrays.js | 2 +- .../tests/jaeger/normalIntTypedArrays.js | 2 +- .../tests/jaeger/smallIntTypedArrays.js | 2 +- .../tests/jaeger/testCallElemAfterGC.js | 2 +- .../tests/jaeger/testDenseCallElem.js | 2 +- js/src/jit-test/tests/jaeger/testForOps.js | 2 +- .../jit-test/tests/jaeger/testPropCallElem.js | 2 +- .../tests/jaeger/testPropCallElem2.js | 2 +- .../jit-test/tests/jaeger/testSetElem-Easy.js | 2 +- .../tests/jaeger/testSetElem-Indexed.js | 2 +- .../tests/jaeger/testSetElem-NewProto.js | 2 +- .../tests/jaeger/testSetTypedFloatArray.js | 2 +- .../tests/jaeger/testSetTypedIntArray.js | 2 +- .../tests/jaeger/testShiftSameBacking.js | 2 +- js/src/jsalloc.cpp | 5 +-- js/src/jsalloc.h | 5 +-- js/src/jsanalyze.cpp | 6 +-- js/src/jsanalyze.h | 6 +-- js/src/jsapi-tests/selfTest.cpp | 2 +- .../jsapi-tests/testAddPropertyPropcache.cpp | 2 +- js/src/jsapi-tests/testArgumentsObject.cpp | 2 +- js/src/jsapi-tests/testArrayBuffer.cpp | 2 +- js/src/jsapi-tests/testBug604087.cpp | 2 +- js/src/jsapi-tests/testClassGetter.cpp | 2 +- js/src/jsapi-tests/testCloneScript.cpp | 2 +- js/src/jsapi-tests/testContexts.cpp | 6 +-- js/src/jsapi-tests/testDebugger.cpp | 2 +- js/src/jsapi-tests/testDeepFreeze.cpp | 2 +- .../testDefineGetterSetterNonEnumerable.cpp | 2 +- js/src/jsapi-tests/testDefineProperty.cpp | 2 +- js/src/jsapi-tests/testEnclosingFunction.cpp | 2 +- js/src/jsapi-tests/testErrorCopying.cpp | 2 +- js/src/jsapi-tests/testFindSCCs.cpp | 2 +- js/src/jsapi-tests/testFunctionProperties.cpp | 2 +- js/src/jsapi-tests/testGCOutOfMemory.cpp | 2 +- js/src/jsapi-tests/testGetPropertyDefault.cpp | 2 +- js/src/jsapi-tests/testIndexToString.cpp | 2 +- js/src/jsapi-tests/testIntString.cpp | 2 +- js/src/jsapi-tests/testJSEvaluateScript.cpp | 2 +- js/src/jsapi-tests/testLookup.cpp | 2 +- js/src/jsapi-tests/testNewObject.cpp | 2 +- js/src/jsapi-tests/testOps.cpp | 2 +- js/src/jsapi-tests/testParseJSON.cpp | 2 +- js/src/jsapi-tests/testProfileStrings.cpp | 2 +- js/src/jsapi-tests/testPropCache.cpp | 2 +- .../testRegExpInstanceProperties.cpp | 2 +- js/src/jsapi-tests/testResolveRecursion.cpp | 2 +- js/src/jsapi-tests/testSameValue.cpp | 2 +- js/src/jsapi-tests/testScriptInfo.cpp | 2 +- js/src/jsapi-tests/testScriptObject.cpp | 2 +- js/src/jsapi-tests/testSetProperty.cpp | 2 +- js/src/jsapi-tests/testStringBuffer.cpp | 2 +- js/src/jsapi-tests/testTrap.cpp | 2 +- js/src/jsapi-tests/testTypedArrays.cpp | 2 +- js/src/jsapi-tests/testUTF8.cpp | 2 +- js/src/jsapi-tests/testXDR.cpp | 2 +- js/src/jsapi-tests/tests.cpp | 3 +- js/src/jsapi-tests/tests.h | 3 +- js/src/jsapi-tests/valueABI.c | 3 +- js/src/jsapi.cpp | 5 +-- js/src/jsapi.h | 3 +- js/src/jsarray.cpp | 3 +- js/src/jsarray.h | 2 +- js/src/jsatom.cpp | 2 +- js/src/jsatom.h | 2 +- js/src/jsatominlines.h | 4 +- js/src/jsbool.cpp | 2 +- js/src/jsbool.h | 4 +- js/src/jsboolinlines.h | 4 +- js/src/jsclass.h | 5 +-- js/src/jsclist.h | 5 ++- js/src/jsclone.cpp | 1 + js/src/jsclone.h | 1 + js/src/jscntxt.cpp | 5 +-- js/src/jscntxt.h | 3 +- js/src/jscntxtinlines.h | 5 +-- js/src/jscompartment.cpp | 5 +-- js/src/jscompartment.h | 5 +-- js/src/jscompartmentinlines.h | 5 +-- js/src/jscpucfg.h | 4 +- js/src/jscrashformat.h | 5 +-- js/src/jscrashreport.cpp | 5 +-- js/src/jscrashreport.h | 5 +-- js/src/jsdate.cpp | 3 +- js/src/jsdate.h | 4 +- js/src/jsdbgapi.cpp | 3 +- js/src/jsdbgapi.h | 3 +- js/src/jsdhash.cpp | 5 ++- js/src/jsdhash.h | 5 ++- js/src/jsdtoa.cpp | 2 +- js/src/jsdtoa.h | 4 +- js/src/jsexn.cpp | 3 +- js/src/jsexn.h | 4 +- js/src/jsfriendapi.cpp | 5 +-- js/src/jsfriendapi.h | 2 +- js/src/jsfun.cpp | 5 +-- js/src/jsfun.h | 4 +- js/src/jsfuninlines.h | 5 +-- js/src/jsgc.cpp | 3 +- js/src/jsgc.h | 2 +- js/src/jsgcinlines.h | 2 +- js/src/jsinfer.cpp | 6 +-- js/src/jsinfer.h | 6 +-- js/src/jsinferinlines.h | 6 +-- js/src/jsinterp.cpp | 5 +-- js/src/jsinterp.h | 5 +-- js/src/jsinterpinlines.h | 5 +-- js/src/jsiter.cpp | 3 +- js/src/jsiter.h | 3 +- js/src/jskwgen.cpp | 3 +- js/src/jslibmath.h | 5 +-- js/src/jslock.h | 3 +- js/src/jslog2.cpp | 5 ++- js/src/jsmath.cpp | 5 +-- js/src/jsmath.h | 4 +- js/src/jsmemorymetrics.cpp | 5 +-- js/src/jsnativestack.cpp | 5 +-- js/src/jsnativestack.h | 5 +-- js/src/jsnum.cpp | 2 +- js/src/jsnum.h | 4 +- js/src/jsnuminlines.h | 4 +- js/src/jsobj.cpp | 3 +- js/src/jsobj.h | 3 +- js/src/jsobjinlines.h | 3 +- js/src/json.cpp | 3 +- js/src/json.h | 4 +- js/src/jsonparser.cpp | 3 +- js/src/jsonparser.h | 3 +- js/src/jsopcode.cpp | 5 +-- js/src/jsopcode.h | 4 +- js/src/jsopcodeinlines.h | 4 +- js/src/jsoplengen.cpp | 3 +- js/src/jsprf.cpp | 5 ++- js/src/jsprf.h | 5 ++- js/src/jsprobes.cpp | 3 +- js/src/jsprobes.h | 5 +-- js/src/jspropertycache.cpp | 5 +-- js/src/jspropertycache.h | 3 +- js/src/jspropertycacheinlines.h | 3 +- js/src/jspropertytree.cpp | 6 +-- js/src/jspropertytree.h | 6 +-- js/src/jsprototypes.h | 5 +-- js/src/jsproxy.cpp | 9 ++-- js/src/jsproxy.h | 5 +-- js/src/jsprvtd.h | 2 +- js/src/jspubtd.h | 2 +- js/src/jsreflect.cpp | 5 +-- js/src/jsreflect.h | 5 +-- js/src/jsscript.cpp | 3 +- js/src/jsscript.h | 3 +- js/src/jsscriptinlines.h | 3 +- js/src/jsstr.cpp | 5 +-- js/src/jsstr.h | 5 +-- js/src/jsstrinlines.h | 4 +- js/src/jstypedarray.cpp | 6 +-- js/src/jstypedarray.h | 6 +-- js/src/jstypedarrayinlines.h | 6 +-- js/src/jstypes.h | 5 ++- js/src/jsutil.cpp | 4 +- js/src/jsutil.h | 4 +- js/src/jsversion.h | 4 +- js/src/jswatchpoint.cpp | 2 +- js/src/jswatchpoint.h | 2 +- js/src/jsweakcache.h | 5 +-- js/src/jsweakmap.cpp | 5 +-- js/src/jsweakmap.h | 5 +-- js/src/jswin.h | 4 +- js/src/jsworkers.cpp | 6 +-- js/src/jsworkers.h | 6 +-- js/src/jswrapper.cpp | 5 +-- js/src/jswrapper.h | 5 +-- js/src/methodjit/BaseAssembler.h | 5 +-- js/src/methodjit/BaseCompiler.h | 5 +-- js/src/methodjit/CodeGenIncludes.h | 5 +-- js/src/methodjit/Compiler.cpp | 5 +-- js/src/methodjit/Compiler.h | 5 +-- js/src/methodjit/FastArithmetic.cpp | 5 +-- js/src/methodjit/FastBuiltins.cpp | 5 +-- js/src/methodjit/FastOps.cpp | 5 +-- js/src/methodjit/FrameEntry.h | 5 +-- js/src/methodjit/FrameState-inl.h | 5 +-- js/src/methodjit/FrameState.cpp | 5 +-- js/src/methodjit/FrameState.h | 5 +-- js/src/methodjit/ICChecker.h | 5 +-- js/src/methodjit/ICLabels.h | 5 +-- js/src/methodjit/ICRepatcher.h | 5 +-- js/src/methodjit/ImmutableSync.cpp | 5 +-- js/src/methodjit/ImmutableSync.h | 5 +-- js/src/methodjit/InlineFrameAssembler.h | 5 +-- js/src/methodjit/InvokeHelpers.cpp | 5 +-- js/src/methodjit/Logging.cpp | 5 +-- js/src/methodjit/Logging.h | 5 +-- js/src/methodjit/LoopState.cpp | 5 +-- js/src/methodjit/LoopState.h | 5 +-- js/src/methodjit/MachineRegs.h | 5 +-- js/src/methodjit/MethodJIT.cpp | 5 +-- js/src/methodjit/MethodJIT.h | 5 +-- js/src/methodjit/MonoIC.cpp | 5 +-- js/src/methodjit/MonoIC.h | 5 +-- js/src/methodjit/NunboxAssembler.h | 5 +-- js/src/methodjit/PolyIC.cpp | 5 +-- js/src/methodjit/PolyIC.h | 5 +-- js/src/methodjit/PunboxAssembler.h | 5 +-- js/src/methodjit/RematInfo.h | 5 +-- js/src/methodjit/Retcon.cpp | 5 +-- js/src/methodjit/Retcon.h | 5 +-- js/src/methodjit/StubCalls-inl.h | 5 +-- js/src/methodjit/StubCalls.cpp | 5 +-- js/src/methodjit/StubCalls.h | 5 +-- js/src/methodjit/StubCompiler.cpp | 5 +-- js/src/methodjit/StubCompiler.h | 5 +-- js/src/methodjit/TrampolineCompiler.cpp | 5 +-- js/src/methodjit/TrampolineCompiler.h | 5 +-- js/src/methodjit/TrampolineMIPS.cpp | 5 +-- js/src/methodjit/TypedArrayIC.h | 5 +-- js/src/perf/jsperf.cpp | 2 +- js/src/perf/jsperf.h | 2 +- js/src/perf/pm_linux.cpp | 2 +- js/src/perf/pm_stub.cpp | 2 +- js/src/prmjtime.cpp | 2 +- js/src/prmjtime.h | 4 +- js/src/shell/js.cpp | 3 +- js/src/shell/jsheaptools.cpp | 3 +- js/src/shell/jsheaptools.h | 3 +- js/src/shell/jsoptparse.cpp | 3 +- js/src/shell/jsoptparse.h | 3 +- .../ecma_2/Exceptions/exception-010-n.js | 1 - .../ecma_2/Exceptions/exception-011-n.js | 1 - .../ecma_2/FunctionObjects/apply-001-n.js | 1 - .../tests/ecma_3/Exceptions/regress-58946.js | 1 - .../tests/ecma_3/ExecutionContexts/10.1.3.js | 1 - .../ecma_3/ExecutionContexts/10.1.4-1.js | 1 - .../ecma_3/ExecutionContexts/regress-23346.js | 1 - js/src/tests/ecma_3/FunExpr/fe-001-n.js | 1 - js/src/tests/ecma_3/FunExpr/fe-001.js | 1 - js/src/tests/ecma_3/FunExpr/fe-002.js | 1 - .../ecma_3/NumberFormatting/tostring-001.js | 1 - js/src/tests/ecma_3/RegExp/regress-24712.js | 1 - js/src/tests/ecma_3/RegExp/regress-28686.js | 1 - js/src/tests/ecma_3/Unicode/uc-001-n.js | 1 - js/src/tests/ecma_3/Unicode/uc-001.js | 1 - js/src/tests/ecma_3/Unicode/uc-002-n.js | 1 - js/src/tests/ecma_3/Unicode/uc-002.js | 1 - js/src/tests/ecma_3/Unicode/uc-003.js | 1 - js/src/tests/ecma_3/Unicode/uc-004.js | 1 - .../js1_5/Exceptions/catchguard-002-n.js | 1 - .../js1_5/Exceptions/catchguard-003-n.js | 1 - js/src/tests/js1_5/GetSet/getset-002.js | 1 - .../js1_5/extensions/catchguard-001-n.js | 1 - .../tests/js1_5/extensions/catchguard-001.js | 1 - .../tests/js1_5/extensions/catchguard-002.js | 1 - .../tests/js1_5/extensions/catchguard-003.js | 1 - js/src/tests/js1_5/extensions/getset-001.js | 1 - .../tests/js1_5/extensions/regress-50447-1.js | 1 - .../tests/js1_5/extensions/regress-50447.js | 1 - js/src/tests/js1_6/shell.js | 1 - js/src/tests/js1_7/shell.js | 1 - js/src/tests/js1_8/shell.js | 1 - js/src/tests/js1_8_1/shell.js | 1 - js/src/tests/shell.js | 1 - js/src/vm/ArgumentsObject-inl.h | 3 +- js/src/vm/ArgumentsObject.cpp | 3 +- js/src/vm/ArgumentsObject.h | 3 +- js/src/vm/BooleanObject-inl.h | 3 +- js/src/vm/BooleanObject.h | 3 +- js/src/vm/CharacterEncoding.cpp | 3 +- js/src/vm/CommonPropertyNames.h | 5 +-- js/src/vm/DateTime.cpp | 6 +-- js/src/vm/DateTime.h | 6 +-- js/src/vm/Debugger.cpp | 5 +-- js/src/vm/Debugger.h | 5 +-- js/src/vm/ForkJoin.cpp | 3 +- js/src/vm/ForkJoin.h | 3 +- js/src/vm/GlobalObject-inl.h | 3 +- js/src/vm/GlobalObject.cpp | 3 +- js/src/vm/GlobalObject.h | 3 +- js/src/vm/Keywords.h | 5 +-- js/src/vm/MatchPairs.h | 5 +-- js/src/vm/Monitor.cpp | 3 +- js/src/vm/Monitor.h | 3 +- js/src/vm/NumberObject-inl.h | 3 +- js/src/vm/NumberObject.h | 3 +- js/src/vm/NumericConversions.h | 7 ++- js/src/vm/ObjectImpl-inl.h | 7 ++- js/src/vm/ObjectImpl.cpp | 7 ++- js/src/vm/ObjectImpl.h | 7 ++- js/src/vm/ParallelDo.cpp | 5 +-- js/src/vm/ParallelDo.h | 5 +-- js/src/vm/PropertyKey.cpp | 2 +- js/src/vm/RegExpObject-inl.h | 5 +-- js/src/vm/RegExpObject.cpp | 5 +-- js/src/vm/RegExpObject.h | 5 +-- js/src/vm/RegExpStatics-inl.h | 5 +-- js/src/vm/RegExpStatics.cpp | 5 +-- js/src/vm/RegExpStatics.h | 5 +-- js/src/vm/SPSProfiler.cpp | 5 +-- js/src/vm/SPSProfiler.h | 5 +-- js/src/vm/ScopeObject-inl.h | 3 +- js/src/vm/ScopeObject.cpp | 5 +-- js/src/vm/ScopeObject.h | 3 +- js/src/vm/SelfHosting.cpp | 5 +-- js/src/vm/Shape-inl.h | 5 ++- js/src/vm/Shape.cpp | 3 +- js/src/vm/Shape.h | 5 +-- js/src/vm/Stack-inl.h | 5 +-- js/src/vm/Stack.cpp | 5 +-- js/src/vm/Stack.h | 5 +-- js/src/vm/String-inl.h | 5 +-- js/src/vm/String.cpp | 5 +-- js/src/vm/String.h | 5 +-- js/src/vm/StringBuffer.cpp | 6 +-- js/src/vm/StringBuffer.h | 6 +-- js/src/vm/StringObject-inl.h | 3 +- js/src/vm/StringObject.h | 3 +- js/src/vm/ThreadPool.cpp | 6 +-- js/src/vm/ThreadPool.h | 3 +- js/src/vm/Unicode.h | 4 +- js/src/vm/Xdr.cpp | 2 +- js/src/vm/Xdr.h | 3 +- js/src/yarr/ASCIICType.h | 4 +- js/src/yarr/BumpPointerAllocator.h | 4 +- js/src/yarr/CheckedArithmetic.h | 3 +- js/src/yarr/MatchResult.h | 4 +- js/src/yarr/OSAllocator.h | 4 +- js/src/yarr/OSAllocatorOS2.cpp | 4 +- js/src/yarr/OSAllocatorPosix.cpp | 4 +- js/src/yarr/OSAllocatorWin.cpp | 4 +- js/src/yarr/PageAllocation.h | 4 +- js/src/yarr/PageBlock.cpp | 4 +- js/src/yarr/PageBlock.h | 4 +- js/src/yarr/VMTags.h | 4 +- js/src/yarr/Yarr.h | 4 +- js/src/yarr/YarrCanonicalizeUCS2.cpp | 4 +- js/src/yarr/YarrCanonicalizeUCS2.h | 4 +- js/src/yarr/YarrInterpreter.cpp | 4 +- js/src/yarr/YarrInterpreter.h | 4 +- js/src/yarr/YarrJIT.cpp | 3 +- js/src/yarr/YarrJIT.h | 3 +- js/src/yarr/YarrParser.h | 3 +- js/src/yarr/YarrPattern.cpp | 3 +- js/src/yarr/YarrPattern.h | 3 +- js/src/yarr/YarrSyntaxChecker.cpp | 4 +- js/src/yarr/YarrSyntaxChecker.h | 4 +- js/src/yarr/wtfbridge.h | 6 +-- 733 files changed, 1279 insertions(+), 1725 deletions(-) diff --git a/js/ipc/CPOWTypes.h b/js/ipc/CPOWTypes.h index 46195f9ee72d..56d84cd3f717 100644 --- a/js/ipc/CPOWTypes.h +++ b/js/ipc/CPOWTypes.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ContextWrapperChild.h b/js/ipc/ContextWrapperChild.h index ec42b78ba6d7..b6d1c9505c17 100644 --- a/js/ipc/ContextWrapperChild.h +++ b/js/ipc/ContextWrapperChild.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ContextWrapperParent.h b/js/ipc/ContextWrapperParent.h index 01fca526411d..671521b36b2a 100644 --- a/js/ipc/ContextWrapperParent.h +++ b/js/ipc/ContextWrapperParent.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperChild.cpp b/js/ipc/ObjectWrapperChild.cpp index 7c90e3612cb0..247eaf0605fd 100644 --- a/js/ipc/ObjectWrapperChild.cpp +++ b/js/ipc/ObjectWrapperChild.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperChild.h b/js/ipc/ObjectWrapperChild.h index dff0afd2f9a9..f9a270cacce5 100644 --- a/js/ipc/ObjectWrapperChild.h +++ b/js/ipc/ObjectWrapperChild.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/ipc/ObjectWrapperParent.cpp b/js/ipc/ObjectWrapperParent.cpp index 9a80c99e7690..54b81d11681c 100644 --- a/js/ipc/ObjectWrapperParent.cpp +++ b/js/ipc/ObjectWrapperParent.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ @@ -691,4 +690,4 @@ ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JSMutab self->CallHasInstance(in_v, aco.StatusPtr(), bp) && aco.Ok()); -} \ No newline at end of file +} diff --git a/js/ipc/ObjectWrapperParent.h b/js/ipc/ObjectWrapperParent.h index a389b52956d9..af147b1f800d 100644 --- a/js/ipc/ObjectWrapperParent.h +++ b/js/ipc/ObjectWrapperParent.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index c0043b986a74..a5dab01407a8 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_atom.cpp b/js/jsd/jsd_atom.cpp index 5517b997d644..dec6b391457a 100644 --- a/js/jsd/jsd_atom.cpp +++ b/js/jsd/jsd_atom.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_high.cpp b/js/jsd/jsd_high.cpp index 3a7bea446e36..7887f8fc73e2 100644 --- a/js/jsd/jsd_high.cpp +++ b/js/jsd/jsd_high.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_hook.cpp b/js/jsd/jsd_hook.cpp index 9f8fa947f082..95e631804472 100644 --- a/js/jsd/jsd_hook.cpp +++ b/js/jsd/jsd_hook.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_java.cpp b/js/jsd/jsd_java.cpp index 4bfcccde93ba..c5c0aec2aaf9 100644 --- a/js/jsd/jsd_java.cpp +++ b/js/jsd/jsd_java.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_lock.cpp b/js/jsd/jsd_lock.cpp index c8a827b8f941..628d2fd621e7 100644 --- a/js/jsd/jsd_lock.cpp +++ b/js/jsd/jsd_lock.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_lock.h b/js/jsd/jsd_lock.h index a3eb821be953..b1e8c31053bd 100644 --- a/js/jsd/jsd_lock.h +++ b/js/jsd/jsd_lock.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_obj.cpp b/js/jsd/jsd_obj.cpp index dc7c927cab99..cc0e8bb754bf 100644 --- a/js/jsd/jsd_obj.cpp +++ b/js/jsd/jsd_obj.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_scpt.cpp b/js/jsd/jsd_scpt.cpp index f4ef023d45ea..67c53f92791d 100644 --- a/js/jsd/jsd_scpt.cpp +++ b/js/jsd/jsd_scpt.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 8e5fbb384aa5..7dac8eb3befd 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_step.cpp b/js/jsd/jsd_step.cpp index 0396a5cb7318..da1886a2b03f 100644 --- a/js/jsd/jsd_step.cpp +++ b/js/jsd/jsd_step.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_text.cpp b/js/jsd/jsd_text.cpp index bc851a3def41..ab11e82eac8b 100644 --- a/js/jsd/jsd_text.cpp +++ b/js/jsd/jsd_text.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_val.cpp b/js/jsd/jsd_val.cpp index a8cad6d005a9..97385a98af32 100644 --- a/js/jsd/jsd_val.cpp +++ b/js/jsd/jsd_val.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index 8ce10b932552..ea1ef4b837dd 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsd_xpc.h b/js/jsd/jsd_xpc.h index da383e30f9d9..4dbfe7cab405 100644 --- a/js/jsd/jsd_xpc.h +++ b/js/jsd/jsd_xpc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jsdebug.cpp b/js/jsd/jsdebug.cpp index 06954cead55f..7e893c69d149 100644 --- a/js/jsd/jsdebug.cpp +++ b/js/jsd/jsdebug.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index 0971ba121f17..a3a05eeb1f15 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jsdstubs.cpp b/js/jsd/jsdstubs.cpp index 68cf75b79889..22420410251c 100644 --- a/js/jsd/jsdstubs.cpp +++ b/js/jsd/jsdstubs.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/jsd/jshash.cpp b/js/jsd/jshash.cpp index 6ae4e549ea34..d4caf2ce833f 100644 --- a/js/jsd/jshash.cpp +++ b/js/jsd/jshash.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/jshash.h b/js/jsd/jshash.h index 5c44b7ba964a..e21c7b786a04 100644 --- a/js/jsd/jshash.h +++ b/js/jsd/jshash.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/jsd/resource.h b/js/jsd/resource.h index d40e61ae13d1..69874fe0ff30 100644 --- a/js/jsd/resource.h +++ b/js/jsd/resource.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/public/Anchor.h b/js/public/Anchor.h index 166ada5cd28e..d0c2476cf726 100644 --- a/js/public/Anchor.h +++ b/js/public/Anchor.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h index 6ecc4273de8d..5b474f0ac3b3 100644 --- a/js/public/CallArgs.h +++ b/js/public/CallArgs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/CharacterEncoding.h b/js/public/CharacterEncoding.h index 36d8670a0821..63e5cc6650ca 100644 --- a/js/public/CharacterEncoding.h +++ b/js/public/CharacterEncoding.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index 1231ca97b9f9..80d8f8a426fb 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef js_gc_api_h___ #define js_gc_api_h___ diff --git a/js/public/HashTable.h b/js/public/HashTable.h index 5cc7ea4e8b9e..acd4e310ac79 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h index 47cb5602123d..cd50b7e1bbcb 100644 --- a/js/public/HeapAPI.h +++ b/js/public/HeapAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef js_heap_api_h___ #define js_heap_api_h___ diff --git a/js/public/LegacyIntTypes.h b/js/public/LegacyIntTypes.h index 30944efda61e..387a68b9e9d1 100644 --- a/js/public/LegacyIntTypes.h +++ b/js/public/LegacyIntTypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index 14cf88ec4c60..e5f9ea3b5bce 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/PropertyKey.h b/js/public/PropertyKey.h index 5d048195f51e..53158c26f30f 100644 --- a/js/public/PropertyKey.h +++ b/js/public/PropertyKey.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/RequiredDefines.h b/js/public/RequiredDefines.h index 8dc47e251c95..2be2efbf9a3b 100644 --- a/js/public/RequiredDefines.h +++ b/js/public/RequiredDefines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 9f9fa9df53f0..5d139292fe38 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/TemplateLib.h b/js/public/TemplateLib.h index 58966b166f9f..a4ff6829125f 100644 --- a/js/public/TemplateLib.h +++ b/js/public/TemplateLib.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Utility.h b/js/public/Utility.h index 70f09d6b22a9..2a883323ff63 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Value.h b/js/public/Value.h index a9a7bfd40005..57e951a1defd 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/public/Vector.h b/js/public/Vector.h index b8e2ea698504..5f40dd634b8c 100644 --- a/js/public/Vector.h +++ b/js/public/Vector.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/TraceLogging.cpp b/js/src/TraceLogging.cpp index 49fe2d3e8ace..1c64a67fd68d 100644 --- a/js/src/TraceLogging.cpp +++ b/js/src/TraceLogging.cpp @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 sw=4 et tw=79: */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "TraceLogging.h" #include diff --git a/js/src/TraceLogging.h b/js/src/TraceLogging.h index eebadfc1e14d..2e6d5ba9ac38 100644 --- a/js/src/TraceLogging.h +++ b/js/src/TraceLogging.h @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* vim: set ts=4 sw=4 et tw=79: */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #if !defined(TraceLogging_h__) #define TraceLogging_h__ diff --git a/js/src/assembler/assembler/ARMAssembler.cpp b/js/src/assembler/assembler/ARMAssembler.cpp index a9ada8e9a2c5..18f742b80b6a 100644 --- a/js/src/assembler/assembler/ARMAssembler.cpp +++ b/js/src/assembler/assembler/ARMAssembler.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/ARMAssembler.h b/js/src/assembler/assembler/ARMAssembler.h index e04b251b7439..2c1d712158d8 100644 --- a/js/src/assembler/assembler/ARMAssembler.h +++ b/js/src/assembler/assembler/ARMAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009, 2010 University of Szeged diff --git a/js/src/assembler/assembler/ARMv7Assembler.h b/js/src/assembler/assembler/ARMv7Assembler.h index 1f96585ee16c..1a83139887fd 100644 --- a/js/src/assembler/assembler/ARMv7Assembler.h +++ b/js/src/assembler/assembler/ARMv7Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AbstractMacroAssembler.h b/js/src/assembler/assembler/AbstractMacroAssembler.h index 286fad954742..2bfb275b6884 100644 --- a/js/src/assembler/assembler/AbstractMacroAssembler.h +++ b/js/src/assembler/assembler/AbstractMacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBuffer.h b/js/src/assembler/assembler/AssemblerBuffer.h index d21182527b52..a2e7c3840331 100644 --- a/js/src/assembler/assembler/AssemblerBuffer.h +++ b/js/src/assembler/assembler/AssemblerBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h index 467f9c9e8cbe..2578692dc47a 100644 --- a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h +++ b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/CodeLocation.h b/js/src/assembler/assembler/CodeLocation.h index 490157688614..d9bc6d4175fb 100644 --- a/js/src/assembler/assembler/CodeLocation.h +++ b/js/src/assembler/assembler/CodeLocation.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/LinkBuffer.h b/js/src/assembler/assembler/LinkBuffer.h index 35913c87aaf7..1e6fb4b35249 100644 --- a/js/src/assembler/assembler/LinkBuffer.h +++ b/js/src/assembler/assembler/LinkBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssembler.h b/js/src/assembler/assembler/MacroAssembler.h index 8bf9c0b0a80e..2b77445e14cf 100644 --- a/js/src/assembler/assembler/MacroAssembler.h +++ b/js/src/assembler/assembler/MacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerARM.cpp b/js/src/assembler/assembler/MacroAssemblerARM.cpp index 89db1e2d859e..9c76e8fd43e7 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.cpp +++ b/js/src/assembler/assembler/MacroAssemblerARM.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/MacroAssemblerARM.h b/js/src/assembler/assembler/MacroAssemblerARM.h index 831ccbb8a183..6e18c54b84dc 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.h +++ b/js/src/assembler/assembler/MacroAssemblerARM.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. diff --git a/js/src/assembler/assembler/MacroAssemblerARMv7.h b/js/src/assembler/assembler/MacroAssemblerARMv7.h index 2bdb6e8fdb5e..0abeb2b31de0 100644 --- a/js/src/assembler/assembler/MacroAssemblerARMv7.h +++ b/js/src/assembler/assembler/MacroAssemblerARMv7.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerCodeRef.h b/js/src/assembler/assembler/MacroAssemblerCodeRef.h index 101ffcb098d5..bcf3903f9b13 100644 --- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h +++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerSparc.h b/js/src/assembler/assembler/MacroAssemblerSparc.h index 1d89f17790e7..3692b3e0b272 100644 --- a/js/src/assembler/assembler/MacroAssemblerSparc.h +++ b/js/src/assembler/assembler/MacroAssemblerSparc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86.h b/js/src/assembler/assembler/MacroAssemblerX86.h index c6ab40f587fa..c782ad60d006 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86.h +++ b/js/src/assembler/assembler/MacroAssemblerX86.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp index b94a345ff649..e65b2a3d7c62 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.h b/js/src/assembler/assembler/MacroAssemblerX86Common.h index 30bb1ed26afc..b0bef29120c2 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.h +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86_64.h b/js/src/assembler/assembler/MacroAssemblerX86_64.h index c4b67dcaeb03..c3be4145695a 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86_64.h +++ b/js/src/assembler/assembler/MacroAssemblerX86_64.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/RepatchBuffer.h b/js/src/assembler/assembler/RepatchBuffer.h index 003479211b43..0a3deb3c27d2 100644 --- a/js/src/assembler/assembler/RepatchBuffer.h +++ b/js/src/assembler/assembler/RepatchBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/SparcAssembler.h b/js/src/assembler/assembler/SparcAssembler.h index 4e3d5b14559a..19217a7cafd0 100644 --- a/js/src/assembler/assembler/SparcAssembler.h +++ b/js/src/assembler/assembler/SparcAssembler.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/X86Assembler.h b/js/src/assembler/assembler/X86Assembler.h index 2293098864f3..1533bdfa95e9 100644 --- a/js/src/assembler/assembler/X86Assembler.h +++ b/js/src/assembler/assembler/X86Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/jit/ExecutableAllocator.cpp b/js/src/assembler/jit/ExecutableAllocator.cpp index 59e1c259b673..bd8b1d3ba24d 100644 --- a/js/src/assembler/jit/ExecutableAllocator.cpp +++ b/js/src/assembler/jit/ExecutableAllocator.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2008 Apple Inc. All rights reserved. * diff --git a/js/src/assembler/moco/MocoStubs.h b/js/src/assembler/moco/MocoStubs.h index 7ce6da5e329b..df3d1f979745 100644 --- a/js/src/assembler/moco/MocoStubs.h +++ b/js/src/assembler/moco/MocoStubs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index a29c89517709..a5c203d5b342 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Eval.h b/js/src/builtin/Eval.h index e6eaeefa5b04..133c4b28ebcb 100644 --- a/js/src/builtin/Eval.h +++ b/js/src/builtin/Eval.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp index d3463125da23..4c49405d8909 100644 --- a/js/src/builtin/Intl.cpp +++ b/js/src/builtin/Intl.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Intl.h b/js/src/builtin/Intl.h index 3db27dc63767..eefec5dbcaaa 100644 --- a/js/src/builtin/Intl.h +++ b/js/src/builtin/Intl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Iterator-inl.h b/js/src/builtin/Iterator-inl.h index 7f93219af814..e6c838cdeb98 100644 --- a/js/src/builtin/Iterator-inl.h +++ b/js/src/builtin/Iterator-inl.h @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef Iterator_inl_h_ #define Iterator_inl_h_ diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 1f6258f49bcc..cff6e0a8c746 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index 3661c4cc498b..f8f006472dab 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Module.cpp b/js/src/builtin/Module.cpp index d70ec483e11e..4acec92e6e5b 100644 --- a/js/src/builtin/Module.cpp +++ b/js/src/builtin/Module.cpp @@ -1,3 +1,9 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsobjinlines.h" #include "builtin/Module.h" diff --git a/js/src/builtin/Module.h b/js/src/builtin/Module.h index 7a6386ebc434..f1bdef1ef1ba 100644 --- a/js/src/builtin/Module.h +++ b/js/src/builtin/Module.h @@ -1,3 +1,9 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + #ifndef Module_h___ #define Module_h___ diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 188911c74896..8171d873284b 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Object.h b/js/src/builtin/Object.h index a08fcdfb818e..c6a29225e957 100644 --- a/js/src/builtin/Object.h +++ b/js/src/builtin/Object.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/ParallelArray.cpp b/js/src/builtin/ParallelArray.cpp index c98771d047e4..49bb5a05cd10 100644 --- a/js/src/builtin/ParallelArray.cpp +++ b/js/src/builtin/ParallelArray.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/ParallelArray.h b/js/src/builtin/ParallelArray.h index d63b87872fb2..443ebad5952a 100644 --- a/js/src/builtin/ParallelArray.h +++ b/js/src/builtin/ParallelArray.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/Profilers.cpp b/js/src/builtin/Profilers.cpp index 43b9bea178e5..853d61d89111 100644 --- a/js/src/builtin/Profilers.cpp +++ b/js/src/builtin/Profilers.cpp @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ /* Profiling-related API */ diff --git a/js/src/builtin/Profilers.h b/js/src/builtin/Profilers.h index 872830de12d3..59c4e992024d 100644 --- a/js/src/builtin/Profilers.h +++ b/js/src/builtin/Profilers.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index eeccfcb1129c..502ca8fc6784 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/RegExp.h b/js/src/builtin/RegExp.h index 90662e9ed8bf..60fb782be9f9 100644 --- a/js/src/builtin/RegExp.h +++ b/js/src/builtin/RegExp.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e5f65c3a221b..a66d482f9d1a 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsapi.h" #include "jsbool.h" diff --git a/js/src/builtin/TestingFunctions.h b/js/src/builtin/TestingFunctions.h index 9bcb1e31d2e6..52b9bef76ce3 100644 --- a/js/src/builtin/TestingFunctions.h +++ b/js/src/builtin/TestingFunctions.h @@ -1,7 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef TestingFunctions_h__ #define TestingFunctions_h__ diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index 4b29ed0ed1e5..6ba4b7be7dae 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/ctypes/Library.cpp b/js/src/ctypes/Library.cpp index f76221331c25..9ad6f8fd1301 100644 --- a/js/src/ctypes/Library.cpp +++ b/js/src/ctypes/Library.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=2 sw=2 et tw=99: + * 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/. */ diff --git a/js/src/devtools/jint/treesearch.py b/js/src/devtools/jint/treesearch.py index c06a62b88011..2cbc45335814 100644 --- a/js/src/devtools/jint/treesearch.py +++ b/js/src/devtools/jint/treesearch.py @@ -1,9 +1,8 @@ +# vim: set ts=8 sts=4 et sw=4 tw=99: # 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/. -# vim: set ts=4 sw=4 tw=99 et: - import os, re import tempfile import subprocess diff --git a/js/src/devtools/sharkctl.cpp b/js/src/devtools/sharkctl.cpp index 14a550247af2..86fdfc936d22 100644 --- a/js/src/devtools/sharkctl.cpp +++ b/js/src/devtools/sharkctl.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/devtools/sharkctl.h b/js/src/devtools/sharkctl.h index e381cfd32ba3..bb3038d3ae6a 100644 --- a/js/src/devtools/sharkctl.h +++ b/js/src/devtools/sharkctl.h @@ -1,6 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/BitArray.h b/js/src/ds/BitArray.h index 4d0d0e64bb63..a20796d4dbe4 100644 --- a/js/src/ds/BitArray.h +++ b/js/src/ds/BitArray.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/InlineMap.h b/js/src/ds/InlineMap.h index 68ca36fb3973..d11172463de8 100644 --- a/js/src/ds/InlineMap.h +++ b/js/src/ds/InlineMap.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index c019a7ca12d5..b9621600f512 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index d7233c932a87..167a61c52a90 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/PriorityQueue.h b/js/src/ds/PriorityQueue.h index 1e9e26c918db..8ef6531bb12f 100644 --- a/js/src/ds/PriorityQueue.h +++ b/js/src/ds/PriorityQueue.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/Sort.h b/js/src/ds/Sort.h index 4061f75cb4fe..46542e5bf882 100644 --- a/js/src/ds/Sort.h +++ b/js/src/ds/Sort.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ds/SplayTree.h b/js/src/ds/SplayTree.h index 390282363f9f..8df268335fa6 100644 --- a/js/src/ds/SplayTree.h +++ b/js/src/ds/SplayTree.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/editline/editline.c b/js/src/editline/editline.c index f98d048a4112..21946a6250b8 100644 --- a/js/src/editline/editline.c +++ b/js/src/editline/editline.c @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/editline.h b/js/src/editline/editline.h index 5895322f1be1..0616de03a221 100644 --- a/js/src/editline/editline.h +++ b/js/src/editline/editline.h @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/sysunix.c b/js/src/editline/sysunix.c index 0035640a29f6..d45db6c79baa 100644 --- a/js/src/editline/sysunix.c +++ b/js/src/editline/sysunix.c @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/editline/unix.h b/js/src/editline/unix.h index 3d8687632232..ec4a762acb58 100644 --- a/js/src/editline/unix.h +++ b/js/src/editline/unix.h @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp index 24fe869ecd53..fc891b210dd1 100644 --- a/js/src/frontend/BytecodeCompiler.cpp +++ b/js/src/frontend/BytecodeCompiler.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h index 1b13ffe9ed13..9f1164e69400 100644 --- a/js/src/frontend/BytecodeCompiler.h +++ b/js/src/frontend/BytecodeCompiler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 336445f7ccec..8d90567bb301 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index 3b0bc3b4a31b..e84c80e29f24 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index b78d821f897b..cbad2eb6675a 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FoldConstants.h b/js/src/frontend/FoldConstants.h index a1bf9d14e9ad..86da781e8d80 100644 --- a/js/src/frontend/FoldConstants.h +++ b/js/src/frontend/FoldConstants.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 4152bc957c9c..57b338de55d6 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index 22b9e961d2c1..01d2585d4e88 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/NameFunctions.h b/js/src/frontend/NameFunctions.h index d2f9437cd191..adfb3920ad4d 100644 --- a/js/src/frontend/NameFunctions.h +++ b/js/src/frontend/NameFunctions.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps-inl.h b/js/src/frontend/ParseMaps-inl.h index 55fca1a6eb66..ceefb4c8af89 100644 --- a/js/src/frontend/ParseMaps-inl.h +++ b/js/src/frontend/ParseMaps-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps.cpp b/js/src/frontend/ParseMaps.cpp index 3426d861d903..34b1c8ede742 100644 --- a/js/src/frontend/ParseMaps.cpp +++ b/js/src/frontend/ParseMaps.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseMaps.h b/js/src/frontend/ParseMaps.h index a8026167be12..b986bb10d0b4 100644 --- a/js/src/frontend/ParseMaps.h +++ b/js/src/frontend/ParseMaps.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode-inl.h b/js/src/frontend/ParseNode-inl.h index d35c61409ec2..15da9b41d96e 100644 --- a/js/src/frontend/ParseNode-inl.h +++ b/js/src/frontend/ParseNode-inl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index f705e604db70..26b22639f07e 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index f280390e2609..7b2acefd33a6 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser-inl.h b/js/src/frontend/Parser-inl.h index 1fe084ce700f..b689f3bddd73 100644 --- a/js/src/frontend/Parser-inl.h +++ b/js/src/frontend/Parser-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 88320dad663b..f69d4190a359 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 2dcab9c3242a..22b006981d50 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SharedContext-inl.h b/js/src/frontend/SharedContext-inl.h index 74cac685efc8..247501f07d01 100644 --- a/js/src/frontend/SharedContext-inl.h +++ b/js/src/frontend/SharedContext-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 4b5bfff63a06..7212e66d3080 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h index dd0ba4faedf1..2d32ae516bee 100644 --- a/js/src/frontend/SyntaxParseHandler.h +++ b/js/src/frontend/SyntaxParseHandler.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 69b9477666ab..5435b683f0c7 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 0997a8049aa4..dad7e88ae2c1 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Barrier-inl.h b/js/src/gc/Barrier-inl.h index acab9ef1610d..0329d1e740e6 100644 --- a/js/src/gc/Barrier-inl.h +++ b/js/src/gc/Barrier-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 0a1009721abb..13f2a509a2e1 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/FindSCCs-inl.h b/js/src/gc/FindSCCs-inl.h index 552ce53be271..24ae0b1de3eb 100644 --- a/js/src/gc/FindSCCs-inl.h +++ b/js/src/gc/FindSCCs-inl.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "jsfriendapi.h" diff --git a/js/src/gc/FindSCCs.h b/js/src/gc/FindSCCs.h index ccd5f5991fbf..c8ed79d70a9c 100644 --- a/js/src/gc/FindSCCs.h +++ b/js/src/gc/FindSCCs.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_findsccs_h___ #define gc_findsccs_h___ diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index e661aac9e88e..f900778b106e 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index bf73c24f80d5..e5e7f7b67bc9 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_heap_h___ #define gc_heap_h___ diff --git a/js/src/gc/Iteration.cpp b/js/src/gc/Iteration.cpp index 607fd215aef5..76693e5fecff 100644 --- a/js/src/gc/Iteration.cpp +++ b/js/src/gc/Iteration.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index f527fb650715..f6b18144a985 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 tw=79 et: - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "mozilla/DebugOnly.h" diff --git a/js/src/gc/Marking.h b/js/src/gc/Marking.h index 499becc6aad8..3d89bd3e607b 100644 --- a/js/src/gc/Marking.h +++ b/js/src/gc/Marking.h @@ -1,9 +1,8 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - */ -/* 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifndef gc_marking_h___ #define gc_marking_h___ diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index e2bec9717391..399177771718 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "mozilla/Assertions.h" diff --git a/js/src/gc/Memory.h b/js/src/gc/Memory.h index bf78cd0594bc..b73c266bf2cb 100644 --- a/js/src/gc/Memory.h +++ b/js/src/gc/Memory.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef jsgc_memory_h___ #define jsgc_memory_h___ diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index 2f6e71da4ce6..f97bb1503c81 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index dcbd00f563c9..377c3b21b796 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index 934df0668de8..027600bc0c64 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp index 0a1523096e28..236fcbd1cf6e 100644 --- a/js/src/gc/StoreBuffer.cpp +++ b/js/src/gc/StoreBuffer.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - */ -/* 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/. */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ #ifdef JSGC_GENERATIONAL diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h index 5409eb02a2b5..d927d098f695 100644 --- a/js/src/gc/StoreBuffer.h +++ b/js/src/gc/StoreBuffer.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifdef JSGC_GENERATIONAL #ifndef jsgc_storebuffer_h___ diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 2a45d31f7b6e..d7f714e9679d 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index 49976dd6c65c..8d4be70cdbdf 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h index b9c42184afb3..4fb93bf50250 100644 --- a/js/src/gc/Zone.h +++ b/js/src/gc/Zone.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/gdb/gdb-tests.h b/js/src/gdb/gdb-tests.h index 70fdd8e94fc5..e9141d51528e 100644 --- a/js/src/gdb/gdb-tests.h +++ b/js/src/gdb/gdb-tests.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * 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 diff --git a/js/src/ion/AliasAnalysis.cpp b/js/src/ion/AliasAnalysis.cpp index f90fff43905d..9a9ca27929c9 100644 --- a/js/src/ion/AliasAnalysis.cpp +++ b/js/src/ion/AliasAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AliasAnalysis.h b/js/src/ion/AliasAnalysis.h index 36fd648e5467..64de011e513d 100644 --- a/js/src/ion/AliasAnalysis.h +++ b/js/src/ion/AliasAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index d268f1f922b8..62c1e545c98a 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJS.h b/js/src/ion/AsmJS.h index b27e152e2593..98b297edcbcd 100644 --- a/js/src/ion/AsmJS.h +++ b/js/src/ion/AsmJS.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSLink.cpp b/js/src/ion/AsmJSLink.cpp index 46e87e0841b1..977ab27b46d2 100644 --- a/js/src/ion/AsmJSLink.cpp +++ b/js/src/ion/AsmJSLink.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSModule.h b/js/src/ion/AsmJSModule.h index ae5d1e89a5de..72bf651c5c6a 100644 --- a/js/src/ion/AsmJSModule.h +++ b/js/src/ion/AsmJSModule.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/AsmJSSignalHandlers.cpp b/js/src/ion/AsmJSSignalHandlers.cpp index 0fa3af4adbc2..4e477392ea1d 100644 --- a/js/src/ion/AsmJSSignalHandlers.cpp +++ b/js/src/ion/AsmJSSignalHandlers.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.cpp b/js/src/ion/BacktrackingAllocator.cpp index 491b49a3bd2f..e42befd3ade5 100644 --- a/js/src/ion/BacktrackingAllocator.cpp +++ b/js/src/ion/BacktrackingAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.h b/js/src/ion/BacktrackingAllocator.h index ccf0a2e611fb..51b8ff62ce4e 100644 --- a/js/src/ion/BacktrackingAllocator.h +++ b/js/src/ion/BacktrackingAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Bailouts.cpp b/js/src/ion/Bailouts.cpp index 2cffb267d201..aa4f2d14a458 100644 --- a/js/src/ion/Bailouts.cpp +++ b/js/src/ion/Bailouts.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Bailouts.h b/js/src/ion/Bailouts.h index 8694db28b92f..d9d514d9e102 100644 --- a/js/src/ion/Bailouts.h +++ b/js/src/ion/Bailouts.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineBailouts.cpp b/js/src/ion/BaselineBailouts.cpp index 75e2573e594f..53b7628f2f15 100644 --- a/js/src/ion/BaselineBailouts.cpp +++ b/js/src/ion/BaselineBailouts.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineCompiler.cpp b/js/src/ion/BaselineCompiler.cpp index c50b0d0b11b7..15f392397a97 100644 --- a/js/src/ion/BaselineCompiler.cpp +++ b/js/src/ion/BaselineCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineCompiler.h b/js/src/ion/BaselineCompiler.h index 7e7fe1d4b6da..3c72e32a66c5 100644 --- a/js/src/ion/BaselineCompiler.h +++ b/js/src/ion/BaselineCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame-inl.h b/js/src/ion/BaselineFrame-inl.h index 37f82ba5019e..cf3226aa5360 100644 --- a/js/src/ion/BaselineFrame-inl.h +++ b/js/src/ion/BaselineFrame-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame.cpp b/js/src/ion/BaselineFrame.cpp index e9d317ea54f4..299ef4af564c 100644 --- a/js/src/ion/BaselineFrame.cpp +++ b/js/src/ion/BaselineFrame.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrame.h b/js/src/ion/BaselineFrame.h index 476c66978fae..7d9642b0d12a 100644 --- a/js/src/ion/BaselineFrame.h +++ b/js/src/ion/BaselineFrame.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.cpp b/js/src/ion/BaselineFrameInfo.cpp index 39e1c4556286..17dcd2765c9b 100644 --- a/js/src/ion/BaselineFrameInfo.cpp +++ b/js/src/ion/BaselineFrameInfo.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.h b/js/src/ion/BaselineFrameInfo.h index d02ecbc6af0b..eae34e232184 100644 --- a/js/src/ion/BaselineFrameInfo.h +++ b/js/src/ion/BaselineFrameInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineHelpers.h b/js/src/ion/BaselineHelpers.h index 1502dba2a617..1c2bd3dc0061 100644 --- a/js/src/ion/BaselineHelpers.h +++ b/js/src/ion/BaselineHelpers.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineIC.cpp b/js/src/ion/BaselineIC.cpp index 6c3494bbb287..4403911b76a8 100644 --- a/js/src/ion/BaselineIC.cpp +++ b/js/src/ion/BaselineIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineIC.h b/js/src/ion/BaselineIC.h index f9c08e770f11..461628faf47e 100644 --- a/js/src/ion/BaselineIC.h +++ b/js/src/ion/BaselineIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineInspector.cpp b/js/src/ion/BaselineInspector.cpp index 26a6273f3dd5..b8490f92d4f1 100644 --- a/js/src/ion/BaselineInspector.cpp +++ b/js/src/ion/BaselineInspector.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineInspector.h b/js/src/ion/BaselineInspector.h index 5fb59f6ed015..cef840718a53 100644 --- a/js/src/ion/BaselineInspector.h +++ b/js/src/ion/BaselineInspector.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineJIT.cpp b/js/src/ion/BaselineJIT.cpp index 3dfce7916f15..8061224465aa 100644 --- a/js/src/ion/BaselineJIT.cpp +++ b/js/src/ion/BaselineJIT.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineJIT.h b/js/src/ion/BaselineJIT.h index 2c9e914c5042..33244f8ca2ed 100644 --- a/js/src/ion/BaselineJIT.h +++ b/js/src/ion/BaselineJIT.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BaselineRegisters.h b/js/src/ion/BaselineRegisters.h index c9d0d4136a8e..26365375481d 100644 --- a/js/src/ion/BaselineRegisters.h +++ b/js/src/ion/BaselineRegisters.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BitSet.cpp b/js/src/ion/BitSet.cpp index 1b3ec5863dc2..bbe12ce97f6c 100644 --- a/js/src/ion/BitSet.cpp +++ b/js/src/ion/BitSet.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/BitSet.h b/js/src/ion/BitSet.h index 03903c74a3ac..f9b9dc38dd3b 100644 --- a/js/src/ion/BitSet.h +++ b/js/src/ion/BitSet.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/C1Spewer.cpp b/js/src/ion/C1Spewer.cpp index 7f17319efa40..8934dc09d28e 100644 --- a/js/src/ion/C1Spewer.cpp +++ b/js/src/ion/C1Spewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/C1Spewer.h b/js/src/ion/C1Spewer.h index fe05132a9407..66248f3528ba 100644 --- a/js/src/ion/C1Spewer.h +++ b/js/src/ion/C1Spewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 3b827b76d31a..5106493af101 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index 348fb3ce14f5..4130a3611ebc 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompactBuffer.h b/js/src/ion/CompactBuffer.h index c3ca501190d5..fb29b780e3d8 100644 --- a/js/src/ion/CompactBuffer.h +++ b/js/src/ion/CompactBuffer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompileInfo-inl.h b/js/src/ion/CompileInfo-inl.h index 666da9777c4d..85971562381a 100644 --- a/js/src/ion/CompileInfo-inl.h +++ b/js/src/ion/CompileInfo-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompileInfo.h b/js/src/ion/CompileInfo.h index 237e9e4e1a4b..2288b20460f6 100644 --- a/js/src/ion/CompileInfo.h +++ b/js/src/ion/CompileInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/CompilerRoot.h b/js/src/ion/CompilerRoot.h index 81e9386ac417..141924b7094a 100644 --- a/js/src/ion/CompilerRoot.h +++ b/js/src/ion/CompilerRoot.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.cpp b/js/src/ion/EdgeCaseAnalysis.cpp index 18a7547581e9..38cb200838b4 100644 --- a/js/src/ion/EdgeCaseAnalysis.cpp +++ b/js/src/ion/EdgeCaseAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.h b/js/src/ion/EdgeCaseAnalysis.h index bb744dd40eab..a322257996bf 100644 --- a/js/src/ion/EdgeCaseAnalysis.h +++ b/js/src/ion/EdgeCaseAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.cpp b/js/src/ion/EffectiveAddressAnalysis.cpp index 76fa88a36e06..e936a6ebfe8d 100644 --- a/js/src/ion/EffectiveAddressAnalysis.cpp +++ b/js/src/ion/EffectiveAddressAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.h b/js/src/ion/EffectiveAddressAnalysis.h index e7f3dc9f2e71..a86e871290b1 100644 --- a/js/src/ion/EffectiveAddressAnalysis.h +++ b/js/src/ion/EffectiveAddressAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ExecutionModeInlines.h b/js/src/ion/ExecutionModeInlines.h index 1f86e4a8d294..8a4c2d758ebd 100644 --- a/js/src/ion/ExecutionModeInlines.h +++ b/js/src/ion/ExecutionModeInlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/FixedArityList.h b/js/src/ion/FixedArityList.h index d737ad4e1d02..4cf6ccf51827 100644 --- a/js/src/ion/FixedArityList.h +++ b/js/src/ion/FixedArityList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/FixedList.h b/js/src/ion/FixedList.h index 9213d0744955..2062ad8d64e3 100644 --- a/js/src/ion/FixedList.h +++ b/js/src/ion/FixedList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/InlineList.h b/js/src/ion/InlineList.h index 7bc21801de30..00897619b123 100644 --- a/js/src/ion/InlineList.h +++ b/js/src/ion/InlineList.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Ion.cpp b/js/src/ion/Ion.cpp index 3298897730b4..9a227fa73aeb 100644 --- a/js/src/ion/Ion.cpp +++ b/js/src/ion/Ion.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Ion.h b/js/src/ion/Ion.h index c9e4f0cd8fa2..d11485db6fe6 100644 --- a/js/src/ion/Ion.h +++ b/js/src/ion/Ion.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAllocPolicy.h b/js/src/ion/IonAllocPolicy.h index 8c828f71528f..f604a5005b49 100644 --- a/js/src/ion/IonAllocPolicy.h +++ b/js/src/ion/IonAllocPolicy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAnalysis.cpp b/js/src/ion/IonAnalysis.cpp index fc13e62faec3..58a070c42954 100644 --- a/js/src/ion/IonAnalysis.cpp +++ b/js/src/ion/IonAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonAnalysis.h b/js/src/ion/IonAnalysis.h index 42b02bb3f961..0f311da802df 100644 --- a/js/src/ion/IonAnalysis.h +++ b/js/src/ion/IonAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 3fd3b2cea121..cf372aa04ddb 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 4b1422e29608..8f8f2a486734 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index 6cb2874769ef..e5983da59c2d 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCaches.h b/js/src/ion/IonCaches.h index ec61d6a13604..00c05567ab47 100644 --- a/js/src/ion/IonCaches.h +++ b/js/src/ion/IonCaches.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCode.h b/js/src/ion/IonCode.h index 0a4aeb1f34b9..ec4a86d60e9c 100644 --- a/js/src/ion/IonCode.h +++ b/js/src/ion/IonCode.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonCompartment.h b/js/src/ion/IonCompartment.h index 5a5681f110f6..472cf55fba5d 100644 --- a/js/src/ion/IonCompartment.h +++ b/js/src/ion/IonCompartment.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrameIterator-inl.h b/js/src/ion/IonFrameIterator-inl.h index 5b1094bda4d7..2740d9432b5b 100644 --- a/js/src/ion/IonFrameIterator-inl.h +++ b/js/src/ion/IonFrameIterator-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrameIterator.h b/js/src/ion/IonFrameIterator.h index e85656fb4265..fb0a339ae79d 100644 --- a/js/src/ion/IonFrameIterator.h +++ b/js/src/ion/IonFrameIterator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames-inl.h b/js/src/ion/IonFrames-inl.h index 1267a565856f..a1fa889785c8 100644 --- a/js/src/ion/IonFrames-inl.h +++ b/js/src/ion/IonFrames-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index 880a6396905d..4f24db565cad 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonFrames.h b/js/src/ion/IonFrames.h index 6872c96a3422..5e598e244b27 100644 --- a/js/src/ion/IonFrames.h +++ b/js/src/ion/IonFrames.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonInstrumentation.h b/js/src/ion/IonInstrumentation.h index cb8ceae9119a..62d9ea1f6951 100644 --- a/js/src/ion/IonInstrumentation.h +++ b/js/src/ion/IonInstrumentation.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonLinker.h b/js/src/ion/IonLinker.h index 979385254362..b818368ccbaa 100644 --- a/js/src/ion/IonLinker.h +++ b/js/src/ion/IonLinker.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index 808218f3df8b..bcf85af67d84 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index b08f08d277cc..9b4571354eb8 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonSpewer.cpp b/js/src/ion/IonSpewer.cpp index 002a36193d12..c911955b57cf 100644 --- a/js/src/ion/IonSpewer.cpp +++ b/js/src/ion/IonSpewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonSpewer.h b/js/src/ion/IonSpewer.h index 19696dc286e6..4f6ad0eaa776 100644 --- a/js/src/ion/IonSpewer.h +++ b/js/src/ion/IonSpewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/IonTypes.h b/js/src/ion/IonTypes.h index b033e28f18c3..6e60a39c6159 100644 --- a/js/src/ion/IonTypes.h +++ b/js/src/ion/IonTypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/JSONSpewer.cpp b/js/src/ion/JSONSpewer.cpp index bc3a4c363984..466941ddd7a5 100644 --- a/js/src/ion/JSONSpewer.cpp +++ b/js/src/ion/JSONSpewer.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/JSONSpewer.h b/js/src/ion/JSONSpewer.h index 8726b48fcd26..556faa9081bb 100644 --- a/js/src/ion/JSONSpewer.h +++ b/js/src/ion/JSONSpewer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LICM.cpp b/js/src/ion/LICM.cpp index d40970a65994..d93f1c22f248 100644 --- a/js/src/ion/LICM.cpp +++ b/js/src/ion/LICM.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LICM.h b/js/src/ion/LICM.h index ab40b2b6df91..e2f53fafdc65 100644 --- a/js/src/ion/LICM.h +++ b/js/src/ion/LICM.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index f2ddb2d08264..5d6ef835e6bf 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR-inl.h b/js/src/ion/LIR-inl.h index af24d9769146..de4d08ede26c 100644 --- a/js/src/ion/LIR-inl.h +++ b/js/src/ion/LIR-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR.cpp b/js/src/ion/LIR.cpp index 7c70b2a51cda..d0f96070f6c0 100644 --- a/js/src/ion/LIR.cpp +++ b/js/src/ion/LIR.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LIR.h b/js/src/ion/LIR.h index 096cbd374ce0..dcbc44e47b4c 100644 --- a/js/src/ion/LIR.h +++ b/js/src/ion/LIR.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index 227aeac052a4..b7bf009b266c 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LinearScan.cpp b/js/src/ion/LinearScan.cpp index b073db985a1e..8318716ca2d0 100644 --- a/js/src/ion/LinearScan.cpp +++ b/js/src/ion/LinearScan.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LinearScan.h b/js/src/ion/LinearScan.h index 3cf8d80740e3..4dcd24a207ca 100644 --- a/js/src/ion/LinearScan.h +++ b/js/src/ion/LinearScan.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.cpp b/js/src/ion/LiveRangeAllocator.cpp index b35e731eb3ab..154c2767204b 100644 --- a/js/src/ion/LiveRangeAllocator.cpp +++ b/js/src/ion/LiveRangeAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.h b/js/src/ion/LiveRangeAllocator.h index d48aece848d9..3c81bc90903a 100644 --- a/js/src/ion/LiveRangeAllocator.h +++ b/js/src/ion/LiveRangeAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 5a3bbd5c0823..75de254f6577 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index 4d39160fb155..cc8cd249df8b 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MCallOptimize.cpp b/js/src/ion/MCallOptimize.cpp index d05b5f5f1378..98e986259127 100644 --- a/js/src/ion/MCallOptimize.cpp +++ b/js/src/ion/MCallOptimize.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 8eb9b1165495..7b94d6c7419f 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 0e1f6ec87acf..faa0d1ed38fa 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGenerator.h b/js/src/ion/MIRGenerator.h index 39cbba47602c..a734cbdef71b 100644 --- a/js/src/ion/MIRGenerator.h +++ b/js/src/ion/MIRGenerator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGraph.cpp b/js/src/ion/MIRGraph.cpp index 3a02a3394f4d..addbda66aecd 100644 --- a/js/src/ion/MIRGraph.cpp +++ b/js/src/ion/MIRGraph.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MIRGraph.h b/js/src/ion/MIRGraph.h index 21f77942f95d..f5b62e11623e 100644 --- a/js/src/ion/MIRGraph.h +++ b/js/src/ion/MIRGraph.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index c27a8b14251e..a5123a627ccd 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveEmitter.h b/js/src/ion/MoveEmitter.h index 9a88bd12703d..095b5d9e6da6 100644 --- a/js/src/ion/MoveEmitter.h +++ b/js/src/ion/MoveEmitter.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveResolver.cpp b/js/src/ion/MoveResolver.cpp index 1d4c76b7f681..a2b661c3130e 100644 --- a/js/src/ion/MoveResolver.cpp +++ b/js/src/ion/MoveResolver.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/MoveResolver.h b/js/src/ion/MoveResolver.h index 0f816e15be54..8a20e1021a09 100644 --- a/js/src/ion/MoveResolver.h +++ b/js/src/ion/MoveResolver.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 3d92c14267fe..364df7b0902d 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.h b/js/src/ion/ParallelArrayAnalysis.h index 93e4ce36de2d..2c2eba228b37 100644 --- a/js/src/ion/ParallelArrayAnalysis.h +++ b/js/src/ion/ParallelArrayAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelFunctions.cpp b/js/src/ion/ParallelFunctions.cpp index 1b821503b328..e0c7ca406778 100644 --- a/js/src/ion/ParallelFunctions.cpp +++ b/js/src/ion/ParallelFunctions.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ParallelFunctions.h b/js/src/ion/ParallelFunctions.h index b74e5cfa7aee..1fe9fcc333ff 100644 --- a/js/src/ion/ParallelFunctions.h +++ b/js/src/ion/ParallelFunctions.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/PcScriptCache-inl.h b/js/src/ion/PcScriptCache-inl.h index 9a852d0ed453..fdf5acfd19ab 100644 --- a/js/src/ion/PcScriptCache-inl.h +++ b/js/src/ion/PcScriptCache-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/PcScriptCache.h b/js/src/ion/PcScriptCache.h index 4d8eca0cbe31..9f9a3d79c87c 100644 --- a/js/src/ion/PcScriptCache.h +++ b/js/src/ion/PcScriptCache.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RangeAnalysis.cpp b/js/src/ion/RangeAnalysis.cpp index 918dc33bf90b..229b3a552b8d 100644 --- a/js/src/ion/RangeAnalysis.cpp +++ b/js/src/ion/RangeAnalysis.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RangeAnalysis.h b/js/src/ion/RangeAnalysis.h index 830d3a3167de..0ffdc4752288 100644 --- a/js/src/ion/RangeAnalysis.h +++ b/js/src/ion/RangeAnalysis.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterAllocator.cpp b/js/src/ion/RegisterAllocator.cpp index f9986453416f..335eae5265a8 100644 --- a/js/src/ion/RegisterAllocator.cpp +++ b/js/src/ion/RegisterAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterAllocator.h b/js/src/ion/RegisterAllocator.h index d98704d38d03..fe76b3504ee9 100644 --- a/js/src/ion/RegisterAllocator.h +++ b/js/src/ion/RegisterAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/RegisterSets.h b/js/src/ion/RegisterSets.h index b1ec16bcd735..9679f9f734df 100644 --- a/js/src/ion/RegisterSets.h +++ b/js/src/ion/RegisterSets.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Registers.h b/js/src/ion/Registers.h index e942d2e0474e..988d544f279c 100644 --- a/js/src/ion/Registers.h +++ b/js/src/ion/Registers.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Safepoints.cpp b/js/src/ion/Safepoints.cpp index 180b929d0301..8af0573240d7 100644 --- a/js/src/ion/Safepoints.cpp +++ b/js/src/ion/Safepoints.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Safepoints.h b/js/src/ion/Safepoints.h index 6e81e75e6442..4ae9e14bbfaf 100644 --- a/js/src/ion/Safepoints.h +++ b/js/src/ion/Safepoints.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/SnapshotReader.h b/js/src/ion/SnapshotReader.h index 61c930852a6a..497763da8e8c 100644 --- a/js/src/ion/SnapshotReader.h +++ b/js/src/ion/SnapshotReader.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/SnapshotWriter.h b/js/src/ion/SnapshotWriter.h index 9044da1dc405..9c90e6a7a757 100644 --- a/js/src/ion/SnapshotWriter.h +++ b/js/src/ion/SnapshotWriter.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/Snapshots.cpp b/js/src/ion/Snapshots.cpp index bc761faf75f8..3605148521c0 100644 --- a/js/src/ion/Snapshots.cpp +++ b/js/src/ion/Snapshots.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StackSlotAllocator.h b/js/src/ion/StackSlotAllocator.h index d08c63797170..e0b978324b9e 100644 --- a/js/src/ion/StackSlotAllocator.h +++ b/js/src/ion/StackSlotAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StupidAllocator.cpp b/js/src/ion/StupidAllocator.cpp index c0646ac78f24..699194afc6ef 100644 --- a/js/src/ion/StupidAllocator.cpp +++ b/js/src/ion/StupidAllocator.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/StupidAllocator.h b/js/src/ion/StupidAllocator.h index 77534641f7ba..5c1279ddeaa4 100644 --- a/js/src/ion/StupidAllocator.h +++ b/js/src/ion/StupidAllocator.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index 35aa88e63e26..6ad76ecaa892 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypeOracle.h b/js/src/ion/TypeOracle.h index bf13fdd6b8bf..d75a1cb77f32 100644 --- a/js/src/ion/TypeOracle.h +++ b/js/src/ion/TypeOracle.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index 2d4f90a542d4..ce60a3528c03 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 310dd73e99ec..3f209e53c857 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.cpp b/js/src/ion/UnreachableCodeElimination.cpp index 75367fd313c0..50a27363928f 100644 --- a/js/src/ion/UnreachableCodeElimination.cpp +++ b/js/src/ion/UnreachableCodeElimination.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.h b/js/src/ion/UnreachableCodeElimination.h index 99a61eed7b7b..9999afb47443 100644 --- a/js/src/ion/UnreachableCodeElimination.h +++ b/js/src/ion/UnreachableCodeElimination.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index 15b33c5190d4..c9f2f8dda262 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index 7439a9b56276..c7477ddd2b0f 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ValueNumbering.cpp b/js/src/ion/ValueNumbering.cpp index 597fb89170f4..a8b83b5dc950 100644 --- a/js/src/ion/ValueNumbering.cpp +++ b/js/src/ion/ValueNumbering.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/ValueNumbering.h b/js/src/ion/ValueNumbering.h index 24db39cde1a1..edb1f40558f2 100644 --- a/js/src/ion/ValueNumbering.h +++ b/js/src/ion/ValueNumbering.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Architecture-arm.cpp b/js/src/ion/arm/Architecture-arm.cpp index 567715f688d1..7fc302930308 100644 --- a/js/src/ion/arm/Architecture-arm.cpp +++ b/js/src/ion/arm/Architecture-arm.cpp @@ -1,9 +1,9 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + #define HWCAP_ARMv7 (1 << 31) #include diff --git a/js/src/ion/arm/Architecture-arm.h b/js/src/ion/arm/Architecture-arm.h index 3257c31ff1c0..0471efb88357 100644 --- a/js/src/ion/arm/Architecture-arm.h +++ b/js/src/ion/arm/Architecture-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.cpp b/js/src/ion/arm/Assembler-arm.cpp index a2c178ee7f8a..820f99c9b615 100644 --- a/js/src/ion/arm/Assembler-arm.cpp +++ b/js/src/ion/arm/Assembler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.h b/js/src/ion/arm/Assembler-arm.h index 620270bcf3f2..80f1b7737255 100644 --- a/js/src/ion/arm/Assembler-arm.h +++ b/js/src/ion/arm/Assembler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Bailouts-arm.cpp b/js/src/ion/arm/Bailouts-arm.cpp index bb51f8f3fbc6..21968bde4b1d 100644 --- a/js/src/ion/arm/Bailouts-arm.cpp +++ b/js/src/ion/arm/Bailouts-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.cpp b/js/src/ion/arm/BaselineCompiler-arm.cpp index 53ddd75857b0..7ed88a3f246a 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.cpp +++ b/js/src/ion/arm/BaselineCompiler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.h b/js/src/ion/arm/BaselineCompiler-arm.h index baaaff529d02..5485204398d3 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.h +++ b/js/src/ion/arm/BaselineCompiler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineHelpers-arm.h b/js/src/ion/arm/BaselineHelpers-arm.h index 6dd5795c0f39..6d5611eb5437 100644 --- a/js/src/ion/arm/BaselineHelpers-arm.h +++ b/js/src/ion/arm/BaselineHelpers-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineIC-arm.cpp b/js/src/ion/arm/BaselineIC-arm.cpp index 079b5b33d15c..25a1b40c0e5e 100644 --- a/js/src/ion/arm/BaselineIC-arm.cpp +++ b/js/src/ion/arm/BaselineIC-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/BaselineRegisters-arm.h b/js/src/ion/arm/BaselineRegisters-arm.h index 4ba983e6e7d5..53c908850855 100644 --- a/js/src/ion/arm/BaselineRegisters-arm.h +++ b/js/src/ion/arm/BaselineRegisters-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.cpp b/js/src/ion/arm/CodeGenerator-arm.cpp index 4acfde24e38c..b28d73f5f080 100644 --- a/js/src/ion/arm/CodeGenerator-arm.cpp +++ b/js/src/ion/arm/CodeGenerator-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.h b/js/src/ion/arm/CodeGenerator-arm.h index a0e421d57ac0..4c9940ade643 100644 --- a/js/src/ion/arm/CodeGenerator-arm.h +++ b/js/src/ion/arm/CodeGenerator-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.cpp b/js/src/ion/arm/IonFrames-arm.cpp index 0b90bb2c48fb..fe5bd1c65b69 100644 --- a/js/src/ion/arm/IonFrames-arm.cpp +++ b/js/src/ion/arm/IonFrames-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.h b/js/src/ion/arm/IonFrames-arm.h index f5b38c324f4a..c9d5268c6af5 100644 --- a/js/src/ion/arm/IonFrames-arm.h +++ b/js/src/ion/arm/IonFrames-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/LIR-arm.h b/js/src/ion/arm/LIR-arm.h index 7e0997c14bb3..f9db2e9b6e05 100644 --- a/js/src/ion/arm/LIR-arm.h +++ b/js/src/ion/arm/LIR-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/LOpcodes-arm.h b/js/src/ion/arm/LOpcodes-arm.h index 7745129aa645..1f53b9baabc8 100644 --- a/js/src/ion/arm/LOpcodes-arm.h +++ b/js/src/ion/arm/LOpcodes-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.cpp b/js/src/ion/arm/Lowering-arm.cpp index 867f69bbffd3..f5aecb3ed4ef 100644 --- a/js/src/ion/arm/Lowering-arm.cpp +++ b/js/src/ion/arm/Lowering-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.h b/js/src/ion/arm/Lowering-arm.h index 4436f2cd1cd3..0472fa1489e5 100644 --- a/js/src/ion/arm/Lowering-arm.h +++ b/js/src/ion/arm/Lowering-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.cpp b/js/src/ion/arm/MacroAssembler-arm.cpp index 561a0b358802..0076f8d27058 100644 --- a/js/src/ion/arm/MacroAssembler-arm.cpp +++ b/js/src/ion/arm/MacroAssembler-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.h b/js/src/ion/arm/MacroAssembler-arm.h index a383576e8331..18b258b750cc 100644 --- a/js/src/ion/arm/MacroAssembler-arm.h +++ b/js/src/ion/arm/MacroAssembler-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.cpp b/js/src/ion/arm/MoveEmitter-arm.cpp index b6f1b409e900..289ecc795d80 100644 --- a/js/src/ion/arm/MoveEmitter-arm.cpp +++ b/js/src/ion/arm/MoveEmitter-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.h b/js/src/ion/arm/MoveEmitter-arm.h index 783cf1c966e1..8d63c095c83d 100644 --- a/js/src/ion/arm/MoveEmitter-arm.h +++ b/js/src/ion/arm/MoveEmitter-arm.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/arm/Trampoline-arm.cpp b/js/src/ion/arm/Trampoline-arm.cpp index a8dd69f463b4..3f313235f059 100644 --- a/js/src/ion/arm/Trampoline-arm.cpp +++ b/js/src/ion/arm/Trampoline-arm.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-shared.h b/js/src/ion/shared/Assembler-shared.h index eb6371fb2b68..dec722212e45 100644 --- a/js/src/ion/shared/Assembler-shared.h +++ b/js/src/ion/shared/Assembler-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.cpp b/js/src/ion/shared/Assembler-x86-shared.cpp index 689a5a6876d3..09accd9c7bb8 100644 --- a/js/src/ion/shared/Assembler-x86-shared.cpp +++ b/js/src/ion/shared/Assembler-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.h b/js/src/ion/shared/Assembler-x86-shared.h index 41cb8e0bc5da..66f49ef47131 100644 --- a/js/src/ion/shared/Assembler-x86-shared.h +++ b/js/src/ion/shared/Assembler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.cpp b/js/src/ion/shared/BaselineCompiler-shared.cpp index 7b8bbfe05fc9..47831a5c82cc 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.h b/js/src/ion/shared/BaselineCompiler-shared.h index a0baa943e584..2a23e44ed56b 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.h +++ b/js/src/ion/shared/BaselineCompiler-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp index 9c23197aafe1..9c3db57f63a2 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.h b/js/src/ion/shared/BaselineCompiler-x86-shared.h index 56d1b2de020b..20ecdec89408 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.h +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/BaselineIC-x86-shared.cpp b/js/src/ion/shared/BaselineIC-x86-shared.cpp index cc5bf7e616d4..a671664ad752 100644 --- a/js/src/ion/shared/BaselineIC-x86-shared.cpp +++ b/js/src/ion/shared/BaselineIC-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared-inl.h b/js/src/ion/shared/CodeGenerator-shared-inl.h index 7bf3b611417f..67f4aeee310a 100644 --- a/js/src/ion/shared/CodeGenerator-shared-inl.h +++ b/js/src/ion/shared/CodeGenerator-shared-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.cpp b/js/src/ion/shared/CodeGenerator-shared.cpp index 568e0d684500..3017b431e153 100644 --- a/js/src/ion/shared/CodeGenerator-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.h b/js/src/ion/shared/CodeGenerator-shared.h index 1695dc5c45cc..a99934e46968 100644 --- a/js/src/ion/shared/CodeGenerator-shared.h +++ b/js/src/ion/shared/CodeGenerator-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.cpp b/js/src/ion/shared/CodeGenerator-x86-shared.cpp index eaa4ac482f2e..80a6adb35e5f 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.h b/js/src/ion/shared/CodeGenerator-x86-shared.h index 93305081b7b5..547ddbd588de 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.h +++ b/js/src/ion/shared/CodeGenerator-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBuffer.h b/js/src/ion/shared/IonAssemblerBuffer.h index 47653f94955a..59c51eacc751 100644 --- a/js/src/ion/shared/IonAssemblerBuffer.h +++ b/js/src/ion/shared/IonAssemblerBuffer.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h index 8b9b1055e2f4..8dcb2f3eb249 100644 --- a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h +++ b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonFrames-shared.h b/js/src/ion/shared/IonFrames-shared.h index 794da5226709..2b6f12f1da78 100644 --- a/js/src/ion/shared/IonFrames-shared.h +++ b/js/src/ion/shared/IonFrames-shared.h @@ -1,43 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Communicator client code, released - * March 31, 1998. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Anderson - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + #ifndef jsion_ionframes_shared_h__ #define jsion_ionframes_shared_h__ diff --git a/js/src/ion/shared/IonFrames-x86-shared.cpp b/js/src/ion/shared/IonFrames-x86-shared.cpp index 55ca61030a89..fe9dc1f19531 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.cpp +++ b/js/src/ion/shared/IonFrames-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/IonFrames-x86-shared.h b/js/src/ion/shared/IonFrames-x86-shared.h index 04f055884d71..9100f3b38413 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.h +++ b/js/src/ion/shared/IonFrames-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/LIR-x86-shared.h b/js/src/ion/shared/LIR-x86-shared.h index 4cec8fbed08a..5d12830436c9 100644 --- a/js/src/ion/shared/LIR-x86-shared.h +++ b/js/src/ion/shared/LIR-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared-inl.h b/js/src/ion/shared/Lowering-shared-inl.h index a67981a03684..6139c7ea0647 100644 --- a/js/src/ion/shared/Lowering-shared-inl.h +++ b/js/src/ion/shared/Lowering-shared-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.cpp b/js/src/ion/shared/Lowering-shared.cpp index 577196d1aa65..7ab7b2e314f9 100644 --- a/js/src/ion/shared/Lowering-shared.cpp +++ b/js/src/ion/shared/Lowering-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.h b/js/src/ion/shared/Lowering-shared.h index 5f8b34c24237..0808833a0284 100644 --- a/js/src/ion/shared/Lowering-shared.h +++ b/js/src/ion/shared/Lowering-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.cpp b/js/src/ion/shared/Lowering-x86-shared.cpp index 95496d77e916..f2ed21d6b7fb 100644 --- a/js/src/ion/shared/Lowering-x86-shared.cpp +++ b/js/src/ion/shared/Lowering-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.h b/js/src/ion/shared/Lowering-x86-shared.h index 797f552baeb2..99a3c6cf3c50 100644 --- a/js/src/ion/shared/Lowering-x86-shared.h +++ b/js/src/ion/shared/Lowering-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MacroAssembler-x86-shared.h b/js/src/ion/shared/MacroAssembler-x86-shared.h index 644e302b3f5a..f28f229dd7b8 100644 --- a/js/src/ion/shared/MacroAssembler-x86-shared.h +++ b/js/src/ion/shared/MacroAssembler-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.cpp b/js/src/ion/shared/MoveEmitter-x86-shared.cpp index 99e50bef2134..8c8c6290923d 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.cpp +++ b/js/src/ion/shared/MoveEmitter-x86-shared.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.h b/js/src/ion/shared/MoveEmitter-x86-shared.h index bbc2a5ef1fe9..915dd13b5091 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.h +++ b/js/src/ion/shared/MoveEmitter-x86-shared.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Architecture-x64.h b/js/src/ion/x64/Architecture-x64.h index 707fb2a43c04..3a832c95df18 100644 --- a/js/src/ion/x64/Architecture-x64.h +++ b/js/src/ion/x64/Architecture-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.cpp b/js/src/ion/x64/Assembler-x64.cpp index bdb88083fb02..bdcbe791d2e1 100644 --- a/js/src/ion/x64/Assembler-x64.cpp +++ b/js/src/ion/x64/Assembler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.h b/js/src/ion/x64/Assembler-x64.h index 680d24c4f741..bf4a95980831 100644 --- a/js/src/ion/x64/Assembler-x64.h +++ b/js/src/ion/x64/Assembler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Bailouts-x64.cpp b/js/src/ion/x64/Bailouts-x64.cpp index 8062c8814f3a..4f9e265c62f8 100644 --- a/js/src/ion/x64/Bailouts-x64.cpp +++ b/js/src/ion/x64/Bailouts-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.cpp b/js/src/ion/x64/BaselineCompiler-x64.cpp index 45c9bf09c30b..e0bce0af7d51 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.cpp +++ b/js/src/ion/x64/BaselineCompiler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.h b/js/src/ion/x64/BaselineCompiler-x64.h index 1bfb02ba220b..ddac8c9c4133 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.h +++ b/js/src/ion/x64/BaselineCompiler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineHelpers-x64.h b/js/src/ion/x64/BaselineHelpers-x64.h index 939d8d9f5e9a..0e5c802f13ea 100644 --- a/js/src/ion/x64/BaselineHelpers-x64.h +++ b/js/src/ion/x64/BaselineHelpers-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineIC-x64.cpp b/js/src/ion/x64/BaselineIC-x64.cpp index 57d71a05a150..7359d26eb661 100644 --- a/js/src/ion/x64/BaselineIC-x64.cpp +++ b/js/src/ion/x64/BaselineIC-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/BaselineRegisters-x64.h b/js/src/ion/x64/BaselineRegisters-x64.h index f3b9d69d187c..72a64a55bb1f 100644 --- a/js/src/ion/x64/BaselineRegisters-x64.h +++ b/js/src/ion/x64/BaselineRegisters-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.cpp b/js/src/ion/x64/CodeGenerator-x64.cpp index b7d720810de1..e94fe12fdb71 100644 --- a/js/src/ion/x64/CodeGenerator-x64.cpp +++ b/js/src/ion/x64/CodeGenerator-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.h b/js/src/ion/x64/CodeGenerator-x64.h index 5360dc710413..35e103cd3254 100644 --- a/js/src/ion/x64/CodeGenerator-x64.h +++ b/js/src/ion/x64/CodeGenerator-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/LIR-x64.h b/js/src/ion/x64/LIR-x64.h index f1a8d03fe3a5..f5366d747f8d 100644 --- a/js/src/ion/x64/LIR-x64.h +++ b/js/src/ion/x64/LIR-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/LOpcodes-x64.h b/js/src/ion/x64/LOpcodes-x64.h index 8a276914ac25..fb479d48ce5a 100644 --- a/js/src/ion/x64/LOpcodes-x64.h +++ b/js/src/ion/x64/LOpcodes-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.cpp b/js/src/ion/x64/Lowering-x64.cpp index d8eda3c9430b..525d0ecabfb7 100644 --- a/js/src/ion/x64/Lowering-x64.cpp +++ b/js/src/ion/x64/Lowering-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.h b/js/src/ion/x64/Lowering-x64.h index f479e5d1d8b9..176041735618 100644 --- a/js/src/ion/x64/Lowering-x64.h +++ b/js/src/ion/x64/Lowering-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.cpp b/js/src/ion/x64/MacroAssembler-x64.cpp index daf6a8b23875..c91b2471c35e 100644 --- a/js/src/ion/x64/MacroAssembler-x64.cpp +++ b/js/src/ion/x64/MacroAssembler-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.h b/js/src/ion/x64/MacroAssembler-x64.h index 186943bf95a5..8672a2e8e730 100644 --- a/js/src/ion/x64/MacroAssembler-x64.h +++ b/js/src/ion/x64/MacroAssembler-x64.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x64/Trampoline-x64.cpp b/js/src/ion/x64/Trampoline-x64.cpp index a8e1f6f86067..fc8be268141b 100644 --- a/js/src/ion/x64/Trampoline-x64.cpp +++ b/js/src/ion/x64/Trampoline-x64.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Architecture-x86.h b/js/src/ion/x86/Architecture-x86.h index 4c32e49df5b3..61ffbdd3f787 100644 --- a/js/src/ion/x86/Architecture-x86.h +++ b/js/src/ion/x86/Architecture-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.cpp b/js/src/ion/x86/Assembler-x86.cpp index d9cf3d312c9a..e09285f8022c 100644 --- a/js/src/ion/x86/Assembler-x86.cpp +++ b/js/src/ion/x86/Assembler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.h b/js/src/ion/x86/Assembler-x86.h index 3f894a8868fb..3099f80a9b6d 100644 --- a/js/src/ion/x86/Assembler-x86.h +++ b/js/src/ion/x86/Assembler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Bailouts-x86.cpp b/js/src/ion/x86/Bailouts-x86.cpp index 72e3eab4081b..731ef2c7e3ad 100644 --- a/js/src/ion/x86/Bailouts-x86.cpp +++ b/js/src/ion/x86/Bailouts-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.cpp b/js/src/ion/x86/BaselineCompiler-x86.cpp index 4ae0b3c74d3d..618ac55080c5 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.cpp +++ b/js/src/ion/x86/BaselineCompiler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.h b/js/src/ion/x86/BaselineCompiler-x86.h index cd1af33574a7..dcc7eeabbfbf 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.h +++ b/js/src/ion/x86/BaselineCompiler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineHelpers-x86.h b/js/src/ion/x86/BaselineHelpers-x86.h index 6222189a46b5..30f7db30986e 100644 --- a/js/src/ion/x86/BaselineHelpers-x86.h +++ b/js/src/ion/x86/BaselineHelpers-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineIC-x86.cpp b/js/src/ion/x86/BaselineIC-x86.cpp index 56a5dd0bba66..01a0b54bfc49 100644 --- a/js/src/ion/x86/BaselineIC-x86.cpp +++ b/js/src/ion/x86/BaselineIC-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/BaselineRegisters-x86.h b/js/src/ion/x86/BaselineRegisters-x86.h index e8a88217be9f..b28bda46ea29 100644 --- a/js/src/ion/x86/BaselineRegisters-x86.h +++ b/js/src/ion/x86/BaselineRegisters-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.cpp b/js/src/ion/x86/CodeGenerator-x86.cpp index fd36974e9792..4884d5118e26 100644 --- a/js/src/ion/x86/CodeGenerator-x86.cpp +++ b/js/src/ion/x86/CodeGenerator-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.h b/js/src/ion/x86/CodeGenerator-x86.h index 9fdc4b6a1b05..c4a58322e4db 100644 --- a/js/src/ion/x86/CodeGenerator-x86.h +++ b/js/src/ion/x86/CodeGenerator-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/LIR-x86.h b/js/src/ion/x86/LIR-x86.h index b56ab4788770..a27412302000 100644 --- a/js/src/ion/x86/LIR-x86.h +++ b/js/src/ion/x86/LIR-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/LOpcodes-x86.h b/js/src/ion/x86/LOpcodes-x86.h index 7944813552d1..5b4b9f49e2ca 100644 --- a/js/src/ion/x86/LOpcodes-x86.h +++ b/js/src/ion/x86/LOpcodes-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.cpp b/js/src/ion/x86/Lowering-x86.cpp index debcc669fceb..9ef6d6d51c45 100644 --- a/js/src/ion/x86/Lowering-x86.cpp +++ b/js/src/ion/x86/Lowering-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.h b/js/src/ion/x86/Lowering-x86.h index db6347ea5af3..f283e8a41053 100644 --- a/js/src/ion/x86/Lowering-x86.h +++ b/js/src/ion/x86/Lowering-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.cpp b/js/src/ion/x86/MacroAssembler-x86.cpp index d620f46a0792..4183d3c9f372 100644 --- a/js/src/ion/x86/MacroAssembler-x86.cpp +++ b/js/src/ion/x86/MacroAssembler-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.h b/js/src/ion/x86/MacroAssembler-x86.h index 5912f3ec3537..18f95d8bb89d 100644 --- a/js/src/ion/x86/MacroAssembler-x86.h +++ b/js/src/ion/x86/MacroAssembler-x86.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/ion/x86/Trampoline-x86.cpp b/js/src/ion/x86/Trampoline-x86.cpp index c6345788f956..088d7678bc91 100644 --- a/js/src/ion/x86/Trampoline-x86.cpp +++ b/js/src/ion/x86/Trampoline-x86.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jit-test/tests/auto-regress/bug557946.js b/js/src/jit-test/tests/auto-regress/bug557946.js index 37cde015b269..8d1e95c53b17 100644 --- a/js/src/jit-test/tests/auto-regress/bug557946.js +++ b/js/src/jit-test/tests/auto-regress/bug557946.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-6f1a38b94754-linux // Flags: -j // -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ var x = 0; var y = 0; diff --git a/js/src/jit-test/tests/auto-regress/bug558618.js b/js/src/jit-test/tests/auto-regress/bug558618.js index 1618adb14b19..3fe1dfb257ec 100644 --- a/js/src/jit-test/tests/auto-regress/bug558618.js +++ b/js/src/jit-test/tests/auto-regress/bug558618.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-e69034463eeb-linux // Flags: -j // -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function f() { this.search = function(a, b, c) { arguments[3] = { } diff --git a/js/src/jit-test/tests/basic/bug535760.js b/js/src/jit-test/tests/basic/bug535760.js index e7e1fce14880..dd00b961522c 100644 --- a/js/src/jit-test/tests/basic/bug535760.js +++ b/js/src/jit-test/tests/basic/bug535760.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function foundit(items, n) { for (var i = 0; i < 10; i++) arguments[2](items, this); diff --git a/js/src/jit-test/tests/basic/bug541191-1.js b/js/src/jit-test/tests/basic/bug541191-1.js index 78f0caf10ad8..74ccae82976e 100644 --- a/js/src/jit-test/tests/basic/bug541191-1.js +++ b/js/src/jit-test/tests/basic/bug541191-1.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-2.js b/js/src/jit-test/tests/basic/bug541191-2.js index 1d232dc332a9..d270b7de1e2b 100644 --- a/js/src/jit-test/tests/basic/bug541191-2.js +++ b/js/src/jit-test/tests/basic/bug541191-2.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-3.js b/js/src/jit-test/tests/basic/bug541191-3.js index f4e01b9e1802..f447d49d1e2d 100644 --- a/js/src/jit-test/tests/basic/bug541191-3.js +++ b/js/src/jit-test/tests/basic/bug541191-3.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-4.js b/js/src/jit-test/tests/basic/bug541191-4.js index 0ecbb9177425..5d15bedb5c16 100644 --- a/js/src/jit-test/tests/basic/bug541191-4.js +++ b/js/src/jit-test/tests/basic/bug541191-4.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-5.js b/js/src/jit-test/tests/basic/bug541191-5.js index a2f9e5714f0c..f87217b2ccee 100644 --- a/js/src/jit-test/tests/basic/bug541191-5.js +++ b/js/src/jit-test/tests/basic/bug541191-5.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug592927.js b/js/src/jit-test/tests/basic/bug592927.js index dc74a5af9062..69f0bd237e46 100644 --- a/js/src/jit-test/tests/basic/bug592927.js +++ b/js/src/jit-test/tests/basic/bug592927.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x, y) { x(f); assertEq(y, "hello"); diff --git a/js/src/jit-test/tests/basic/bug602088.js b/js/src/jit-test/tests/basic/bug602088.js index 283b546acc3c..7e00d9b4c26d 100644 --- a/js/src/jit-test/tests/basic/bug602088.js +++ b/js/src/jit-test/tests/basic/bug602088.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ var p = Proxy.createFunction({}, function(x, y) { undefined.x(); }); print(new p(1, 2)); diff --git a/js/src/jit-test/tests/basic/bug606083.js b/js/src/jit-test/tests/basic/bug606083.js index fc2594b0ead3..d8049b94fa13 100644 --- a/js/src/jit-test/tests/basic/bug606083.js +++ b/js/src/jit-test/tests/basic/bug606083.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(L) { do { L: for (var i = 0; i < L; i++) { diff --git a/js/src/jit-test/tests/basic/bug616762.js b/js/src/jit-test/tests/basic/bug616762.js index 89b8ddd18ab0..02f5c953cf59 100644 --- a/js/src/jit-test/tests/basic/bug616762.js +++ b/js/src/jit-test/tests/basic/bug616762.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: document = { ready: function (x) { this.exec = x; diff --git a/js/src/jit-test/tests/basic/bug633409-1.js b/js/src/jit-test/tests/basic/bug633409-1.js index 1f65ccc8445f..20eaa6cda58e 100644 --- a/js/src/jit-test/tests/basic/bug633409-1.js +++ b/js/src/jit-test/tests/basic/bug633409-1.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: x = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }; for (i in x) diff --git a/js/src/jit-test/tests/basic/bug633409-2.js b/js/src/jit-test/tests/basic/bug633409-2.js index 349af466a2b3..d3c498d6d235 100644 --- a/js/src/jit-test/tests/basic/bug633409-2.js +++ b/js/src/jit-test/tests/basic/bug633409-2.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: var o1 = {p1: 1}; var o2 = {p1: 1, p2: 2}; diff --git a/js/src/jit-test/tests/ion/bug674664-3.js b/js/src/jit-test/tests/ion/bug674664-3.js index 7838e8738048..ce5a828d57c3 100644 --- a/js/src/jit-test/tests/ion/bug674664-3.js +++ b/js/src/jit-test/tests/ion/bug674664-3.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f0(p0) { var v0; do { diff --git a/js/src/jit-test/tests/ion/bug684362.js b/js/src/jit-test/tests/ion/bug684362.js index dd2f606fc653..9a83b053d711 100644 --- a/js/src/jit-test/tests/ion/bug684362.js +++ b/js/src/jit-test/tests/ion/bug684362.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var k = a; T: for (;;) { diff --git a/js/src/jit-test/tests/ion/bug747271.js b/js/src/jit-test/tests/ion/bug747271.js index 2a751177f5ad..176a44a5833a 100644 --- a/js/src/jit-test/tests/ion/bug747271.js +++ b/js/src/jit-test/tests/ion/bug747271.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function randomFloat () { // note that in fuzz-testing, this can used as the size of a buffer to allocate. // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big. diff --git a/js/src/jit-test/tests/ion/bug750588.js b/js/src/jit-test/tests/ion/bug750588.js index 63bab41d6190..6fa44d9cce63 100644 --- a/js/src/jit-test/tests/ion/bug750588.js +++ b/js/src/jit-test/tests/ion/bug750588.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function S() { var t = new Float32Array(1); diff --git a/js/src/jit-test/tests/ion/bug772901.js b/js/src/jit-test/tests/ion/bug772901.js index 13928ced8592..eb71f6afb8a2 100644 --- a/js/src/jit-test/tests/ion/bug772901.js +++ b/js/src/jit-test/tests/ion/bug772901.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { delete ((x)++); diff --git a/js/src/jit-test/tests/ion/testPos.js b/js/src/jit-test/tests/ion/testPos.js index 1d79df2fc636..197650e9b1fb 100644 --- a/js/src/jit-test/tests/ion/testPos.js +++ b/js/src/jit-test/tests/ion/testPos.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f_int(x) { return +x; } diff --git a/js/src/jit-test/tests/ion/testSubtract.js b/js/src/jit-test/tests/ion/testSubtract.js index ad75a03f2ef0..2b4389b2a8fe 100644 --- a/js/src/jit-test/tests/ion/testSubtract.js +++ b/js/src/jit-test/tests/ion/testSubtract.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f_int(x, y) { return x - y; } diff --git a/js/src/jit-test/tests/ion/testVAndBranch.js b/js/src/jit-test/tests/ion/testVAndBranch.js index e2ac44234227..c1fcc00e961f 100644 --- a/js/src/jit-test/tests/ion/testVAndBranch.js +++ b/js/src/jit-test/tests/ion/testVAndBranch.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { if (x) return true; diff --git a/js/src/jit-test/tests/ion/truncateToInt32.js b/js/src/jit-test/tests/ion/truncateToInt32.js index f48b7f16aef7..462b411ad1fe 100644 --- a/js/src/jit-test/tests/ion/truncateToInt32.js +++ b/js/src/jit-test/tests/ion/truncateToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function w(y) { diff --git a/js/src/jit-test/tests/ion/valueToInt32.js b/js/src/jit-test/tests/ion/valueToInt32.js index c879c2d75a10..65ad561eca4d 100644 --- a/js/src/jit-test/tests/ion/valueToInt32.js +++ b/js/src/jit-test/tests/ion/valueToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x, y) { // Confuse the type analysis to not know the type of x. diff --git a/js/src/jit-test/tests/jaeger/bug592973-1.js b/js/src/jit-test/tests/jaeger/bug592973-1.js index 470f84ee359b..d3bafac623db 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-1.js +++ b/js/src/jit-test/tests/jaeger/bug592973-1.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(x) { if (x) { let y; diff --git a/js/src/jit-test/tests/jaeger/bug592973-3.js b/js/src/jit-test/tests/jaeger/bug592973-3.js index ae4694955f5c..541c39981a4c 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-3.js +++ b/js/src/jit-test/tests/jaeger/bug592973-3.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f([a, b, c, d]) { a = b; return function () { return a + b + c + d; }; diff --git a/js/src/jit-test/tests/jaeger/bug597378.js b/js/src/jit-test/tests/jaeger/bug597378.js index 454935bb9320..c766407ab58c 100644 --- a/js/src/jit-test/tests/jaeger/bug597378.js +++ b/js/src/jit-test/tests/jaeger/bug597378.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a, b) { var o = a; var q = b; diff --git a/js/src/jit-test/tests/jaeger/bug600139.js b/js/src/jit-test/tests/jaeger/bug600139.js index 2fdedf42d5cf..61fa7283a03a 100644 --- a/js/src/jit-test/tests/jaeger/bug600139.js +++ b/js/src/jit-test/tests/jaeger/bug600139.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a, b, c) { if (!a.__SSi) { throw Components.returnCode = Cr.NS_ERROR_INVALID_ARG; diff --git a/js/src/jit-test/tests/jaeger/bug600424.js b/js/src/jit-test/tests/jaeger/bug600424.js index 44bb4e7c9b4c..e59a06614f21 100644 --- a/js/src/jit-test/tests/jaeger/bug600424.js +++ b/js/src/jit-test/tests/jaeger/bug600424.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var x = { g: function () { diff --git a/js/src/jit-test/tests/jaeger/bug601982.js b/js/src/jit-test/tests/jaeger/bug601982.js index b78f0704c69d..99f4bf906fc4 100644 --- a/js/src/jit-test/tests/jaeger/bug601982.js +++ b/js/src/jit-test/tests/jaeger/bug601982.js @@ -1,4 +1,4 @@ -/* vim: set ts=4 sw=4 tw=99 et: */ +/* vim: set ts=8 sts=4 et sw=4 tw=99: */ function J(i) { /* Cause a branch to build(?) */ diff --git a/js/src/jit-test/tests/jaeger/bug604381.js b/js/src/jit-test/tests/jaeger/bug604381.js index 365c9e3d2b16..3ca01cb36234 100644 --- a/js/src/jit-test/tests/jaeger/bug604381.js +++ b/js/src/jit-test/tests/jaeger/bug604381.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function F() { var T = { }; diff --git a/js/src/jit-test/tests/jaeger/bug616508.js b/js/src/jit-test/tests/jaeger/bug616508.js index 38ca2360f1aa..d29bf75f9b5e 100644 --- a/js/src/jit-test/tests/jaeger/bug616508.js +++ b/js/src/jit-test/tests/jaeger/bug616508.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: // Note: modified from original test, which used Uint32Array in place of Array, // because the behavior has changed in a way that this will throw a TypeError diff --git a/js/src/jit-test/tests/jaeger/bug625438.js b/js/src/jit-test/tests/jaeger/bug625438.js index 494bfd1342fd..32586d8ab4fa 100644 --- a/js/src/jit-test/tests/jaeger/bug625438.js +++ b/js/src/jit-test/tests/jaeger/bug625438.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: var count = 0; this.watch("x", function() { diff --git a/js/src/jit-test/tests/jaeger/bug627486.js b/js/src/jit-test/tests/jaeger/bug627486.js index f87d27e18a47..7acc3b01e957 100644 --- a/js/src/jit-test/tests/jaeger/bug627486.js +++ b/js/src/jit-test/tests/jaeger/bug627486.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: g = undefined; function L() { } diff --git a/js/src/jit-test/tests/jaeger/floatTypedArrays.js b/js/src/jit-test/tests/jaeger/floatTypedArrays.js index da1abe0c40ea..51ea7c0a16f6 100644 --- a/js/src/jit-test/tests/jaeger/floatTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/floatTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testFloat32Array(L) { var f = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js index dc5ed7b45270..8bb4627fa678 100644 --- a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testInt32Array(L) { var f = new Int32Array(8); diff --git a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js index 3ed2f2bcb553..c63d36bf2aea 100644 --- a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testInt8Array(L) { var f = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js index f9e7825a6378..369aa2c6fb86 100644 --- a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js +++ b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js @@ -1,4 +1,4 @@ -// vim: ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function A() { this.x = 12; diff --git a/js/src/jit-test/tests/jaeger/testDenseCallElem.js b/js/src/jit-test/tests/jaeger/testDenseCallElem.js index eadb77f55b9f..0301048bf31a 100644 --- a/js/src/jit-test/tests/jaeger/testDenseCallElem.js +++ b/js/src/jit-test/tests/jaeger/testDenseCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function fillDense(a) { } diff --git a/js/src/jit-test/tests/jaeger/testForOps.js b/js/src/jit-test/tests/jaeger/testForOps.js index 5704e070de07..382f096121ff 100644 --- a/js/src/jit-test/tests/jaeger/testForOps.js +++ b/js/src/jit-test/tests/jaeger/testForOps.js @@ -1,5 +1,5 @@ // |jit-test| mjitalways -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function assertObjectsEqual(obj1, obj2) { assertEq(obj1.a, obj2.a); diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem.js b/js/src/jit-test/tests/jaeger/testPropCallElem.js index fd067bbf7a50..2bb97fbe64a1 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem2.js b/js/src/jit-test/tests/jaeger/testPropCallElem2.js index 328193ae4b21..43f8efb0fb57 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem2.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem2.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js index 9eb9d0688689..ed8fc7c9a9bb 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testBadSetElems(obj, key) { obj[key] = 5; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js index 146092fbb5d4..01b42bd6b392 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js index 91d71401d489..f202513d534a 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js index 49ea74a8b94c..33e38dd3fc3f 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testSetTypedFloat32Array(k) { var ar = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js index bf3099c50c0f..89e943b698a7 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function testSetTypedInt8Array(k) { var ar = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js index cb2ce0059b46..1cbe064d3fef 100644 --- a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js +++ b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js @@ -1,4 +1,4 @@ -// vim: set ts=4 sw=4 tw=99 et: +// vim: set ts=8 sts=4 et sw=4 tw=99: function f(a) { var x = a; diff --git a/js/src/jsalloc.cpp b/js/src/jsalloc.cpp index a5ceae2a22c5..744eb68cb9d7 100644 --- a/js/src/jsalloc.cpp +++ b/js/src/jsalloc.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsalloc.h b/js/src/jsalloc.h index 7d76a7c701ad..7d2690b69a79 100644 --- a/js/src/jsalloc.h +++ b/js/src/jsalloc.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index 64eec6de4443..43dd7ea25d02 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsanalyze.h b/js/src/jsanalyze.h index 2be5bcdaf3c2..e1b60575aaed 100644 --- a/js/src/jsanalyze.h +++ b/js/src/jsanalyze.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsapi-tests/selfTest.cpp b/js/src/jsapi-tests/selfTest.cpp index 91f25ccce612..39202abb5720 100644 --- a/js/src/jsapi-tests/selfTest.cpp +++ b/js/src/jsapi-tests/selfTest.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testAddPropertyPropcache.cpp b/js/src/jsapi-tests/testAddPropertyPropcache.cpp index be190df1824c..10acaf89c2f0 100644 --- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp +++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArgumentsObject.cpp b/js/src/jsapi-tests/testArgumentsObject.cpp index 81c79608fd73..0d34e41b2dad 100644 --- a/js/src/jsapi-tests/testArgumentsObject.cpp +++ b/js/src/jsapi-tests/testArgumentsObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArrayBuffer.cpp b/js/src/jsapi-tests/testArrayBuffer.cpp index 081146c3d690..a8299a611b51 100644 --- a/js/src/jsapi-tests/testArrayBuffer.cpp +++ b/js/src/jsapi-tests/testArrayBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index c3a907a20b91..f66c702aab19 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests JS_TransplantObject */ diff --git a/js/src/jsapi-tests/testClassGetter.cpp b/js/src/jsapi-tests/testClassGetter.cpp index 420ef24c4346..7b3ecb728447 100644 --- a/js/src/jsapi-tests/testClassGetter.cpp +++ b/js/src/jsapi-tests/testClassGetter.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests the JSClass::getProperty hook */ diff --git a/js/src/jsapi-tests/testCloneScript.cpp b/js/src/jsapi-tests/testCloneScript.cpp index 14e6882dd431..91ff93d76180 100644 --- a/js/src/jsapi-tests/testCloneScript.cpp +++ b/js/src/jsapi-tests/testCloneScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testContexts.cpp b/js/src/jsapi-tests/testContexts.cpp index 1f65b462a2d0..e863a4086ee1 100644 --- a/js/src/jsapi-tests/testContexts.cpp +++ b/js/src/jsapi-tests/testContexts.cpp @@ -1,11 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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 "tests.h" BEGIN_TEST(testContexts_IsRunning) diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index 586a24da62ba..577fffa08129 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDeepFreeze.cpp b/js/src/jsapi-tests/testDeepFreeze.cpp index 9b95af5b0bbf..48d31f6bcaa2 100644 --- a/js/src/jsapi-tests/testDeepFreeze.cpp +++ b/js/src/jsapi-tests/testDeepFreeze.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp index 7f07b640e842..d28c8affb58a 100644 --- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp +++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineProperty.cpp b/js/src/jsapi-tests/testDefineProperty.cpp index b5617799adae..739dfafdb6c5 100644 --- a/js/src/jsapi-tests/testDefineProperty.cpp +++ b/js/src/jsapi-tests/testDefineProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testEnclosingFunction.cpp b/js/src/jsapi-tests/testEnclosingFunction.cpp index 2549b6f181aa..0a88f6c598e1 100644 --- a/js/src/jsapi-tests/testEnclosingFunction.cpp +++ b/js/src/jsapi-tests/testEnclosingFunction.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testErrorCopying.cpp b/js/src/jsapi-tests/testErrorCopying.cpp index 1923879d2763..bda243b85265 100644 --- a/js/src/jsapi-tests/testErrorCopying.cpp +++ b/js/src/jsapi-tests/testErrorCopying.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests that the column number of error reports is properly copied over from * other reports when invoked from the C++ api. diff --git a/js/src/jsapi-tests/testFindSCCs.cpp b/js/src/jsapi-tests/testFindSCCs.cpp index 1e98800059e4..ad38b56ac036 100644 --- a/js/src/jsapi-tests/testFindSCCs.cpp +++ b/js/src/jsapi-tests/testFindSCCs.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testFunctionProperties.cpp b/js/src/jsapi-tests/testFunctionProperties.cpp index 9fee41561803..b70f95bcb0e0 100644 --- a/js/src/jsapi-tests/testFunctionProperties.cpp +++ b/js/src/jsapi-tests/testFunctionProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp index 83aa3c774f85..49e3db00f819 100644 --- a/js/src/jsapi-tests/testGCOutOfMemory.cpp +++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/licenses/publicdomain/ diff --git a/js/src/jsapi-tests/testGetPropertyDefault.cpp b/js/src/jsapi-tests/testGetPropertyDefault.cpp index 4dc9664fb921..8aa0323d8c3e 100644 --- a/js/src/jsapi-tests/testGetPropertyDefault.cpp +++ b/js/src/jsapi-tests/testGetPropertyDefault.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIndexToString.cpp b/js/src/jsapi-tests/testIndexToString.cpp index 0b59b6f0b402..998e65218614 100644 --- a/js/src/jsapi-tests/testIndexToString.cpp +++ b/js/src/jsapi-tests/testIndexToString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIntString.cpp b/js/src/jsapi-tests/testIntString.cpp index 18b3d53371e5..fc627d62430d 100644 --- a/js/src/jsapi-tests/testIntString.cpp +++ b/js/src/jsapi-tests/testIntString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp index 875ae83094be..72d92e751432 100644 --- a/js/src/jsapi-tests/testJSEvaluateScript.cpp +++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testLookup.cpp b/js/src/jsapi-tests/testLookup.cpp index 692ca846d5b1..74125b62cbdf 100644 --- a/js/src/jsapi-tests/testLookup.cpp +++ b/js/src/jsapi-tests/testLookup.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testNewObject.cpp b/js/src/jsapi-tests/testNewObject.cpp index 94b8607bb1db..03dac00c0a36 100644 --- a/js/src/jsapi-tests/testNewObject.cpp +++ b/js/src/jsapi-tests/testNewObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp index 648493be1df0..c883439b0e39 100644 --- a/js/src/jsapi-tests/testOps.cpp +++ b/js/src/jsapi-tests/testOps.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests for operators and implicit type conversion. */ diff --git a/js/src/jsapi-tests/testParseJSON.cpp b/js/src/jsapi-tests/testParseJSON.cpp index abfe849ec214..87255505bc6f 100644 --- a/js/src/jsapi-tests/testParseJSON.cpp +++ b/js/src/jsapi-tests/testParseJSON.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testProfileStrings.cpp b/js/src/jsapi-tests/testProfileStrings.cpp index bf6a82ca5e85..15b265ca6fce 100644 --- a/js/src/jsapi-tests/testProfileStrings.cpp +++ b/js/src/jsapi-tests/testProfileStrings.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Tests the stack-based instrumentation profiler on a JSRuntime */ diff --git a/js/src/jsapi-tests/testPropCache.cpp b/js/src/jsapi-tests/testPropCache.cpp index 3920a1f06bfd..9c619183dc34 100644 --- a/js/src/jsapi-tests/testPropCache.cpp +++ b/js/src/jsapi-tests/testPropCache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp index 5fdebda8acac..717c7dccac2b 100644 --- a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp +++ b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testResolveRecursion.cpp b/js/src/jsapi-tests/testResolveRecursion.cpp index 43d7b2d2be99..58f387e585ed 100644 --- a/js/src/jsapi-tests/testResolveRecursion.cpp +++ b/js/src/jsapi-tests/testResolveRecursion.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSameValue.cpp b/js/src/jsapi-tests/testSameValue.cpp index 6f1c75b54e60..3d35df3a671b 100644 --- a/js/src/jsapi-tests/testSameValue.cpp +++ b/js/src/jsapi-tests/testSameValue.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptInfo.cpp b/js/src/jsapi-tests/testScriptInfo.cpp index 3265ed9fc430..2fa8f29429a4 100644 --- a/js/src/jsapi-tests/testScriptInfo.cpp +++ b/js/src/jsapi-tests/testScriptInfo.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp index 4075976864c7..29a522dfa857 100644 --- a/js/src/jsapi-tests/testScriptObject.cpp +++ b/js/src/jsapi-tests/testScriptObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSetProperty.cpp b/js/src/jsapi-tests/testSetProperty.cpp index 598d5d24d8fa..8003c473b35a 100644 --- a/js/src/jsapi-tests/testSetProperty.cpp +++ b/js/src/jsapi-tests/testSetProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testStringBuffer.cpp b/js/src/jsapi-tests/testStringBuffer.cpp index 51c232381d27..ebbd2dff1f61 100644 --- a/js/src/jsapi-tests/testStringBuffer.cpp +++ b/js/src/jsapi-tests/testStringBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTrap.cpp b/js/src/jsapi-tests/testTrap.cpp index 3e66a388ec06..a1bde8d9d2d8 100644 --- a/js/src/jsapi-tests/testTrap.cpp +++ b/js/src/jsapi-tests/testTrap.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTypedArrays.cpp b/js/src/jsapi-tests/testTypedArrays.cpp index 00ec3704e356..8aba225ac576 100644 --- a/js/src/jsapi-tests/testTypedArrays.cpp +++ b/js/src/jsapi-tests/testTypedArrays.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testUTF8.cpp b/js/src/jsapi-tests/testUTF8.cpp index 941177369b89..2ec6b06898ef 100644 --- a/js/src/jsapi-tests/testUTF8.cpp +++ b/js/src/jsapi-tests/testUTF8.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp index e8d934a83d6d..c47d82897726 100644 --- a/js/src/jsapi-tests/testXDR.cpp +++ b/js/src/jsapi-tests/testXDR.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: + * vim: set ts=8 sts=4 et sw=4 tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/tests.cpp b/js/src/jsapi-tests/tests.cpp index 6ce8c30b6244..30b89be2d3b8 100644 --- a/js/src/jsapi-tests/tests.cpp +++ b/js/src/jsapi-tests/tests.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index e251ca981a23..d9579ef9ec50 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi-tests/valueABI.c b/js/src/jsapi-tests/valueABI.c index 89a5693ee393..65b31d38c48e 100644 --- a/js/src/jsapi-tests/valueABI.c +++ b/js/src/jsapi-tests/valueABI.c @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sw=4 et tw=99 ft=c: - * * 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/. */ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 3180e7f3e55e..a506b06fb23c 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsapi.h b/js/src/jsapi.h index cd4d151ca4f1..610c7f8071e6 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index d3cbcc4be99d..cf6da3726fc4 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsarray.h b/js/src/jsarray.h index a61d7a829deb..7cb15822c18b 100644 --- a/js/src/jsarray.h +++ b/js/src/jsarray.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp index e0178dedd302..a675149a54aa 100644 --- a/js/src/jsatom.cpp +++ b/js/src/jsatom.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatom.h b/js/src/jsatom.h index 9ff01bd6fac1..1aa15269e9d6 100644 --- a/js/src/jsatom.h +++ b/js/src/jsatom.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsatominlines.h b/js/src/jsatominlines.h index 2d5df3d44029..421bf141b6be 100644 --- a/js/src/jsatominlines.h +++ b/js/src/jsatominlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp index b3a54c63c24e..1b29be168a50 100644 --- a/js/src/jsbool.cpp +++ b/js/src/jsbool.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsbool.h b/js/src/jsbool.h index 1676d523af87..0d847ec30514 100644 --- a/js/src/jsbool.h +++ b/js/src/jsbool.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsboolinlines.h b/js/src/jsboolinlines.h index 1f2b361d276e..58ed270c1966 100644 --- a/js/src/jsboolinlines.h +++ b/js/src/jsboolinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclass.h b/js/src/jsclass.h index 86c0e5b86e68..a8559ea554ab 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclist.h b/js/src/jsclist.h index 4881104eee79..8782307fa4ab 100644 --- a/js/src/jsclist.h +++ b/js/src/jsclist.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsclone.cpp b/js/src/jsclone.cpp index e3b249e486eb..885bfc01a1ba 100644 --- a/js/src/jsclone.cpp +++ b/js/src/jsclone.cpp @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclone.h b/js/src/jsclone.h index 5a3326152b65..595bf8f013a1 100644 --- a/js/src/jsclone.h +++ b/js/src/jsclone.h @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 2190cf5be7ae..9e36c88415c6 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index b3b0fad13626..487903125723 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 9c9a03d3b1da..58de7e00b258 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index 41961c8b8b2e..2a6dc4dc4edf 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index d4fda4b68e7d..454f13137d3a 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscompartmentinlines.h b/js/src/jscompartmentinlines.h index e9724ff9b047..c9c747b55e96 100644 --- a/js/src/jscompartmentinlines.h +++ b/js/src/jscompartmentinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscpucfg.h b/js/src/jscpucfg.h index 3d2022dbe292..1b7baf996f1a 100644 --- a/js/src/jscpucfg.h +++ b/js/src/jscpucfg.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashformat.h b/js/src/jscrashformat.h index cf274f336018..7d3940d9f661 100644 --- a/js/src/jscrashformat.h +++ b/js/src/jscrashformat.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashreport.cpp b/js/src/jscrashreport.cpp index 6cb415aeb716..1ebac89fa44f 100644 --- a/js/src/jscrashreport.cpp +++ b/js/src/jscrashreport.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscrashreport.h b/js/src/jscrashreport.h index beeb76151ba1..cb2336be00d1 100644 --- a/js/src/jscrashreport.h +++ b/js/src/jscrashreport.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 928c4a66a8ea..666e72e3912a 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdate.h b/js/src/jsdate.h index 514160ecd634..67c2ca067981 100644 --- a/js/src/jsdate.h +++ b/js/src/jsdate.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index be6e447aad9c..a3ed445bd705 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index e47c33a85718..d6f5b2e9db25 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdhash.cpp b/js/src/jsdhash.cpp index 51b5cb5d94bd..00b0dbdbc04b 100644 --- a/js/src/jsdhash.cpp +++ b/js/src/jsdhash.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsdhash.h b/js/src/jsdhash.h index c8f02b18b708..1f7830fd2b1f 100644 --- a/js/src/jsdhash.h +++ b/js/src/jsdhash.h @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.cpp index b8b57eb3f368..9d94bebaf5e9 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/jsdtoa.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsdtoa.h b/js/src/jsdtoa.h index c55b8277ed40..dfd5393d1090 100644 --- a/js/src/jsdtoa.h +++ b/js/src/jsdtoa.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 21d2a3afeb9e..4ba3778e74e2 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsexn.h b/js/src/jsexn.h index 4d14278db6f8..c7b8882bdce6 100644 --- a/js/src/jsexn.h +++ b/js/src/jsexn.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index d2e8a0b84b12..cb69671550fe 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index a95600ac89a7..c0f4c975cb29 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 96d9eb2a4057..bbc90d477d64 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 4fce726bc1cf..d1cf351dcbc0 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ @@ -212,7 +212,7 @@ class JSFunction : public JSObject js::RawScript getOrCreateScript(JSContext *cx) { JS_ASSERT(isInterpreted()); - JS_ASSERT(cx); + JS_ASSERT(cx); if (isInterpretedLazy()) { JS::RootedFunction self(cx, this); js::MaybeCheckStackRoots(cx); diff --git a/js/src/jsfuninlines.h b/js/src/jsfuninlines.h index 0a0b49ad79c4..a15eb7ec3b48 100644 --- a/js/src/jsfuninlines.h +++ b/js/src/jsfuninlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index f89147853304..7e5e0fda211c 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 6b26f57faadb..22894caf3bdf 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index a684d0636d5f..9fc17ff96585 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index 508eb23b1413..75d40a8f30e7 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index 1043a9954265..2d26722ad9f7 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinferinlines.h b/js/src/jsinferinlines.h index c6d29d39a7ea..c3dbb5f8f067 100644 --- a/js/src/jsinferinlines.h +++ b/js/src/jsinferinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 68b4c69e57b2..5e16c739dc08 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index 9cbd70dbeafa..9887aa0e6db9 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsinterpinlines.h b/js/src/jsinterpinlines.h index 56a513dd30bc..989cb28cb43c 100644 --- a/js/src/jsinterpinlines.h +++ b/js/src/jsinterpinlines.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 552bdd95fb13..39e49e81b684 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsiter.h b/js/src/jsiter.h index 3d7627384df6..6640de902901 100644 --- a/js/src/jsiter.h +++ b/js/src/jsiter.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jskwgen.cpp b/js/src/jskwgen.cpp index c488184603f7..c5e66707fb98 100644 --- a/js/src/jskwgen.cpp +++ b/js/src/jskwgen.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jslibmath.h b/js/src/jslibmath.h index 778d7f8ae1de..bcd136a1a79b 100644 --- a/js/src/jslibmath.h +++ b/js/src/jslibmath.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jslock.h b/js/src/jslock.h index 025aaea0af82..b4a28a9fa9c4 100644 --- a/js/src/jslock.h +++ b/js/src/jslock.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + #ifndef jslock_h__ #define jslock_h__ diff --git a/js/src/jslog2.cpp b/js/src/jslog2.cpp index d02400721365..cee3d0d13e22 100644 --- a/js/src/jslog2.cpp +++ b/js/src/jslog2.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 97f880fe98d0..424ad79ed60e 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsmath.h b/js/src/jsmath.h index 91150d809fc9..4f2a4b467eca 100644 --- a/js/src/jsmath.h +++ b/js/src/jsmath.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsmemorymetrics.cpp b/js/src/jsmemorymetrics.cpp index fc82601c5c17..e744b6be9d6d 100644 --- a/js/src/jsmemorymetrics.cpp +++ b/js/src/jsmemorymetrics.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 9fec01d35f0d..cd301292d72d 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -1,7 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 et sw=4 tw=80: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsnativestack.h b/js/src/jsnativestack.h index 3f823f56d22f..916bee2d0394 100644 --- a/js/src/jsnativestack.h +++ b/js/src/jsnativestack.h @@ -1,7 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 et sw=4 tw=80: - */ -/* This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 8c9dc7aff420..49e89fc124e5 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnum.h b/js/src/jsnum.h index 653ff12fddf0..0f765f3c616b 100644 --- a/js/src/jsnum.h +++ b/js/src/jsnum.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsnuminlines.h b/js/src/jsnuminlines.h index c17909fdb52e..1c4dcf515d56 100644 --- a/js/src/jsnuminlines.h +++ b/js/src/jsnuminlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index f8cb8b97e8a4..347cbbf5d1e4 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 25a8652c5ec5..a2e6a3e7deae 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 9213ae088914..20790e56c8d9 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/json.cpp b/js/src/json.cpp index d03a8da9931f..467c3ca0b8f5 100644 --- a/js/src/json.cpp +++ b/js/src/json.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/json.h b/js/src/json.h index bb21f9145151..7fa2c117c804 100644 --- a/js/src/json.h +++ b/js/src/json.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsonparser.cpp b/js/src/jsonparser.cpp index 3b4b1ebb2a8c..9c89d08b4997 100644 --- a/js/src/jsonparser.cpp +++ b/js/src/jsonparser.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsonparser.h b/js/src/jsonparser.h index 10c954055ff8..d8df9946b27b 100644 --- a/js/src/jsonparser.h +++ b/js/src/jsonparser.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index aafd8bbf4b6e..2ce6dfc2c2a0 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcode.h b/js/src/jsopcode.h index 1d1e17cbce46..f0ec5c580cb3 100644 --- a/js/src/jsopcode.h +++ b/js/src/jsopcode.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsopcodeinlines.h b/js/src/jsopcodeinlines.h index 5fd85cd891da..701be7785e5a 100644 --- a/js/src/jsopcodeinlines.h +++ b/js/src/jsopcodeinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsoplengen.cpp b/js/src/jsoplengen.cpp index 4bef284c5f5f..808f5ed778b9 100644 --- a/js/src/jsoplengen.cpp +++ b/js/src/jsoplengen.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprf.cpp b/js/src/jsprf.cpp index 0a2ebc8e41e5..08fb08ff3fb5 100644 --- a/js/src/jsprf.cpp +++ b/js/src/jsprf.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprf.h b/js/src/jsprf.h index 4c2bef91d29e..c0891f0e9e90 100644 --- a/js/src/jsprf.h +++ b/js/src/jsprf.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprobes.cpp b/js/src/jsprobes.cpp index 3a103ea612b0..b2217b1b8c1f 100644 --- a/js/src/jsprobes.cpp +++ b/js/src/jsprobes.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h index 601bc5c70a03..0bd391a2b70a 100644 --- a/js/src/jsprobes.h +++ b/js/src/jsprobes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycache.cpp b/js/src/jspropertycache.cpp index 20d074edd5f1..98a84f21df78 100644 --- a/js/src/jspropertycache.cpp +++ b/js/src/jspropertycache.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=98: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycache.h b/js/src/jspropertycache.h index b63aff4c7026..ce0acab2c78f 100644 --- a/js/src/jspropertycache.h +++ b/js/src/jspropertycache.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=98: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertycacheinlines.h b/js/src/jspropertycacheinlines.h index 48e1a7874db7..910a9e180a74 100644 --- a/js/src/jspropertycacheinlines.h +++ b/js/src/jspropertycacheinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspropertytree.cpp b/js/src/jspropertytree.cpp index cf32bfac4e1a..6e8843821c1d 100644 --- a/js/src/jspropertytree.cpp +++ b/js/src/jspropertytree.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jspropertytree.h b/js/src/jspropertytree.h index 4c3fbd725a2a..d269e2937c4e 100644 --- a/js/src/jspropertytree.h +++ b/js/src/jspropertytree.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsprototypes.h b/js/src/jsprototypes.h index 27f5c84450b1..007d25d7204f 100644 --- a/js/src/jsprototypes.h +++ b/js/src/jsprototypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index dda39fda162d..df2f78af54c4 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -1,10 +1,9 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. - */ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + #include #include "jsapi.h" #include "jscntxt.h" diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index a6f7851744c8..54e91db7fa61 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index a131e61ba6e0..4db5ed8c36d0 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 2159dd4f6cc6..ab124ee57104 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsreflect.cpp b/js/src/jsreflect.cpp index 16978563e9c8..e97e31344415 100644 --- a/js/src/jsreflect.cpp +++ b/js/src/jsreflect.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsreflect.h b/js/src/jsreflect.h index b517c1bc4d90..be973527970c 100644 --- a/js/src/jsreflect.h +++ b/js/src/jsreflect.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index c978f3d2c967..358f76c8f547 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 34cd5055602b..14c76c85bb4d 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsscriptinlines.h b/js/src/jsscriptinlines.h index 2861ea2e5f4c..560aa44a14ab 100644 --- a/js/src/jsscriptinlines.h +++ b/js/src/jsscriptinlines.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=79 ft=cpp: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 0e50cb0f7f74..bbd9401bad3f 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 10ae7b2fc106..8a1d270ad720 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsstrinlines.h b/js/src/jsstrinlines.h index 82550466197c..262a1d11a33a 100644 --- a/js/src/jsstrinlines.h +++ b/js/src/jsstrinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index 15b5c5daf67b..c09511515e8d 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypedarray.h b/js/src/jstypedarray.h index e38313b16299..0a7602a850c5 100644 --- a/js/src/jstypedarray.h +++ b/js/src/jstypedarray.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypedarrayinlines.h b/js/src/jstypedarrayinlines.h index 22e30038b946..952ecb100505 100644 --- a/js/src/jstypedarrayinlines.h +++ b/js/src/jstypedarrayinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jstypes.h b/js/src/jstypes.h index c83e7fed26e3..b597cf3b987b 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsutil.cpp b/js/src/jsutil.cpp index f04077996b08..fc4341002444 100644 --- a/js/src/jsutil.cpp +++ b/js/src/jsutil.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsutil.h b/js/src/jsutil.h index ff77e41a8893..ed7e0989e0f7 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsversion.h b/js/src/jsversion.h index 50e2fa6beb0b..64f2ad217675 100644 --- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp index 152eb4d0f211..42b6a272bd8d 100644 --- a/js/src/jswatchpoint.cpp +++ b/js/src/jswatchpoint.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswatchpoint.h b/js/src/jswatchpoint.h index 2c05f77c77f3..47179327d6df 100644 --- a/js/src/jswatchpoint.h +++ b/js/src/jswatchpoint.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakcache.h b/js/src/jsweakcache.h index bc3ac58b2c57..54d810032461 100644 --- a/js/src/jsweakcache.h +++ b/js/src/jsweakcache.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index 5977bfca5971..8f01f6aa4ccd 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsweakmap.h b/js/src/jsweakmap.h index 47a7f42eff72..bc130e10c6ef 100644 --- a/js/src/jsweakmap.h +++ b/js/src/jsweakmap.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswin.h b/js/src/jswin.h index 50b548cb8fd7..689d23810677 100644 --- a/js/src/jswin.h +++ b/js/src/jswin.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsworkers.cpp b/js/src/jsworkers.cpp index d80ee15f3037..f6a2e279f741 100644 --- a/js/src/jsworkers.cpp +++ b/js/src/jsworkers.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jsworkers.h b/js/src/jsworkers.h index a3b7edafda00..89baca26d7ca 100644 --- a/js/src/jsworkers.h +++ b/js/src/jsworkers.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 3f21082891d9..4d8aceb2cef2 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index 3e7985cb6b2a..e8423b993b23 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/BaseAssembler.h b/js/src/methodjit/BaseAssembler.h index 7b84a48e532f..9e3af92cd4dc 100644 --- a/js/src/methodjit/BaseAssembler.h +++ b/js/src/methodjit/BaseAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/BaseCompiler.h b/js/src/methodjit/BaseCompiler.h index 3531ec04d773..ad3af9d3da38 100644 --- a/js/src/methodjit/BaseCompiler.h +++ b/js/src/methodjit/BaseCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/CodeGenIncludes.h b/js/src/methodjit/CodeGenIncludes.h index 23378e5e7e89..3cddee0a5638 100644 --- a/js/src/methodjit/CodeGenIncludes.h +++ b/js/src/methodjit/CodeGenIncludes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index ef5680120c5d..b934effe95db 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Compiler.h b/js/src/methodjit/Compiler.h index 5cafd3e298a4..9652a071c8fb 100644 --- a/js/src/methodjit/Compiler.h +++ b/js/src/methodjit/Compiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastArithmetic.cpp b/js/src/methodjit/FastArithmetic.cpp index f2f6d19a1ea2..44c2361cacb3 100644 --- a/js/src/methodjit/FastArithmetic.cpp +++ b/js/src/methodjit/FastArithmetic.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastBuiltins.cpp b/js/src/methodjit/FastBuiltins.cpp index 5415930e9ab2..8d907b836fbc 100644 --- a/js/src/methodjit/FastBuiltins.cpp +++ b/js/src/methodjit/FastBuiltins.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FastOps.cpp b/js/src/methodjit/FastOps.cpp index 45d038a9047c..4d6ec3126640 100644 --- a/js/src/methodjit/FastOps.cpp +++ b/js/src/methodjit/FastOps.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameEntry.h b/js/src/methodjit/FrameEntry.h index 53e6b0b493c0..5d3b5c38218f 100644 --- a/js/src/methodjit/FrameEntry.h +++ b/js/src/methodjit/FrameEntry.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState-inl.h b/js/src/methodjit/FrameState-inl.h index a12867a47e38..0a4b6439c1e5 100644 --- a/js/src/methodjit/FrameState-inl.h +++ b/js/src/methodjit/FrameState-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState.cpp b/js/src/methodjit/FrameState.cpp index bdfbf2ffbece..186fb524e86c 100644 --- a/js/src/methodjit/FrameState.cpp +++ b/js/src/methodjit/FrameState.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/FrameState.h b/js/src/methodjit/FrameState.h index 85f1f959d913..f568943a70c3 100644 --- a/js/src/methodjit/FrameState.h +++ b/js/src/methodjit/FrameState.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICChecker.h b/js/src/methodjit/ICChecker.h index 93c4889bf992..44c06cc100e5 100644 --- a/js/src/methodjit/ICChecker.h +++ b/js/src/methodjit/ICChecker.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICLabels.h b/js/src/methodjit/ICLabels.h index 4b422ff94883..8d4e8ad2106c 100644 --- a/js/src/methodjit/ICLabels.h +++ b/js/src/methodjit/ICLabels.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ICRepatcher.h b/js/src/methodjit/ICRepatcher.h index 79c7666b9a00..2d5ea4035caa 100644 --- a/js/src/methodjit/ICRepatcher.h +++ b/js/src/methodjit/ICRepatcher.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.cpp b/js/src/methodjit/ImmutableSync.cpp index a763b5c0a479..7cef76bb72ff 100644 --- a/js/src/methodjit/ImmutableSync.cpp +++ b/js/src/methodjit/ImmutableSync.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.h b/js/src/methodjit/ImmutableSync.h index f232175db78f..bd1429efa655 100644 --- a/js/src/methodjit/ImmutableSync.h +++ b/js/src/methodjit/ImmutableSync.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/InlineFrameAssembler.h b/js/src/methodjit/InlineFrameAssembler.h index 12d3bac8f3b6..b80bb52d24bd 100644 --- a/js/src/methodjit/InlineFrameAssembler.h +++ b/js/src/methodjit/InlineFrameAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp index c02d6db68996..582558fb60f2 100644 --- a/js/src/methodjit/InvokeHelpers.cpp +++ b/js/src/methodjit/InvokeHelpers.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Logging.cpp b/js/src/methodjit/Logging.cpp index 5bca55ccc240..7ecf536d8bb1 100644 --- a/js/src/methodjit/Logging.cpp +++ b/js/src/methodjit/Logging.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Logging.h b/js/src/methodjit/Logging.h index fff123e911ce..6825f0313695 100644 --- a/js/src/methodjit/Logging.h +++ b/js/src/methodjit/Logging.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/LoopState.cpp b/js/src/methodjit/LoopState.cpp index 21e65fd40865..92e9c6dffce8 100644 --- a/js/src/methodjit/LoopState.cpp +++ b/js/src/methodjit/LoopState.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/LoopState.h b/js/src/methodjit/LoopState.h index 6280bf2598bc..3518ba88e5eb 100644 --- a/js/src/methodjit/LoopState.h +++ b/js/src/methodjit/LoopState.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MachineRegs.h b/js/src/methodjit/MachineRegs.h index e355dd7b6cab..2b5d80c51600 100644 --- a/js/src/methodjit/MachineRegs.h +++ b/js/src/methodjit/MachineRegs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp index 94f145bf00fd..7741b59b7fa9 100644 --- a/js/src/methodjit/MethodJIT.cpp +++ b/js/src/methodjit/MethodJIT.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MethodJIT.h b/js/src/methodjit/MethodJIT.h index c813d1fc47f6..a60415f82e0c 100644 --- a/js/src/methodjit/MethodJIT.h +++ b/js/src/methodjit/MethodJIT.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MonoIC.cpp b/js/src/methodjit/MonoIC.cpp index b07bdeab577d..f633ef29d8a9 100644 --- a/js/src/methodjit/MonoIC.cpp +++ b/js/src/methodjit/MonoIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/MonoIC.h b/js/src/methodjit/MonoIC.h index 852dacc02f65..acb0acdc6aef 100644 --- a/js/src/methodjit/MonoIC.h +++ b/js/src/methodjit/MonoIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/NunboxAssembler.h b/js/src/methodjit/NunboxAssembler.h index 9d764a5f0e88..8c30afc06815 100644 --- a/js/src/methodjit/NunboxAssembler.h +++ b/js/src/methodjit/NunboxAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PolyIC.cpp b/js/src/methodjit/PolyIC.cpp index df176bc13de1..f76a68abdbf0 100644 --- a/js/src/methodjit/PolyIC.cpp +++ b/js/src/methodjit/PolyIC.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PolyIC.h b/js/src/methodjit/PolyIC.h index f7b4423c3f09..e17226aaeb2a 100644 --- a/js/src/methodjit/PolyIC.h +++ b/js/src/methodjit/PolyIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/PunboxAssembler.h b/js/src/methodjit/PunboxAssembler.h index 959ba595f306..7a066bd4ffc9 100644 --- a/js/src/methodjit/PunboxAssembler.h +++ b/js/src/methodjit/PunboxAssembler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/RematInfo.h b/js/src/methodjit/RematInfo.h index cd9ec7a2e50d..c0bdc40e3881 100644 --- a/js/src/methodjit/RematInfo.h +++ b/js/src/methodjit/RematInfo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Retcon.cpp b/js/src/methodjit/Retcon.cpp index d91286108123..2479236a3a5c 100644 --- a/js/src/methodjit/Retcon.cpp +++ b/js/src/methodjit/Retcon.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/Retcon.h b/js/src/methodjit/Retcon.h index d4e688bf7046..8e4105644347 100644 --- a/js/src/methodjit/Retcon.h +++ b/js/src/methodjit/Retcon.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls-inl.h b/js/src/methodjit/StubCalls-inl.h index cf5903865f93..47f4725e04fa 100644 --- a/js/src/methodjit/StubCalls-inl.h +++ b/js/src/methodjit/StubCalls-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls.cpp b/js/src/methodjit/StubCalls.cpp index c9fda4f151fe..1d49c4fa0a2a 100644 --- a/js/src/methodjit/StubCalls.cpp +++ b/js/src/methodjit/StubCalls.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCalls.h b/js/src/methodjit/StubCalls.h index 23dc2420d03f..e620b37dba3d 100644 --- a/js/src/methodjit/StubCalls.h +++ b/js/src/methodjit/StubCalls.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCompiler.cpp b/js/src/methodjit/StubCompiler.cpp index f366d8e826ac..77754e2f60f9 100644 --- a/js/src/methodjit/StubCompiler.cpp +++ b/js/src/methodjit/StubCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/StubCompiler.h b/js/src/methodjit/StubCompiler.h index e2a0d49c4e03..be3b4b97c021 100644 --- a/js/src/methodjit/StubCompiler.h +++ b/js/src/methodjit/StubCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.cpp b/js/src/methodjit/TrampolineCompiler.cpp index 81478f2d8891..4860a7ecb522 100644 --- a/js/src/methodjit/TrampolineCompiler.cpp +++ b/js/src/methodjit/TrampolineCompiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.h b/js/src/methodjit/TrampolineCompiler.h index 11e118be78fe..e3d4a6e8bffc 100644 --- a/js/src/methodjit/TrampolineCompiler.h +++ b/js/src/methodjit/TrampolineCompiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TrampolineMIPS.cpp b/js/src/methodjit/TrampolineMIPS.cpp index 7be2e42d01a3..4da001eda725 100644 --- a/js/src/methodjit/TrampolineMIPS.cpp +++ b/js/src/methodjit/TrampolineMIPS.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/methodjit/TypedArrayIC.h b/js/src/methodjit/TypedArrayIC.h index aa86cb2f8ead..16deeb770adb 100644 --- a/js/src/methodjit/TypedArrayIC.h +++ b/js/src/methodjit/TypedArrayIC.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/perf/jsperf.cpp b/js/src/perf/jsperf.cpp index 098361a964a4..b153e0a61d2f 100644 --- a/js/src/perf/jsperf.cpp +++ b/js/src/perf/jsperf.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/jsperf.h b/js/src/perf/jsperf.h index 265478c33ebb..aaf513342736 100644 --- a/js/src/perf/jsperf.h +++ b/js/src/perf/jsperf.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_linux.cpp b/js/src/perf/pm_linux.cpp index 3156354bdff7..de5675eff5e9 100644 --- a/js/src/perf/pm_linux.cpp +++ b/js/src/perf/pm_linux.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_stub.cpp b/js/src/perf/pm_stub.cpp index 4af53cb1250f..cf82288f093c 100644 --- a/js/src/perf/pm_stub.cpp +++ b/js/src/perf/pm_stub.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/prmjtime.cpp b/js/src/prmjtime.cpp index a5bb6478220b..4fa2ae2359ff 100644 --- a/js/src/prmjtime.cpp +++ b/js/src/prmjtime.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/prmjtime.h b/js/src/prmjtime.h index e7b13c35d4a0..30ee7c080b99 100644 --- a/js/src/prmjtime.h +++ b/js/src/prmjtime.h @@ -1,5 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 68f0c08168de..32608379f44c 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsheaptools.cpp b/js/src/shell/jsheaptools.cpp index 4cae34a43cf5..e5d38ba1538c 100644 --- a/js/src/shell/jsheaptools.cpp +++ b/js/src/shell/jsheaptools.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsheaptools.h b/js/src/shell/jsheaptools.h index 55e12ab39ffc..326102668a2c 100644 --- a/js/src/shell/jsheaptools.h +++ b/js/src/shell/jsheaptools.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index 1a54690de8c8..0556b747eb76 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/shell/jsoptparse.h b/js/src/shell/jsoptparse.h index 7e2ef72e994a..9e52cb97871a 100644 --- a/js/src/shell/jsoptparse.h +++ b/js/src/shell/jsoptparse.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-010-n.js b/js/src/tests/ecma_2/Exceptions/exception-010-n.js index 95f5ef725d3d..51931804e4ca 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-010-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-010-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-011-n.js b/js/src/tests/ecma_2/Exceptions/exception-011-n.js index 533765a69f28..dc08346ca9a1 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-011-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-011-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js index f19fce62e90f..932f51ab804e 100644 --- a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js +++ b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Exceptions/regress-58946.js b/js/src/tests/ecma_3/Exceptions/regress-58946.js index c961e5ab739a..1147fdd633d6 100644 --- a/js/src/tests/ecma_3/Exceptions/regress-58946.js +++ b/js/src/tests/ecma_3/Exceptions/regress-58946.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js index 3f8b6a84778f..5352534a3f38 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js index 1e6b115a61b2..97ec349a0e59 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js index 41ae113c9123..1a6cb1a21ddc 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js +++ b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001-n.js b/js/src/tests/ecma_3/FunExpr/fe-001-n.js index 55c57212ec40..d1f9c3e49545 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001-n.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001.js b/js/src/tests/ecma_3/FunExpr/fe-001.js index a68d6e10aa12..f80f34e2e8c4 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-002.js b/js/src/tests/ecma_3/FunExpr/fe-002.js index 9ee5bfbaf250..5619fbbb65da 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-002.js +++ b/js/src/tests/ecma_3/FunExpr/fe-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js index 49915472953e..8634f53dd4f7 100644 --- a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js +++ b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-24712.js b/js/src/tests/ecma_3/RegExp/regress-24712.js index dfaded2661f0..d675f6a3c184 100644 --- a/js/src/tests/ecma_3/RegExp/regress-24712.js +++ b/js/src/tests/ecma_3/RegExp/regress-24712.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-28686.js b/js/src/tests/ecma_3/RegExp/regress-28686.js index 669455ba6893..1e3871f1968c 100644 --- a/js/src/tests/ecma_3/RegExp/regress-28686.js +++ b/js/src/tests/ecma_3/RegExp/regress-28686.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001-n.js b/js/src/tests/ecma_3/Unicode/uc-001-n.js index 80dc1a782939..566c7459f5a7 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001.js b/js/src/tests/ecma_3/Unicode/uc-001.js index 2a81693d5ff1..bfb8fd515ef4 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001.js +++ b/js/src/tests/ecma_3/Unicode/uc-001.js @@ -1,6 +1,5 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002-n.js b/js/src/tests/ecma_3/Unicode/uc-002-n.js index 6d673f88b983..ca09090d6304 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-002-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002.js b/js/src/tests/ecma_3/Unicode/uc-002.js index 93d78b9ebb70..1ff15d3769ab 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002.js +++ b/js/src/tests/ecma_3/Unicode/uc-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-003.js b/js/src/tests/ecma_3/Unicode/uc-003.js index f77b3b9dcea0..d06815cf941a 100644 --- a/js/src/tests/ecma_3/Unicode/uc-003.js +++ b/js/src/tests/ecma_3/Unicode/uc-003.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-004.js b/js/src/tests/ecma_3/Unicode/uc-004.js index a82eb3528c37..5d243d56de3f 100644 --- a/js/src/tests/ecma_3/Unicode/uc-004.js +++ b/js/src/tests/ecma_3/Unicode/uc-004.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js index 08b9f52d499a..fbbcecd3bc99 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js index c768f1f046f8..0d4e1767e5e4 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/GetSet/getset-002.js b/js/src/tests/js1_5/GetSet/getset-002.js index 114a282fb778..d2a5c2218024 100644 --- a/js/src/tests/js1_5/GetSet/getset-002.js +++ b/js/src/tests/js1_5/GetSet/getset-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001-n.js b/js/src/tests/js1_5/extensions/catchguard-001-n.js index 8d357fd39ac4..8e0a5ad7feee 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001-n.js +++ b/js/src/tests/js1_5/extensions/catchguard-001-n.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001.js b/js/src/tests/js1_5/extensions/catchguard-001.js index c1e447f105f4..da531a13ec3b 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001.js +++ b/js/src/tests/js1_5/extensions/catchguard-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-002.js b/js/src/tests/js1_5/extensions/catchguard-002.js index 8148ca45e455..da590140236a 100644 --- a/js/src/tests/js1_5/extensions/catchguard-002.js +++ b/js/src/tests/js1_5/extensions/catchguard-002.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-003.js b/js/src/tests/js1_5/extensions/catchguard-003.js index 9e64f89d23ed..97f2cbfea310 100644 --- a/js/src/tests/js1_5/extensions/catchguard-003.js +++ b/js/src/tests/js1_5/extensions/catchguard-003.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/getset-001.js b/js/src/tests/js1_5/extensions/getset-001.js index 2e6b9488dab5..2609f359aa9c 100644 --- a/js/src/tests/js1_5/extensions/getset-001.js +++ b/js/src/tests/js1_5/extensions/getset-001.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447-1.js b/js/src/tests/js1_5/extensions/regress-50447-1.js index 55ca6aca7f00..96d801b128d8 100644 --- a/js/src/tests/js1_5/extensions/regress-50447-1.js +++ b/js/src/tests/js1_5/extensions/regress-50447-1.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447.js b/js/src/tests/js1_5/extensions/regress-50447.js index 1621d5576395..32044a8edc4e 100644 --- a/js/src/tests/js1_5/extensions/regress-50447.js +++ b/js/src/tests/js1_5/extensions/regress-50447.js @@ -1,6 +1,5 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_6/shell.js b/js/src/tests/js1_6/shell.js index d378e171db67..a5bfae873392 100644 --- a/js/src/tests/js1_6/shell.js +++ b/js/src/tests/js1_6/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_7/shell.js b/js/src/tests/js1_7/shell.js index 13cf0022e7a7..9c935544e6ca 100644 --- a/js/src/tests/js1_7/shell.js +++ b/js/src/tests/js1_7/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_8/shell.js b/js/src/tests/js1_8/shell.js index d61c2d6a07b9..934ae1489d02 100644 --- a/js/src/tests/js1_8/shell.js +++ b/js/src/tests/js1_8/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/js1_8_1/shell.js b/js/src/tests/js1_8_1/shell.js index d8fe725b7444..f4eadfbb411d 100644 --- a/js/src/tests/js1_8_1/shell.js +++ b/js/src/tests/js1_8_1/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * * 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/. */ diff --git a/js/src/tests/shell.js b/js/src/tests/shell.js index 08abb3bb518e..c2d42e4e6fd3 100644 --- a/js/src/tests/shell.js +++ b/js/src/tests/shell.js @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * * 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/. */ diff --git a/js/src/vm/ArgumentsObject-inl.h b/js/src/vm/ArgumentsObject-inl.h index b94c1de19f4e..c442eda6e559 100644 --- a/js/src/vm/ArgumentsObject-inl.h +++ b/js/src/vm/ArgumentsObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ArgumentsObject.cpp b/js/src/vm/ArgumentsObject.cpp index f53e0d639d31..b7598bab1aaf 100644 --- a/js/src/vm/ArgumentsObject.cpp +++ b/js/src/vm/ArgumentsObject.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ArgumentsObject.h b/js/src/vm/ArgumentsObject.h index 162ceeea73e4..fbb70f0b84f4 100644 --- a/js/src/vm/ArgumentsObject.h +++ b/js/src/vm/ArgumentsObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/BooleanObject-inl.h b/js/src/vm/BooleanObject-inl.h index c36e75d05111..b84171b8eb1d 100644 --- a/js/src/vm/BooleanObject-inl.h +++ b/js/src/vm/BooleanObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/BooleanObject.h b/js/src/vm/BooleanObject.h index 0df94da2cf86..3892a404e19e 100644 --- a/js/src/vm/BooleanObject.h +++ b/js/src/vm/BooleanObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/CharacterEncoding.cpp b/js/src/vm/CharacterEncoding.cpp index 96d94d86cb19..79266f4fd4db 100644 --- a/js/src/vm/CharacterEncoding.cpp +++ b/js/src/vm/CharacterEncoding.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 2f363a4a0d51..48acbbbcbbb8 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp index 4bf194cf7add..9c839c7ef156 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "DateTime.h" diff --git a/js/src/vm/DateTime.h b/js/src/vm/DateTime.h index 4dff3186439e..3d006a8f7654 100644 --- a/js/src/vm/DateTime.h +++ b/js/src/vm/DateTime.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef DateTime_h___ #define DateTime_h___ diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index a2d6598cfb2d..cd8d5e7cf4f8 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index cda35fb0d7d8..69c5230ce203 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ForkJoin.cpp b/js/src/vm/ForkJoin.cpp index 6c654568eeeb..f636cbae1a21 100644 --- a/js/src/vm/ForkJoin.cpp +++ b/js/src/vm/ForkJoin.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ForkJoin.h b/js/src/vm/ForkJoin.h index 1b89efdc4377..a5c244310e73 100644 --- a/js/src/vm/ForkJoin.h +++ b/js/src/vm/ForkJoin.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject-inl.h b/js/src/vm/GlobalObject-inl.h index 9797cfd3918b..06d103aee0f1 100644 --- a/js/src/vm/GlobalObject-inl.h +++ b/js/src/vm/GlobalObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index b6716c25683e..7e329bda043a 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index 783d4fdf18c7..3886b133c09b 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Keywords.h b/js/src/vm/Keywords.h index 0f0409a2e150..cc2d5dbc982e 100644 --- a/js/src/vm/Keywords.h +++ b/js/src/vm/Keywords.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set sw=4 ts=8 et tw=80: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/MatchPairs.h b/js/src/vm/MatchPairs.h index 8fd9320dab85..1018d7d67b33 100644 --- a/js/src/vm/MatchPairs.h +++ b/js/src/vm/MatchPairs.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Monitor.cpp b/js/src/vm/Monitor.cpp index 0cd21ae23443..f92ee48dc477 100644 --- a/js/src/vm/Monitor.cpp +++ b/js/src/vm/Monitor.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Monitor.h b/js/src/vm/Monitor.h index e13f138ce939..9b0144586bde 100644 --- a/js/src/vm/Monitor.h +++ b/js/src/vm/Monitor.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumberObject-inl.h b/js/src/vm/NumberObject-inl.h index e2822f9cc375..651cb93d6ddd 100644 --- a/js/src/vm/NumberObject-inl.h +++ b/js/src/vm/NumberObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumberObject.h b/js/src/vm/NumberObject.h index dc0ab3bdea74..48ee6383da35 100644 --- a/js/src/vm/NumberObject.h +++ b/js/src/vm/NumberObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/NumericConversions.h b/js/src/vm/NumericConversions.h index 42e69d63dd75..674df8cb58c0 100644 --- a/js/src/vm/NumericConversions.h +++ b/js/src/vm/NumericConversions.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef NumericConversions_h___ #define NumericConversions_h___ diff --git a/js/src/vm/ObjectImpl-inl.h b/js/src/vm/ObjectImpl-inl.h index 8423dacb09ad..a4048fac745a 100644 --- a/js/src/vm/ObjectImpl-inl.h +++ b/js/src/vm/ObjectImpl-inl.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef ObjectImpl_inl_h___ #define ObjectImpl_inl_h___ diff --git a/js/src/vm/ObjectImpl.cpp b/js/src/vm/ObjectImpl.cpp index c009fc680b5e..7375b3da6419 100644 --- a/js/src/vm/ObjectImpl.cpp +++ b/js/src/vm/ObjectImpl.cpp @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "mozilla/Assertions.h" #include "mozilla/Attributes.h" diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index d683b4380ef6..a765088b45fe 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef ObjectImpl_h___ #define ObjectImpl_h___ diff --git a/js/src/vm/ParallelDo.cpp b/js/src/vm/ParallelDo.cpp index 6f4b63fdb064..461e5acff556 100644 --- a/js/src/vm/ParallelDo.cpp +++ b/js/src/vm/ParallelDo.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ParallelDo.h b/js/src/vm/ParallelDo.h index 807174528857..3188c147bd54 100644 --- a/js/src/vm/ParallelDo.h +++ b/js/src/vm/ParallelDo.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/PropertyKey.cpp b/js/src/vm/PropertyKey.cpp index d7ca7b371607..0935cd377c8b 100644 --- a/js/src/vm/PropertyKey.cpp +++ b/js/src/vm/PropertyKey.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h index d6a0f04fac13..d1f3371356d2 100644 --- a/js/src/vm/RegExpObject-inl.h +++ b/js/src/vm/RegExpObject-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index e5dc014b5ba6..e26bb82834be 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h index 61d329dedc73..929d7147ee06 100644 --- a/js/src/vm/RegExpObject.h +++ b/js/src/vm/RegExpObject.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics-inl.h b/js/src/vm/RegExpStatics-inl.h index d70fdf2dccec..8b8842e40c71 100644 --- a/js/src/vm/RegExpStatics-inl.h +++ b/js/src/vm/RegExpStatics-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics.cpp b/js/src/vm/RegExpStatics.cpp index ff4b46b514b8..662c8e68596f 100644 --- a/js/src/vm/RegExpStatics.cpp +++ b/js/src/vm/RegExpStatics.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/RegExpStatics.h b/js/src/vm/RegExpStatics.h index 9a7a84e934da..422424f91a0a 100644 --- a/js/src/vm/RegExpStatics.h +++ b/js/src/vm/RegExpStatics.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SPSProfiler.cpp b/js/src/vm/SPSProfiler.cpp index 8e44d71ca853..d39903b61960 100644 --- a/js/src/vm/SPSProfiler.cpp +++ b/js/src/vm/SPSProfiler.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SPSProfiler.h b/js/src/vm/SPSProfiler.h index 80c6b09e6baf..16defd8a6f94 100644 --- a/js/src/vm/SPSProfiler.h +++ b/js/src/vm/SPSProfiler.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject-inl.h b/js/src/vm/ScopeObject-inl.h index 63daedcba784..d85c8879ac26 100644 --- a/js/src/vm/ScopeObject-inl.h +++ b/js/src/vm/ScopeObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject.cpp b/js/src/vm/ScopeObject.cpp index d101aaf222c4..e9fffddbb290 100644 --- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 6; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ScopeObject.h b/js/src/vm/ScopeObject.h index fdb9303803e9..b9cb94f584eb 100644 --- a/js/src/vm/ScopeObject.h +++ b/js/src/vm/ScopeObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index a6aa8f4f0212..356fec739a0d 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=99 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index b0d0ab45f502..2abc80cfaa94 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 8e3c7996f461..674e67958f74 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 46ed68612c14..73986fa1294c 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h index 4d77179b9a29..a925de1e4e9c 100644 --- a/js/src/vm/Stack-inl.h +++ b/js/src/vm/Stack-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index 5780e66b656c..2bd273a71dae 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index e10c627d5f22..e197fc03fcec 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String-inl.h b/js/src/vm/String-inl.h index 7be763b696d9..981a9651b55d 100644 --- a/js/src/vm/String-inl.h +++ b/js/src/vm/String-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String.cpp b/js/src/vm/String.cpp index d6d550fd40bf..1bb9b86c641f 100644 --- a/js/src/vm/String.cpp +++ b/js/src/vm/String.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/String.h b/js/src/vm/String.h index 9fd5899cd988..e7769c0e4ec9 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=4 sw=4 et tw=79 ft=cpp: - * +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/StringBuffer.cpp b/js/src/vm/StringBuffer.cpp index 459571a70dc6..1ecc31c7f046 100644 --- a/js/src/vm/StringBuffer.cpp +++ b/js/src/vm/StringBuffer.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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 "vm/StringBuffer.h" diff --git a/js/src/vm/StringBuffer.h b/js/src/vm/StringBuffer.h index 7706e83032dd..92ab4f8c6eeb 100644 --- a/js/src/vm/StringBuffer.h +++ b/js/src/vm/StringBuffer.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ + * 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/. */ #ifndef StringBuffer_h___ #define StringBuffer_h___ diff --git a/js/src/vm/StringObject-inl.h b/js/src/vm/StringObject-inl.h index 0940081d9e0e..b1b01bbdddc3 100644 --- a/js/src/vm/StringObject-inl.h +++ b/js/src/vm/StringObject-inl.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/StringObject.h b/js/src/vm/StringObject.h index 75446443365c..59510956a0e6 100644 --- a/js/src/vm/StringObject.h +++ b/js/src/vm/StringObject.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/ThreadPool.cpp b/js/src/vm/ThreadPool.cpp index 7eee4965cc11..754ad507d2cd 100644 --- a/js/src/vm/ThreadPool.cpp +++ b/js/src/vm/ThreadPool.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ -/* vim: set ts=4 sw=4 et tw=99: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/ThreadPool.h b/js/src/vm/ThreadPool.h index 901894137ad8..75698d526ad5 100644 --- a/js/src/vm/ThreadPool.h +++ b/js/src/vm/ThreadPool.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Unicode.h b/js/src/vm/Unicode.h index a83a0925de36..27fde7a60373 100644 --- a/js/src/vm/Unicode.h +++ b/js/src/vm/Unicode.h @@ -1,4 +1,6 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ diff --git a/js/src/vm/Xdr.cpp b/js/src/vm/Xdr.cpp index 34fc4b6b0668..d248926f9cca 100644 --- a/js/src/vm/Xdr.cpp +++ b/js/src/vm/Xdr.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 3ad573a6de0f..46a00ba9de51 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: - * + * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/yarr/ASCIICType.h b/js/src/yarr/ASCIICType.h index a3ae9f4455e2..2082b758bc56 100644 --- a/js/src/yarr/ASCIICType.h +++ b/js/src/yarr/ASCIICType.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. diff --git a/js/src/yarr/BumpPointerAllocator.h b/js/src/yarr/BumpPointerAllocator.h index 6d23a684831e..a43a5d8ba2d4 100644 --- a/js/src/yarr/BumpPointerAllocator.h +++ b/js/src/yarr/BumpPointerAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/CheckedArithmetic.h b/js/src/yarr/CheckedArithmetic.h index 0f60971d0f1f..21aa188bd969 100644 --- a/js/src/yarr/CheckedArithmetic.h +++ b/js/src/yarr/CheckedArithmetic.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2011 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/MatchResult.h b/js/src/yarr/MatchResult.h index e28ac4bbf42f..4ebc936779d5 100644 --- a/js/src/yarr/MatchResult.h +++ b/js/src/yarr/MatchResult.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/OSAllocator.h b/js/src/yarr/OSAllocator.h index ecfdc3b042ec..c8b815b52d2e 100644 --- a/js/src/yarr/OSAllocator.h +++ b/js/src/yarr/OSAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorOS2.cpp b/js/src/yarr/OSAllocatorOS2.cpp index ead003084dd1..466b9e949d81 100644 --- a/js/src/yarr/OSAllocatorOS2.cpp +++ b/js/src/yarr/OSAllocatorOS2.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorPosix.cpp b/js/src/yarr/OSAllocatorPosix.cpp index 99bf061467ca..013b6af0771a 100644 --- a/js/src/yarr/OSAllocatorPosix.cpp +++ b/js/src/yarr/OSAllocatorPosix.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorWin.cpp b/js/src/yarr/OSAllocatorWin.cpp index 08df9e98aefb..a5d5fa7db823 100644 --- a/js/src/yarr/OSAllocatorWin.cpp +++ b/js/src/yarr/OSAllocatorWin.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageAllocation.h b/js/src/yarr/PageAllocation.h index a86f37116e50..42a57f6ae5fe 100644 --- a/js/src/yarr/PageAllocation.h +++ b/js/src/yarr/PageAllocation.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.cpp b/js/src/yarr/PageBlock.cpp index 047172d6476f..0ffc1bc95157 100644 --- a/js/src/yarr/PageBlock.cpp +++ b/js/src/yarr/PageBlock.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.h b/js/src/yarr/PageBlock.h index 145bb0a8d63a..ea98f42f2237 100644 --- a/js/src/yarr/PageBlock.h +++ b/js/src/yarr/PageBlock.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/VMTags.h b/js/src/yarr/VMTags.h index fe6a006d3601..f44136907fe7 100644 --- a/js/src/yarr/VMTags.h +++ b/js/src/yarr/VMTags.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/Yarr.h b/js/src/yarr/Yarr.h index 110ae4124bed..da9a0ec70f33 100644 --- a/js/src/yarr/Yarr.h +++ b/js/src/yarr/Yarr.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * All rights reserved. diff --git a/js/src/yarr/YarrCanonicalizeUCS2.cpp b/js/src/yarr/YarrCanonicalizeUCS2.cpp index ce3a372a6a63..e6d334212fd3 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.cpp +++ b/js/src/yarr/YarrCanonicalizeUCS2.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrCanonicalizeUCS2.h b/js/src/yarr/YarrCanonicalizeUCS2.h index 735064ac803b..874af40e8693 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.h +++ b/js/src/yarr/YarrCanonicalizeUCS2.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrInterpreter.cpp b/js/src/yarr/YarrInterpreter.cpp index 296e7d5c9559..176fa381ac6e 100644 --- a/js/src/yarr/YarrInterpreter.cpp +++ b/js/src/yarr/YarrInterpreter.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * diff --git a/js/src/yarr/YarrInterpreter.h b/js/src/yarr/YarrInterpreter.h index ae40fa7d1cac..0a3da2fbb1c9 100644 --- a/js/src/yarr/YarrInterpreter.h +++ b/js/src/yarr/YarrInterpreter.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrJIT.cpp b/js/src/yarr/YarrJIT.cpp index 225933ff5a5a..d570f4697d42 100644 --- a/js/src/yarr/YarrJIT.cpp +++ b/js/src/yarr/YarrJIT.cpp @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrJIT.h b/js/src/yarr/YarrJIT.h index fad19adfdf44..b4c03b7e9b23 100644 --- a/js/src/yarr/YarrJIT.h +++ b/js/src/yarr/YarrJIT.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrParser.h b/js/src/yarr/YarrParser.h index f5d1aca6095c..7cbeea0f010d 100644 --- a/js/src/yarr/YarrParser.h +++ b/js/src/yarr/YarrParser.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrPattern.cpp b/js/src/yarr/YarrPattern.cpp index f091b984884c..3de728032c18 100644 --- a/js/src/yarr/YarrPattern.cpp +++ b/js/src/yarr/YarrPattern.cpp @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrPattern.h b/js/src/yarr/YarrPattern.h index 737de608199f..3baaf5369ed1 100644 --- a/js/src/yarr/YarrPattern.h +++ b/js/src/yarr/YarrPattern.h @@ -1,4 +1,5 @@ -/* vim: set ts=4 sw=4 tw=99 et: +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrSyntaxChecker.cpp b/js/src/yarr/YarrSyntaxChecker.cpp index 34fb5010cfc9..bd4b8dc05025 100644 --- a/js/src/yarr/YarrSyntaxChecker.cpp +++ b/js/src/yarr/YarrSyntaxChecker.cpp @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrSyntaxChecker.h b/js/src/yarr/YarrSyntaxChecker.h index b6848e752681..e42d8afa8184 100644 --- a/js/src/yarr/YarrSyntaxChecker.h +++ b/js/src/yarr/YarrSyntaxChecker.h @@ -1,4 +1,6 @@ -/* +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h index a7646b87ea34..890b269355f0 100644 --- a/js/src/yarr/wtfbridge.h +++ b/js/src/yarr/wtfbridge.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: */ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ From 040ed30c64ce4775432d973ea6701bef6aa8f726 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 15 Apr 2013 14:41:46 -0400 Subject: [PATCH 179/438] Bug 748495 - Don't call setCSSViewport unnecessarily. r=Cwiiis --- mobile/android/chrome/content/browser.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 93f4b921f803..f0a85a37c626 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3567,7 +3567,12 @@ Tab.prototype = { }, setBrowserSize: function(aWidth, aHeight) { + if (Math.abs(this.browserWidth - aWidth) < 1e-6 && Math.abs(this.browserHeight - aHeight) < 1e-6) { + return; + } + this.browserWidth = aWidth; + this.browserHeight = aHeight; if (!this.browser.contentWindow) return; From e021e62e302e86fdcdbe360e9e78070bbb13f08e Mon Sep 17 00:00:00 2001 From: David Keeler Date: Mon, 15 Apr 2013 11:51:52 -0700 Subject: [PATCH 180/438] bug 847621 - follow-up to fix SOURCE url r=bsmith DONTBUILD because NPOTB --- security/manager/tools/getHSTSPreloadList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/manager/tools/getHSTSPreloadList.js b/security/manager/tools/getHSTSPreloadList.js index eafdee090d18..53f945bd41bb 100644 --- a/security/manager/tools/getHSTSPreloadList.js +++ b/security/manager/tools/getHSTSPreloadList.js @@ -30,7 +30,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource:///modules/XPCOMUtils.jsm"); -const SOURCE = "https://src.chromium.org/viewvc/chrome/trunk/src/net/http/transport_security_state_static.json"; +const SOURCE = "https://src.chromium.org/chrome/trunk/src/net/http/transport_security_state_static.json"; const OUTPUT = "nsSTSPreloadList.inc"; const ERROR_OUTPUT = "nsSTSPreloadList.errors"; const MINIMUM_REQUIRED_MAX_AGE = 60 * 60 * 24 * 7 * 18; From 2c149ba1b68c7a5d80c33009a2f3151a61328c0a Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 15 Apr 2013 12:22:31 -0700 Subject: [PATCH 181/438] Back out e6f337d218b4 (bug 768288) for bug648747.js jit-test failures CLOSED TREE --- js/src/ion/IonBuilder.cpp | 89 ++++++++++++--------------------------- js/src/ion/TypeOracle.cpp | 6 +++ js/src/jsanalyze.cpp | 2 +- js/src/jsscript.cpp | 1 - js/src/jsscript.h | 28 ++---------- 5 files changed, 36 insertions(+), 90 deletions(-) diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index cf372aa04ddb..8a4b4f8f8974 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -202,8 +202,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript inlineScript(cx, target->nonLazyScript()); ExecutionMode executionMode = info().executionMode(); if (!CanIonCompile(inlineScript, executionMode)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to disable Ion compilation", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to disable Ion compilation"); return false; } @@ -212,8 +211,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) ion::IsBaselineEnabled(cx) && !inlineScript->hasBaselineScript()) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline target with no baseline jitcode", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline target with no baseline jitcode"); return false; } @@ -221,8 +219,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) IonBuilder *builder = callerBuilder_; while (builder) { if (builder->script() == inlineScript) { - IonSpew(IonSpew_Inlining, "%s:%d Not inlining recursive call", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Not inlining recursive call"); return false; } builder = builder->callerBuilder_; @@ -231,15 +228,12 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) RootedScript callerScript(cx, script()); if (!oracle->canEnterInlinedFunction(target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to oracle veto %d", - inlineScript->filename(), inlineScript->lineno, - script()->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to oracle veto %d", script()->lineno); return false; } if (!oracle->callReturnTypeSetMatches(callerScript, pc, target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to return typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to return typeset mismatch"); return false; } @@ -248,8 +242,7 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // For constructing calls the typeset of caller should intersect the callee's typeset. // Except for the |this| type, because that is created during execution depending on target. if (!oracle->callArgsTypeSetIntersects(NULL, callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } else if (JSOp(*pc) == JSOP_FUNAPPLY) { @@ -258,25 +251,18 @@ IonBuilder::canInlineTarget(JSFunction *target, CallInfo &callInfo) // of fun.apply. Seeing a new type will only be noticed in the inlined call and // result in missed types in TI. if (!oracle->callArgsTypeSetMatches(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } else { // For normal calls the typeset of caller should intersect the callee's typeset. if (!oracle->callArgsTypeSetIntersects(callInfo.thisType(), callInfo.argvType(), target)) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to arguments typeset mismatch", - inlineScript->filename(), inlineScript->lineno); + IonSpew(IonSpew_Inlining, "Cannot inline due to arguments typeset mismatch"); return false; } } - if (inlineScript->hasIonScript() && inlineScript->ionScript()->bailoutExpected()) { - IonSpew(IonSpew_Inlining, "%s:%d Cannot inline due to known bailing script", - inlineScript->filename(), inlineScript->lineno); - return false; - } - + IonSpew(IonSpew_Inlining, "Inlining good to go!"); return true; } @@ -3239,17 +3225,24 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) // Heuristics! - IonBuilder *baseBuilder = this; - while (baseBuilder->callerBuilder_) - baseBuilder = baseBuilder->callerBuilder_; + // Cap the inlining depth. + if (IsSmallFunction(targetScript)) { + if (inliningDepth_ >= js_IonOptions.smallFunctionMaxInlineDepth) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", + targetScript->filename(), targetScript->lineno); + return false; + } + } else { + if (inliningDepth_ >= js_IonOptions.maxInlineDepth) { + IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding allowed inline depth", + targetScript->filename(), targetScript->lineno); + return false; + } + } - // When caller is excessively large only inline small functions. - if (script()->length > js_IonOptions.inlineMaxTotalBytecodeLength && - !IsSmallFunction(targetScript)) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: caller excessively large.", - targetScript->filename(), targetScript->lineno); - return false; - } + // Always inline the empty script up to the inlining depth. + if (targetScript->length == 1) + return true; // Callee must not be excessively large. // This heuristic also applies to the callsite as a whole. @@ -3274,36 +3267,6 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo) return false; } - // Cap the inlining depth. - uint32_t scriptMaxInlineDepth = targetScript->maxInlineDepth(); - uint32_t globalMaxInlineDepth = js_IonOptions.maxInlineDepth; - if (IsSmallFunction(targetScript)) - globalMaxInlineDepth = js_IonOptions.smallFunctionMaxInlineDepth; - - // Cap the global inline depth. - if (inliningDepth_ >= globalMaxInlineDepth) { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding global inline depth", - targetScript->filename(), targetScript->lineno); - baseBuilder->script()->disableInlineDepthCheck(); - return false; - } - - // Cap on scripts inline depth. - if (inliningDepth_ >= scriptMaxInlineDepth) - { - IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: exceeding script inline depth.", - targetScript->filename(), targetScript->lineno); - return false; - } - - // Update scripts max inline depth - // I.e. make sure that all known scripts that get inlined by this script still get inlined. - if (!baseBuilder->script()->isInlineDepthCheckDisabled()) { - uint32_t updatedInlineDepth = globalMaxInlineDepth - inliningDepth_ - 1; - if (updatedInlineDepth < baseBuilder->script()->maxInlineDepth()) - baseBuilder->script()->setMaxInlineDepth(updatedInlineDepth); - } - return true; } diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index 6ad76ecaa892..a54068563498 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -702,6 +702,12 @@ TypeInferenceOracle::canEnterInlinedFunction(RawFunction target) { RootedScript targetScript(cx, target->nonLazyScript()); + // Make sure empty script has type information, to allow inlining in more cases. + if (targetScript->length == 1) { + if (!targetScript->ensureRanInference(cx)) + return false; + } + if (!targetScript->hasAnalysis() || !targetScript->analysis()->ranInference() || !targetScript->analysis()->ranSSA()) diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index 43dd7ea25d02..bda8e36751e5 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -77,7 +77,7 @@ ScriptAnalysis::addJump(JSContext *cx, unsigned offset, if (offset < *currentOffset) { /* Scripts containing loops are never inlined. */ - isJaegerInlineable = false; + isJaegerInlineable = isIonInlineable = false; hasLoops_ = true; if (code->analyzed) { diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 358f76c8f547..3135a6159e31 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1687,7 +1687,6 @@ JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun script->sourceStart = bufStart; script->sourceEnd = bufEnd; script->userBit = options.userBit; - script->maxInlineDepth_ = uint8_t(-1); return script; } diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 14c76c85bb4d..38f8b8d69d6e 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -426,6 +426,9 @@ class JSScript : public js::gc::Cell // 16-bit fields. + private: + uint16_t PADDING16; + uint16_t version; /* JS version under which script was compiled */ public: @@ -441,11 +444,6 @@ class JSScript : public js::gc::Cell uint16_t staticLevel;/* static level for display maintenance */ // 8-bit fields. - private: - uint8_t maxInlineDepth_; /* script max inline depth (IonMonkey) - uint8_t(-1): unitialized - uint8_t(-2): disabled */ - uint8_t PADDING8; public: // The kinds of the optional arrays. @@ -809,26 +807,6 @@ class JSScript : public js::gc::Cell return maxLoopCount; } - void setMaxInlineDepth(uint32_t maxInlineDepth) { - if (maxInlineDepth >= uint8_t(-2)) { - disableInlineDepthCheck(); - return; - } - maxInlineDepth_ = maxInlineDepth; - } - - uint8_t maxInlineDepth() const { - return maxInlineDepth_; - } - - void disableInlineDepthCheck() { - maxInlineDepth_ = uint8_t(-2); - } - - bool isInlineDepthCheckDisabled() { - return maxInlineDepth_ == uint8_t(-2); - } - /* * Size of the JITScript and all sections. If |mallocSizeOf| is NULL, the * size is computed analytically. (This method is implemented in From 055e8d693c254e4a58ecc62966bff9624702af85 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Mon, 15 Apr 2013 12:45:29 -0700 Subject: [PATCH 182/438] Bug 848519 - Part 1: Move files. r=gavin --HG-- rename : services/common/preferences.js => toolkit/modules/Preferences.jsm rename : services/common/tests/unit/test_preferences.js => toolkit/modules/tests/xpcshell/test_Preferences.js --- services/common/preferences.js => toolkit/modules/Preferences.jsm | 0 .../modules/tests/xpcshell/test_Preferences.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename services/common/preferences.js => toolkit/modules/Preferences.jsm (100%) rename services/common/tests/unit/test_preferences.js => toolkit/modules/tests/xpcshell/test_Preferences.js (100%) diff --git a/services/common/preferences.js b/toolkit/modules/Preferences.jsm similarity index 100% rename from services/common/preferences.js rename to toolkit/modules/Preferences.jsm diff --git a/services/common/tests/unit/test_preferences.js b/toolkit/modules/tests/xpcshell/test_Preferences.js similarity index 100% rename from services/common/tests/unit/test_preferences.js rename to toolkit/modules/tests/xpcshell/test_Preferences.js From 9ecf1e93c14a0a7935a3ea50ce5e2663213795a0 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Mon, 15 Apr 2013 12:45:33 -0700 Subject: [PATCH 183/438] Bug 848519 - Part 2: Update Makefile.in and test harness. r=gavin --- services/common/Makefile.in | 1 - services/common/tests/unit/test_load_modules.js | 1 - services/common/tests/unit/xpcshell.ini | 1 - toolkit/modules/Makefile.in | 1 + toolkit/modules/tests/xpcshell/test_Preferences.js | 4 +++- toolkit/modules/tests/xpcshell/xpcshell.ini | 1 + 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/common/Makefile.in b/services/common/Makefile.in index db08d99b2248..cf9a878e8a16 100644 --- a/services/common/Makefile.in +++ b/services/common/Makefile.in @@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk modules := \ log4moz.js \ - preferences.js \ storageservice.js \ stringbundle.js \ tokenserverclient.js \ diff --git a/services/common/tests/unit/test_load_modules.js b/services/common/tests/unit/test_load_modules.js index 06c2005747b3..abb5b659f8a6 100644 --- a/services/common/tests/unit/test_load_modules.js +++ b/services/common/tests/unit/test_load_modules.js @@ -5,7 +5,6 @@ const modules = [ "async.js", "bagheeraclient.js", "log4moz.js", - "preferences.js", "rest.js", "storageservice.js", "stringbundle.js", diff --git a/services/common/tests/unit/xpcshell.ini b/services/common/tests/unit/xpcshell.ini index 64c12a7e713a..d9314c193c44 100644 --- a/services/common/tests/unit/xpcshell.ini +++ b/services/common/tests/unit/xpcshell.ini @@ -27,7 +27,6 @@ firefox-appdir = browser [test_bagheera_client.js] [test_log4moz.js] [test_observers.js] -[test_preferences.js] [test_restrequest.js] [test_tokenauthenticatedrequest.js] diff --git a/toolkit/modules/Makefile.in b/toolkit/modules/Makefile.in index 338effd08bf1..353fba44dde9 100644 --- a/toolkit/modules/Makefile.in +++ b/toolkit/modules/Makefile.in @@ -11,6 +11,7 @@ include $(DEPTH)/config/autoconf.mk EXTRA_JS_MODULES := \ NewTabUtils.jsm \ + Preferences.jsm \ Sqlite.jsm \ TelemetryTimestamps.jsm \ Timer.jsm \ diff --git a/toolkit/modules/tests/xpcshell/test_Preferences.js b/toolkit/modules/tests/xpcshell/test_Preferences.js index f144c4c9c6c6..2b08cb94b513 100644 --- a/toolkit/modules/tests/xpcshell/test_Preferences.js +++ b/toolkit/modules/tests/xpcshell/test_Preferences.js @@ -1,7 +1,9 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -Cu.import("resource://services-common/preferences.js"); +const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components; + +Cu.import("resource://gre/modules/Preferences.jsm"); function run_test() { run_next_test(); diff --git a/toolkit/modules/tests/xpcshell/xpcshell.ini b/toolkit/modules/tests/xpcshell/xpcshell.ini index de3b2dcac6ed..9b2b53a44e04 100644 --- a/toolkit/modules/tests/xpcshell/xpcshell.ini +++ b/toolkit/modules/tests/xpcshell/xpcshell.ini @@ -3,6 +3,7 @@ head = tail = [test_newtab-migrate-v1.js] +[test_Preferences.js] [test_sqlite.js] [test_TelemetryTimestamps.js] [test_timer.js] From 0481627d399ac1137cf7b3a0eb48071335d408b6 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Mon, 15 Apr 2013 12:45:37 -0700 Subject: [PATCH 184/438] Bug 848519 - Part 3: Replace services-common/preferences.js with gre/modules/Preferences.jsm in imports. r=gavin --- browser/base/content/abouthealthreport/abouthealth.js | 2 +- .../content/test/browser_datareporting_notification.js | 2 +- dom/push/src/PushService.js | 2 +- services/common/rest.js | 2 +- services/common/storageservice.js | 2 +- services/common/tests/unit/test_utils_dateprefs.js | 2 +- services/common/tokenserverclient.js | 2 +- services/datareporting/DataReportingService.js | 2 +- services/datareporting/sessions.jsm | 2 +- services/datareporting/tests/xpcshell/test_policy.js | 2 +- services/healthreport/healthreporter.jsm | 2 +- services/healthreport/providers.jsm | 2 +- .../healthreport/tests/xpcshell/test_healthreporter.js | 2 +- services/metrics/dataprovider.jsm | 2 +- .../metrics/tests/xpcshell/test_metrics_provider.js | 2 +- services/sync/modules/engines/addons.js | 2 +- services/sync/modules/engines/prefs.js | 2 +- services/sync/modules/engines/tabs.js | 2 +- services/sync/modules/resource.js | 2 +- services/sync/modules/service.js | 2 +- services/sync/modules/util.js | 10 +++++----- services/sync/tests/unit/test_addon_utils.js | 2 +- services/sync/tests/unit/test_addons_engine.js | 2 +- services/sync/tests/unit/test_addons_store.js | 2 +- services/sync/tests/unit/test_prefs_store.js | 2 +- services/sync/tests/unit/test_prefs_tracker.js | 2 +- services/sync/tests/unit/test_service_migratePrefs.js | 2 +- 27 files changed, 31 insertions(+), 31 deletions(-) diff --git a/browser/base/content/abouthealthreport/abouthealth.js b/browser/base/content/abouthealthreport/abouthealth.js index ad0aaa5fb094..84c054bca44b 100644 --- a/browser/base/content/abouthealthreport/abouthealth.js +++ b/browser/base/content/abouthealthreport/abouthealth.js @@ -6,7 +6,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); const reporter = Cc["@mozilla.org/datareporting/service;1"] diff --git a/browser/base/content/test/browser_datareporting_notification.js b/browser/base/content/test/browser_datareporting_notification.js index 2e7d3f7e67a0..78ff065b7f40 100644 --- a/browser/base/content/test/browser_datareporting_notification.js +++ b/browser/base/content/test/browser_datareporting_notification.js @@ -5,7 +5,7 @@ function sendNotifyRequest(name) { let ns = {}; Components.utils.import("resource://gre/modules/services/datareporting/policy.jsm", ns); - Components.utils.import("resource://services-common/preferences.js", ns); + Components.utils.import("resource://gre/modules/Preferences.jsm", ns); let service = Components.classes["@mozilla.org/datareporting/service;1"] .getService(Components.interfaces.nsISupports) diff --git a/dom/push/src/PushService.js b/dom/push/src/PushService.js index a4182c92b00b..17abe1c43e4a 100644 --- a/dom/push/src/PushService.js +++ b/dom/push/src/PushService.js @@ -17,7 +17,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/IndexedDBHelper.jsm"); Cu.import("resource://gre/modules/Timer.jsm"); -Cu.import("resource://gre/modules/services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); const prefs = new Preferences("services.push."); diff --git a/services/common/rest.js b/services/common/rest.js index f4dd4773cf1e..f0af94b90ea2 100644 --- a/services/common/rest.js +++ b/services/common/rest.js @@ -14,10 +14,10 @@ this.EXPORTED_SYMBOLS = [ #endif +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils", diff --git a/services/common/storageservice.js b/services/common/storageservice.js index 89670a31a5da..1cb8b3f6b79e 100644 --- a/services/common/storageservice.js +++ b/services/common/storageservice.js @@ -33,9 +33,9 @@ this.EXPORTED_SYMBOLS = [ const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-common/async.js"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/rest.js"); Cu.import("resource://services-common/utils.js"); diff --git a/services/common/tests/unit/test_utils_dateprefs.js b/services/common/tests/unit/test_utils_dateprefs.js index a11d354c7e5e..fcec5423572e 100644 --- a/services/common/tests/unit/test_utils_dateprefs.js +++ b/services/common/tests/unit/test_utils_dateprefs.js @@ -3,7 +3,7 @@ "use strict"; -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-common/utils.js"); diff --git a/services/common/tokenserverclient.js b/services/common/tokenserverclient.js index db7f4cf879ca..57a61e56d040 100644 --- a/services/common/tokenserverclient.js +++ b/services/common/tokenserverclient.js @@ -13,8 +13,8 @@ this.EXPORTED_SYMBOLS = [ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/rest.js"); Cu.import("resource://services-common/utils.js"); diff --git a/services/datareporting/DataReportingService.js b/services/datareporting/DataReportingService.js index 56919f93dd98..e9b262154e3d 100644 --- a/services/datareporting/DataReportingService.js +++ b/services/datareporting/DataReportingService.js @@ -6,8 +6,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); diff --git a/services/datareporting/sessions.jsm b/services/datareporting/sessions.jsm index f8aeaf131323..e0f524e00d38 100644 --- a/services/datareporting/sessions.jsm +++ b/services/datareporting/sessions.jsm @@ -14,9 +14,9 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; #endif +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); diff --git a/services/datareporting/tests/xpcshell/test_policy.js b/services/datareporting/tests/xpcshell/test_policy.js index 4fbbfee5582e..4cc9ad607332 100644 --- a/services/datareporting/tests/xpcshell/test_policy.js +++ b/services/datareporting/tests/xpcshell/test_policy.js @@ -5,7 +5,7 @@ const {utils: Cu} = Components; -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/services/datareporting/policy.jsm"); Cu.import("resource://testing-common/services/datareporting/mocks.jsm"); diff --git a/services/healthreport/healthreporter.jsm b/services/healthreport/healthreporter.jsm index c39a43a9e265..d11c85ef41af 100644 --- a/services/healthreport/healthreporter.jsm +++ b/services/healthreport/healthreporter.jsm @@ -19,10 +19,10 @@ Cu.import("resource://services-common/bagheeraclient.js"); #endif Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); Cu.import("resource://gre/modules/osfile.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/TelemetryStopwatch.jsm"); diff --git a/services/healthreport/providers.jsm b/services/healthreport/providers.jsm index 70cc560ae80d..49faea684efb 100644 --- a/services/healthreport/providers.jsm +++ b/services/healthreport/providers.jsm @@ -35,10 +35,10 @@ Cu.import("resource://gre/modules/Metrics.jsm"); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); Cu.import("resource://gre/modules/osfile.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", diff --git a/services/healthreport/tests/xpcshell/test_healthreporter.js b/services/healthreport/tests/xpcshell/test_healthreporter.js index f42626bbf951..3895da327f28 100644 --- a/services/healthreport/tests/xpcshell/test_healthreporter.js +++ b/services/healthreport/tests/xpcshell/test_healthreporter.js @@ -6,9 +6,9 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://services-common/observers.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); Cu.import("resource://gre/modules/Metrics.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/services/healthreport/healthreporter.jsm"); Cu.import("resource://gre/modules/services/datareporting/policy.jsm"); Cu.import("resource://gre/modules/Services.jsm"); diff --git a/services/metrics/dataprovider.jsm b/services/metrics/dataprovider.jsm index 0d1e4afab2b5..8679db8dfa0e 100644 --- a/services/metrics/dataprovider.jsm +++ b/services/metrics/dataprovider.jsm @@ -18,9 +18,9 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000; #endif Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Task.jsm"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); diff --git a/services/metrics/tests/xpcshell/test_metrics_provider.js b/services/metrics/tests/xpcshell/test_metrics_provider.js index d204c600ab32..af4cd8098f4e 100644 --- a/services/metrics/tests/xpcshell/test_metrics_provider.js +++ b/services/metrics/tests/xpcshell/test_metrics_provider.js @@ -6,8 +6,8 @@ const {utils: Cu} = Components; Cu.import("resource://gre/modules/Metrics.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://testing-common/services/metrics/mocks.jsm"); diff --git a/services/sync/modules/engines/addons.js b/services/sync/modules/engines/addons.js index c9299eb04964..d8cf014be0ea 100644 --- a/services/sync/modules/engines/addons.js +++ b/services/sync/modules/engines/addons.js @@ -42,8 +42,8 @@ Cu.import("resource://services-sync/record.js"); Cu.import("resource://services-sync/util.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-common/async.js"); -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index d6363c6f9e7f..2418cd0dc5be 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -15,8 +15,8 @@ Cu.import("resource://services-sync/record.js"); Cu.import("resource://services-sync/util.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-common/utils.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://gre/modules/LightweightThemeManager.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); const PREFS_GUID = CommonUtils.encodeBase64URL(Services.appinfo.ID); diff --git a/services/sync/modules/engines/tabs.js b/services/sync/modules/engines/tabs.js index ad1331e5cc5e..24dbf0b2fae2 100644 --- a/services/sync/modules/engines/tabs.js +++ b/services/sync/modules/engines/tabs.js @@ -10,13 +10,13 @@ const Cu = Components.utils; const TABS_TTL = 604800; // 7 days +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://services-sync/engines.js"); Cu.import("resource://services-sync/engines/clients.js"); Cu.import("resource://services-sync/record.js"); Cu.import("resource://services-sync/util.js"); Cu.import("resource://services-sync/constants.js"); -Cu.import("resource://services-common/preferences.js"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); diff --git a/services/sync/modules/resource.js b/services/sync/modules/resource.js index bb5b8b53c78f..e6587cd43f07 100644 --- a/services/sync/modules/resource.js +++ b/services/sync/modules/resource.js @@ -12,10 +12,10 @@ const Ci = Components.interfaces; const Cr = Components.results; const Cu = Components.utils; +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-common/async.js"); Cu.import("resource://services-common/log4moz.js"); Cu.import("resource://services-common/observers.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/util.js"); diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 905f2509dea8..fcb8275c4703 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -18,9 +18,9 @@ const PBKDF2_KEY_BYTES = 16; const CRYPTO_COLLECTION = "crypto"; const KEYS_WBO = "keys"; +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://services-common/log4moz.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/engines.js"); diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index 915920b640ff..32d85b4c316a 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -9,17 +9,17 @@ const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; Cu.import("resource://services-common/log4moz.js"); Cu.import("resource://services-common/observers.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/stringbundle.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-common/async.js", this); Cu.import("resource://services-crypto/utils.js"); Cu.import("resource://services-sync/constants.js"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); -Cu.import("resource://gre/modules/Services.jsm", this); -Cu.import("resource://gre/modules/PlacesUtils.jsm", this); -Cu.import("resource://gre/modules/NetUtil.jsm", this); Cu.import("resource://gre/modules/FileUtils.jsm", this); +Cu.import("resource://gre/modules/NetUtil.jsm", this); +Cu.import("resource://gre/modules/PlacesUtils.jsm", this); +Cu.import("resource://gre/modules/Preferences.jsm"); +Cu.import("resource://gre/modules/Services.jsm", this); +Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); /* * Utility functions diff --git a/services/sync/tests/unit/test_addon_utils.js b/services/sync/tests/unit/test_addon_utils.js index b1ab9cd0d08a..49824cd4ce15 100644 --- a/services/sync/tests/unit/test_addon_utils.js +++ b/services/sync/tests/unit/test_addon_utils.js @@ -3,7 +3,7 @@ "use strict"; -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-sync/addonutils.js"); Cu.import("resource://services-sync/util.js"); diff --git a/services/sync/tests/unit/test_addons_engine.js b/services/sync/tests/unit/test_addons_engine.js index 3bcb94accac1..4244ddc2a45a 100644 --- a/services/sync/tests/unit/test_addons_engine.js +++ b/services/sync/tests/unit/test_addons_engine.js @@ -4,9 +4,9 @@ "use strict"; Cu.import("resource://gre/modules/AddonManager.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://services-common/async.js"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-sync/addonsreconciler.js"); Cu.import("resource://services-sync/engines/addons.js"); Cu.import("resource://services-sync/service.js"); diff --git a/services/sync/tests/unit/test_addons_store.js b/services/sync/tests/unit/test_addons_store.js index 86198c8d39b8..4a0e419ab0c2 100644 --- a/services/sync/tests/unit/test_addons_store.js +++ b/services/sync/tests/unit/test_addons_store.js @@ -3,7 +3,7 @@ "use strict"; -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-sync/addonutils.js"); Cu.import("resource://services-sync/engines/addons.js"); Cu.import("resource://services-sync/service.js"); diff --git a/services/sync/tests/unit/test_prefs_store.js b/services/sync/tests/unit/test_prefs_store.js index dd007ecec4db..35a2ece1fe9b 100644 --- a/services/sync/tests/unit/test_prefs_store.js +++ b/services/sync/tests/unit/test_prefs_store.js @@ -2,8 +2,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ Cu.import("resource://gre/modules/LightweightThemeManager.jsm"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/engines/prefs.js"); Cu.import("resource://services-sync/service.js"); diff --git a/services/sync/tests/unit/test_prefs_tracker.js b/services/sync/tests/unit/test_prefs_tracker.js index dd45f239852f..17ccaa43e30f 100644 --- a/services/sync/tests/unit/test_prefs_tracker.js +++ b/services/sync/tests/unit/test_prefs_tracker.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/engines/prefs.js"); diff --git a/services/sync/tests/unit/test_service_migratePrefs.js b/services/sync/tests/unit/test_service_migratePrefs.js index 72dd2c6e209a..89a147c06a43 100644 --- a/services/sync/tests/unit/test_service_migratePrefs.js +++ b/services/sync/tests/unit/test_service_migratePrefs.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -Cu.import("resource://services-common/preferences.js"); +Cu.import("resource://gre/modules/Preferences.jsm"); Cu.import("resource://services-sync/util.js"); function test_migrate_logging() { From 23acd6102658b22c643e7e35eb1a34c35cee24b0 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 15 Apr 2013 12:55:38 -0700 Subject: [PATCH 185/438] Back out a5a1dd3bd8ae (bug 860029) for stupidorange --- js/ipc/CPOWTypes.h | 3 +- js/ipc/ContextWrapperChild.h | 3 +- js/ipc/ContextWrapperParent.h | 3 +- js/ipc/ObjectWrapperChild.cpp | 3 +- js/ipc/ObjectWrapperChild.h | 3 +- js/ipc/ObjectWrapperParent.cpp | 5 ++- js/ipc/ObjectWrapperParent.h | 3 +- js/jsd/jsd.h | 5 +-- js/jsd/jsd_atom.cpp | 5 +-- js/jsd/jsd_high.cpp | 5 +-- js/jsd/jsd_hook.cpp | 5 +-- js/jsd/jsd_java.cpp | 5 +-- js/jsd/jsd_lock.cpp | 5 +-- js/jsd/jsd_lock.h | 5 +-- js/jsd/jsd_obj.cpp | 5 +-- js/jsd/jsd_scpt.cpp | 5 +-- js/jsd/jsd_stak.cpp | 5 +-- js/jsd/jsd_step.cpp | 5 +-- js/jsd/jsd_text.cpp | 5 +-- js/jsd/jsd_val.cpp | 5 +-- js/jsd/jsd_xpc.cpp | 4 +- js/jsd/jsd_xpc.h | 4 +- js/jsd/jsdebug.cpp | 5 +-- js/jsd/jsdebug.h | 5 +-- js/jsd/jsdstubs.cpp | 5 +-- js/jsd/jshash.cpp | 2 +- js/jsd/jshash.h | 4 +- js/jsd/resource.h | 5 +-- js/public/Anchor.h | 5 ++- js/public/CallArgs.h | 5 ++- js/public/CharacterEncoding.h | 3 +- js/public/GCAPI.h | 8 ++-- js/public/HashTable.h | 5 ++- js/public/HeapAPI.h | 8 ++-- js/public/LegacyIntTypes.h | 5 +-- js/public/MemoryMetrics.h | 5 ++- js/public/PropertyKey.h | 5 ++- js/public/RequiredDefines.h | 3 +- js/public/RootingAPI.h | 3 +- js/public/TemplateLib.h | 5 ++- js/public/Utility.h | 5 ++- js/public/Value.h | 5 ++- js/public/Vector.h | 5 ++- js/src/TraceLogging.cpp | 10 ++--- js/src/TraceLogging.h | 10 ++--- js/src/assembler/assembler/ARMAssembler.cpp | 2 +- js/src/assembler/assembler/ARMAssembler.h | 2 +- js/src/assembler/assembler/ARMv7Assembler.h | 2 +- .../assembler/AbstractMacroAssembler.h | 2 +- js/src/assembler/assembler/AssemblerBuffer.h | 2 +- .../AssemblerBufferWithConstantPool.h | 2 +- js/src/assembler/assembler/CodeLocation.h | 2 +- js/src/assembler/assembler/LinkBuffer.h | 2 +- js/src/assembler/assembler/MacroAssembler.h | 2 +- .../assembler/assembler/MacroAssemblerARM.cpp | 2 +- .../assembler/assembler/MacroAssemblerARM.h | 2 +- .../assembler/assembler/MacroAssemblerARMv7.h | 2 +- .../assembler/MacroAssemblerCodeRef.h | 2 +- .../assembler/assembler/MacroAssemblerSparc.h | 4 +- .../assembler/assembler/MacroAssemblerX86.h | 2 +- .../assembler/MacroAssemblerX86Common.cpp | 4 +- .../assembler/MacroAssemblerX86Common.h | 2 +- .../assembler/MacroAssemblerX86_64.h | 2 +- js/src/assembler/assembler/RepatchBuffer.h | 2 +- js/src/assembler/assembler/SparcAssembler.h | 4 +- js/src/assembler/assembler/X86Assembler.h | 2 +- js/src/assembler/jit/ExecutableAllocator.cpp | 4 +- js/src/assembler/moco/MocoStubs.h | 5 ++- js/src/builtin/Eval.cpp | 3 +- js/src/builtin/Eval.h | 5 ++- js/src/builtin/Intl.cpp | 2 +- js/src/builtin/Intl.h | 2 +- js/src/builtin/Iterator-inl.h | 9 ++-- js/src/builtin/MapObject.cpp | 5 ++- js/src/builtin/MapObject.h | 5 ++- js/src/builtin/Module.cpp | 6 --- js/src/builtin/Module.h | 6 --- js/src/builtin/Object.cpp | 5 ++- js/src/builtin/Object.h | 5 ++- js/src/builtin/ParallelArray.cpp | 5 ++- js/src/builtin/ParallelArray.h | 5 ++- js/src/builtin/Profilers.cpp | 9 ++-- js/src/builtin/Profilers.h | 3 +- js/src/builtin/RegExp.cpp | 5 ++- js/src/builtin/RegExp.h | 5 ++- js/src/builtin/TestingFunctions.cpp | 9 ++-- js/src/builtin/TestingFunctions.h | 9 ++-- js/src/ctypes/CTypes.cpp | 5 +-- js/src/ctypes/Library.cpp | 5 +-- js/src/devtools/jint/treesearch.py | 3 +- js/src/devtools/sharkctl.cpp | 3 +- js/src/devtools/sharkctl.h | 3 +- js/src/ds/BitArray.h | 5 ++- js/src/ds/InlineMap.h | 5 ++- js/src/ds/LifoAlloc.cpp | 5 ++- js/src/ds/LifoAlloc.h | 5 ++- js/src/ds/PriorityQueue.h | 5 ++- js/src/ds/Sort.h | 5 ++- js/src/ds/SplayTree.h | 5 ++- js/src/editline/editline.c | 1 + js/src/editline/editline.h | 1 + js/src/editline/sysunix.c | 1 + js/src/editline/unix.h | 1 + js/src/frontend/BytecodeCompiler.cpp | 3 +- js/src/frontend/BytecodeCompiler.h | 3 +- js/src/frontend/BytecodeEmitter.cpp | 3 +- js/src/frontend/BytecodeEmitter.h | 3 +- js/src/frontend/FoldConstants.cpp | 3 +- js/src/frontend/FoldConstants.h | 3 +- js/src/frontend/FullParseHandler.h | 3 +- js/src/frontend/NameFunctions.cpp | 3 +- js/src/frontend/NameFunctions.h | 3 +- js/src/frontend/ParseMaps-inl.h | 5 ++- js/src/frontend/ParseMaps.cpp | 5 ++- js/src/frontend/ParseMaps.h | 5 ++- js/src/frontend/ParseNode-inl.h | 2 +- js/src/frontend/ParseNode.cpp | 3 +- js/src/frontend/ParseNode.h | 3 +- js/src/frontend/Parser-inl.h | 3 +- js/src/frontend/Parser.cpp | 3 +- js/src/frontend/Parser.h | 3 +- js/src/frontend/SharedContext-inl.h | 3 +- js/src/frontend/SharedContext.h | 3 +- js/src/frontend/SyntaxParseHandler.h | 3 +- js/src/frontend/TokenStream.cpp | 3 +- js/src/frontend/TokenStream.h | 4 +- js/src/gc/Barrier-inl.h | 3 +- js/src/gc/Barrier.h | 3 +- js/src/gc/FindSCCs-inl.h | 8 ++-- js/src/gc/FindSCCs.h | 8 ++-- js/src/gc/GCInternals.h | 3 +- js/src/gc/Heap.h | 8 ++-- js/src/gc/Iteration.cpp | 3 +- js/src/gc/Marking.cpp | 9 ++-- js/src/gc/Marking.h | 11 ++--- js/src/gc/Memory.cpp | 7 +-- js/src/gc/Memory.h | 7 +-- js/src/gc/RootMarking.cpp | 3 +- js/src/gc/Statistics.cpp | 3 +- js/src/gc/Statistics.h | 3 +- js/src/gc/StoreBuffer.cpp | 9 ++-- js/src/gc/StoreBuffer.h | 7 +-- js/src/gc/Verifier.cpp | 3 +- js/src/gc/Zone.cpp | 3 +- js/src/gc/Zone.h | 5 ++- js/src/gdb/gdb-tests.h | 2 +- js/src/ion/AliasAnalysis.cpp | 5 ++- js/src/ion/AliasAnalysis.h | 5 ++- js/src/ion/AsmJS.cpp | 5 ++- js/src/ion/AsmJS.h | 5 ++- js/src/ion/AsmJSLink.cpp | 5 ++- js/src/ion/AsmJSModule.h | 5 ++- js/src/ion/AsmJSSignalHandlers.cpp | 5 ++- js/src/ion/BacktrackingAllocator.cpp | 5 ++- js/src/ion/BacktrackingAllocator.h | 5 ++- js/src/ion/Bailouts.cpp | 5 ++- js/src/ion/Bailouts.h | 5 ++- js/src/ion/BaselineBailouts.cpp | 5 ++- js/src/ion/BaselineCompiler.cpp | 5 ++- js/src/ion/BaselineCompiler.h | 5 ++- js/src/ion/BaselineFrame-inl.h | 5 ++- js/src/ion/BaselineFrame.cpp | 5 ++- js/src/ion/BaselineFrame.h | 5 ++- js/src/ion/BaselineFrameInfo.cpp | 5 ++- js/src/ion/BaselineFrameInfo.h | 5 ++- js/src/ion/BaselineHelpers.h | 5 ++- js/src/ion/BaselineIC.cpp | 5 ++- js/src/ion/BaselineIC.h | 5 ++- js/src/ion/BaselineInspector.cpp | 5 ++- js/src/ion/BaselineInspector.h | 5 ++- js/src/ion/BaselineJIT.cpp | 5 ++- js/src/ion/BaselineJIT.h | 5 ++- js/src/ion/BaselineRegisters.h | 5 ++- js/src/ion/BitSet.cpp | 5 ++- js/src/ion/BitSet.h | 5 ++- js/src/ion/C1Spewer.cpp | 5 ++- js/src/ion/C1Spewer.h | 5 ++- js/src/ion/CodeGenerator.cpp | 5 ++- js/src/ion/CodeGenerator.h | 5 ++- js/src/ion/CompactBuffer.h | 5 ++- js/src/ion/CompileInfo-inl.h | 5 ++- js/src/ion/CompileInfo.h | 5 ++- js/src/ion/CompilerRoot.h | 5 ++- js/src/ion/EdgeCaseAnalysis.cpp | 5 ++- js/src/ion/EdgeCaseAnalysis.h | 5 ++- js/src/ion/EffectiveAddressAnalysis.cpp | 5 ++- js/src/ion/EffectiveAddressAnalysis.h | 5 ++- js/src/ion/ExecutionModeInlines.h | 5 ++- js/src/ion/FixedArityList.h | 5 ++- js/src/ion/FixedList.h | 5 ++- js/src/ion/InlineList.h | 5 ++- js/src/ion/Ion.cpp | 5 ++- js/src/ion/Ion.h | 5 ++- js/src/ion/IonAllocPolicy.h | 5 ++- js/src/ion/IonAnalysis.cpp | 5 ++- js/src/ion/IonAnalysis.h | 5 ++- js/src/ion/IonBuilder.cpp | 5 ++- js/src/ion/IonBuilder.h | 5 ++- js/src/ion/IonCaches.cpp | 5 ++- js/src/ion/IonCaches.h | 5 ++- js/src/ion/IonCode.h | 5 ++- js/src/ion/IonCompartment.h | 5 ++- js/src/ion/IonFrameIterator-inl.h | 5 ++- js/src/ion/IonFrameIterator.h | 5 ++- js/src/ion/IonFrames-inl.h | 5 ++- js/src/ion/IonFrames.cpp | 5 ++- js/src/ion/IonFrames.h | 5 ++- js/src/ion/IonInstrumentation.h | 5 ++- js/src/ion/IonLinker.h | 5 ++- js/src/ion/IonMacroAssembler.cpp | 5 ++- js/src/ion/IonMacroAssembler.h | 5 ++- js/src/ion/IonSpewer.cpp | 5 ++- js/src/ion/IonSpewer.h | 5 ++- js/src/ion/IonTypes.h | 5 ++- js/src/ion/JSONSpewer.cpp | 5 ++- js/src/ion/JSONSpewer.h | 5 ++- js/src/ion/LICM.cpp | 5 ++- js/src/ion/LICM.h | 5 ++- js/src/ion/LIR-Common.h | 5 ++- js/src/ion/LIR-inl.h | 5 ++- js/src/ion/LIR.cpp | 5 ++- js/src/ion/LIR.h | 5 ++- js/src/ion/LOpcodes.h | 5 ++- js/src/ion/LinearScan.cpp | 5 ++- js/src/ion/LinearScan.h | 5 ++- js/src/ion/LiveRangeAllocator.cpp | 5 ++- js/src/ion/LiveRangeAllocator.h | 5 ++- js/src/ion/Lowering.cpp | 5 ++- js/src/ion/Lowering.h | 5 ++- js/src/ion/MCallOptimize.cpp | 5 ++- js/src/ion/MIR.cpp | 5 ++- js/src/ion/MIR.h | 5 ++- js/src/ion/MIRGenerator.h | 5 ++- js/src/ion/MIRGraph.cpp | 5 ++- js/src/ion/MIRGraph.h | 5 ++- js/src/ion/MOpcodes.h | 5 ++- js/src/ion/MoveEmitter.h | 5 ++- js/src/ion/MoveResolver.cpp | 5 ++- js/src/ion/MoveResolver.h | 5 ++- js/src/ion/ParallelArrayAnalysis.cpp | 5 ++- js/src/ion/ParallelArrayAnalysis.h | 5 ++- js/src/ion/ParallelFunctions.cpp | 5 ++- js/src/ion/ParallelFunctions.h | 5 ++- js/src/ion/PcScriptCache-inl.h | 5 ++- js/src/ion/PcScriptCache.h | 5 ++- js/src/ion/RangeAnalysis.cpp | 5 ++- js/src/ion/RangeAnalysis.h | 5 ++- js/src/ion/RegisterAllocator.cpp | 5 ++- js/src/ion/RegisterAllocator.h | 5 ++- js/src/ion/RegisterSets.h | 5 ++- js/src/ion/Registers.h | 5 ++- js/src/ion/Safepoints.cpp | 5 ++- js/src/ion/Safepoints.h | 5 ++- js/src/ion/SnapshotReader.h | 5 ++- js/src/ion/SnapshotWriter.h | 5 ++- js/src/ion/Snapshots.cpp | 5 ++- js/src/ion/StackSlotAllocator.h | 5 ++- js/src/ion/StupidAllocator.cpp | 5 ++- js/src/ion/StupidAllocator.h | 5 ++- js/src/ion/TypeOracle.cpp | 5 ++- js/src/ion/TypeOracle.h | 5 ++- js/src/ion/TypePolicy.cpp | 5 ++- js/src/ion/TypePolicy.h | 5 ++- js/src/ion/UnreachableCodeElimination.cpp | 5 ++- js/src/ion/UnreachableCodeElimination.h | 5 ++- js/src/ion/VMFunctions.cpp | 5 ++- js/src/ion/VMFunctions.h | 5 ++- js/src/ion/ValueNumbering.cpp | 5 ++- js/src/ion/ValueNumbering.h | 5 ++- js/src/ion/arm/Architecture-arm.cpp | 6 +-- js/src/ion/arm/Architecture-arm.h | 5 ++- js/src/ion/arm/Assembler-arm.cpp | 5 ++- js/src/ion/arm/Assembler-arm.h | 5 ++- js/src/ion/arm/Bailouts-arm.cpp | 5 ++- js/src/ion/arm/BaselineCompiler-arm.cpp | 5 ++- js/src/ion/arm/BaselineCompiler-arm.h | 5 ++- js/src/ion/arm/BaselineHelpers-arm.h | 5 ++- js/src/ion/arm/BaselineIC-arm.cpp | 5 ++- js/src/ion/arm/BaselineRegisters-arm.h | 5 ++- js/src/ion/arm/CodeGenerator-arm.cpp | 5 ++- js/src/ion/arm/CodeGenerator-arm.h | 5 ++- js/src/ion/arm/IonFrames-arm.cpp | 5 ++- js/src/ion/arm/IonFrames-arm.h | 5 ++- js/src/ion/arm/LIR-arm.h | 5 ++- js/src/ion/arm/LOpcodes-arm.h | 5 ++- js/src/ion/arm/Lowering-arm.cpp | 5 ++- js/src/ion/arm/Lowering-arm.h | 5 ++- js/src/ion/arm/MacroAssembler-arm.cpp | 5 ++- js/src/ion/arm/MacroAssembler-arm.h | 5 ++- js/src/ion/arm/MoveEmitter-arm.cpp | 5 ++- js/src/ion/arm/MoveEmitter-arm.h | 5 ++- js/src/ion/arm/Trampoline-arm.cpp | 5 ++- js/src/ion/shared/Assembler-shared.h | 5 ++- js/src/ion/shared/Assembler-x86-shared.cpp | 5 ++- js/src/ion/shared/Assembler-x86-shared.h | 5 ++- js/src/ion/shared/BaselineCompiler-shared.cpp | 5 ++- js/src/ion/shared/BaselineCompiler-shared.h | 5 ++- .../shared/BaselineCompiler-x86-shared.cpp | 5 ++- .../ion/shared/BaselineCompiler-x86-shared.h | 5 ++- js/src/ion/shared/BaselineIC-x86-shared.cpp | 5 ++- js/src/ion/shared/CodeGenerator-shared-inl.h | 5 ++- js/src/ion/shared/CodeGenerator-shared.cpp | 5 ++- js/src/ion/shared/CodeGenerator-shared.h | 5 ++- .../ion/shared/CodeGenerator-x86-shared.cpp | 5 ++- js/src/ion/shared/CodeGenerator-x86-shared.h | 5 ++- js/src/ion/shared/IonAssemblerBuffer.h | 5 ++- .../IonAssemblerBufferWithConstantPools.h | 5 ++- js/src/ion/shared/IonFrames-shared.h | 44 ++++++++++++++++--- js/src/ion/shared/IonFrames-x86-shared.cpp | 5 ++- js/src/ion/shared/IonFrames-x86-shared.h | 5 ++- js/src/ion/shared/LIR-x86-shared.h | 5 ++- js/src/ion/shared/Lowering-shared-inl.h | 5 ++- js/src/ion/shared/Lowering-shared.cpp | 5 ++- js/src/ion/shared/Lowering-shared.h | 5 ++- js/src/ion/shared/Lowering-x86-shared.cpp | 5 ++- js/src/ion/shared/Lowering-x86-shared.h | 5 ++- js/src/ion/shared/MacroAssembler-x86-shared.h | 5 ++- js/src/ion/shared/MoveEmitter-x86-shared.cpp | 5 ++- js/src/ion/shared/MoveEmitter-x86-shared.h | 5 ++- js/src/ion/x64/Architecture-x64.h | 5 ++- js/src/ion/x64/Assembler-x64.cpp | 5 ++- js/src/ion/x64/Assembler-x64.h | 5 ++- js/src/ion/x64/Bailouts-x64.cpp | 5 ++- js/src/ion/x64/BaselineCompiler-x64.cpp | 5 ++- js/src/ion/x64/BaselineCompiler-x64.h | 5 ++- js/src/ion/x64/BaselineHelpers-x64.h | 5 ++- js/src/ion/x64/BaselineIC-x64.cpp | 5 ++- js/src/ion/x64/BaselineRegisters-x64.h | 5 ++- js/src/ion/x64/CodeGenerator-x64.cpp | 5 ++- js/src/ion/x64/CodeGenerator-x64.h | 5 ++- js/src/ion/x64/LIR-x64.h | 5 ++- js/src/ion/x64/LOpcodes-x64.h | 5 ++- js/src/ion/x64/Lowering-x64.cpp | 5 ++- js/src/ion/x64/Lowering-x64.h | 5 ++- js/src/ion/x64/MacroAssembler-x64.cpp | 5 ++- js/src/ion/x64/MacroAssembler-x64.h | 5 ++- js/src/ion/x64/Trampoline-x64.cpp | 5 ++- js/src/ion/x86/Architecture-x86.h | 5 ++- js/src/ion/x86/Assembler-x86.cpp | 5 ++- js/src/ion/x86/Assembler-x86.h | 5 ++- js/src/ion/x86/Bailouts-x86.cpp | 5 ++- js/src/ion/x86/BaselineCompiler-x86.cpp | 5 ++- js/src/ion/x86/BaselineCompiler-x86.h | 5 ++- js/src/ion/x86/BaselineHelpers-x86.h | 5 ++- js/src/ion/x86/BaselineIC-x86.cpp | 5 ++- js/src/ion/x86/BaselineRegisters-x86.h | 5 ++- js/src/ion/x86/CodeGenerator-x86.cpp | 5 ++- js/src/ion/x86/CodeGenerator-x86.h | 5 ++- js/src/ion/x86/LIR-x86.h | 5 ++- js/src/ion/x86/LOpcodes-x86.h | 5 ++- js/src/ion/x86/Lowering-x86.cpp | 5 ++- js/src/ion/x86/Lowering-x86.h | 5 ++- js/src/ion/x86/MacroAssembler-x86.cpp | 5 ++- js/src/ion/x86/MacroAssembler-x86.h | 5 ++- js/src/ion/x86/Trampoline-x86.cpp | 5 ++- .../jit-test/tests/auto-regress/bug557946.js | 2 +- .../jit-test/tests/auto-regress/bug558618.js | 2 +- js/src/jit-test/tests/basic/bug535760.js | 2 +- js/src/jit-test/tests/basic/bug541191-1.js | 2 +- js/src/jit-test/tests/basic/bug541191-2.js | 2 +- js/src/jit-test/tests/basic/bug541191-3.js | 2 +- js/src/jit-test/tests/basic/bug541191-4.js | 2 +- js/src/jit-test/tests/basic/bug541191-5.js | 2 +- js/src/jit-test/tests/basic/bug592927.js | 2 +- js/src/jit-test/tests/basic/bug602088.js | 2 +- js/src/jit-test/tests/basic/bug606083.js | 2 +- js/src/jit-test/tests/basic/bug616762.js | 2 +- js/src/jit-test/tests/basic/bug633409-1.js | 2 +- js/src/jit-test/tests/basic/bug633409-2.js | 2 +- js/src/jit-test/tests/ion/bug674664-3.js | 2 +- js/src/jit-test/tests/ion/bug684362.js | 2 +- js/src/jit-test/tests/ion/bug747271.js | 2 +- js/src/jit-test/tests/ion/bug750588.js | 2 +- js/src/jit-test/tests/ion/bug772901.js | 2 +- js/src/jit-test/tests/ion/testPos.js | 2 +- js/src/jit-test/tests/ion/testSubtract.js | 2 +- js/src/jit-test/tests/ion/testVAndBranch.js | 2 +- js/src/jit-test/tests/ion/truncateToInt32.js | 2 +- js/src/jit-test/tests/ion/valueToInt32.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-1.js | 2 +- js/src/jit-test/tests/jaeger/bug592973-3.js | 2 +- js/src/jit-test/tests/jaeger/bug597378.js | 2 +- js/src/jit-test/tests/jaeger/bug600139.js | 2 +- js/src/jit-test/tests/jaeger/bug600424.js | 2 +- js/src/jit-test/tests/jaeger/bug601982.js | 2 +- js/src/jit-test/tests/jaeger/bug604381.js | 2 +- js/src/jit-test/tests/jaeger/bug616508.js | 2 +- js/src/jit-test/tests/jaeger/bug625438.js | 2 +- js/src/jit-test/tests/jaeger/bug627486.js | 2 +- .../jit-test/tests/jaeger/floatTypedArrays.js | 2 +- .../tests/jaeger/normalIntTypedArrays.js | 2 +- .../tests/jaeger/smallIntTypedArrays.js | 2 +- .../tests/jaeger/testCallElemAfterGC.js | 2 +- .../tests/jaeger/testDenseCallElem.js | 2 +- js/src/jit-test/tests/jaeger/testForOps.js | 2 +- .../jit-test/tests/jaeger/testPropCallElem.js | 2 +- .../tests/jaeger/testPropCallElem2.js | 2 +- .../jit-test/tests/jaeger/testSetElem-Easy.js | 2 +- .../tests/jaeger/testSetElem-Indexed.js | 2 +- .../tests/jaeger/testSetElem-NewProto.js | 2 +- .../tests/jaeger/testSetTypedFloatArray.js | 2 +- .../tests/jaeger/testSetTypedIntArray.js | 2 +- .../tests/jaeger/testShiftSameBacking.js | 2 +- js/src/jsalloc.cpp | 5 ++- js/src/jsalloc.h | 5 ++- js/src/jsanalyze.cpp | 6 +-- js/src/jsanalyze.h | 6 +-- js/src/jsapi-tests/selfTest.cpp | 2 +- .../jsapi-tests/testAddPropertyPropcache.cpp | 2 +- js/src/jsapi-tests/testArgumentsObject.cpp | 2 +- js/src/jsapi-tests/testArrayBuffer.cpp | 2 +- js/src/jsapi-tests/testBug604087.cpp | 2 +- js/src/jsapi-tests/testClassGetter.cpp | 2 +- js/src/jsapi-tests/testCloneScript.cpp | 2 +- js/src/jsapi-tests/testContexts.cpp | 6 ++- js/src/jsapi-tests/testDebugger.cpp | 2 +- js/src/jsapi-tests/testDeepFreeze.cpp | 2 +- .../testDefineGetterSetterNonEnumerable.cpp | 2 +- js/src/jsapi-tests/testDefineProperty.cpp | 2 +- js/src/jsapi-tests/testEnclosingFunction.cpp | 2 +- js/src/jsapi-tests/testErrorCopying.cpp | 2 +- js/src/jsapi-tests/testFindSCCs.cpp | 2 +- js/src/jsapi-tests/testFunctionProperties.cpp | 2 +- js/src/jsapi-tests/testGCOutOfMemory.cpp | 2 +- js/src/jsapi-tests/testGetPropertyDefault.cpp | 2 +- js/src/jsapi-tests/testIndexToString.cpp | 2 +- js/src/jsapi-tests/testIntString.cpp | 2 +- js/src/jsapi-tests/testJSEvaluateScript.cpp | 2 +- js/src/jsapi-tests/testLookup.cpp | 2 +- js/src/jsapi-tests/testNewObject.cpp | 2 +- js/src/jsapi-tests/testOps.cpp | 2 +- js/src/jsapi-tests/testParseJSON.cpp | 2 +- js/src/jsapi-tests/testProfileStrings.cpp | 2 +- js/src/jsapi-tests/testPropCache.cpp | 2 +- .../testRegExpInstanceProperties.cpp | 2 +- js/src/jsapi-tests/testResolveRecursion.cpp | 2 +- js/src/jsapi-tests/testSameValue.cpp | 2 +- js/src/jsapi-tests/testScriptInfo.cpp | 2 +- js/src/jsapi-tests/testScriptObject.cpp | 2 +- js/src/jsapi-tests/testSetProperty.cpp | 2 +- js/src/jsapi-tests/testStringBuffer.cpp | 2 +- js/src/jsapi-tests/testTrap.cpp | 2 +- js/src/jsapi-tests/testTypedArrays.cpp | 2 +- js/src/jsapi-tests/testUTF8.cpp | 2 +- js/src/jsapi-tests/testXDR.cpp | 2 +- js/src/jsapi-tests/tests.cpp | 3 +- js/src/jsapi-tests/tests.h | 3 +- js/src/jsapi-tests/valueABI.c | 3 +- js/src/jsapi.cpp | 5 ++- js/src/jsapi.h | 3 +- js/src/jsarray.cpp | 3 +- js/src/jsarray.h | 2 +- js/src/jsatom.cpp | 2 +- js/src/jsatom.h | 2 +- js/src/jsatominlines.h | 4 +- js/src/jsbool.cpp | 2 +- js/src/jsbool.h | 4 +- js/src/jsboolinlines.h | 4 +- js/src/jsclass.h | 5 ++- js/src/jsclist.h | 5 +-- js/src/jsclone.cpp | 1 - js/src/jsclone.h | 1 - js/src/jscntxt.cpp | 5 ++- js/src/jscntxt.h | 3 +- js/src/jscntxtinlines.h | 5 ++- js/src/jscompartment.cpp | 5 ++- js/src/jscompartment.h | 5 ++- js/src/jscompartmentinlines.h | 5 ++- js/src/jscpucfg.h | 4 +- js/src/jscrashformat.h | 5 ++- js/src/jscrashreport.cpp | 5 ++- js/src/jscrashreport.h | 5 ++- js/src/jsdate.cpp | 3 +- js/src/jsdate.h | 4 +- js/src/jsdbgapi.cpp | 3 +- js/src/jsdbgapi.h | 3 +- js/src/jsdhash.cpp | 5 +-- js/src/jsdhash.h | 5 +-- js/src/jsdtoa.cpp | 2 +- js/src/jsdtoa.h | 4 +- js/src/jsexn.cpp | 3 +- js/src/jsexn.h | 4 +- js/src/jsfriendapi.cpp | 5 ++- js/src/jsfriendapi.h | 2 +- js/src/jsfun.cpp | 5 ++- js/src/jsfun.h | 4 +- js/src/jsfuninlines.h | 5 ++- js/src/jsgc.cpp | 3 +- js/src/jsgc.h | 2 +- js/src/jsgcinlines.h | 2 +- js/src/jsinfer.cpp | 6 +-- js/src/jsinfer.h | 6 +-- js/src/jsinferinlines.h | 6 +-- js/src/jsinterp.cpp | 5 ++- js/src/jsinterp.h | 5 ++- js/src/jsinterpinlines.h | 5 ++- js/src/jsiter.cpp | 3 +- js/src/jsiter.h | 3 +- js/src/jskwgen.cpp | 3 +- js/src/jslibmath.h | 5 ++- js/src/jslock.h | 3 +- js/src/jslog2.cpp | 5 +-- js/src/jsmath.cpp | 5 ++- js/src/jsmath.h | 4 +- js/src/jsmemorymetrics.cpp | 5 ++- js/src/jsnativestack.cpp | 5 ++- js/src/jsnativestack.h | 5 ++- js/src/jsnum.cpp | 2 +- js/src/jsnum.h | 4 +- js/src/jsnuminlines.h | 4 +- js/src/jsobj.cpp | 3 +- js/src/jsobj.h | 3 +- js/src/jsobjinlines.h | 3 +- js/src/json.cpp | 3 +- js/src/json.h | 4 +- js/src/jsonparser.cpp | 3 +- js/src/jsonparser.h | 3 +- js/src/jsopcode.cpp | 5 ++- js/src/jsopcode.h | 4 +- js/src/jsopcodeinlines.h | 4 +- js/src/jsoplengen.cpp | 3 +- js/src/jsprf.cpp | 5 +-- js/src/jsprf.h | 5 +-- js/src/jsprobes.cpp | 3 +- js/src/jsprobes.h | 5 ++- js/src/jspropertycache.cpp | 5 ++- js/src/jspropertycache.h | 3 +- js/src/jspropertycacheinlines.h | 3 +- js/src/jspropertytree.cpp | 6 +-- js/src/jspropertytree.h | 6 +-- js/src/jsprototypes.h | 5 ++- js/src/jsproxy.cpp | 9 ++-- js/src/jsproxy.h | 5 ++- js/src/jsprvtd.h | 2 +- js/src/jspubtd.h | 2 +- js/src/jsreflect.cpp | 5 ++- js/src/jsreflect.h | 5 ++- js/src/jsscript.cpp | 3 +- js/src/jsscript.h | 3 +- js/src/jsscriptinlines.h | 3 +- js/src/jsstr.cpp | 5 ++- js/src/jsstr.h | 5 ++- js/src/jsstrinlines.h | 4 +- js/src/jstypedarray.cpp | 6 +-- js/src/jstypedarray.h | 6 +-- js/src/jstypedarrayinlines.h | 6 +-- js/src/jstypes.h | 5 +-- js/src/jsutil.cpp | 4 +- js/src/jsutil.h | 4 +- js/src/jsversion.h | 4 +- js/src/jswatchpoint.cpp | 2 +- js/src/jswatchpoint.h | 2 +- js/src/jsweakcache.h | 5 ++- js/src/jsweakmap.cpp | 5 ++- js/src/jsweakmap.h | 5 ++- js/src/jswin.h | 4 +- js/src/jsworkers.cpp | 6 +-- js/src/jsworkers.h | 6 +-- js/src/jswrapper.cpp | 5 ++- js/src/jswrapper.h | 5 ++- js/src/methodjit/BaseAssembler.h | 5 ++- js/src/methodjit/BaseCompiler.h | 5 ++- js/src/methodjit/CodeGenIncludes.h | 5 ++- js/src/methodjit/Compiler.cpp | 5 ++- js/src/methodjit/Compiler.h | 5 ++- js/src/methodjit/FastArithmetic.cpp | 5 ++- js/src/methodjit/FastBuiltins.cpp | 5 ++- js/src/methodjit/FastOps.cpp | 5 ++- js/src/methodjit/FrameEntry.h | 5 ++- js/src/methodjit/FrameState-inl.h | 5 ++- js/src/methodjit/FrameState.cpp | 5 ++- js/src/methodjit/FrameState.h | 5 ++- js/src/methodjit/ICChecker.h | 5 ++- js/src/methodjit/ICLabels.h | 5 ++- js/src/methodjit/ICRepatcher.h | 5 ++- js/src/methodjit/ImmutableSync.cpp | 5 ++- js/src/methodjit/ImmutableSync.h | 5 ++- js/src/methodjit/InlineFrameAssembler.h | 5 ++- js/src/methodjit/InvokeHelpers.cpp | 5 ++- js/src/methodjit/Logging.cpp | 5 ++- js/src/methodjit/Logging.h | 5 ++- js/src/methodjit/LoopState.cpp | 5 ++- js/src/methodjit/LoopState.h | 5 ++- js/src/methodjit/MachineRegs.h | 5 ++- js/src/methodjit/MethodJIT.cpp | 5 ++- js/src/methodjit/MethodJIT.h | 5 ++- js/src/methodjit/MonoIC.cpp | 5 ++- js/src/methodjit/MonoIC.h | 5 ++- js/src/methodjit/NunboxAssembler.h | 5 ++- js/src/methodjit/PolyIC.cpp | 5 ++- js/src/methodjit/PolyIC.h | 5 ++- js/src/methodjit/PunboxAssembler.h | 5 ++- js/src/methodjit/RematInfo.h | 5 ++- js/src/methodjit/Retcon.cpp | 5 ++- js/src/methodjit/Retcon.h | 5 ++- js/src/methodjit/StubCalls-inl.h | 5 ++- js/src/methodjit/StubCalls.cpp | 5 ++- js/src/methodjit/StubCalls.h | 5 ++- js/src/methodjit/StubCompiler.cpp | 5 ++- js/src/methodjit/StubCompiler.h | 5 ++- js/src/methodjit/TrampolineCompiler.cpp | 5 ++- js/src/methodjit/TrampolineCompiler.h | 5 ++- js/src/methodjit/TrampolineMIPS.cpp | 5 ++- js/src/methodjit/TypedArrayIC.h | 5 ++- js/src/perf/jsperf.cpp | 2 +- js/src/perf/jsperf.h | 2 +- js/src/perf/pm_linux.cpp | 2 +- js/src/perf/pm_stub.cpp | 2 +- js/src/prmjtime.cpp | 2 +- js/src/prmjtime.h | 4 +- js/src/shell/js.cpp | 3 +- js/src/shell/jsheaptools.cpp | 3 +- js/src/shell/jsheaptools.h | 3 +- js/src/shell/jsoptparse.cpp | 3 +- js/src/shell/jsoptparse.h | 3 +- .../ecma_2/Exceptions/exception-010-n.js | 1 + .../ecma_2/Exceptions/exception-011-n.js | 1 + .../ecma_2/FunctionObjects/apply-001-n.js | 1 + .../tests/ecma_3/Exceptions/regress-58946.js | 1 + .../tests/ecma_3/ExecutionContexts/10.1.3.js | 1 + .../ecma_3/ExecutionContexts/10.1.4-1.js | 1 + .../ecma_3/ExecutionContexts/regress-23346.js | 1 + js/src/tests/ecma_3/FunExpr/fe-001-n.js | 1 + js/src/tests/ecma_3/FunExpr/fe-001.js | 1 + js/src/tests/ecma_3/FunExpr/fe-002.js | 1 + .../ecma_3/NumberFormatting/tostring-001.js | 1 + js/src/tests/ecma_3/RegExp/regress-24712.js | 1 + js/src/tests/ecma_3/RegExp/regress-28686.js | 1 + js/src/tests/ecma_3/Unicode/uc-001-n.js | 1 + js/src/tests/ecma_3/Unicode/uc-001.js | 1 + js/src/tests/ecma_3/Unicode/uc-002-n.js | 1 + js/src/tests/ecma_3/Unicode/uc-002.js | 1 + js/src/tests/ecma_3/Unicode/uc-003.js | 1 + js/src/tests/ecma_3/Unicode/uc-004.js | 1 + .../js1_5/Exceptions/catchguard-002-n.js | 1 + .../js1_5/Exceptions/catchguard-003-n.js | 1 + js/src/tests/js1_5/GetSet/getset-002.js | 1 + .../js1_5/extensions/catchguard-001-n.js | 1 + .../tests/js1_5/extensions/catchguard-001.js | 1 + .../tests/js1_5/extensions/catchguard-002.js | 1 + .../tests/js1_5/extensions/catchguard-003.js | 1 + js/src/tests/js1_5/extensions/getset-001.js | 1 + .../tests/js1_5/extensions/regress-50447-1.js | 1 + .../tests/js1_5/extensions/regress-50447.js | 1 + js/src/tests/js1_6/shell.js | 1 + js/src/tests/js1_7/shell.js | 1 + js/src/tests/js1_8/shell.js | 1 + js/src/tests/js1_8_1/shell.js | 1 + js/src/tests/shell.js | 1 + js/src/vm/ArgumentsObject-inl.h | 3 +- js/src/vm/ArgumentsObject.cpp | 3 +- js/src/vm/ArgumentsObject.h | 3 +- js/src/vm/BooleanObject-inl.h | 3 +- js/src/vm/BooleanObject.h | 3 +- js/src/vm/CharacterEncoding.cpp | 3 +- js/src/vm/CommonPropertyNames.h | 5 ++- js/src/vm/DateTime.cpp | 6 +-- js/src/vm/DateTime.h | 6 +-- js/src/vm/Debugger.cpp | 5 ++- js/src/vm/Debugger.h | 5 ++- js/src/vm/ForkJoin.cpp | 3 +- js/src/vm/ForkJoin.h | 3 +- js/src/vm/GlobalObject-inl.h | 3 +- js/src/vm/GlobalObject.cpp | 3 +- js/src/vm/GlobalObject.h | 3 +- js/src/vm/Keywords.h | 5 ++- js/src/vm/MatchPairs.h | 5 ++- js/src/vm/Monitor.cpp | 3 +- js/src/vm/Monitor.h | 3 +- js/src/vm/NumberObject-inl.h | 3 +- js/src/vm/NumberObject.h | 3 +- js/src/vm/NumericConversions.h | 7 +-- js/src/vm/ObjectImpl-inl.h | 7 +-- js/src/vm/ObjectImpl.cpp | 7 +-- js/src/vm/ObjectImpl.h | 7 +-- js/src/vm/ParallelDo.cpp | 5 ++- js/src/vm/ParallelDo.h | 5 ++- js/src/vm/PropertyKey.cpp | 2 +- js/src/vm/RegExpObject-inl.h | 5 ++- js/src/vm/RegExpObject.cpp | 5 ++- js/src/vm/RegExpObject.h | 5 ++- js/src/vm/RegExpStatics-inl.h | 5 ++- js/src/vm/RegExpStatics.cpp | 5 ++- js/src/vm/RegExpStatics.h | 5 ++- js/src/vm/SPSProfiler.cpp | 5 ++- js/src/vm/SPSProfiler.h | 5 ++- js/src/vm/ScopeObject-inl.h | 3 +- js/src/vm/ScopeObject.cpp | 5 ++- js/src/vm/ScopeObject.h | 3 +- js/src/vm/SelfHosting.cpp | 5 ++- js/src/vm/Shape-inl.h | 5 +-- js/src/vm/Shape.cpp | 3 +- js/src/vm/Shape.h | 5 ++- js/src/vm/Stack-inl.h | 5 ++- js/src/vm/Stack.cpp | 5 ++- js/src/vm/Stack.h | 5 ++- js/src/vm/String-inl.h | 5 ++- js/src/vm/String.cpp | 5 ++- js/src/vm/String.h | 5 ++- js/src/vm/StringBuffer.cpp | 6 +-- js/src/vm/StringBuffer.h | 6 +-- js/src/vm/StringObject-inl.h | 3 +- js/src/vm/StringObject.h | 3 +- js/src/vm/ThreadPool.cpp | 6 +-- js/src/vm/ThreadPool.h | 3 +- js/src/vm/Unicode.h | 4 +- js/src/vm/Xdr.cpp | 2 +- js/src/vm/Xdr.h | 3 +- js/src/yarr/ASCIICType.h | 4 +- js/src/yarr/BumpPointerAllocator.h | 4 +- js/src/yarr/CheckedArithmetic.h | 3 +- js/src/yarr/MatchResult.h | 4 +- js/src/yarr/OSAllocator.h | 4 +- js/src/yarr/OSAllocatorOS2.cpp | 4 +- js/src/yarr/OSAllocatorPosix.cpp | 4 +- js/src/yarr/OSAllocatorWin.cpp | 4 +- js/src/yarr/PageAllocation.h | 4 +- js/src/yarr/PageBlock.cpp | 4 +- js/src/yarr/PageBlock.h | 4 +- js/src/yarr/VMTags.h | 4 +- js/src/yarr/Yarr.h | 4 +- js/src/yarr/YarrCanonicalizeUCS2.cpp | 4 +- js/src/yarr/YarrCanonicalizeUCS2.h | 4 +- js/src/yarr/YarrInterpreter.cpp | 4 +- js/src/yarr/YarrInterpreter.h | 4 +- js/src/yarr/YarrJIT.cpp | 3 +- js/src/yarr/YarrJIT.h | 3 +- js/src/yarr/YarrParser.h | 3 +- js/src/yarr/YarrPattern.cpp | 3 +- js/src/yarr/YarrPattern.h | 3 +- js/src/yarr/YarrSyntaxChecker.cpp | 4 +- js/src/yarr/YarrSyntaxChecker.h | 4 +- js/src/yarr/wtfbridge.h | 6 +-- 733 files changed, 1725 insertions(+), 1279 deletions(-) diff --git a/js/ipc/CPOWTypes.h b/js/ipc/CPOWTypes.h index 56d84cd3f717..46195f9ee72d 100644 --- a/js/ipc/CPOWTypes.h +++ b/js/ipc/CPOWTypes.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/ipc/ContextWrapperChild.h b/js/ipc/ContextWrapperChild.h index b6d1c9505c17..ec42b78ba6d7 100644 --- a/js/ipc/ContextWrapperChild.h +++ b/js/ipc/ContextWrapperChild.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/ipc/ContextWrapperParent.h b/js/ipc/ContextWrapperParent.h index 671521b36b2a..01fca526411d 100644 --- a/js/ipc/ContextWrapperParent.h +++ b/js/ipc/ContextWrapperParent.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/ipc/ObjectWrapperChild.cpp b/js/ipc/ObjectWrapperChild.cpp index 247eaf0605fd..7c90e3612cb0 100644 --- a/js/ipc/ObjectWrapperChild.cpp +++ b/js/ipc/ObjectWrapperChild.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/ipc/ObjectWrapperChild.h b/js/ipc/ObjectWrapperChild.h index f9a270cacce5..dff0afd2f9a9 100644 --- a/js/ipc/ObjectWrapperChild.h +++ b/js/ipc/ObjectWrapperChild.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/ipc/ObjectWrapperParent.cpp b/js/ipc/ObjectWrapperParent.cpp index 54b81d11681c..9a80c99e7690 100644 --- a/js/ipc/ObjectWrapperParent.cpp +++ b/js/ipc/ObjectWrapperParent.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -690,4 +691,4 @@ ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JSMutab self->CallHasInstance(in_v, aco.StatusPtr(), bp) && aco.Ok()); -} +} \ No newline at end of file diff --git a/js/ipc/ObjectWrapperParent.h b/js/ipc/ObjectWrapperParent.h index af147b1f800d..a389b52956d9 100644 --- a/js/ipc/ObjectWrapperParent.h +++ b/js/ipc/ObjectWrapperParent.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index a5dab01407a8..c0043b986a74 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_atom.cpp b/js/jsd/jsd_atom.cpp index dec6b391457a..5517b997d644 100644 --- a/js/jsd/jsd_atom.cpp +++ b/js/jsd/jsd_atom.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_high.cpp b/js/jsd/jsd_high.cpp index 7887f8fc73e2..3a7bea446e36 100644 --- a/js/jsd/jsd_high.cpp +++ b/js/jsd/jsd_high.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_hook.cpp b/js/jsd/jsd_hook.cpp index 95e631804472..9f8fa947f082 100644 --- a/js/jsd/jsd_hook.cpp +++ b/js/jsd/jsd_hook.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_java.cpp b/js/jsd/jsd_java.cpp index c5c0aec2aaf9..4bfcccde93ba 100644 --- a/js/jsd/jsd_java.cpp +++ b/js/jsd/jsd_java.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_lock.cpp b/js/jsd/jsd_lock.cpp index 628d2fd621e7..c8a827b8f941 100644 --- a/js/jsd/jsd_lock.cpp +++ b/js/jsd/jsd_lock.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_lock.h b/js/jsd/jsd_lock.h index b1e8c31053bd..a3eb821be953 100644 --- a/js/jsd/jsd_lock.h +++ b/js/jsd/jsd_lock.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_obj.cpp b/js/jsd/jsd_obj.cpp index cc0e8bb754bf..dc7c927cab99 100644 --- a/js/jsd/jsd_obj.cpp +++ b/js/jsd/jsd_obj.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_scpt.cpp b/js/jsd/jsd_scpt.cpp index 67c53f92791d..f4ef023d45ea 100644 --- a/js/jsd/jsd_scpt.cpp +++ b/js/jsd/jsd_scpt.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 7dac8eb3befd..8e5fbb384aa5 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_step.cpp b/js/jsd/jsd_step.cpp index da1886a2b03f..0396a5cb7318 100644 --- a/js/jsd/jsd_step.cpp +++ b/js/jsd/jsd_step.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_text.cpp b/js/jsd/jsd_text.cpp index ab11e82eac8b..bc851a3def41 100644 --- a/js/jsd/jsd_text.cpp +++ b/js/jsd/jsd_text.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_val.cpp b/js/jsd/jsd_val.cpp index 97385a98af32..a8cad6d005a9 100644 --- a/js/jsd/jsd_val.cpp +++ b/js/jsd/jsd_val.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index ea1ef4b837dd..8ce10b932552 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/jsd/jsd_xpc.h b/js/jsd/jsd_xpc.h index 4dbfe7cab405..da383e30f9d9 100644 --- a/js/jsd/jsd_xpc.h +++ b/js/jsd/jsd_xpc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/jsd/jsdebug.cpp b/js/jsd/jsdebug.cpp index 7e893c69d149..06954cead55f 100644 --- a/js/jsd/jsdebug.cpp +++ b/js/jsd/jsdebug.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index a3a05eeb1f15..0971ba121f17 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/jsd/jsdstubs.cpp b/js/jsd/jsdstubs.cpp index 22420410251c..68cf75b79889 100644 --- a/js/jsd/jsdstubs.cpp +++ b/js/jsd/jsdstubs.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/jsd/jshash.cpp b/js/jsd/jshash.cpp index d4caf2ce833f..6ae4e549ea34 100644 --- a/js/jsd/jshash.cpp +++ b/js/jsd/jshash.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/jsd/jshash.h b/js/jsd/jshash.h index e21c7b786a04..5c44b7ba964a 100644 --- a/js/jsd/jshash.h +++ b/js/jsd/jshash.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/jsd/resource.h b/js/jsd/resource.h index 69874fe0ff30..d40e61ae13d1 100644 --- a/js/jsd/resource.h +++ b/js/jsd/resource.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/public/Anchor.h b/js/public/Anchor.h index d0c2476cf726..166ada5cd28e 100644 --- a/js/public/Anchor.h +++ b/js/public/Anchor.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h index 5b474f0ac3b3..6ecc4273de8d 100644 --- a/js/public/CallArgs.h +++ b/js/public/CallArgs.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/CharacterEncoding.h b/js/public/CharacterEncoding.h index 63e5cc6650ca..36d8670a0821 100644 --- a/js/public/CharacterEncoding.h +++ b/js/public/CharacterEncoding.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index 80d8f8a426fb..1231ca97b9f9 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + */ +/* 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/. */ #ifndef js_gc_api_h___ #define js_gc_api_h___ diff --git a/js/public/HashTable.h b/js/public/HashTable.h index acd4e310ac79..5cc7ea4e8b9e 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h index cd50b7e1bbcb..47cb5602123d 100644 --- a/js/public/HeapAPI.h +++ b/js/public/HeapAPI.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + */ +/* 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/. */ #ifndef js_heap_api_h___ #define js_heap_api_h___ diff --git a/js/public/LegacyIntTypes.h b/js/public/LegacyIntTypes.h index 387a68b9e9d1..30944efda61e 100644 --- a/js/public/LegacyIntTypes.h +++ b/js/public/LegacyIntTypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h index e5f9ea3b5bce..14cf88ec4c60 100644 --- a/js/public/MemoryMetrics.h +++ b/js/public/MemoryMetrics.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/PropertyKey.h b/js/public/PropertyKey.h index 53158c26f30f..5d048195f51e 100644 --- a/js/public/PropertyKey.h +++ b/js/public/PropertyKey.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/RequiredDefines.h b/js/public/RequiredDefines.h index 2be2efbf9a3b..8dc47e251c95 100644 --- a/js/public/RequiredDefines.h +++ b/js/public/RequiredDefines.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: + * * 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/. */ diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h index 5d139292fe38..9f9fa9df53f0 100644 --- a/js/public/RootingAPI.h +++ b/js/public/RootingAPI.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/public/TemplateLib.h b/js/public/TemplateLib.h index a4ff6829125f..58966b166f9f 100644 --- a/js/public/TemplateLib.h +++ b/js/public/TemplateLib.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/Utility.h b/js/public/Utility.h index 2a883323ff63..70f09d6b22a9 100644 --- a/js/public/Utility.h +++ b/js/public/Utility.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/Value.h b/js/public/Value.h index 57e951a1defd..a9a7bfd40005 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/public/Vector.h b/js/public/Vector.h index 5f40dd634b8c..b8e2ea698504 100644 --- a/js/public/Vector.h +++ b/js/public/Vector.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/TraceLogging.cpp b/js/src/TraceLogging.cpp index 1c64a67fd68d..49fe2d3e8ace 100644 --- a/js/src/TraceLogging.cpp +++ b/js/src/TraceLogging.cpp @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=4 sw=4 et tw=79: */ +/* 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 "TraceLogging.h" #include diff --git a/js/src/TraceLogging.h b/js/src/TraceLogging.h index 2e6d5ba9ac38..eebadfc1e14d 100644 --- a/js/src/TraceLogging.h +++ b/js/src/TraceLogging.h @@ -1,8 +1,8 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim: set ts=4 sw=4 et tw=79: */ +/* 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/. */ #if !defined(TraceLogging_h__) #define TraceLogging_h__ diff --git a/js/src/assembler/assembler/ARMAssembler.cpp b/js/src/assembler/assembler/ARMAssembler.cpp index 18f742b80b6a..a9ada8e9a2c5 100644 --- a/js/src/assembler/assembler/ARMAssembler.cpp +++ b/js/src/assembler/assembler/ARMAssembler.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/ARMAssembler.h b/js/src/assembler/assembler/ARMAssembler.h index 2c1d712158d8..e04b251b7439 100644 --- a/js/src/assembler/assembler/ARMAssembler.h +++ b/js/src/assembler/assembler/ARMAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009, 2010 University of Szeged diff --git a/js/src/assembler/assembler/ARMv7Assembler.h b/js/src/assembler/assembler/ARMv7Assembler.h index 1a83139887fd..1f96585ee16c 100644 --- a/js/src/assembler/assembler/ARMv7Assembler.h +++ b/js/src/assembler/assembler/ARMv7Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AbstractMacroAssembler.h b/js/src/assembler/assembler/AbstractMacroAssembler.h index 2bfb275b6884..286fad954742 100644 --- a/js/src/assembler/assembler/AbstractMacroAssembler.h +++ b/js/src/assembler/assembler/AbstractMacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBuffer.h b/js/src/assembler/assembler/AssemblerBuffer.h index a2e7c3840331..d21182527b52 100644 --- a/js/src/assembler/assembler/AssemblerBuffer.h +++ b/js/src/assembler/assembler/AssemblerBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h index 2578692dc47a..467f9c9e8cbe 100644 --- a/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h +++ b/js/src/assembler/assembler/AssemblerBufferWithConstantPool.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/CodeLocation.h b/js/src/assembler/assembler/CodeLocation.h index d9bc6d4175fb..490157688614 100644 --- a/js/src/assembler/assembler/CodeLocation.h +++ b/js/src/assembler/assembler/CodeLocation.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/LinkBuffer.h b/js/src/assembler/assembler/LinkBuffer.h index 1e6fb4b35249..35913c87aaf7 100644 --- a/js/src/assembler/assembler/LinkBuffer.h +++ b/js/src/assembler/assembler/LinkBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssembler.h b/js/src/assembler/assembler/MacroAssembler.h index 2b77445e14cf..8bf9c0b0a80e 100644 --- a/js/src/assembler/assembler/MacroAssembler.h +++ b/js/src/assembler/assembler/MacroAssembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerARM.cpp b/js/src/assembler/assembler/MacroAssemblerARM.cpp index 9c76e8fd43e7..89db1e2d859e 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.cpp +++ b/js/src/assembler/assembler/MacroAssemblerARM.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 University of Szeged diff --git a/js/src/assembler/assembler/MacroAssemblerARM.h b/js/src/assembler/assembler/MacroAssemblerARM.h index 6e18c54b84dc..831ccbb8a183 100644 --- a/js/src/assembler/assembler/MacroAssemblerARM.h +++ b/js/src/assembler/assembler/MacroAssemblerARM.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. diff --git a/js/src/assembler/assembler/MacroAssemblerARMv7.h b/js/src/assembler/assembler/MacroAssemblerARMv7.h index 0abeb2b31de0..2bdb6e8fdb5e 100644 --- a/js/src/assembler/assembler/MacroAssemblerARMv7.h +++ b/js/src/assembler/assembler/MacroAssemblerARMv7.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerCodeRef.h b/js/src/assembler/assembler/MacroAssemblerCodeRef.h index bcf3903f9b13..101ffcb098d5 100644 --- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h +++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerSparc.h b/js/src/assembler/assembler/MacroAssemblerSparc.h index 3692b3e0b272..1d89f17790e7 100644 --- a/js/src/assembler/assembler/MacroAssemblerSparc.h +++ b/js/src/assembler/assembler/MacroAssemblerSparc.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86.h b/js/src/assembler/assembler/MacroAssemblerX86.h index c782ad60d006..c6ab40f587fa 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86.h +++ b/js/src/assembler/assembler/MacroAssemblerX86.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp index e65b2a3d7c62..b94a345ff649 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.cpp +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/MacroAssemblerX86Common.h b/js/src/assembler/assembler/MacroAssemblerX86Common.h index b0bef29120c2..30bb1ed26afc 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86Common.h +++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/MacroAssemblerX86_64.h b/js/src/assembler/assembler/MacroAssemblerX86_64.h index c3be4145695a..c4b67dcaeb03 100644 --- a/js/src/assembler/assembler/MacroAssemblerX86_64.h +++ b/js/src/assembler/assembler/MacroAssemblerX86_64.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/RepatchBuffer.h b/js/src/assembler/assembler/RepatchBuffer.h index 0a3deb3c27d2..003479211b43 100644 --- a/js/src/assembler/assembler/RepatchBuffer.h +++ b/js/src/assembler/assembler/RepatchBuffer.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2009 Apple Inc. All rights reserved. diff --git a/js/src/assembler/assembler/SparcAssembler.h b/js/src/assembler/assembler/SparcAssembler.h index 19217a7cafd0..4e3d5b14559a 100644 --- a/js/src/assembler/assembler/SparcAssembler.h +++ b/js/src/assembler/assembler/SparcAssembler.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: */ /* 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/. */ diff --git a/js/src/assembler/assembler/X86Assembler.h b/js/src/assembler/assembler/X86Assembler.h index 1533bdfa95e9..2293098864f3 100644 --- a/js/src/assembler/assembler/X86Assembler.h +++ b/js/src/assembler/assembler/X86Assembler.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2008 Apple Inc. All rights reserved. diff --git a/js/src/assembler/jit/ExecutableAllocator.cpp b/js/src/assembler/jit/ExecutableAllocator.cpp index bd8b1d3ba24d..59e1c259b673 100644 --- a/js/src/assembler/jit/ExecutableAllocator.cpp +++ b/js/src/assembler/jit/ExecutableAllocator.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99: * * Copyright (C) 2008 Apple Inc. All rights reserved. * diff --git a/js/src/assembler/moco/MocoStubs.h b/js/src/assembler/moco/MocoStubs.h index df3d1f979745..7ce6da5e329b 100644 --- a/js/src/assembler/moco/MocoStubs.h +++ b/js/src/assembler/moco/MocoStubs.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index a5c203d5b342..a29c89517709 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/builtin/Eval.h b/js/src/builtin/Eval.h index 133c4b28ebcb..e6eaeefa5b04 100644 --- a/js/src/builtin/Eval.h +++ b/js/src/builtin/Eval.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp index 4c49405d8909..d3463125da23 100644 --- a/js/src/builtin/Intl.cpp +++ b/js/src/builtin/Intl.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/builtin/Intl.h b/js/src/builtin/Intl.h index eefec5dbcaaa..3db27dc63767 100644 --- a/js/src/builtin/Intl.h +++ b/js/src/builtin/Intl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/builtin/Iterator-inl.h b/js/src/builtin/Iterator-inl.h index e6c838cdeb98..7f93219af814 100644 --- a/js/src/builtin/Iterator-inl.h +++ b/js/src/builtin/Iterator-inl.h @@ -1,8 +1,7 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ #ifndef Iterator_inl_h_ #define Iterator_inl_h_ diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index cff6e0a8c746..1f6258f49bcc 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/MapObject.h b/js/src/builtin/MapObject.h index f8f006472dab..3661c4cc498b 100644 --- a/js/src/builtin/MapObject.h +++ b/js/src/builtin/MapObject.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/Module.cpp b/js/src/builtin/Module.cpp index 4acec92e6e5b..d70ec483e11e 100644 --- a/js/src/builtin/Module.cpp +++ b/js/src/builtin/Module.cpp @@ -1,9 +1,3 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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 "jsobjinlines.h" #include "builtin/Module.h" diff --git a/js/src/builtin/Module.h b/js/src/builtin/Module.h index f1bdef1ef1ba..7a6386ebc434 100644 --- a/js/src/builtin/Module.h +++ b/js/src/builtin/Module.h @@ -1,9 +1,3 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ - #ifndef Module_h___ #define Module_h___ diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 8171d873284b..188911c74896 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/Object.h b/js/src/builtin/Object.h index c6a29225e957..a08fcdfb818e 100644 --- a/js/src/builtin/Object.h +++ b/js/src/builtin/Object.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/ParallelArray.cpp b/js/src/builtin/ParallelArray.cpp index 49bb5a05cd10..c98771d047e4 100644 --- a/js/src/builtin/ParallelArray.cpp +++ b/js/src/builtin/ParallelArray.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/ParallelArray.h b/js/src/builtin/ParallelArray.h index 443ebad5952a..d63b87872fb2 100644 --- a/js/src/builtin/ParallelArray.h +++ b/js/src/builtin/ParallelArray.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/Profilers.cpp b/js/src/builtin/Profilers.cpp index 853d61d89111..43b9bea178e5 100644 --- a/js/src/builtin/Profilers.cpp +++ b/js/src/builtin/Profilers.cpp @@ -1,8 +1,7 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ /* Profiling-related API */ diff --git a/js/src/builtin/Profilers.h b/js/src/builtin/Profilers.h index 59c4e992024d..872830de12d3 100644 --- a/js/src/builtin/Profilers.h +++ b/js/src/builtin/Profilers.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 502ca8fc6784..eeccfcb1129c 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/RegExp.h b/js/src/builtin/RegExp.h index 60fb782be9f9..90662e9ed8bf 100644 --- a/js/src/builtin/RegExp.h +++ b/js/src/builtin/RegExp.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index a66d482f9d1a..e5f65c3a221b 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1,8 +1,7 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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 "jsapi.h" #include "jsbool.h" diff --git a/js/src/builtin/TestingFunctions.h b/js/src/builtin/TestingFunctions.h index 52b9bef76ce3..9bcb1e31d2e6 100644 --- a/js/src/builtin/TestingFunctions.h +++ b/js/src/builtin/TestingFunctions.h @@ -1,8 +1,7 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ #ifndef TestingFunctions_h__ #define TestingFunctions_h__ diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index 6ba4b7be7dae..4b29ed0ed1e5 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ +/* 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/. */ diff --git a/js/src/ctypes/Library.cpp b/js/src/ctypes/Library.cpp index 9ad6f8fd1301..f76221331c25 100644 --- a/js/src/ctypes/Library.cpp +++ b/js/src/ctypes/Library.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: set ts=2 sw=2 et tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ +/* 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/. */ diff --git a/js/src/devtools/jint/treesearch.py b/js/src/devtools/jint/treesearch.py index 2cbc45335814..c06a62b88011 100644 --- a/js/src/devtools/jint/treesearch.py +++ b/js/src/devtools/jint/treesearch.py @@ -1,8 +1,9 @@ -# vim: set ts=8 sts=4 et sw=4 tw=99: # 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/. +# vim: set ts=4 sw=4 tw=99 et: + import os, re import tempfile import subprocess diff --git a/js/src/devtools/sharkctl.cpp b/js/src/devtools/sharkctl.cpp index 86fdfc936d22..14a550247af2 100644 --- a/js/src/devtools/sharkctl.cpp +++ b/js/src/devtools/sharkctl.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/devtools/sharkctl.h b/js/src/devtools/sharkctl.h index bb3038d3ae6a..e381cfd32ba3 100644 --- a/js/src/devtools/sharkctl.h +++ b/js/src/devtools/sharkctl.h @@ -1,5 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/ds/BitArray.h b/js/src/ds/BitArray.h index a20796d4dbe4..4d0d0e64bb63 100644 --- a/js/src/ds/BitArray.h +++ b/js/src/ds/BitArray.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/InlineMap.h b/js/src/ds/InlineMap.h index d11172463de8..68ca36fb3973 100644 --- a/js/src/ds/InlineMap.h +++ b/js/src/ds/InlineMap.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/LifoAlloc.cpp b/js/src/ds/LifoAlloc.cpp index b9621600f512..c019a7ca12d5 100644 --- a/js/src/ds/LifoAlloc.cpp +++ b/js/src/ds/LifoAlloc.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/LifoAlloc.h b/js/src/ds/LifoAlloc.h index 167a61c52a90..d7233c932a87 100644 --- a/js/src/ds/LifoAlloc.h +++ b/js/src/ds/LifoAlloc.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/PriorityQueue.h b/js/src/ds/PriorityQueue.h index 8ef6531bb12f..1e9e26c918db 100644 --- a/js/src/ds/PriorityQueue.h +++ b/js/src/ds/PriorityQueue.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/Sort.h b/js/src/ds/Sort.h index 46542e5bf882..4061f75cb4fe 100644 --- a/js/src/ds/Sort.h +++ b/js/src/ds/Sort.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/ds/SplayTree.h b/js/src/ds/SplayTree.h index 8df268335fa6..390282363f9f 100644 --- a/js/src/ds/SplayTree.h +++ b/js/src/ds/SplayTree.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/editline/editline.c b/js/src/editline/editline.c index 21946a6250b8..f98d048a4112 100644 --- a/js/src/editline/editline.c +++ b/js/src/editline/editline.c @@ -1,4 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/editline/editline.h b/js/src/editline/editline.h index 0616de03a221..5895322f1be1 100644 --- a/js/src/editline/editline.h +++ b/js/src/editline/editline.h @@ -1,4 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/editline/sysunix.c b/js/src/editline/sysunix.c index d45db6c79baa..0035640a29f6 100644 --- a/js/src/editline/sysunix.c +++ b/js/src/editline/sysunix.c @@ -1,4 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/editline/unix.h b/js/src/editline/unix.h index ec4a762acb58..3d8687632232 100644 --- a/js/src/editline/unix.h +++ b/js/src/editline/unix.h @@ -1,4 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp index fc891b210dd1..24fe869ecd53 100644 --- a/js/src/frontend/BytecodeCompiler.cpp +++ b/js/src/frontend/BytecodeCompiler.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/BytecodeCompiler.h b/js/src/frontend/BytecodeCompiler.h index 9f1164e69400..1b13ffe9ed13 100644 --- a/js/src/frontend/BytecodeCompiler.h +++ b/js/src/frontend/BytecodeCompiler.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 8d90567bb301..336445f7ccec 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index e84c80e29f24..3b0bc3b4a31b 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index cbad2eb6675a..b78d821f897b 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/FoldConstants.h b/js/src/frontend/FoldConstants.h index 86da781e8d80..a1bf9d14e9ad 100644 --- a/js/src/frontend/FoldConstants.h +++ b/js/src/frontend/FoldConstants.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 57b338de55d6..4152bc957c9c 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=4 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index 01d2585d4e88..22b9e961d2c1 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/NameFunctions.h b/js/src/frontend/NameFunctions.h index adfb3920ad4d..d2f9437cd191 100644 --- a/js/src/frontend/NameFunctions.h +++ b/js/src/frontend/NameFunctions.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/ParseMaps-inl.h b/js/src/frontend/ParseMaps-inl.h index ceefb4c8af89..55fca1a6eb66 100644 --- a/js/src/frontend/ParseMaps-inl.h +++ b/js/src/frontend/ParseMaps-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/frontend/ParseMaps.cpp b/js/src/frontend/ParseMaps.cpp index 34b1c8ede742..3426d861d903 100644 --- a/js/src/frontend/ParseMaps.cpp +++ b/js/src/frontend/ParseMaps.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/frontend/ParseMaps.h b/js/src/frontend/ParseMaps.h index b986bb10d0b4..a8026167be12 100644 --- a/js/src/frontend/ParseMaps.h +++ b/js/src/frontend/ParseMaps.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/frontend/ParseNode-inl.h b/js/src/frontend/ParseNode-inl.h index 15da9b41d96e..d35c61409ec2 100644 --- a/js/src/frontend/ParseNode-inl.h +++ b/js/src/frontend/ParseNode-inl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * 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/. */ diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index 26b22639f07e..f705e604db70 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index 7b2acefd33a6..f280390e2609 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/Parser-inl.h b/js/src/frontend/Parser-inl.h index b689f3bddd73..1fe084ce700f 100644 --- a/js/src/frontend/Parser-inl.h +++ b/js/src/frontend/Parser-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index f69d4190a359..88320dad663b 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 22b006981d50..2dcab9c3242a 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=4 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/frontend/SharedContext-inl.h b/js/src/frontend/SharedContext-inl.h index 247501f07d01..74cac685efc8 100644 --- a/js/src/frontend/SharedContext-inl.h +++ b/js/src/frontend/SharedContext-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 7212e66d3080..4b5bfff63a06 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h index 2d32ae516bee..dd0ba4faedf1 100644 --- a/js/src/frontend/SyntaxParseHandler.h +++ b/js/src/frontend/SyntaxParseHandler.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=4 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 5435b683f0c7..69b9477666ab 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index dad7e88ae2c1..0997a8049aa4 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/gc/Barrier-inl.h b/js/src/gc/Barrier-inl.h index 0329d1e740e6..acab9ef1610d 100644 --- a/js/src/gc/Barrier-inl.h +++ b/js/src/gc/Barrier-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Barrier.h b/js/src/gc/Barrier.h index 13f2a509a2e1..0a1009721abb 100644 --- a/js/src/gc/Barrier.h +++ b/js/src/gc/Barrier.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/FindSCCs-inl.h b/js/src/gc/FindSCCs-inl.h index 24ae0b1de3eb..552ce53be271 100644 --- a/js/src/gc/FindSCCs-inl.h +++ b/js/src/gc/FindSCCs-inl.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + */ +/* 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 "jsfriendapi.h" diff --git a/js/src/gc/FindSCCs.h b/js/src/gc/FindSCCs.h index c8ed79d70a9c..ccd5f5991fbf 100644 --- a/js/src/gc/FindSCCs.h +++ b/js/src/gc/FindSCCs.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + */ +/* 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/. */ #ifndef gc_findsccs_h___ #define gc_findsccs_h___ diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index f900778b106e..e661aac9e88e 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Heap.h b/js/src/gc/Heap.h index e5e7f7b67bc9..bf73c24f80d5 100644 --- a/js/src/gc/Heap.h +++ b/js/src/gc/Heap.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + */ +/* 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/. */ #ifndef gc_heap_h___ #define gc_heap_h___ diff --git a/js/src/gc/Iteration.cpp b/js/src/gc/Iteration.cpp index 76693e5fecff..607fd215aef5 100644 --- a/js/src/gc/Iteration.cpp +++ b/js/src/gc/Iteration.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index f6b18144a985..f527fb650715 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + * vim: set ts=4 sw=4 tw=79 et: + */ +/* 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 "mozilla/DebugOnly.h" diff --git a/js/src/gc/Marking.h b/js/src/gc/Marking.h index 3d89bd3e607b..499becc6aad8 100644 --- a/js/src/gc/Marking.h +++ b/js/src/gc/Marking.h @@ -1,8 +1,9 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + */ +/* 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/. */ #ifndef gc_marking_h___ #define gc_marking_h___ diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 399177771718..e2bec9717391 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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 "mozilla/Assertions.h" diff --git a/js/src/gc/Memory.h b/js/src/gc/Memory.h index b73c266bf2cb..bf78cd0594bc 100644 --- a/js/src/gc/Memory.h +++ b/js/src/gc/Memory.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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/. */ #ifndef jsgc_memory_h___ #define jsgc_memory_h___ diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index f97bb1503c81..2f6e71da4ce6 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index 377c3b21b796..dcbd00f563c9 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index 027600bc0c64..934df0668de8 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp index 236fcbd1cf6e..0a1523096e28 100644 --- a/js/src/gc/StoreBuffer.cpp +++ b/js/src/gc/StoreBuffer.cpp @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ + * vim: set ts=8 sw=4 et tw=78: + */ +/* 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/. */ #ifdef JSGC_GENERATIONAL diff --git a/js/src/gc/StoreBuffer.h b/js/src/gc/StoreBuffer.h index d927d098f695..5409eb02a2b5 100644 --- a/js/src/gc/StoreBuffer.h +++ b/js/src/gc/StoreBuffer.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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/. */ #ifdef JSGC_GENERATIONAL #ifndef jsgc_storebuffer_h___ diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index d7f714e9679d..2a45d31f7b6e 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index 8d4be70cdbdf..49976dd6c65c 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h index 4fb93bf50250..b9c42184afb3 100644 --- a/js/src/gc/Zone.h +++ b/js/src/gc/Zone.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/gdb/gdb-tests.h b/js/src/gdb/gdb-tests.h index e9141d51528e..70fdd8e94fc5 100644 --- a/js/src/gdb/gdb-tests.h +++ b/js/src/gdb/gdb-tests.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * 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 diff --git a/js/src/ion/AliasAnalysis.cpp b/js/src/ion/AliasAnalysis.cpp index 9a9ca27929c9..f90fff43905d 100644 --- a/js/src/ion/AliasAnalysis.cpp +++ b/js/src/ion/AliasAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AliasAnalysis.h b/js/src/ion/AliasAnalysis.h index 64de011e513d..36fd648e5467 100644 --- a/js/src/ion/AliasAnalysis.h +++ b/js/src/ion/AliasAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index 62c1e545c98a..d268f1f922b8 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AsmJS.h b/js/src/ion/AsmJS.h index 98b297edcbcd..b27e152e2593 100644 --- a/js/src/ion/AsmJS.h +++ b/js/src/ion/AsmJS.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AsmJSLink.cpp b/js/src/ion/AsmJSLink.cpp index 977ab27b46d2..46e87e0841b1 100644 --- a/js/src/ion/AsmJSLink.cpp +++ b/js/src/ion/AsmJSLink.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AsmJSModule.h b/js/src/ion/AsmJSModule.h index 72bf651c5c6a..ae5d1e89a5de 100644 --- a/js/src/ion/AsmJSModule.h +++ b/js/src/ion/AsmJSModule.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/AsmJSSignalHandlers.cpp b/js/src/ion/AsmJSSignalHandlers.cpp index 4e477392ea1d..0fa3af4adbc2 100644 --- a/js/src/ion/AsmJSSignalHandlers.cpp +++ b/js/src/ion/AsmJSSignalHandlers.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.cpp b/js/src/ion/BacktrackingAllocator.cpp index e42befd3ade5..491b49a3bd2f 100644 --- a/js/src/ion/BacktrackingAllocator.cpp +++ b/js/src/ion/BacktrackingAllocator.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BacktrackingAllocator.h b/js/src/ion/BacktrackingAllocator.h index 51b8ff62ce4e..ccf0a2e611fb 100644 --- a/js/src/ion/BacktrackingAllocator.h +++ b/js/src/ion/BacktrackingAllocator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Bailouts.cpp b/js/src/ion/Bailouts.cpp index aa4f2d14a458..2cffb267d201 100644 --- a/js/src/ion/Bailouts.cpp +++ b/js/src/ion/Bailouts.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Bailouts.h b/js/src/ion/Bailouts.h index d9d514d9e102..8694db28b92f 100644 --- a/js/src/ion/Bailouts.h +++ b/js/src/ion/Bailouts.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineBailouts.cpp b/js/src/ion/BaselineBailouts.cpp index 53b7628f2f15..75e2573e594f 100644 --- a/js/src/ion/BaselineBailouts.cpp +++ b/js/src/ion/BaselineBailouts.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineCompiler.cpp b/js/src/ion/BaselineCompiler.cpp index 15f392397a97..c50b0d0b11b7 100644 --- a/js/src/ion/BaselineCompiler.cpp +++ b/js/src/ion/BaselineCompiler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineCompiler.h b/js/src/ion/BaselineCompiler.h index 3c72e32a66c5..7e7fe1d4b6da 100644 --- a/js/src/ion/BaselineCompiler.h +++ b/js/src/ion/BaselineCompiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineFrame-inl.h b/js/src/ion/BaselineFrame-inl.h index cf3226aa5360..37f82ba5019e 100644 --- a/js/src/ion/BaselineFrame-inl.h +++ b/js/src/ion/BaselineFrame-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineFrame.cpp b/js/src/ion/BaselineFrame.cpp index 299ef4af564c..e9d317ea54f4 100644 --- a/js/src/ion/BaselineFrame.cpp +++ b/js/src/ion/BaselineFrame.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineFrame.h b/js/src/ion/BaselineFrame.h index 7d9642b0d12a..476c66978fae 100644 --- a/js/src/ion/BaselineFrame.h +++ b/js/src/ion/BaselineFrame.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.cpp b/js/src/ion/BaselineFrameInfo.cpp index 17dcd2765c9b..39e1c4556286 100644 --- a/js/src/ion/BaselineFrameInfo.cpp +++ b/js/src/ion/BaselineFrameInfo.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineFrameInfo.h b/js/src/ion/BaselineFrameInfo.h index eae34e232184..d02ecbc6af0b 100644 --- a/js/src/ion/BaselineFrameInfo.h +++ b/js/src/ion/BaselineFrameInfo.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineHelpers.h b/js/src/ion/BaselineHelpers.h index 1c2bd3dc0061..1502dba2a617 100644 --- a/js/src/ion/BaselineHelpers.h +++ b/js/src/ion/BaselineHelpers.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineIC.cpp b/js/src/ion/BaselineIC.cpp index 4403911b76a8..6c3494bbb287 100644 --- a/js/src/ion/BaselineIC.cpp +++ b/js/src/ion/BaselineIC.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineIC.h b/js/src/ion/BaselineIC.h index 461628faf47e..f9c08e770f11 100644 --- a/js/src/ion/BaselineIC.h +++ b/js/src/ion/BaselineIC.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineInspector.cpp b/js/src/ion/BaselineInspector.cpp index b8490f92d4f1..26a6273f3dd5 100644 --- a/js/src/ion/BaselineInspector.cpp +++ b/js/src/ion/BaselineInspector.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineInspector.h b/js/src/ion/BaselineInspector.h index cef840718a53..5fb59f6ed015 100644 --- a/js/src/ion/BaselineInspector.h +++ b/js/src/ion/BaselineInspector.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineJIT.cpp b/js/src/ion/BaselineJIT.cpp index 8061224465aa..3dfce7916f15 100644 --- a/js/src/ion/BaselineJIT.cpp +++ b/js/src/ion/BaselineJIT.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineJIT.h b/js/src/ion/BaselineJIT.h index 33244f8ca2ed..2c9e914c5042 100644 --- a/js/src/ion/BaselineJIT.h +++ b/js/src/ion/BaselineJIT.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BaselineRegisters.h b/js/src/ion/BaselineRegisters.h index 26365375481d..c9d0d4136a8e 100644 --- a/js/src/ion/BaselineRegisters.h +++ b/js/src/ion/BaselineRegisters.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BitSet.cpp b/js/src/ion/BitSet.cpp index bbe12ce97f6c..1b3ec5863dc2 100644 --- a/js/src/ion/BitSet.cpp +++ b/js/src/ion/BitSet.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/BitSet.h b/js/src/ion/BitSet.h index f9b9dc38dd3b..03903c74a3ac 100644 --- a/js/src/ion/BitSet.h +++ b/js/src/ion/BitSet.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/C1Spewer.cpp b/js/src/ion/C1Spewer.cpp index 8934dc09d28e..7f17319efa40 100644 --- a/js/src/ion/C1Spewer.cpp +++ b/js/src/ion/C1Spewer.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/C1Spewer.h b/js/src/ion/C1Spewer.h index 66248f3528ba..fe05132a9407 100644 --- a/js/src/ion/C1Spewer.h +++ b/js/src/ion/C1Spewer.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 5106493af101..3b827b76d31a 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CodeGenerator.h b/js/src/ion/CodeGenerator.h index 4130a3611ebc..348fb3ce14f5 100644 --- a/js/src/ion/CodeGenerator.h +++ b/js/src/ion/CodeGenerator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CompactBuffer.h b/js/src/ion/CompactBuffer.h index fb29b780e3d8..c3ca501190d5 100644 --- a/js/src/ion/CompactBuffer.h +++ b/js/src/ion/CompactBuffer.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CompileInfo-inl.h b/js/src/ion/CompileInfo-inl.h index 85971562381a..666da9777c4d 100644 --- a/js/src/ion/CompileInfo-inl.h +++ b/js/src/ion/CompileInfo-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CompileInfo.h b/js/src/ion/CompileInfo.h index 2288b20460f6..237e9e4e1a4b 100644 --- a/js/src/ion/CompileInfo.h +++ b/js/src/ion/CompileInfo.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/CompilerRoot.h b/js/src/ion/CompilerRoot.h index 141924b7094a..81e9386ac417 100644 --- a/js/src/ion/CompilerRoot.h +++ b/js/src/ion/CompilerRoot.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.cpp b/js/src/ion/EdgeCaseAnalysis.cpp index 38cb200838b4..18a7547581e9 100644 --- a/js/src/ion/EdgeCaseAnalysis.cpp +++ b/js/src/ion/EdgeCaseAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/EdgeCaseAnalysis.h b/js/src/ion/EdgeCaseAnalysis.h index a322257996bf..bb744dd40eab 100644 --- a/js/src/ion/EdgeCaseAnalysis.h +++ b/js/src/ion/EdgeCaseAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.cpp b/js/src/ion/EffectiveAddressAnalysis.cpp index e936a6ebfe8d..76fa88a36e06 100644 --- a/js/src/ion/EffectiveAddressAnalysis.cpp +++ b/js/src/ion/EffectiveAddressAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/EffectiveAddressAnalysis.h b/js/src/ion/EffectiveAddressAnalysis.h index a86e871290b1..e7f3dc9f2e71 100644 --- a/js/src/ion/EffectiveAddressAnalysis.h +++ b/js/src/ion/EffectiveAddressAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ExecutionModeInlines.h b/js/src/ion/ExecutionModeInlines.h index 8a4c2d758ebd..1f86e4a8d294 100644 --- a/js/src/ion/ExecutionModeInlines.h +++ b/js/src/ion/ExecutionModeInlines.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/FixedArityList.h b/js/src/ion/FixedArityList.h index 4cf6ccf51827..d737ad4e1d02 100644 --- a/js/src/ion/FixedArityList.h +++ b/js/src/ion/FixedArityList.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/FixedList.h b/js/src/ion/FixedList.h index 2062ad8d64e3..9213d0744955 100644 --- a/js/src/ion/FixedList.h +++ b/js/src/ion/FixedList.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/InlineList.h b/js/src/ion/InlineList.h index 00897619b123..7bc21801de30 100644 --- a/js/src/ion/InlineList.h +++ b/js/src/ion/InlineList.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Ion.cpp b/js/src/ion/Ion.cpp index 9a227fa73aeb..3298897730b4 100644 --- a/js/src/ion/Ion.cpp +++ b/js/src/ion/Ion.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Ion.h b/js/src/ion/Ion.h index d11485db6fe6..c9e4f0cd8fa2 100644 --- a/js/src/ion/Ion.h +++ b/js/src/ion/Ion.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonAllocPolicy.h b/js/src/ion/IonAllocPolicy.h index f604a5005b49..8c828f71528f 100644 --- a/js/src/ion/IonAllocPolicy.h +++ b/js/src/ion/IonAllocPolicy.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonAnalysis.cpp b/js/src/ion/IonAnalysis.cpp index 58a070c42954..fc13e62faec3 100644 --- a/js/src/ion/IonAnalysis.cpp +++ b/js/src/ion/IonAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonAnalysis.h b/js/src/ion/IonAnalysis.h index 0f311da802df..42b02bb3f961 100644 --- a/js/src/ion/IonAnalysis.h +++ b/js/src/ion/IonAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 8a4b4f8f8974..e41193c06496 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonBuilder.h b/js/src/ion/IonBuilder.h index 8f8f2a486734..4b1422e29608 100644 --- a/js/src/ion/IonBuilder.h +++ b/js/src/ion/IonBuilder.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index e5983da59c2d..6cb2874769ef 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonCaches.h b/js/src/ion/IonCaches.h index 00c05567ab47..ec61d6a13604 100644 --- a/js/src/ion/IonCaches.h +++ b/js/src/ion/IonCaches.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonCode.h b/js/src/ion/IonCode.h index ec4a86d60e9c..0a4aeb1f34b9 100644 --- a/js/src/ion/IonCode.h +++ b/js/src/ion/IonCode.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonCompartment.h b/js/src/ion/IonCompartment.h index 472cf55fba5d..5a5681f110f6 100644 --- a/js/src/ion/IonCompartment.h +++ b/js/src/ion/IonCompartment.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonFrameIterator-inl.h b/js/src/ion/IonFrameIterator-inl.h index 2740d9432b5b..5b1094bda4d7 100644 --- a/js/src/ion/IonFrameIterator-inl.h +++ b/js/src/ion/IonFrameIterator-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonFrameIterator.h b/js/src/ion/IonFrameIterator.h index fb0a339ae79d..e85656fb4265 100644 --- a/js/src/ion/IonFrameIterator.h +++ b/js/src/ion/IonFrameIterator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonFrames-inl.h b/js/src/ion/IonFrames-inl.h index a1fa889785c8..1267a565856f 100644 --- a/js/src/ion/IonFrames-inl.h +++ b/js/src/ion/IonFrames-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index 4f24db565cad..880a6396905d 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonFrames.h b/js/src/ion/IonFrames.h index 5e598e244b27..6872c96a3422 100644 --- a/js/src/ion/IonFrames.h +++ b/js/src/ion/IonFrames.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonInstrumentation.h b/js/src/ion/IonInstrumentation.h index 62d9ea1f6951..cb8ceae9119a 100644 --- a/js/src/ion/IonInstrumentation.h +++ b/js/src/ion/IonInstrumentation.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonLinker.h b/js/src/ion/IonLinker.h index b818368ccbaa..979385254362 100644 --- a/js/src/ion/IonLinker.h +++ b/js/src/ion/IonLinker.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.cpp b/js/src/ion/IonMacroAssembler.cpp index bcf85af67d84..808218f3df8b 100644 --- a/js/src/ion/IonMacroAssembler.cpp +++ b/js/src/ion/IonMacroAssembler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index 9b4571354eb8..b08f08d277cc 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonSpewer.cpp b/js/src/ion/IonSpewer.cpp index c911955b57cf..002a36193d12 100644 --- a/js/src/ion/IonSpewer.cpp +++ b/js/src/ion/IonSpewer.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonSpewer.h b/js/src/ion/IonSpewer.h index 4f6ad0eaa776..19696dc286e6 100644 --- a/js/src/ion/IonSpewer.h +++ b/js/src/ion/IonSpewer.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/IonTypes.h b/js/src/ion/IonTypes.h index 6e60a39c6159..b033e28f18c3 100644 --- a/js/src/ion/IonTypes.h +++ b/js/src/ion/IonTypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/JSONSpewer.cpp b/js/src/ion/JSONSpewer.cpp index 466941ddd7a5..bc3a4c363984 100644 --- a/js/src/ion/JSONSpewer.cpp +++ b/js/src/ion/JSONSpewer.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/JSONSpewer.h b/js/src/ion/JSONSpewer.h index 556faa9081bb..8726b48fcd26 100644 --- a/js/src/ion/JSONSpewer.h +++ b/js/src/ion/JSONSpewer.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LICM.cpp b/js/src/ion/LICM.cpp index d93f1c22f248..d40970a65994 100644 --- a/js/src/ion/LICM.cpp +++ b/js/src/ion/LICM.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LICM.h b/js/src/ion/LICM.h index e2f53fafdc65..ab40b2b6df91 100644 --- a/js/src/ion/LICM.h +++ b/js/src/ion/LICM.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LIR-Common.h b/js/src/ion/LIR-Common.h index 5d6ef835e6bf..f2ddb2d08264 100644 --- a/js/src/ion/LIR-Common.h +++ b/js/src/ion/LIR-Common.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LIR-inl.h b/js/src/ion/LIR-inl.h index de4d08ede26c..af24d9769146 100644 --- a/js/src/ion/LIR-inl.h +++ b/js/src/ion/LIR-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LIR.cpp b/js/src/ion/LIR.cpp index d0f96070f6c0..7c70b2a51cda 100644 --- a/js/src/ion/LIR.cpp +++ b/js/src/ion/LIR.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LIR.h b/js/src/ion/LIR.h index dcbc44e47b4c..096cbd374ce0 100644 --- a/js/src/ion/LIR.h +++ b/js/src/ion/LIR.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LOpcodes.h b/js/src/ion/LOpcodes.h index b7bf009b266c..227aeac052a4 100644 --- a/js/src/ion/LOpcodes.h +++ b/js/src/ion/LOpcodes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LinearScan.cpp b/js/src/ion/LinearScan.cpp index 8318716ca2d0..b073db985a1e 100644 --- a/js/src/ion/LinearScan.cpp +++ b/js/src/ion/LinearScan.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LinearScan.h b/js/src/ion/LinearScan.h index 4dcd24a207ca..3cf8d80740e3 100644 --- a/js/src/ion/LinearScan.h +++ b/js/src/ion/LinearScan.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.cpp b/js/src/ion/LiveRangeAllocator.cpp index 154c2767204b..b35e731eb3ab 100644 --- a/js/src/ion/LiveRangeAllocator.cpp +++ b/js/src/ion/LiveRangeAllocator.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/LiveRangeAllocator.h b/js/src/ion/LiveRangeAllocator.h index 3c81bc90903a..d48aece848d9 100644 --- a/js/src/ion/LiveRangeAllocator.h +++ b/js/src/ion/LiveRangeAllocator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Lowering.cpp b/js/src/ion/Lowering.cpp index 75de254f6577..5a3bbd5c0823 100644 --- a/js/src/ion/Lowering.cpp +++ b/js/src/ion/Lowering.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Lowering.h b/js/src/ion/Lowering.h index cc8cd249df8b..4d39160fb155 100644 --- a/js/src/ion/Lowering.h +++ b/js/src/ion/Lowering.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MCallOptimize.cpp b/js/src/ion/MCallOptimize.cpp index 98e986259127..d05b5f5f1378 100644 --- a/js/src/ion/MCallOptimize.cpp +++ b/js/src/ion/MCallOptimize.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MIR.cpp b/js/src/ion/MIR.cpp index 7b94d6c7419f..8eb9b1165495 100644 --- a/js/src/ion/MIR.cpp +++ b/js/src/ion/MIR.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index faa0d1ed38fa..0e1f6ec87acf 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MIRGenerator.h b/js/src/ion/MIRGenerator.h index a734cbdef71b..39cbba47602c 100644 --- a/js/src/ion/MIRGenerator.h +++ b/js/src/ion/MIRGenerator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MIRGraph.cpp b/js/src/ion/MIRGraph.cpp index addbda66aecd..3a02a3394f4d 100644 --- a/js/src/ion/MIRGraph.cpp +++ b/js/src/ion/MIRGraph.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MIRGraph.h b/js/src/ion/MIRGraph.h index f5b62e11623e..21f77942f95d 100644 --- a/js/src/ion/MIRGraph.h +++ b/js/src/ion/MIRGraph.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MOpcodes.h b/js/src/ion/MOpcodes.h index a5123a627ccd..c27a8b14251e 100644 --- a/js/src/ion/MOpcodes.h +++ b/js/src/ion/MOpcodes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MoveEmitter.h b/js/src/ion/MoveEmitter.h index 095b5d9e6da6..9a88bd12703d 100644 --- a/js/src/ion/MoveEmitter.h +++ b/js/src/ion/MoveEmitter.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MoveResolver.cpp b/js/src/ion/MoveResolver.cpp index a2b661c3130e..1d4c76b7f681 100644 --- a/js/src/ion/MoveResolver.cpp +++ b/js/src/ion/MoveResolver.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/MoveResolver.h b/js/src/ion/MoveResolver.h index 8a20e1021a09..0f816e15be54 100644 --- a/js/src/ion/MoveResolver.h +++ b/js/src/ion/MoveResolver.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.cpp b/js/src/ion/ParallelArrayAnalysis.cpp index 364df7b0902d..3d92c14267fe 100644 --- a/js/src/ion/ParallelArrayAnalysis.cpp +++ b/js/src/ion/ParallelArrayAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ParallelArrayAnalysis.h b/js/src/ion/ParallelArrayAnalysis.h index 2c2eba228b37..93e4ce36de2d 100644 --- a/js/src/ion/ParallelArrayAnalysis.h +++ b/js/src/ion/ParallelArrayAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ParallelFunctions.cpp b/js/src/ion/ParallelFunctions.cpp index e0c7ca406778..1b821503b328 100644 --- a/js/src/ion/ParallelFunctions.cpp +++ b/js/src/ion/ParallelFunctions.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ParallelFunctions.h b/js/src/ion/ParallelFunctions.h index 1fe9fcc333ff..b74e5cfa7aee 100644 --- a/js/src/ion/ParallelFunctions.h +++ b/js/src/ion/ParallelFunctions.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/PcScriptCache-inl.h b/js/src/ion/PcScriptCache-inl.h index fdf5acfd19ab..9a852d0ed453 100644 --- a/js/src/ion/PcScriptCache-inl.h +++ b/js/src/ion/PcScriptCache-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/PcScriptCache.h b/js/src/ion/PcScriptCache.h index 9f9a3d79c87c..4d8eca0cbe31 100644 --- a/js/src/ion/PcScriptCache.h +++ b/js/src/ion/PcScriptCache.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/RangeAnalysis.cpp b/js/src/ion/RangeAnalysis.cpp index 229b3a552b8d..918dc33bf90b 100644 --- a/js/src/ion/RangeAnalysis.cpp +++ b/js/src/ion/RangeAnalysis.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/RangeAnalysis.h b/js/src/ion/RangeAnalysis.h index 0ffdc4752288..830d3a3167de 100644 --- a/js/src/ion/RangeAnalysis.h +++ b/js/src/ion/RangeAnalysis.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/RegisterAllocator.cpp b/js/src/ion/RegisterAllocator.cpp index 335eae5265a8..f9986453416f 100644 --- a/js/src/ion/RegisterAllocator.cpp +++ b/js/src/ion/RegisterAllocator.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/RegisterAllocator.h b/js/src/ion/RegisterAllocator.h index fe76b3504ee9..d98704d38d03 100644 --- a/js/src/ion/RegisterAllocator.h +++ b/js/src/ion/RegisterAllocator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/RegisterSets.h b/js/src/ion/RegisterSets.h index 9679f9f734df..b1ec16bcd735 100644 --- a/js/src/ion/RegisterSets.h +++ b/js/src/ion/RegisterSets.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Registers.h b/js/src/ion/Registers.h index 988d544f279c..e942d2e0474e 100644 --- a/js/src/ion/Registers.h +++ b/js/src/ion/Registers.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Safepoints.cpp b/js/src/ion/Safepoints.cpp index 8af0573240d7..180b929d0301 100644 --- a/js/src/ion/Safepoints.cpp +++ b/js/src/ion/Safepoints.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Safepoints.h b/js/src/ion/Safepoints.h index 4ae9e14bbfaf..6e81e75e6442 100644 --- a/js/src/ion/Safepoints.h +++ b/js/src/ion/Safepoints.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/SnapshotReader.h b/js/src/ion/SnapshotReader.h index 497763da8e8c..61c930852a6a 100644 --- a/js/src/ion/SnapshotReader.h +++ b/js/src/ion/SnapshotReader.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/SnapshotWriter.h b/js/src/ion/SnapshotWriter.h index 9c90e6a7a757..9044da1dc405 100644 --- a/js/src/ion/SnapshotWriter.h +++ b/js/src/ion/SnapshotWriter.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/Snapshots.cpp b/js/src/ion/Snapshots.cpp index 3605148521c0..bc761faf75f8 100644 --- a/js/src/ion/Snapshots.cpp +++ b/js/src/ion/Snapshots.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/StackSlotAllocator.h b/js/src/ion/StackSlotAllocator.h index e0b978324b9e..d08c63797170 100644 --- a/js/src/ion/StackSlotAllocator.h +++ b/js/src/ion/StackSlotAllocator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/StupidAllocator.cpp b/js/src/ion/StupidAllocator.cpp index 699194afc6ef..c0646ac78f24 100644 --- a/js/src/ion/StupidAllocator.cpp +++ b/js/src/ion/StupidAllocator.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/StupidAllocator.h b/js/src/ion/StupidAllocator.h index 5c1279ddeaa4..77534641f7ba 100644 --- a/js/src/ion/StupidAllocator.h +++ b/js/src/ion/StupidAllocator.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/TypeOracle.cpp b/js/src/ion/TypeOracle.cpp index a54068563498..6e67e7956079 100644 --- a/js/src/ion/TypeOracle.cpp +++ b/js/src/ion/TypeOracle.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/TypeOracle.h b/js/src/ion/TypeOracle.h index d75a1cb77f32..bf13fdd6b8bf 100644 --- a/js/src/ion/TypeOracle.h +++ b/js/src/ion/TypeOracle.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/TypePolicy.cpp b/js/src/ion/TypePolicy.cpp index ce60a3528c03..2d4f90a542d4 100644 --- a/js/src/ion/TypePolicy.cpp +++ b/js/src/ion/TypePolicy.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/TypePolicy.h b/js/src/ion/TypePolicy.h index 3f209e53c857..310dd73e99ec 100644 --- a/js/src/ion/TypePolicy.h +++ b/js/src/ion/TypePolicy.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.cpp b/js/src/ion/UnreachableCodeElimination.cpp index 50a27363928f..75367fd313c0 100644 --- a/js/src/ion/UnreachableCodeElimination.cpp +++ b/js/src/ion/UnreachableCodeElimination.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/UnreachableCodeElimination.h b/js/src/ion/UnreachableCodeElimination.h index 9999afb47443..99a61eed7b7b 100644 --- a/js/src/ion/UnreachableCodeElimination.h +++ b/js/src/ion/UnreachableCodeElimination.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/VMFunctions.cpp b/js/src/ion/VMFunctions.cpp index c9f2f8dda262..15b33c5190d4 100644 --- a/js/src/ion/VMFunctions.cpp +++ b/js/src/ion/VMFunctions.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/VMFunctions.h b/js/src/ion/VMFunctions.h index c7477ddd2b0f..7439a9b56276 100644 --- a/js/src/ion/VMFunctions.h +++ b/js/src/ion/VMFunctions.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ValueNumbering.cpp b/js/src/ion/ValueNumbering.cpp index a8b83b5dc950..597fb89170f4 100644 --- a/js/src/ion/ValueNumbering.cpp +++ b/js/src/ion/ValueNumbering.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/ValueNumbering.h b/js/src/ion/ValueNumbering.h index edb1f40558f2..24db39cde1a1 100644 --- a/js/src/ion/ValueNumbering.h +++ b/js/src/ion/ValueNumbering.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Architecture-arm.cpp b/js/src/ion/arm/Architecture-arm.cpp index 7fc302930308..567715f688d1 100644 --- a/js/src/ion/arm/Architecture-arm.cpp +++ b/js/src/ion/arm/Architecture-arm.cpp @@ -1,9 +1,9 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ - #define HWCAP_ARMv7 (1 << 31) #include diff --git a/js/src/ion/arm/Architecture-arm.h b/js/src/ion/arm/Architecture-arm.h index 0471efb88357..3257c31ff1c0 100644 --- a/js/src/ion/arm/Architecture-arm.h +++ b/js/src/ion/arm/Architecture-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.cpp b/js/src/ion/arm/Assembler-arm.cpp index 820f99c9b615..a2c178ee7f8a 100644 --- a/js/src/ion/arm/Assembler-arm.cpp +++ b/js/src/ion/arm/Assembler-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Assembler-arm.h b/js/src/ion/arm/Assembler-arm.h index 80f1b7737255..620270bcf3f2 100644 --- a/js/src/ion/arm/Assembler-arm.h +++ b/js/src/ion/arm/Assembler-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Bailouts-arm.cpp b/js/src/ion/arm/Bailouts-arm.cpp index 21968bde4b1d..bb51f8f3fbc6 100644 --- a/js/src/ion/arm/Bailouts-arm.cpp +++ b/js/src/ion/arm/Bailouts-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.cpp b/js/src/ion/arm/BaselineCompiler-arm.cpp index 7ed88a3f246a..53ddd75857b0 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.cpp +++ b/js/src/ion/arm/BaselineCompiler-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/BaselineCompiler-arm.h b/js/src/ion/arm/BaselineCompiler-arm.h index 5485204398d3..baaaff529d02 100644 --- a/js/src/ion/arm/BaselineCompiler-arm.h +++ b/js/src/ion/arm/BaselineCompiler-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/BaselineHelpers-arm.h b/js/src/ion/arm/BaselineHelpers-arm.h index 6d5611eb5437..6dd5795c0f39 100644 --- a/js/src/ion/arm/BaselineHelpers-arm.h +++ b/js/src/ion/arm/BaselineHelpers-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/BaselineIC-arm.cpp b/js/src/ion/arm/BaselineIC-arm.cpp index 25a1b40c0e5e..079b5b33d15c 100644 --- a/js/src/ion/arm/BaselineIC-arm.cpp +++ b/js/src/ion/arm/BaselineIC-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/BaselineRegisters-arm.h b/js/src/ion/arm/BaselineRegisters-arm.h index 53c908850855..4ba983e6e7d5 100644 --- a/js/src/ion/arm/BaselineRegisters-arm.h +++ b/js/src/ion/arm/BaselineRegisters-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.cpp b/js/src/ion/arm/CodeGenerator-arm.cpp index b28d73f5f080..4acfde24e38c 100644 --- a/js/src/ion/arm/CodeGenerator-arm.cpp +++ b/js/src/ion/arm/CodeGenerator-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/CodeGenerator-arm.h b/js/src/ion/arm/CodeGenerator-arm.h index 4c9940ade643..a0e421d57ac0 100644 --- a/js/src/ion/arm/CodeGenerator-arm.h +++ b/js/src/ion/arm/CodeGenerator-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.cpp b/js/src/ion/arm/IonFrames-arm.cpp index fe5bd1c65b69..0b90bb2c48fb 100644 --- a/js/src/ion/arm/IonFrames-arm.cpp +++ b/js/src/ion/arm/IonFrames-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/IonFrames-arm.h b/js/src/ion/arm/IonFrames-arm.h index c9d5268c6af5..f5b38c324f4a 100644 --- a/js/src/ion/arm/IonFrames-arm.h +++ b/js/src/ion/arm/IonFrames-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/LIR-arm.h b/js/src/ion/arm/LIR-arm.h index f9db2e9b6e05..7e0997c14bb3 100644 --- a/js/src/ion/arm/LIR-arm.h +++ b/js/src/ion/arm/LIR-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/LOpcodes-arm.h b/js/src/ion/arm/LOpcodes-arm.h index 1f53b9baabc8..7745129aa645 100644 --- a/js/src/ion/arm/LOpcodes-arm.h +++ b/js/src/ion/arm/LOpcodes-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.cpp b/js/src/ion/arm/Lowering-arm.cpp index f5aecb3ed4ef..867f69bbffd3 100644 --- a/js/src/ion/arm/Lowering-arm.cpp +++ b/js/src/ion/arm/Lowering-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Lowering-arm.h b/js/src/ion/arm/Lowering-arm.h index 0472fa1489e5..4436f2cd1cd3 100644 --- a/js/src/ion/arm/Lowering-arm.h +++ b/js/src/ion/arm/Lowering-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.cpp b/js/src/ion/arm/MacroAssembler-arm.cpp index 0076f8d27058..561a0b358802 100644 --- a/js/src/ion/arm/MacroAssembler-arm.cpp +++ b/js/src/ion/arm/MacroAssembler-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/MacroAssembler-arm.h b/js/src/ion/arm/MacroAssembler-arm.h index 18b258b750cc..a383576e8331 100644 --- a/js/src/ion/arm/MacroAssembler-arm.h +++ b/js/src/ion/arm/MacroAssembler-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.cpp b/js/src/ion/arm/MoveEmitter-arm.cpp index 289ecc795d80..b6f1b409e900 100644 --- a/js/src/ion/arm/MoveEmitter-arm.cpp +++ b/js/src/ion/arm/MoveEmitter-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/MoveEmitter-arm.h b/js/src/ion/arm/MoveEmitter-arm.h index 8d63c095c83d..783cf1c966e1 100644 --- a/js/src/ion/arm/MoveEmitter-arm.h +++ b/js/src/ion/arm/MoveEmitter-arm.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/arm/Trampoline-arm.cpp b/js/src/ion/arm/Trampoline-arm.cpp index 3f313235f059..a8dd69f463b4 100644 --- a/js/src/ion/arm/Trampoline-arm.cpp +++ b/js/src/ion/arm/Trampoline-arm.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Assembler-shared.h b/js/src/ion/shared/Assembler-shared.h index dec722212e45..eb6371fb2b68 100644 --- a/js/src/ion/shared/Assembler-shared.h +++ b/js/src/ion/shared/Assembler-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.cpp b/js/src/ion/shared/Assembler-x86-shared.cpp index 09accd9c7bb8..689a5a6876d3 100644 --- a/js/src/ion/shared/Assembler-x86-shared.cpp +++ b/js/src/ion/shared/Assembler-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Assembler-x86-shared.h b/js/src/ion/shared/Assembler-x86-shared.h index 66f49ef47131..41cb8e0bc5da 100644 --- a/js/src/ion/shared/Assembler-x86-shared.h +++ b/js/src/ion/shared/Assembler-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.cpp b/js/src/ion/shared/BaselineCompiler-shared.cpp index 47831a5c82cc..7b8bbfe05fc9 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-shared.h b/js/src/ion/shared/BaselineCompiler-shared.h index 2a23e44ed56b..a0baa943e584 100644 --- a/js/src/ion/shared/BaselineCompiler-shared.h +++ b/js/src/ion/shared/BaselineCompiler-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp index 9c3db57f63a2..9c23197aafe1 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.cpp +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/BaselineCompiler-x86-shared.h b/js/src/ion/shared/BaselineCompiler-x86-shared.h index 20ecdec89408..56d1b2de020b 100644 --- a/js/src/ion/shared/BaselineCompiler-x86-shared.h +++ b/js/src/ion/shared/BaselineCompiler-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/BaselineIC-x86-shared.cpp b/js/src/ion/shared/BaselineIC-x86-shared.cpp index a671664ad752..cc5bf7e616d4 100644 --- a/js/src/ion/shared/BaselineIC-x86-shared.cpp +++ b/js/src/ion/shared/BaselineIC-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared-inl.h b/js/src/ion/shared/CodeGenerator-shared-inl.h index 67f4aeee310a..7bf3b611417f 100644 --- a/js/src/ion/shared/CodeGenerator-shared-inl.h +++ b/js/src/ion/shared/CodeGenerator-shared-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.cpp b/js/src/ion/shared/CodeGenerator-shared.cpp index 3017b431e153..568e0d684500 100644 --- a/js/src/ion/shared/CodeGenerator-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-shared.h b/js/src/ion/shared/CodeGenerator-shared.h index a99934e46968..1695dc5c45cc 100644 --- a/js/src/ion/shared/CodeGenerator-shared.h +++ b/js/src/ion/shared/CodeGenerator-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.cpp b/js/src/ion/shared/CodeGenerator-x86-shared.cpp index 80a6adb35e5f..eaa4ac482f2e 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/ion/shared/CodeGenerator-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/CodeGenerator-x86-shared.h b/js/src/ion/shared/CodeGenerator-x86-shared.h index 547ddbd588de..93305081b7b5 100644 --- a/js/src/ion/shared/CodeGenerator-x86-shared.h +++ b/js/src/ion/shared/CodeGenerator-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBuffer.h b/js/src/ion/shared/IonAssemblerBuffer.h index 59c51eacc751..47653f94955a 100644 --- a/js/src/ion/shared/IonAssemblerBuffer.h +++ b/js/src/ion/shared/IonAssemblerBuffer.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h index 8dcb2f3eb249..8b9b1055e2f4 100644 --- a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h +++ b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/IonFrames-shared.h b/js/src/ion/shared/IonFrames-shared.h index 2b6f12f1da78..794da5226709 100644 --- a/js/src/ion/shared/IonFrames-shared.h +++ b/js/src/ion/shared/IonFrames-shared.h @@ -1,9 +1,43 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * 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/. */ - + * vim: set ts=4 sw=4 et tw=79: + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * David Anderson + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ #ifndef jsion_ionframes_shared_h__ #define jsion_ionframes_shared_h__ diff --git a/js/src/ion/shared/IonFrames-x86-shared.cpp b/js/src/ion/shared/IonFrames-x86-shared.cpp index fe9dc1f19531..55ca61030a89 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.cpp +++ b/js/src/ion/shared/IonFrames-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/IonFrames-x86-shared.h b/js/src/ion/shared/IonFrames-x86-shared.h index 9100f3b38413..04f055884d71 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.h +++ b/js/src/ion/shared/IonFrames-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/LIR-x86-shared.h b/js/src/ion/shared/LIR-x86-shared.h index 5d12830436c9..4cec8fbed08a 100644 --- a/js/src/ion/shared/LIR-x86-shared.h +++ b/js/src/ion/shared/LIR-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared-inl.h b/js/src/ion/shared/Lowering-shared-inl.h index 6139c7ea0647..a67981a03684 100644 --- a/js/src/ion/shared/Lowering-shared-inl.h +++ b/js/src/ion/shared/Lowering-shared-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.cpp b/js/src/ion/shared/Lowering-shared.cpp index 7ab7b2e314f9..577196d1aa65 100644 --- a/js/src/ion/shared/Lowering-shared.cpp +++ b/js/src/ion/shared/Lowering-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Lowering-shared.h b/js/src/ion/shared/Lowering-shared.h index 0808833a0284..5f8b34c24237 100644 --- a/js/src/ion/shared/Lowering-shared.h +++ b/js/src/ion/shared/Lowering-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.cpp b/js/src/ion/shared/Lowering-x86-shared.cpp index f2ed21d6b7fb..95496d77e916 100644 --- a/js/src/ion/shared/Lowering-x86-shared.cpp +++ b/js/src/ion/shared/Lowering-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/Lowering-x86-shared.h b/js/src/ion/shared/Lowering-x86-shared.h index 99a3c6cf3c50..797f552baeb2 100644 --- a/js/src/ion/shared/Lowering-x86-shared.h +++ b/js/src/ion/shared/Lowering-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/MacroAssembler-x86-shared.h b/js/src/ion/shared/MacroAssembler-x86-shared.h index f28f229dd7b8..644e302b3f5a 100644 --- a/js/src/ion/shared/MacroAssembler-x86-shared.h +++ b/js/src/ion/shared/MacroAssembler-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.cpp b/js/src/ion/shared/MoveEmitter-x86-shared.cpp index 8c8c6290923d..99e50bef2134 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.cpp +++ b/js/src/ion/shared/MoveEmitter-x86-shared.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/shared/MoveEmitter-x86-shared.h b/js/src/ion/shared/MoveEmitter-x86-shared.h index 915dd13b5091..bbc2a5ef1fe9 100644 --- a/js/src/ion/shared/MoveEmitter-x86-shared.h +++ b/js/src/ion/shared/MoveEmitter-x86-shared.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Architecture-x64.h b/js/src/ion/x64/Architecture-x64.h index 3a832c95df18..707fb2a43c04 100644 --- a/js/src/ion/x64/Architecture-x64.h +++ b/js/src/ion/x64/Architecture-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.cpp b/js/src/ion/x64/Assembler-x64.cpp index bdcbe791d2e1..bdb88083fb02 100644 --- a/js/src/ion/x64/Assembler-x64.cpp +++ b/js/src/ion/x64/Assembler-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Assembler-x64.h b/js/src/ion/x64/Assembler-x64.h index bf4a95980831..680d24c4f741 100644 --- a/js/src/ion/x64/Assembler-x64.h +++ b/js/src/ion/x64/Assembler-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Bailouts-x64.cpp b/js/src/ion/x64/Bailouts-x64.cpp index 4f9e265c62f8..8062c8814f3a 100644 --- a/js/src/ion/x64/Bailouts-x64.cpp +++ b/js/src/ion/x64/Bailouts-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.cpp b/js/src/ion/x64/BaselineCompiler-x64.cpp index e0bce0af7d51..45c9bf09c30b 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.cpp +++ b/js/src/ion/x64/BaselineCompiler-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/BaselineCompiler-x64.h b/js/src/ion/x64/BaselineCompiler-x64.h index ddac8c9c4133..1bfb02ba220b 100644 --- a/js/src/ion/x64/BaselineCompiler-x64.h +++ b/js/src/ion/x64/BaselineCompiler-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/BaselineHelpers-x64.h b/js/src/ion/x64/BaselineHelpers-x64.h index 0e5c802f13ea..939d8d9f5e9a 100644 --- a/js/src/ion/x64/BaselineHelpers-x64.h +++ b/js/src/ion/x64/BaselineHelpers-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/BaselineIC-x64.cpp b/js/src/ion/x64/BaselineIC-x64.cpp index 7359d26eb661..57d71a05a150 100644 --- a/js/src/ion/x64/BaselineIC-x64.cpp +++ b/js/src/ion/x64/BaselineIC-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/BaselineRegisters-x64.h b/js/src/ion/x64/BaselineRegisters-x64.h index 72a64a55bb1f..f3b9d69d187c 100644 --- a/js/src/ion/x64/BaselineRegisters-x64.h +++ b/js/src/ion/x64/BaselineRegisters-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.cpp b/js/src/ion/x64/CodeGenerator-x64.cpp index e94fe12fdb71..b7d720810de1 100644 --- a/js/src/ion/x64/CodeGenerator-x64.cpp +++ b/js/src/ion/x64/CodeGenerator-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/CodeGenerator-x64.h b/js/src/ion/x64/CodeGenerator-x64.h index 35e103cd3254..5360dc710413 100644 --- a/js/src/ion/x64/CodeGenerator-x64.h +++ b/js/src/ion/x64/CodeGenerator-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/LIR-x64.h b/js/src/ion/x64/LIR-x64.h index f5366d747f8d..f1a8d03fe3a5 100644 --- a/js/src/ion/x64/LIR-x64.h +++ b/js/src/ion/x64/LIR-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/LOpcodes-x64.h b/js/src/ion/x64/LOpcodes-x64.h index fb479d48ce5a..8a276914ac25 100644 --- a/js/src/ion/x64/LOpcodes-x64.h +++ b/js/src/ion/x64/LOpcodes-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.cpp b/js/src/ion/x64/Lowering-x64.cpp index 525d0ecabfb7..d8eda3c9430b 100644 --- a/js/src/ion/x64/Lowering-x64.cpp +++ b/js/src/ion/x64/Lowering-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Lowering-x64.h b/js/src/ion/x64/Lowering-x64.h index 176041735618..f479e5d1d8b9 100644 --- a/js/src/ion/x64/Lowering-x64.h +++ b/js/src/ion/x64/Lowering-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.cpp b/js/src/ion/x64/MacroAssembler-x64.cpp index c91b2471c35e..daf6a8b23875 100644 --- a/js/src/ion/x64/MacroAssembler-x64.cpp +++ b/js/src/ion/x64/MacroAssembler-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/MacroAssembler-x64.h b/js/src/ion/x64/MacroAssembler-x64.h index 8672a2e8e730..186943bf95a5 100644 --- a/js/src/ion/x64/MacroAssembler-x64.h +++ b/js/src/ion/x64/MacroAssembler-x64.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x64/Trampoline-x64.cpp b/js/src/ion/x64/Trampoline-x64.cpp index fc8be268141b..a8e1f6f86067 100644 --- a/js/src/ion/x64/Trampoline-x64.cpp +++ b/js/src/ion/x64/Trampoline-x64.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Architecture-x86.h b/js/src/ion/x86/Architecture-x86.h index 61ffbdd3f787..4c32e49df5b3 100644 --- a/js/src/ion/x86/Architecture-x86.h +++ b/js/src/ion/x86/Architecture-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.cpp b/js/src/ion/x86/Assembler-x86.cpp index e09285f8022c..d9cf3d312c9a 100644 --- a/js/src/ion/x86/Assembler-x86.cpp +++ b/js/src/ion/x86/Assembler-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Assembler-x86.h b/js/src/ion/x86/Assembler-x86.h index 3099f80a9b6d..3f894a8868fb 100644 --- a/js/src/ion/x86/Assembler-x86.h +++ b/js/src/ion/x86/Assembler-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Bailouts-x86.cpp b/js/src/ion/x86/Bailouts-x86.cpp index 731ef2c7e3ad..72e3eab4081b 100644 --- a/js/src/ion/x86/Bailouts-x86.cpp +++ b/js/src/ion/x86/Bailouts-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.cpp b/js/src/ion/x86/BaselineCompiler-x86.cpp index 618ac55080c5..4ae0b3c74d3d 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.cpp +++ b/js/src/ion/x86/BaselineCompiler-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/BaselineCompiler-x86.h b/js/src/ion/x86/BaselineCompiler-x86.h index dcc7eeabbfbf..cd1af33574a7 100644 --- a/js/src/ion/x86/BaselineCompiler-x86.h +++ b/js/src/ion/x86/BaselineCompiler-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/BaselineHelpers-x86.h b/js/src/ion/x86/BaselineHelpers-x86.h index 30f7db30986e..6222189a46b5 100644 --- a/js/src/ion/x86/BaselineHelpers-x86.h +++ b/js/src/ion/x86/BaselineHelpers-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/BaselineIC-x86.cpp b/js/src/ion/x86/BaselineIC-x86.cpp index 01a0b54bfc49..56a5dd0bba66 100644 --- a/js/src/ion/x86/BaselineIC-x86.cpp +++ b/js/src/ion/x86/BaselineIC-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/BaselineRegisters-x86.h b/js/src/ion/x86/BaselineRegisters-x86.h index b28bda46ea29..e8a88217be9f 100644 --- a/js/src/ion/x86/BaselineRegisters-x86.h +++ b/js/src/ion/x86/BaselineRegisters-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.cpp b/js/src/ion/x86/CodeGenerator-x86.cpp index 4884d5118e26..fd36974e9792 100644 --- a/js/src/ion/x86/CodeGenerator-x86.cpp +++ b/js/src/ion/x86/CodeGenerator-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/CodeGenerator-x86.h b/js/src/ion/x86/CodeGenerator-x86.h index c4a58322e4db..9fdc4b6a1b05 100644 --- a/js/src/ion/x86/CodeGenerator-x86.h +++ b/js/src/ion/x86/CodeGenerator-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/LIR-x86.h b/js/src/ion/x86/LIR-x86.h index a27412302000..b56ab4788770 100644 --- a/js/src/ion/x86/LIR-x86.h +++ b/js/src/ion/x86/LIR-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/LOpcodes-x86.h b/js/src/ion/x86/LOpcodes-x86.h index 5b4b9f49e2ca..7944813552d1 100644 --- a/js/src/ion/x86/LOpcodes-x86.h +++ b/js/src/ion/x86/LOpcodes-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.cpp b/js/src/ion/x86/Lowering-x86.cpp index 9ef6d6d51c45..debcc669fceb 100644 --- a/js/src/ion/x86/Lowering-x86.cpp +++ b/js/src/ion/x86/Lowering-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Lowering-x86.h b/js/src/ion/x86/Lowering-x86.h index f283e8a41053..db6347ea5af3 100644 --- a/js/src/ion/x86/Lowering-x86.h +++ b/js/src/ion/x86/Lowering-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.cpp b/js/src/ion/x86/MacroAssembler-x86.cpp index 4183d3c9f372..d620f46a0792 100644 --- a/js/src/ion/x86/MacroAssembler-x86.cpp +++ b/js/src/ion/x86/MacroAssembler-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/MacroAssembler-x86.h b/js/src/ion/x86/MacroAssembler-x86.h index 18f95d8bb89d..5912f3ec3537 100644 --- a/js/src/ion/x86/MacroAssembler-x86.h +++ b/js/src/ion/x86/MacroAssembler-x86.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/ion/x86/Trampoline-x86.cpp b/js/src/ion/x86/Trampoline-x86.cpp index 088d7678bc91..c6345788f956 100644 --- a/js/src/ion/x86/Trampoline-x86.cpp +++ b/js/src/ion/x86/Trampoline-x86.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jit-test/tests/auto-regress/bug557946.js b/js/src/jit-test/tests/auto-regress/bug557946.js index 8d1e95c53b17..37cde015b269 100644 --- a/js/src/jit-test/tests/auto-regress/bug557946.js +++ b/js/src/jit-test/tests/auto-regress/bug557946.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-6f1a38b94754-linux // Flags: -j // -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ var x = 0; var y = 0; diff --git a/js/src/jit-test/tests/auto-regress/bug558618.js b/js/src/jit-test/tests/auto-regress/bug558618.js index 3fe1dfb257ec..1618adb14b19 100644 --- a/js/src/jit-test/tests/auto-regress/bug558618.js +++ b/js/src/jit-test/tests/auto-regress/bug558618.js @@ -1,7 +1,7 @@ // Binary: cache/js-dbg-64-e69034463eeb-linux // Flags: -j // -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function f() { this.search = function(a, b, c) { arguments[3] = { } diff --git a/js/src/jit-test/tests/basic/bug535760.js b/js/src/jit-test/tests/basic/bug535760.js index dd00b961522c..e7e1fce14880 100644 --- a/js/src/jit-test/tests/basic/bug535760.js +++ b/js/src/jit-test/tests/basic/bug535760.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function foundit(items, n) { for (var i = 0; i < 10; i++) arguments[2](items, this); diff --git a/js/src/jit-test/tests/basic/bug541191-1.js b/js/src/jit-test/tests/basic/bug541191-1.js index 74ccae82976e..78f0caf10ad8 100644 --- a/js/src/jit-test/tests/basic/bug541191-1.js +++ b/js/src/jit-test/tests/basic/bug541191-1.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-2.js b/js/src/jit-test/tests/basic/bug541191-2.js index d270b7de1e2b..1d232dc332a9 100644 --- a/js/src/jit-test/tests/basic/bug541191-2.js +++ b/js/src/jit-test/tests/basic/bug541191-2.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-3.js b/js/src/jit-test/tests/basic/bug541191-3.js index f447d49d1e2d..f4e01b9e1802 100644 --- a/js/src/jit-test/tests/basic/bug541191-3.js +++ b/js/src/jit-test/tests/basic/bug541191-3.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-4.js b/js/src/jit-test/tests/basic/bug541191-4.js index 5d15bedb5c16..0ecbb9177425 100644 --- a/js/src/jit-test/tests/basic/bug541191-4.js +++ b/js/src/jit-test/tests/basic/bug541191-4.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug541191-5.js b/js/src/jit-test/tests/basic/bug541191-5.js index f87217b2ccee..a2f9e5714f0c 100644 --- a/js/src/jit-test/tests/basic/bug541191-5.js +++ b/js/src/jit-test/tests/basic/bug541191-5.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function g(a, b, c, d) { return "" + a + b + c + d; diff --git a/js/src/jit-test/tests/basic/bug592927.js b/js/src/jit-test/tests/basic/bug592927.js index 69f0bd237e46..dc74a5af9062 100644 --- a/js/src/jit-test/tests/basic/bug592927.js +++ b/js/src/jit-test/tests/basic/bug592927.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(x, y) { x(f); assertEq(y, "hello"); diff --git a/js/src/jit-test/tests/basic/bug602088.js b/js/src/jit-test/tests/basic/bug602088.js index 7e00d9b4c26d..283b546acc3c 100644 --- a/js/src/jit-test/tests/basic/bug602088.js +++ b/js/src/jit-test/tests/basic/bug602088.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ var p = Proxy.createFunction({}, function(x, y) { undefined.x(); }); print(new p(1, 2)); diff --git a/js/src/jit-test/tests/basic/bug606083.js b/js/src/jit-test/tests/basic/bug606083.js index d8049b94fa13..fc2594b0ead3 100644 --- a/js/src/jit-test/tests/basic/bug606083.js +++ b/js/src/jit-test/tests/basic/bug606083.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(L) { do { L: for (var i = 0; i < L; i++) { diff --git a/js/src/jit-test/tests/basic/bug616762.js b/js/src/jit-test/tests/basic/bug616762.js index 02f5c953cf59..89b8ddd18ab0 100644 --- a/js/src/jit-test/tests/basic/bug616762.js +++ b/js/src/jit-test/tests/basic/bug616762.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: document = { ready: function (x) { this.exec = x; diff --git a/js/src/jit-test/tests/basic/bug633409-1.js b/js/src/jit-test/tests/basic/bug633409-1.js index 20eaa6cda58e..1f65ccc8445f 100644 --- a/js/src/jit-test/tests/basic/bug633409-1.js +++ b/js/src/jit-test/tests/basic/bug633409-1.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: x = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }; for (i in x) diff --git a/js/src/jit-test/tests/basic/bug633409-2.js b/js/src/jit-test/tests/basic/bug633409-2.js index d3c498d6d235..349af466a2b3 100644 --- a/js/src/jit-test/tests/basic/bug633409-2.js +++ b/js/src/jit-test/tests/basic/bug633409-2.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: var o1 = {p1: 1}; var o2 = {p1: 1, p2: 2}; diff --git a/js/src/jit-test/tests/ion/bug674664-3.js b/js/src/jit-test/tests/ion/bug674664-3.js index ce5a828d57c3..7838e8738048 100644 --- a/js/src/jit-test/tests/ion/bug674664-3.js +++ b/js/src/jit-test/tests/ion/bug674664-3.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f0(p0) { var v0; do { diff --git a/js/src/jit-test/tests/ion/bug684362.js b/js/src/jit-test/tests/ion/bug684362.js index 9a83b053d711..dd2f606fc653 100644 --- a/js/src/jit-test/tests/ion/bug684362.js +++ b/js/src/jit-test/tests/ion/bug684362.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(a) { var k = a; T: for (;;) { diff --git a/js/src/jit-test/tests/ion/bug747271.js b/js/src/jit-test/tests/ion/bug747271.js index 176a44a5833a..2a751177f5ad 100644 --- a/js/src/jit-test/tests/ion/bug747271.js +++ b/js/src/jit-test/tests/ion/bug747271.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function randomFloat () { // note that in fuzz-testing, this can used as the size of a buffer to allocate. // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big. diff --git a/js/src/jit-test/tests/ion/bug750588.js b/js/src/jit-test/tests/ion/bug750588.js index 6fa44d9cce63..63bab41d6190 100644 --- a/js/src/jit-test/tests/ion/bug750588.js +++ b/js/src/jit-test/tests/ion/bug750588.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function S() { var t = new Float32Array(1); diff --git a/js/src/jit-test/tests/ion/bug772901.js b/js/src/jit-test/tests/ion/bug772901.js index eb71f6afb8a2..13928ced8592 100644 --- a/js/src/jit-test/tests/ion/bug772901.js +++ b/js/src/jit-test/tests/ion/bug772901.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(x) { delete ((x)++); diff --git a/js/src/jit-test/tests/ion/testPos.js b/js/src/jit-test/tests/ion/testPos.js index 197650e9b1fb..1d79df2fc636 100644 --- a/js/src/jit-test/tests/ion/testPos.js +++ b/js/src/jit-test/tests/ion/testPos.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f_int(x) { return +x; } diff --git a/js/src/jit-test/tests/ion/testSubtract.js b/js/src/jit-test/tests/ion/testSubtract.js index 2b4389b2a8fe..ad75a03f2ef0 100644 --- a/js/src/jit-test/tests/ion/testSubtract.js +++ b/js/src/jit-test/tests/ion/testSubtract.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f_int(x, y) { return x - y; } diff --git a/js/src/jit-test/tests/ion/testVAndBranch.js b/js/src/jit-test/tests/ion/testVAndBranch.js index c1fcc00e961f..e2ac44234227 100644 --- a/js/src/jit-test/tests/ion/testVAndBranch.js +++ b/js/src/jit-test/tests/ion/testVAndBranch.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(x) { if (x) return true; diff --git a/js/src/jit-test/tests/ion/truncateToInt32.js b/js/src/jit-test/tests/ion/truncateToInt32.js index 462b411ad1fe..f48b7f16aef7 100644 --- a/js/src/jit-test/tests/ion/truncateToInt32.js +++ b/js/src/jit-test/tests/ion/truncateToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function w(y) { diff --git a/js/src/jit-test/tests/ion/valueToInt32.js b/js/src/jit-test/tests/ion/valueToInt32.js index 65ad561eca4d..c879c2d75a10 100644 --- a/js/src/jit-test/tests/ion/valueToInt32.js +++ b/js/src/jit-test/tests/ion/valueToInt32.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(x, y) { // Confuse the type analysis to not know the type of x. diff --git a/js/src/jit-test/tests/jaeger/bug592973-1.js b/js/src/jit-test/tests/jaeger/bug592973-1.js index d3bafac623db..470f84ee359b 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-1.js +++ b/js/src/jit-test/tests/jaeger/bug592973-1.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(x) { if (x) { let y; diff --git a/js/src/jit-test/tests/jaeger/bug592973-3.js b/js/src/jit-test/tests/jaeger/bug592973-3.js index 541c39981a4c..ae4694955f5c 100644 --- a/js/src/jit-test/tests/jaeger/bug592973-3.js +++ b/js/src/jit-test/tests/jaeger/bug592973-3.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f([a, b, c, d]) { a = b; return function () { return a + b + c + d; }; diff --git a/js/src/jit-test/tests/jaeger/bug597378.js b/js/src/jit-test/tests/jaeger/bug597378.js index c766407ab58c..454935bb9320 100644 --- a/js/src/jit-test/tests/jaeger/bug597378.js +++ b/js/src/jit-test/tests/jaeger/bug597378.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(a, b) { var o = a; var q = b; diff --git a/js/src/jit-test/tests/jaeger/bug600139.js b/js/src/jit-test/tests/jaeger/bug600139.js index 61fa7283a03a..2fdedf42d5cf 100644 --- a/js/src/jit-test/tests/jaeger/bug600139.js +++ b/js/src/jit-test/tests/jaeger/bug600139.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(a, b, c) { if (!a.__SSi) { throw Components.returnCode = Cr.NS_ERROR_INVALID_ARG; diff --git a/js/src/jit-test/tests/jaeger/bug600424.js b/js/src/jit-test/tests/jaeger/bug600424.js index e59a06614f21..44bb4e7c9b4c 100644 --- a/js/src/jit-test/tests/jaeger/bug600424.js +++ b/js/src/jit-test/tests/jaeger/bug600424.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(a) { var x = { g: function () { diff --git a/js/src/jit-test/tests/jaeger/bug601982.js b/js/src/jit-test/tests/jaeger/bug601982.js index 99f4bf906fc4..b78f0704c69d 100644 --- a/js/src/jit-test/tests/jaeger/bug601982.js +++ b/js/src/jit-test/tests/jaeger/bug601982.js @@ -1,4 +1,4 @@ -/* vim: set ts=8 sts=4 et sw=4 tw=99: */ +/* vim: set ts=4 sw=4 tw=99 et: */ function J(i) { /* Cause a branch to build(?) */ diff --git a/js/src/jit-test/tests/jaeger/bug604381.js b/js/src/jit-test/tests/jaeger/bug604381.js index 3ca01cb36234..365c9e3d2b16 100644 --- a/js/src/jit-test/tests/jaeger/bug604381.js +++ b/js/src/jit-test/tests/jaeger/bug604381.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function F() { var T = { }; diff --git a/js/src/jit-test/tests/jaeger/bug616508.js b/js/src/jit-test/tests/jaeger/bug616508.js index d29bf75f9b5e..38ca2360f1aa 100644 --- a/js/src/jit-test/tests/jaeger/bug616508.js +++ b/js/src/jit-test/tests/jaeger/bug616508.js @@ -1,5 +1,5 @@ // |jit-test| error: ReferenceError -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: // Note: modified from original test, which used Uint32Array in place of Array, // because the behavior has changed in a way that this will throw a TypeError diff --git a/js/src/jit-test/tests/jaeger/bug625438.js b/js/src/jit-test/tests/jaeger/bug625438.js index 32586d8ab4fa..494bfd1342fd 100644 --- a/js/src/jit-test/tests/jaeger/bug625438.js +++ b/js/src/jit-test/tests/jaeger/bug625438.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: var count = 0; this.watch("x", function() { diff --git a/js/src/jit-test/tests/jaeger/bug627486.js b/js/src/jit-test/tests/jaeger/bug627486.js index 7acc3b01e957..f87d27e18a47 100644 --- a/js/src/jit-test/tests/jaeger/bug627486.js +++ b/js/src/jit-test/tests/jaeger/bug627486.js @@ -1,5 +1,5 @@ // |jit-test| error: TypeError -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: g = undefined; function L() { } diff --git a/js/src/jit-test/tests/jaeger/floatTypedArrays.js b/js/src/jit-test/tests/jaeger/floatTypedArrays.js index 51ea7c0a16f6..da1abe0c40ea 100644 --- a/js/src/jit-test/tests/jaeger/floatTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/floatTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testFloat32Array(L) { var f = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js index 8bb4627fa678..dc5ed7b45270 100644 --- a/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/normalIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testInt32Array(L) { var f = new Int32Array(8); diff --git a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js index c63d36bf2aea..3ed2f2bcb553 100644 --- a/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js +++ b/js/src/jit-test/tests/jaeger/smallIntTypedArrays.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testInt8Array(L) { var f = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js index 369aa2c6fb86..f9e7825a6378 100644 --- a/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js +++ b/js/src/jit-test/tests/jaeger/testCallElemAfterGC.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: ts=4 sw=4 tw=99 et: function A() { this.x = 12; diff --git a/js/src/jit-test/tests/jaeger/testDenseCallElem.js b/js/src/jit-test/tests/jaeger/testDenseCallElem.js index 0301048bf31a..eadb77f55b9f 100644 --- a/js/src/jit-test/tests/jaeger/testDenseCallElem.js +++ b/js/src/jit-test/tests/jaeger/testDenseCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function fillDense(a) { } diff --git a/js/src/jit-test/tests/jaeger/testForOps.js b/js/src/jit-test/tests/jaeger/testForOps.js index 382f096121ff..5704e070de07 100644 --- a/js/src/jit-test/tests/jaeger/testForOps.js +++ b/js/src/jit-test/tests/jaeger/testForOps.js @@ -1,5 +1,5 @@ // |jit-test| mjitalways -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function assertObjectsEqual(obj1, obj2) { assertEq(obj1.a, obj2.a); diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem.js b/js/src/jit-test/tests/jaeger/testPropCallElem.js index 2bb97fbe64a1..fd067bbf7a50 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testPropCallElem2.js b/js/src/jit-test/tests/jaeger/testPropCallElem2.js index 43f8efb0fb57..328193ae4b21 100644 --- a/js/src/jit-test/tests/jaeger/testPropCallElem2.js +++ b/js/src/jit-test/tests/jaeger/testPropCallElem2.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testUKeyUObject(a, key1, key2, key3) { a.a = function () { return this.d; } diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js index ed8fc7c9a9bb..9eb9d0688689 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Easy.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Easy.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testBadSetElems(obj, key) { obj[key] = 5; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js index 01b42bd6b392..146092fbb5d4 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-Indexed.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js index f202513d534a..91d71401d489 100644 --- a/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js +++ b/js/src/jit-test/tests/jaeger/testSetElem-NewProto.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f() { return [[], [], [], []]; diff --git a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js index 33e38dd3fc3f..49ea74a8b94c 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedFloatArray.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testSetTypedFloat32Array(k) { var ar = new Float32Array(8); diff --git a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js index 89e943b698a7..bf3099c50c0f 100644 --- a/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js +++ b/js/src/jit-test/tests/jaeger/testSetTypedIntArray.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function testSetTypedInt8Array(k) { var ar = new Int8Array(8); diff --git a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js index 1cbe064d3fef..cb2ce0059b46 100644 --- a/js/src/jit-test/tests/jaeger/testShiftSameBacking.js +++ b/js/src/jit-test/tests/jaeger/testShiftSameBacking.js @@ -1,4 +1,4 @@ -// vim: set ts=8 sts=4 et sw=4 tw=99: +// vim: set ts=4 sw=4 tw=99 et: function f(a) { var x = a; diff --git a/js/src/jsalloc.cpp b/js/src/jsalloc.cpp index 744eb68cb9d7..a5ceae2a22c5 100644 --- a/js/src/jsalloc.cpp +++ b/js/src/jsalloc.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsalloc.h b/js/src/jsalloc.h index 7d2690b69a79..7d76a7c701ad 100644 --- a/js/src/jsalloc.h +++ b/js/src/jsalloc.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsanalyze.cpp b/js/src/jsanalyze.cpp index bda8e36751e5..0e5312f58ce2 100644 --- a/js/src/jsanalyze.cpp +++ b/js/src/jsanalyze.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsanalyze.h b/js/src/jsanalyze.h index e1b60575aaed..2be5bcdaf3c2 100644 --- a/js/src/jsanalyze.h +++ b/js/src/jsanalyze.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsapi-tests/selfTest.cpp b/js/src/jsapi-tests/selfTest.cpp index 39202abb5720..91f25ccce612 100644 --- a/js/src/jsapi-tests/selfTest.cpp +++ b/js/src/jsapi-tests/selfTest.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testAddPropertyPropcache.cpp b/js/src/jsapi-tests/testAddPropertyPropcache.cpp index 10acaf89c2f0..be190df1824c 100644 --- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp +++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArgumentsObject.cpp b/js/src/jsapi-tests/testArgumentsObject.cpp index 0d34e41b2dad..81c79608fd73 100644 --- a/js/src/jsapi-tests/testArgumentsObject.cpp +++ b/js/src/jsapi-tests/testArgumentsObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testArrayBuffer.cpp b/js/src/jsapi-tests/testArrayBuffer.cpp index a8299a611b51..081146c3d690 100644 --- a/js/src/jsapi-tests/testArrayBuffer.cpp +++ b/js/src/jsapi-tests/testArrayBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index f66c702aab19..c3a907a20b91 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Tests JS_TransplantObject */ diff --git a/js/src/jsapi-tests/testClassGetter.cpp b/js/src/jsapi-tests/testClassGetter.cpp index 7b3ecb728447..420ef24c4346 100644 --- a/js/src/jsapi-tests/testClassGetter.cpp +++ b/js/src/jsapi-tests/testClassGetter.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Tests the JSClass::getProperty hook */ diff --git a/js/src/jsapi-tests/testCloneScript.cpp b/js/src/jsapi-tests/testCloneScript.cpp index 91ff93d76180..14e6882dd431 100644 --- a/js/src/jsapi-tests/testCloneScript.cpp +++ b/js/src/jsapi-tests/testCloneScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testContexts.cpp b/js/src/jsapi-tests/testContexts.cpp index e863a4086ee1..1f65b462a2d0 100644 --- a/js/src/jsapi-tests/testContexts.cpp +++ b/js/src/jsapi-tests/testContexts.cpp @@ -1,9 +1,11 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 sw=4 et tw=99: + */ +/* 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 "tests.h" BEGIN_TEST(testContexts_IsRunning) diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index 577fffa08129..586a24da62ba 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDeepFreeze.cpp b/js/src/jsapi-tests/testDeepFreeze.cpp index 48d31f6bcaa2..9b95af5b0bbf 100644 --- a/js/src/jsapi-tests/testDeepFreeze.cpp +++ b/js/src/jsapi-tests/testDeepFreeze.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp index d28c8affb58a..7f07b640e842 100644 --- a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp +++ b/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testDefineProperty.cpp b/js/src/jsapi-tests/testDefineProperty.cpp index 739dfafdb6c5..b5617799adae 100644 --- a/js/src/jsapi-tests/testDefineProperty.cpp +++ b/js/src/jsapi-tests/testDefineProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testEnclosingFunction.cpp b/js/src/jsapi-tests/testEnclosingFunction.cpp index 0a88f6c598e1..2549b6f181aa 100644 --- a/js/src/jsapi-tests/testEnclosingFunction.cpp +++ b/js/src/jsapi-tests/testEnclosingFunction.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Test script cloning. */ diff --git a/js/src/jsapi-tests/testErrorCopying.cpp b/js/src/jsapi-tests/testErrorCopying.cpp index bda243b85265..1923879d2763 100644 --- a/js/src/jsapi-tests/testErrorCopying.cpp +++ b/js/src/jsapi-tests/testErrorCopying.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Tests that the column number of error reports is properly copied over from * other reports when invoked from the C++ api. diff --git a/js/src/jsapi-tests/testFindSCCs.cpp b/js/src/jsapi-tests/testFindSCCs.cpp index ad38b56ac036..1e98800059e4 100644 --- a/js/src/jsapi-tests/testFindSCCs.cpp +++ b/js/src/jsapi-tests/testFindSCCs.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testFunctionProperties.cpp b/js/src/jsapi-tests/testFunctionProperties.cpp index b70f95bcb0e0..9fee41561803 100644 --- a/js/src/jsapi-tests/testFunctionProperties.cpp +++ b/js/src/jsapi-tests/testFunctionProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testGCOutOfMemory.cpp b/js/src/jsapi-tests/testGCOutOfMemory.cpp index 49e3db00f819..83aa3c774f85 100644 --- a/js/src/jsapi-tests/testGCOutOfMemory.cpp +++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/licenses/publicdomain/ diff --git a/js/src/jsapi-tests/testGetPropertyDefault.cpp b/js/src/jsapi-tests/testGetPropertyDefault.cpp index 8aa0323d8c3e..4dc9664fb921 100644 --- a/js/src/jsapi-tests/testGetPropertyDefault.cpp +++ b/js/src/jsapi-tests/testGetPropertyDefault.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIndexToString.cpp b/js/src/jsapi-tests/testIndexToString.cpp index 998e65218614..0b59b6f0b402 100644 --- a/js/src/jsapi-tests/testIndexToString.cpp +++ b/js/src/jsapi-tests/testIndexToString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testIntString.cpp b/js/src/jsapi-tests/testIntString.cpp index fc627d62430d..18b3d53371e5 100644 --- a/js/src/jsapi-tests/testIntString.cpp +++ b/js/src/jsapi-tests/testIntString.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testJSEvaluateScript.cpp b/js/src/jsapi-tests/testJSEvaluateScript.cpp index 72d92e751432..875ae83094be 100644 --- a/js/src/jsapi-tests/testJSEvaluateScript.cpp +++ b/js/src/jsapi-tests/testJSEvaluateScript.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ #include "tests.h" diff --git a/js/src/jsapi-tests/testLookup.cpp b/js/src/jsapi-tests/testLookup.cpp index 74125b62cbdf..692ca846d5b1 100644 --- a/js/src/jsapi-tests/testLookup.cpp +++ b/js/src/jsapi-tests/testLookup.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testNewObject.cpp b/js/src/jsapi-tests/testNewObject.cpp index 03dac00c0a36..94b8607bb1db 100644 --- a/js/src/jsapi-tests/testNewObject.cpp +++ b/js/src/jsapi-tests/testNewObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp index c883439b0e39..648493be1df0 100644 --- a/js/src/jsapi-tests/testOps.cpp +++ b/js/src/jsapi-tests/testOps.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Tests for operators and implicit type conversion. */ diff --git a/js/src/jsapi-tests/testParseJSON.cpp b/js/src/jsapi-tests/testParseJSON.cpp index 87255505bc6f..abfe849ec214 100644 --- a/js/src/jsapi-tests/testParseJSON.cpp +++ b/js/src/jsapi-tests/testParseJSON.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testProfileStrings.cpp b/js/src/jsapi-tests/testProfileStrings.cpp index 15b265ca6fce..bf6a82ca5e85 100644 --- a/js/src/jsapi-tests/testProfileStrings.cpp +++ b/js/src/jsapi-tests/testProfileStrings.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: * * Tests the stack-based instrumentation profiler on a JSRuntime */ diff --git a/js/src/jsapi-tests/testPropCache.cpp b/js/src/jsapi-tests/testPropCache.cpp index 9c619183dc34..3920a1f06bfd 100644 --- a/js/src/jsapi-tests/testPropCache.cpp +++ b/js/src/jsapi-tests/testPropCache.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp index 717c7dccac2b..5fdebda8acac 100644 --- a/js/src/jsapi-tests/testRegExpInstanceProperties.cpp +++ b/js/src/jsapi-tests/testRegExpInstanceProperties.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testResolveRecursion.cpp b/js/src/jsapi-tests/testResolveRecursion.cpp index 58f387e585ed..43d7b2d2be99 100644 --- a/js/src/jsapi-tests/testResolveRecursion.cpp +++ b/js/src/jsapi-tests/testResolveRecursion.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSameValue.cpp b/js/src/jsapi-tests/testSameValue.cpp index 3d35df3a671b..6f1c75b54e60 100644 --- a/js/src/jsapi-tests/testSameValue.cpp +++ b/js/src/jsapi-tests/testSameValue.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptInfo.cpp b/js/src/jsapi-tests/testScriptInfo.cpp index 2fa8f29429a4..3265ed9fc430 100644 --- a/js/src/jsapi-tests/testScriptInfo.cpp +++ b/js/src/jsapi-tests/testScriptInfo.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp index 29a522dfa857..4075976864c7 100644 --- a/js/src/jsapi-tests/testScriptObject.cpp +++ b/js/src/jsapi-tests/testScriptObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testSetProperty.cpp b/js/src/jsapi-tests/testSetProperty.cpp index 8003c473b35a..598d5d24d8fa 100644 --- a/js/src/jsapi-tests/testSetProperty.cpp +++ b/js/src/jsapi-tests/testSetProperty.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testStringBuffer.cpp b/js/src/jsapi-tests/testStringBuffer.cpp index ebbd2dff1f61..51c232381d27 100644 --- a/js/src/jsapi-tests/testStringBuffer.cpp +++ b/js/src/jsapi-tests/testStringBuffer.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTrap.cpp b/js/src/jsapi-tests/testTrap.cpp index a1bde8d9d2d8..3e66a388ec06 100644 --- a/js/src/jsapi-tests/testTrap.cpp +++ b/js/src/jsapi-tests/testTrap.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testTypedArrays.cpp b/js/src/jsapi-tests/testTypedArrays.cpp index 8aba225ac576..00ec3704e356 100644 --- a/js/src/jsapi-tests/testTypedArrays.cpp +++ b/js/src/jsapi-tests/testTypedArrays.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testUTF8.cpp b/js/src/jsapi-tests/testUTF8.cpp index 2ec6b06898ef..941177369b89 100644 --- a/js/src/jsapi-tests/testUTF8.cpp +++ b/js/src/jsapi-tests/testUTF8.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp index c47d82897726..e8d934a83d6d 100644 --- a/js/src/jsapi-tests/testXDR.cpp +++ b/js/src/jsapi-tests/testXDR.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: */ /* 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 diff --git a/js/src/jsapi-tests/tests.cpp b/js/src/jsapi-tests/tests.cpp index 30b89be2d3b8..6ce8c30b6244 100644 --- a/js/src/jsapi-tests/tests.cpp +++ b/js/src/jsapi-tests/tests.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index d9579ef9ec50..e251ca981a23 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsapi-tests/valueABI.c b/js/src/jsapi-tests/valueABI.c index 65b31d38c48e..89a5693ee393 100644 --- a/js/src/jsapi-tests/valueABI.c +++ b/js/src/jsapi-tests/valueABI.c @@ -1,5 +1,6 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sw=4 et tw=99 ft=c: + * * 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/. */ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index a506b06fb23c..3180e7f3e55e 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 610c7f8071e6..cd4d151ca4f1 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index cf6da3726fc4..d3cbcc4be99d 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set sw=4 ts=8 et tw=78: + * * 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/. */ diff --git a/js/src/jsarray.h b/js/src/jsarray.h index 7cb15822c18b..a61d7a829deb 100644 --- a/js/src/jsarray.h +++ b/js/src/jsarray.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp index a675149a54aa..e0178dedd302 100644 --- a/js/src/jsatom.cpp +++ b/js/src/jsatom.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsatom.h b/js/src/jsatom.h index 1aa15269e9d6..9ff01bd6fac1 100644 --- a/js/src/jsatom.h +++ b/js/src/jsatom.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsatominlines.h b/js/src/jsatominlines.h index 421bf141b6be..2d5df3d44029 100644 --- a/js/src/jsatominlines.h +++ b/js/src/jsatominlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsbool.cpp b/js/src/jsbool.cpp index 1b29be168a50..b3a54c63c24e 100644 --- a/js/src/jsbool.cpp +++ b/js/src/jsbool.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsbool.h b/js/src/jsbool.h index 0d847ec30514..1676d523af87 100644 --- a/js/src/jsbool.h +++ b/js/src/jsbool.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsboolinlines.h b/js/src/jsboolinlines.h index 58ed270c1966..1f2b361d276e 100644 --- a/js/src/jsboolinlines.h +++ b/js/src/jsboolinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsclass.h b/js/src/jsclass.h index a8559ea554ab..86c0e5b86e68 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/jsclist.h b/js/src/jsclist.h index 8782307fa4ab..4881104eee79 100644 --- a/js/src/jsclist.h +++ b/js/src/jsclist.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/src/jsclone.cpp b/js/src/jsclone.cpp index 885bfc01a1ba..e3b249e486eb 100644 --- a/js/src/jsclone.cpp +++ b/js/src/jsclone.cpp @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jsclone.h b/js/src/jsclone.h index 595bf8f013a1..5a3326152b65 100644 --- a/js/src/jsclone.h +++ b/js/src/jsclone.h @@ -1,5 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ diff --git a/js/src/jscntxt.cpp b/js/src/jscntxt.cpp index 9e36c88415c6..2190cf5be7ae 100644 --- a/js/src/jscntxt.cpp +++ b/js/src/jscntxt.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 487903125723..b3b0fad13626 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 58de7e00b258..9c9a03d3b1da 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index 2a6dc4dc4edf..41961c8b8b2e 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index 454f13137d3a..d4fda4b68e7d 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/jscompartmentinlines.h b/js/src/jscompartmentinlines.h index c9c747b55e96..e9724ff9b047 100644 --- a/js/src/jscompartmentinlines.h +++ b/js/src/jscompartmentinlines.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/jscpucfg.h b/js/src/jscpucfg.h index 1b7baf996f1a..3d2022dbe292 100644 --- a/js/src/jscpucfg.h +++ b/js/src/jscpucfg.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jscrashformat.h b/js/src/jscrashformat.h index 7d3940d9f661..cf274f336018 100644 --- a/js/src/jscrashformat.h +++ b/js/src/jscrashformat.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jscrashreport.cpp b/js/src/jscrashreport.cpp index 1ebac89fa44f..6cb415aeb716 100644 --- a/js/src/jscrashreport.cpp +++ b/js/src/jscrashreport.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jscrashreport.h b/js/src/jscrashreport.h index cb2336be00d1..beeb76151ba1 100644 --- a/js/src/jscrashreport.h +++ b/js/src/jscrashreport.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index 666e72e3912a..928c4a66a8ea 100644 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsdate.h b/js/src/jsdate.h index 67c2ca067981..514160ecd634 100644 --- a/js/src/jsdate.h +++ b/js/src/jsdate.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index a3ed445bd705..be6e447aad9c 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index d6f5b2e9db25..e47c33a85718 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsdhash.cpp b/js/src/jsdhash.cpp index 00b0dbdbc04b..51b5cb5d94bd 100644 --- a/js/src/jsdhash.cpp +++ b/js/src/jsdhash.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/src/jsdhash.h b/js/src/jsdhash.h index 1f7830fd2b1f..c8f02b18b708 100644 --- a/js/src/jsdhash.h +++ b/js/src/jsdhash.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/src/jsdtoa.cpp b/js/src/jsdtoa.cpp index 9d94bebaf5e9..b8b57eb3f368 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/jsdtoa.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsdtoa.h b/js/src/jsdtoa.h index dfd5393d1090..c55b8277ed40 100644 --- a/js/src/jsdtoa.h +++ b/js/src/jsdtoa.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 4ba3778e74e2..21d2a3afeb9e 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsexn.h b/js/src/jsexn.h index c7b8882bdce6..4d14278db6f8 100644 --- a/js/src/jsexn.h +++ b/js/src/jsexn.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index cb69671550fe..d2e8a0b84b12 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index c0f4c975cb29..a95600ac89a7 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index bbc90d477d64..96d9eb2a4057 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsfun.h b/js/src/jsfun.h index d1cf351dcbc0..4fce726bc1cf 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ @@ -212,7 +212,7 @@ class JSFunction : public JSObject js::RawScript getOrCreateScript(JSContext *cx) { JS_ASSERT(isInterpreted()); - JS_ASSERT(cx); + JS_ASSERT(cx); if (isInterpretedLazy()) { JS::RootedFunction self(cx, this); js::MaybeCheckStackRoots(cx); diff --git a/js/src/jsfuninlines.h b/js/src/jsfuninlines.h index a15eb7ec3b48..0a0b49ad79c4 100644 --- a/js/src/jsfuninlines.h +++ b/js/src/jsfuninlines.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 7e5e0fda211c..f89147853304 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 22894caf3bdf..6b26f57faadb 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsgcinlines.h b/js/src/jsgcinlines.h index 9fc17ff96585..a684d0636d5f 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/jsgcinlines.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index 75d40a8f30e7..508eb23b1413 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index 2d26722ad9f7..1043a9954265 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsinferinlines.h b/js/src/jsinferinlines.h index c3dbb5f8f067..c6d29d39a7ea 100644 --- a/js/src/jsinferinlines.h +++ b/js/src/jsinferinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 5e16c739dc08..68b4c69e57b2 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index 9887aa0e6db9..9cbd70dbeafa 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsinterpinlines.h b/js/src/jsinterpinlines.h index 989cb28cb43c..56a513dd30bc 100644 --- a/js/src/jsinterpinlines.h +++ b/js/src/jsinterpinlines.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 39e49e81b684..552bdd95fb13 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsiter.h b/js/src/jsiter.h index 6640de902901..3d7627384df6 100644 --- a/js/src/jsiter.h +++ b/js/src/jsiter.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jskwgen.cpp b/js/src/jskwgen.cpp index c5e66707fb98..c488184603f7 100644 --- a/js/src/jskwgen.cpp +++ b/js/src/jskwgen.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set sw=4 ts=8 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jslibmath.h b/js/src/jslibmath.h index bcd136a1a79b..778d7f8ae1de 100644 --- a/js/src/jslibmath.h +++ b/js/src/jslibmath.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/jslock.h b/js/src/jslock.h index b4a28a9fa9c4..025aaea0af82 100644 --- a/js/src/jslock.h +++ b/js/src/jslock.h @@ -1,9 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ - #ifndef jslock_h__ #define jslock_h__ diff --git a/js/src/jslog2.cpp b/js/src/jslog2.cpp index cee3d0d13e22..d02400721365 100644 --- a/js/src/jslog2.cpp +++ b/js/src/jslog2.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 424ad79ed60e..97f880fe98d0 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsmath.h b/js/src/jsmath.h index 4f2a4b467eca..91150d809fc9 100644 --- a/js/src/jsmath.h +++ b/js/src/jsmath.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsmemorymetrics.cpp b/js/src/jsmemorymetrics.cpp index e744b6be9d6d..fc82601c5c17 100644 --- a/js/src/jsmemorymetrics.cpp +++ b/js/src/jsmemorymetrics.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index cd301292d72d..9fec01d35f0d 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -1,6 +1,7 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 et sw=4 tw=80: + */ +/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jsnativestack.h b/js/src/jsnativestack.h index 916bee2d0394..3f823f56d22f 100644 --- a/js/src/jsnativestack.h +++ b/js/src/jsnativestack.h @@ -1,6 +1,7 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public + * vim: set ts=8 et sw=4 tw=80: + */ +/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 49e89fc124e5..8c9dc7aff420 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsnum.h b/js/src/jsnum.h index 0f765f3c616b..653ff12fddf0 100644 --- a/js/src/jsnum.h +++ b/js/src/jsnum.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsnuminlines.h b/js/src/jsnuminlines.h index 1c4dcf515d56..c17909fdb52e 100644 --- a/js/src/jsnuminlines.h +++ b/js/src/jsnuminlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 347cbbf5d1e4..f8cb8b97e8a4 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79: + * * 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/. */ diff --git a/js/src/jsobj.h b/js/src/jsobj.h index a2e6a3e7deae..25a8652c5ec5 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 20790e56c8d9..9213ae088914 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/json.cpp b/js/src/json.cpp index 467c3ca0b8f5..d03a8da9931f 100644 --- a/js/src/json.cpp +++ b/js/src/json.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/json.h b/js/src/json.h index 7fa2c117c804..bb21f9145151 100644 --- a/js/src/json.h +++ b/js/src/json.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* 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/. */ diff --git a/js/src/jsonparser.cpp b/js/src/jsonparser.cpp index 9c89d08b4997..3b4b1ebb2a8c 100644 --- a/js/src/jsonparser.cpp +++ b/js/src/jsonparser.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsonparser.h b/js/src/jsonparser.h index d8df9946b27b..10c954055ff8 100644 --- a/js/src/jsonparser.h +++ b/js/src/jsonparser.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 2ce6dfc2c2a0..aafd8bbf4b6e 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set sw=4 ts=8 et tw=99: + * * 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/. */ diff --git a/js/src/jsopcode.h b/js/src/jsopcode.h index f0ec5c580cb3..1d1e17cbce46 100644 --- a/js/src/jsopcode.h +++ b/js/src/jsopcode.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsopcodeinlines.h b/js/src/jsopcodeinlines.h index 701be7785e5a..5fd85cd891da 100644 --- a/js/src/jsopcodeinlines.h +++ b/js/src/jsopcodeinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsoplengen.cpp b/js/src/jsoplengen.cpp index 808f5ed778b9..4bef284c5f5f 100644 --- a/js/src/jsoplengen.cpp +++ b/js/src/jsoplengen.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set sw=4 ts=8 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jsprf.cpp b/js/src/jsprf.cpp index 08fb08ff3fb5..0a2ebc8e41e5 100644 --- a/js/src/jsprf.cpp +++ b/js/src/jsprf.cpp @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/src/jsprf.h b/js/src/jsprf.h index c0891f0e9e90..4c2bef91d29e 100644 --- a/js/src/jsprf.h +++ b/js/src/jsprf.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/src/jsprobes.cpp b/js/src/jsprobes.cpp index b2217b1b8c1f..3a103ea612b0 100644 --- a/js/src/jsprobes.cpp +++ b/js/src/jsprobes.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h index 0bd391a2b70a..601bc5c70a03 100644 --- a/js/src/jsprobes.h +++ b/js/src/jsprobes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/jspropertycache.cpp b/js/src/jspropertycache.cpp index 98a84f21df78..20d074edd5f1 100644 --- a/js/src/jspropertycache.cpp +++ b/js/src/jspropertycache.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=98: + * * 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/. */ diff --git a/js/src/jspropertycache.h b/js/src/jspropertycache.h index ce0acab2c78f..b63aff4c7026 100644 --- a/js/src/jspropertycache.h +++ b/js/src/jspropertycache.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=98: + * * 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/. */ diff --git a/js/src/jspropertycacheinlines.h b/js/src/jspropertycacheinlines.h index 910a9e180a74..48e1a7874db7 100644 --- a/js/src/jspropertycacheinlines.h +++ b/js/src/jspropertycacheinlines.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jspropertytree.cpp b/js/src/jspropertytree.cpp index 6e8843821c1d..cf32bfac4e1a 100644 --- a/js/src/jspropertytree.cpp +++ b/js/src/jspropertytree.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jspropertytree.h b/js/src/jspropertytree.h index d269e2937c4e..4c3fbd725a2a 100644 --- a/js/src/jspropertytree.h +++ b/js/src/jspropertytree.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsprototypes.h b/js/src/jsprototypes.h index 007d25d7204f..27f5c84450b1 100644 --- a/js/src/jsprototypes.h +++ b/js/src/jsprototypes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index df2f78af54c4..dda39fda162d 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -1,9 +1,10 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ - + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ #include #include "jsapi.h" #include "jscntxt.h" diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 54e91db7fa61..a6f7851744c8 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index 4db5ed8c36d0..a131e61ba6e0 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index ab124ee57104..2159dd4f6cc6 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsreflect.cpp b/js/src/jsreflect.cpp index e97e31344415..16978563e9c8 100644 --- a/js/src/jsreflect.cpp +++ b/js/src/jsreflect.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsreflect.h b/js/src/jsreflect.h index be973527970c..b517c1bc4d90 100644 --- a/js/src/jsreflect.h +++ b/js/src/jsreflect.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 3135a6159e31..ed61d59d663b 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 38f8b8d69d6e..595287a6b12b 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/jsscriptinlines.h b/js/src/jsscriptinlines.h index 560aa44a14ab..2861ea2e5f4c 100644 --- a/js/src/jsscriptinlines.h +++ b/js/src/jsscriptinlines.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index bbd9401bad3f..0e50cb0f7f74 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 8a1d270ad720..10ae7b2fc106 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/jsstrinlines.h b/js/src/jsstrinlines.h index 262a1d11a33a..82550466197c 100644 --- a/js/src/jsstrinlines.h +++ b/js/src/jsstrinlines.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index c09511515e8d..15b5c5daf67b 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jstypedarray.h b/js/src/jstypedarray.h index 0a7602a850c5..e38313b16299 100644 --- a/js/src/jstypedarray.h +++ b/js/src/jstypedarray.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jstypedarrayinlines.h b/js/src/jstypedarrayinlines.h index 952ecb100505..22e30038b946 100644 --- a/js/src/jstypedarrayinlines.h +++ b/js/src/jstypedarrayinlines.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jstypes.h b/js/src/jstypes.h index b597cf3b987b..c83e7fed26e3 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ diff --git a/js/src/jsutil.cpp b/js/src/jsutil.cpp index fc4341002444..f04077996b08 100644 --- a/js/src/jsutil.cpp +++ b/js/src/jsutil.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsutil.h b/js/src/jsutil.h index ed7e0989e0f7..ff77e41a8893 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jsversion.h b/js/src/jsversion.h index 64f2ad217675..50e2fa6beb0b 100644 --- a/js/src/jsversion.h +++ b/js/src/jsversion.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/jswatchpoint.cpp b/js/src/jswatchpoint.cpp index 42b6a272bd8d..152eb4d0f211 100644 --- a/js/src/jswatchpoint.cpp +++ b/js/src/jswatchpoint.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jswatchpoint.h b/js/src/jswatchpoint.h index 47179327d6df..2c05f77c77f3 100644 --- a/js/src/jswatchpoint.h +++ b/js/src/jswatchpoint.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/jsweakcache.h b/js/src/jsweakcache.h index 54d810032461..bc3ac58b2c57 100644 --- a/js/src/jsweakcache.h +++ b/js/src/jsweakcache.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index 8f01f6aa4ccd..5977bfca5971 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jsweakmap.h b/js/src/jsweakmap.h index bc130e10c6ef..47a7f42eff72 100644 --- a/js/src/jsweakmap.h +++ b/js/src/jsweakmap.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jswin.h b/js/src/jswin.h index 689d23810677..50b548cb8fd7 100644 --- a/js/src/jswin.h +++ b/js/src/jswin.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* 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/. */ diff --git a/js/src/jsworkers.cpp b/js/src/jsworkers.cpp index f6a2e279f741..d80ee15f3037 100644 --- a/js/src/jsworkers.cpp +++ b/js/src/jsworkers.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jsworkers.h b/js/src/jsworkers.h index 89baca26d7ca..a3b7edafda00 100644 --- a/js/src/jsworkers.h +++ b/js/src/jsworkers.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/jswrapper.cpp b/js/src/jswrapper.cpp index 4d8aceb2cef2..3f21082891d9 100644 --- a/js/src/jswrapper.cpp +++ b/js/src/jswrapper.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h index e8423b993b23..3e7985cb6b2a 100644 --- a/js/src/jswrapper.h +++ b/js/src/jswrapper.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/BaseAssembler.h b/js/src/methodjit/BaseAssembler.h index 9e3af92cd4dc..7b84a48e532f 100644 --- a/js/src/methodjit/BaseAssembler.h +++ b/js/src/methodjit/BaseAssembler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/BaseCompiler.h b/js/src/methodjit/BaseCompiler.h index ad3af9d3da38..3531ec04d773 100644 --- a/js/src/methodjit/BaseCompiler.h +++ b/js/src/methodjit/BaseCompiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/CodeGenIncludes.h b/js/src/methodjit/CodeGenIncludes.h index 3cddee0a5638..23378e5e7e89 100644 --- a/js/src/methodjit/CodeGenIncludes.h +++ b/js/src/methodjit/CodeGenIncludes.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index b934effe95db..ef5680120c5d 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Compiler.h b/js/src/methodjit/Compiler.h index 9652a071c8fb..5cafd3e298a4 100644 --- a/js/src/methodjit/Compiler.h +++ b/js/src/methodjit/Compiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FastArithmetic.cpp b/js/src/methodjit/FastArithmetic.cpp index 44c2361cacb3..f2f6d19a1ea2 100644 --- a/js/src/methodjit/FastArithmetic.cpp +++ b/js/src/methodjit/FastArithmetic.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FastBuiltins.cpp b/js/src/methodjit/FastBuiltins.cpp index 8d907b836fbc..5415930e9ab2 100644 --- a/js/src/methodjit/FastBuiltins.cpp +++ b/js/src/methodjit/FastBuiltins.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FastOps.cpp b/js/src/methodjit/FastOps.cpp index 4d6ec3126640..45d038a9047c 100644 --- a/js/src/methodjit/FastOps.cpp +++ b/js/src/methodjit/FastOps.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FrameEntry.h b/js/src/methodjit/FrameEntry.h index 5d3b5c38218f..53e6b0b493c0 100644 --- a/js/src/methodjit/FrameEntry.h +++ b/js/src/methodjit/FrameEntry.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FrameState-inl.h b/js/src/methodjit/FrameState-inl.h index 0a4b6439c1e5..a12867a47e38 100644 --- a/js/src/methodjit/FrameState-inl.h +++ b/js/src/methodjit/FrameState-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FrameState.cpp b/js/src/methodjit/FrameState.cpp index 186fb524e86c..bdfbf2ffbece 100644 --- a/js/src/methodjit/FrameState.cpp +++ b/js/src/methodjit/FrameState.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/FrameState.h b/js/src/methodjit/FrameState.h index f568943a70c3..85f1f959d913 100644 --- a/js/src/methodjit/FrameState.h +++ b/js/src/methodjit/FrameState.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/ICChecker.h b/js/src/methodjit/ICChecker.h index 44c06cc100e5..93c4889bf992 100644 --- a/js/src/methodjit/ICChecker.h +++ b/js/src/methodjit/ICChecker.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/ICLabels.h b/js/src/methodjit/ICLabels.h index 8d4e8ad2106c..4b422ff94883 100644 --- a/js/src/methodjit/ICLabels.h +++ b/js/src/methodjit/ICLabels.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/ICRepatcher.h b/js/src/methodjit/ICRepatcher.h index 2d5ea4035caa..79c7666b9a00 100644 --- a/js/src/methodjit/ICRepatcher.h +++ b/js/src/methodjit/ICRepatcher.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.cpp b/js/src/methodjit/ImmutableSync.cpp index 7cef76bb72ff..a763b5c0a479 100644 --- a/js/src/methodjit/ImmutableSync.cpp +++ b/js/src/methodjit/ImmutableSync.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/ImmutableSync.h b/js/src/methodjit/ImmutableSync.h index bd1429efa655..f232175db78f 100644 --- a/js/src/methodjit/ImmutableSync.h +++ b/js/src/methodjit/ImmutableSync.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/InlineFrameAssembler.h b/js/src/methodjit/InlineFrameAssembler.h index b80bb52d24bd..12d3bac8f3b6 100644 --- a/js/src/methodjit/InlineFrameAssembler.h +++ b/js/src/methodjit/InlineFrameAssembler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp index 582558fb60f2..c02d6db68996 100644 --- a/js/src/methodjit/InvokeHelpers.cpp +++ b/js/src/methodjit/InvokeHelpers.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Logging.cpp b/js/src/methodjit/Logging.cpp index 7ecf536d8bb1..5bca55ccc240 100644 --- a/js/src/methodjit/Logging.cpp +++ b/js/src/methodjit/Logging.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Logging.h b/js/src/methodjit/Logging.h index 6825f0313695..fff123e911ce 100644 --- a/js/src/methodjit/Logging.h +++ b/js/src/methodjit/Logging.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/LoopState.cpp b/js/src/methodjit/LoopState.cpp index 92e9c6dffce8..21e65fd40865 100644 --- a/js/src/methodjit/LoopState.cpp +++ b/js/src/methodjit/LoopState.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/LoopState.h b/js/src/methodjit/LoopState.h index 3518ba88e5eb..6280bf2598bc 100644 --- a/js/src/methodjit/LoopState.h +++ b/js/src/methodjit/LoopState.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/MachineRegs.h b/js/src/methodjit/MachineRegs.h index 2b5d80c51600..e355dd7b6cab 100644 --- a/js/src/methodjit/MachineRegs.h +++ b/js/src/methodjit/MachineRegs.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp index 7741b59b7fa9..94f145bf00fd 100644 --- a/js/src/methodjit/MethodJIT.cpp +++ b/js/src/methodjit/MethodJIT.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/MethodJIT.h b/js/src/methodjit/MethodJIT.h index a60415f82e0c..c813d1fc47f6 100644 --- a/js/src/methodjit/MethodJIT.h +++ b/js/src/methodjit/MethodJIT.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/MonoIC.cpp b/js/src/methodjit/MonoIC.cpp index f633ef29d8a9..b07bdeab577d 100644 --- a/js/src/methodjit/MonoIC.cpp +++ b/js/src/methodjit/MonoIC.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/MonoIC.h b/js/src/methodjit/MonoIC.h index acb0acdc6aef..852dacc02f65 100644 --- a/js/src/methodjit/MonoIC.h +++ b/js/src/methodjit/MonoIC.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/NunboxAssembler.h b/js/src/methodjit/NunboxAssembler.h index 8c30afc06815..9d764a5f0e88 100644 --- a/js/src/methodjit/NunboxAssembler.h +++ b/js/src/methodjit/NunboxAssembler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/PolyIC.cpp b/js/src/methodjit/PolyIC.cpp index f76a68abdbf0..df176bc13de1 100644 --- a/js/src/methodjit/PolyIC.cpp +++ b/js/src/methodjit/PolyIC.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/PolyIC.h b/js/src/methodjit/PolyIC.h index e17226aaeb2a..f7b4423c3f09 100644 --- a/js/src/methodjit/PolyIC.h +++ b/js/src/methodjit/PolyIC.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/PunboxAssembler.h b/js/src/methodjit/PunboxAssembler.h index 7a066bd4ffc9..959ba595f306 100644 --- a/js/src/methodjit/PunboxAssembler.h +++ b/js/src/methodjit/PunboxAssembler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/RematInfo.h b/js/src/methodjit/RematInfo.h index c0bdc40e3881..cd9ec7a2e50d 100644 --- a/js/src/methodjit/RematInfo.h +++ b/js/src/methodjit/RematInfo.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Retcon.cpp b/js/src/methodjit/Retcon.cpp index 2479236a3a5c..d91286108123 100644 --- a/js/src/methodjit/Retcon.cpp +++ b/js/src/methodjit/Retcon.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/Retcon.h b/js/src/methodjit/Retcon.h index 8e4105644347..d4e688bf7046 100644 --- a/js/src/methodjit/Retcon.h +++ b/js/src/methodjit/Retcon.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/StubCalls-inl.h b/js/src/methodjit/StubCalls-inl.h index 47f4725e04fa..cf5903865f93 100644 --- a/js/src/methodjit/StubCalls-inl.h +++ b/js/src/methodjit/StubCalls-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/StubCalls.cpp b/js/src/methodjit/StubCalls.cpp index 1d49c4fa0a2a..c9fda4f151fe 100644 --- a/js/src/methodjit/StubCalls.cpp +++ b/js/src/methodjit/StubCalls.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/StubCalls.h b/js/src/methodjit/StubCalls.h index e620b37dba3d..23dc2420d03f 100644 --- a/js/src/methodjit/StubCalls.h +++ b/js/src/methodjit/StubCalls.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/StubCompiler.cpp b/js/src/methodjit/StubCompiler.cpp index 77754e2f60f9..f366d8e826ac 100644 --- a/js/src/methodjit/StubCompiler.cpp +++ b/js/src/methodjit/StubCompiler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/StubCompiler.h b/js/src/methodjit/StubCompiler.h index be3b4b97c021..e2a0d49c4e03 100644 --- a/js/src/methodjit/StubCompiler.h +++ b/js/src/methodjit/StubCompiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.cpp b/js/src/methodjit/TrampolineCompiler.cpp index 4860a7ecb522..81478f2d8891 100644 --- a/js/src/methodjit/TrampolineCompiler.cpp +++ b/js/src/methodjit/TrampolineCompiler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/TrampolineCompiler.h b/js/src/methodjit/TrampolineCompiler.h index e3d4a6e8bffc..11e118be78fe 100644 --- a/js/src/methodjit/TrampolineCompiler.h +++ b/js/src/methodjit/TrampolineCompiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/TrampolineMIPS.cpp b/js/src/methodjit/TrampolineMIPS.cpp index 4da001eda725..7be2e42d01a3 100644 --- a/js/src/methodjit/TrampolineMIPS.cpp +++ b/js/src/methodjit/TrampolineMIPS.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/methodjit/TypedArrayIC.h b/js/src/methodjit/TypedArrayIC.h index 16deeb770adb..aa86cb2f8ead 100644 --- a/js/src/methodjit/TypedArrayIC.h +++ b/js/src/methodjit/TypedArrayIC.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/perf/jsperf.cpp b/js/src/perf/jsperf.cpp index b153e0a61d2f..098361a964a4 100644 --- a/js/src/perf/jsperf.cpp +++ b/js/src/perf/jsperf.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/jsperf.h b/js/src/perf/jsperf.h index aaf513342736..265478c33ebb 100644 --- a/js/src/perf/jsperf.h +++ b/js/src/perf/jsperf.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_linux.cpp b/js/src/perf/pm_linux.cpp index de5675eff5e9..3156354bdff7 100644 --- a/js/src/perf/pm_linux.cpp +++ b/js/src/perf/pm_linux.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/perf/pm_stub.cpp b/js/src/perf/pm_stub.cpp index cf82288f093c..4af53cb1250f 100644 --- a/js/src/perf/pm_stub.cpp +++ b/js/src/perf/pm_stub.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* 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/. */ diff --git a/js/src/prmjtime.cpp b/js/src/prmjtime.cpp index 4fa2ae2359ff..a5bb6478220b 100644 --- a/js/src/prmjtime.cpp +++ b/js/src/prmjtime.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/prmjtime.h b/js/src/prmjtime.h index 30ee7c080b99..e7b13c35d4a0 100644 --- a/js/src/prmjtime.h +++ b/js/src/prmjtime.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 32608379f44c..68f0c08168de 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/shell/jsheaptools.cpp b/js/src/shell/jsheaptools.cpp index e5d38ba1538c..4cae34a43cf5 100644 --- a/js/src/shell/jsheaptools.cpp +++ b/js/src/shell/jsheaptools.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/shell/jsheaptools.h b/js/src/shell/jsheaptools.h index 326102668a2c..55e12ab39ffc 100644 --- a/js/src/shell/jsheaptools.h +++ b/js/src/shell/jsheaptools.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/shell/jsoptparse.cpp b/js/src/shell/jsoptparse.cpp index 0556b747eb76..1a54690de8c8 100644 --- a/js/src/shell/jsoptparse.cpp +++ b/js/src/shell/jsoptparse.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/shell/jsoptparse.h b/js/src/shell/jsoptparse.h index 9e52cb97871a..7e2ef72e994a 100644 --- a/js/src/shell/jsoptparse.h +++ b/js/src/shell/jsoptparse.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-010-n.js b/js/src/tests/ecma_2/Exceptions/exception-010-n.js index 51931804e4ca..95f5ef725d3d 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-010-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-010-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_2/Exceptions/exception-011-n.js b/js/src/tests/ecma_2/Exceptions/exception-011-n.js index dc08346ca9a1..533765a69f28 100644 --- a/js/src/tests/ecma_2/Exceptions/exception-011-n.js +++ b/js/src/tests/ecma_2/Exceptions/exception-011-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js index 932f51ab804e..f19fce62e90f 100644 --- a/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js +++ b/js/src/tests/ecma_2/FunctionObjects/apply-001-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Exceptions/regress-58946.js b/js/src/tests/ecma_3/Exceptions/regress-58946.js index 1147fdd633d6..c961e5ab739a 100644 --- a/js/src/tests/ecma_3/Exceptions/regress-58946.js +++ b/js/src/tests/ecma_3/Exceptions/regress-58946.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js index 5352534a3f38..3f8b6a84778f 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.3.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js index 97ec349a0e59..1e6b115a61b2 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js +++ b/js/src/tests/ecma_3/ExecutionContexts/10.1.4-1.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js index 1a6cb1a21ddc..41ae113c9123 100644 --- a/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js +++ b/js/src/tests/ecma_3/ExecutionContexts/regress-23346.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001-n.js b/js/src/tests/ecma_3/FunExpr/fe-001-n.js index d1f9c3e49545..55c57212ec40 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001-n.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-001.js b/js/src/tests/ecma_3/FunExpr/fe-001.js index f80f34e2e8c4..a68d6e10aa12 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-001.js +++ b/js/src/tests/ecma_3/FunExpr/fe-001.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/FunExpr/fe-002.js b/js/src/tests/ecma_3/FunExpr/fe-002.js index 5619fbbb65da..9ee5bfbaf250 100644 --- a/js/src/tests/ecma_3/FunExpr/fe-002.js +++ b/js/src/tests/ecma_3/FunExpr/fe-002.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js index 8634f53dd4f7..49915472953e 100644 --- a/js/src/tests/ecma_3/NumberFormatting/tostring-001.js +++ b/js/src/tests/ecma_3/NumberFormatting/tostring-001.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-24712.js b/js/src/tests/ecma_3/RegExp/regress-24712.js index d675f6a3c184..dfaded2661f0 100644 --- a/js/src/tests/ecma_3/RegExp/regress-24712.js +++ b/js/src/tests/ecma_3/RegExp/regress-24712.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/RegExp/regress-28686.js b/js/src/tests/ecma_3/RegExp/regress-28686.js index 1e3871f1968c..669455ba6893 100644 --- a/js/src/tests/ecma_3/RegExp/regress-28686.js +++ b/js/src/tests/ecma_3/RegExp/regress-28686.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001-n.js b/js/src/tests/ecma_3/Unicode/uc-001-n.js index 566c7459f5a7..80dc1a782939 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-001-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-001.js b/js/src/tests/ecma_3/Unicode/uc-001.js index bfb8fd515ef4..2a81693d5ff1 100644 --- a/js/src/tests/ecma_3/Unicode/uc-001.js +++ b/js/src/tests/ecma_3/Unicode/uc-001.js @@ -1,5 +1,6 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002-n.js b/js/src/tests/ecma_3/Unicode/uc-002-n.js index ca09090d6304..6d673f88b983 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002-n.js +++ b/js/src/tests/ecma_3/Unicode/uc-002-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-002.js b/js/src/tests/ecma_3/Unicode/uc-002.js index 1ff15d3769ab..93d78b9ebb70 100644 --- a/js/src/tests/ecma_3/Unicode/uc-002.js +++ b/js/src/tests/ecma_3/Unicode/uc-002.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-003.js b/js/src/tests/ecma_3/Unicode/uc-003.js index d06815cf941a..f77b3b9dcea0 100644 --- a/js/src/tests/ecma_3/Unicode/uc-003.js +++ b/js/src/tests/ecma_3/Unicode/uc-003.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/ecma_3/Unicode/uc-004.js b/js/src/tests/ecma_3/Unicode/uc-004.js index 5d243d56de3f..a82eb3528c37 100644 --- a/js/src/tests/ecma_3/Unicode/uc-004.js +++ b/js/src/tests/ecma_3/Unicode/uc-004.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js index fbbcecd3bc99..08b9f52d499a 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-002-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-002-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js index 0d4e1767e5e4..c768f1f046f8 100644 --- a/js/src/tests/js1_5/Exceptions/catchguard-003-n.js +++ b/js/src/tests/js1_5/Exceptions/catchguard-003-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/GetSet/getset-002.js b/js/src/tests/js1_5/GetSet/getset-002.js index d2a5c2218024..114a282fb778 100644 --- a/js/src/tests/js1_5/GetSet/getset-002.js +++ b/js/src/tests/js1_5/GetSet/getset-002.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001-n.js b/js/src/tests/js1_5/extensions/catchguard-001-n.js index 8e0a5ad7feee..8d357fd39ac4 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001-n.js +++ b/js/src/tests/js1_5/extensions/catchguard-001-n.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-001.js b/js/src/tests/js1_5/extensions/catchguard-001.js index da531a13ec3b..c1e447f105f4 100644 --- a/js/src/tests/js1_5/extensions/catchguard-001.js +++ b/js/src/tests/js1_5/extensions/catchguard-001.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-002.js b/js/src/tests/js1_5/extensions/catchguard-002.js index da590140236a..8148ca45e455 100644 --- a/js/src/tests/js1_5/extensions/catchguard-002.js +++ b/js/src/tests/js1_5/extensions/catchguard-002.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/catchguard-003.js b/js/src/tests/js1_5/extensions/catchguard-003.js index 97f2cbfea310..9e64f89d23ed 100644 --- a/js/src/tests/js1_5/extensions/catchguard-003.js +++ b/js/src/tests/js1_5/extensions/catchguard-003.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/getset-001.js b/js/src/tests/js1_5/extensions/getset-001.js index 2609f359aa9c..2e6b9488dab5 100644 --- a/js/src/tests/js1_5/extensions/getset-001.js +++ b/js/src/tests/js1_5/extensions/getset-001.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447-1.js b/js/src/tests/js1_5/extensions/regress-50447-1.js index 96d801b128d8..55ca6aca7f00 100644 --- a/js/src/tests/js1_5/extensions/regress-50447-1.js +++ b/js/src/tests/js1_5/extensions/regress-50447-1.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_5/extensions/regress-50447.js b/js/src/tests/js1_5/extensions/regress-50447.js index 32044a8edc4e..1621d5576395 100644 --- a/js/src/tests/js1_5/extensions/regress-50447.js +++ b/js/src/tests/js1_5/extensions/regress-50447.js @@ -1,5 +1,6 @@ // |reftest| skip -- obsolete test /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_6/shell.js b/js/src/tests/js1_6/shell.js index a5bfae873392..d378e171db67 100644 --- a/js/src/tests/js1_6/shell.js +++ b/js/src/tests/js1_6/shell.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_7/shell.js b/js/src/tests/js1_7/shell.js index 9c935544e6ca..13cf0022e7a7 100644 --- a/js/src/tests/js1_7/shell.js +++ b/js/src/tests/js1_7/shell.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_8/shell.js b/js/src/tests/js1_8/shell.js index 934ae1489d02..d61c2d6a07b9 100644 --- a/js/src/tests/js1_8/shell.js +++ b/js/src/tests/js1_8/shell.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/js1_8_1/shell.js b/js/src/tests/js1_8_1/shell.js index f4eadfbb411d..d8fe725b7444 100644 --- a/js/src/tests/js1_8_1/shell.js +++ b/js/src/tests/js1_8_1/shell.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * * 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/. */ diff --git a/js/src/tests/shell.js b/js/src/tests/shell.js index c2d42e4e6fd3..08abb3bb518e 100644 --- a/js/src/tests/shell.js +++ b/js/src/tests/shell.js @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * * 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/. */ diff --git a/js/src/vm/ArgumentsObject-inl.h b/js/src/vm/ArgumentsObject-inl.h index c442eda6e559..b94c1de19f4e 100644 --- a/js/src/vm/ArgumentsObject-inl.h +++ b/js/src/vm/ArgumentsObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/ArgumentsObject.cpp b/js/src/vm/ArgumentsObject.cpp index b7598bab1aaf..f53e0d639d31 100644 --- a/js/src/vm/ArgumentsObject.cpp +++ b/js/src/vm/ArgumentsObject.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/vm/ArgumentsObject.h b/js/src/vm/ArgumentsObject.h index fbb70f0b84f4..162ceeea73e4 100644 --- a/js/src/vm/ArgumentsObject.h +++ b/js/src/vm/ArgumentsObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/BooleanObject-inl.h b/js/src/vm/BooleanObject-inl.h index b84171b8eb1d..c36e75d05111 100644 --- a/js/src/vm/BooleanObject-inl.h +++ b/js/src/vm/BooleanObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/BooleanObject.h b/js/src/vm/BooleanObject.h index 3892a404e19e..0df94da2cf86 100644 --- a/js/src/vm/BooleanObject.h +++ b/js/src/vm/BooleanObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/CharacterEncoding.cpp b/js/src/vm/CharacterEncoding.cpp index 79266f4fd4db..96d94d86cb19 100644 --- a/js/src/vm/CharacterEncoding.cpp +++ b/js/src/vm/CharacterEncoding.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 48acbbbcbbb8..2f363a4a0d51 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp index 9c839c7ef156..4bf194cf7add 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ + * 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 "DateTime.h" diff --git a/js/src/vm/DateTime.h b/js/src/vm/DateTime.h index 3d006a8f7654..4dff3186439e 100644 --- a/js/src/vm/DateTime.h +++ b/js/src/vm/DateTime.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ + * 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/. */ #ifndef DateTime_h___ #define DateTime_h___ diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index cd8d5e7cf4f8..a2d6598cfb2d 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index 69c5230ce203..cda35fb0d7d8 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/ForkJoin.cpp b/js/src/vm/ForkJoin.cpp index f636cbae1a21..6c654568eeeb 100644 --- a/js/src/vm/ForkJoin.cpp +++ b/js/src/vm/ForkJoin.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/ForkJoin.h b/js/src/vm/ForkJoin.h index a5c244310e73..1b89efdc4377 100644 --- a/js/src/vm/ForkJoin.h +++ b/js/src/vm/ForkJoin.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/GlobalObject-inl.h b/js/src/vm/GlobalObject-inl.h index 06d103aee0f1..9797cfd3918b 100644 --- a/js/src/vm/GlobalObject-inl.h +++ b/js/src/vm/GlobalObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index 7e329bda043a..b6716c25683e 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index 3886b133c09b..783d4fdf18c7 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/Keywords.h b/js/src/vm/Keywords.h index cc2d5dbc982e..0f0409a2e150 100644 --- a/js/src/vm/Keywords.h +++ b/js/src/vm/Keywords.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set sw=4 ts=8 et tw=80: + * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/src/vm/MatchPairs.h b/js/src/vm/MatchPairs.h index 1018d7d67b33..8fd9320dab85 100644 --- a/js/src/vm/MatchPairs.h +++ b/js/src/vm/MatchPairs.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/Monitor.cpp b/js/src/vm/Monitor.cpp index f92ee48dc477..0cd21ae23443 100644 --- a/js/src/vm/Monitor.cpp +++ b/js/src/vm/Monitor.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/vm/Monitor.h b/js/src/vm/Monitor.h index 9b0144586bde..e13f138ce939 100644 --- a/js/src/vm/Monitor.h +++ b/js/src/vm/Monitor.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/NumberObject-inl.h b/js/src/vm/NumberObject-inl.h index 651cb93d6ddd..e2822f9cc375 100644 --- a/js/src/vm/NumberObject-inl.h +++ b/js/src/vm/NumberObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/NumberObject.h b/js/src/vm/NumberObject.h index 48ee6383da35..dc0ab3bdea74 100644 --- a/js/src/vm/NumberObject.h +++ b/js/src/vm/NumberObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/NumericConversions.h b/js/src/vm/NumericConversions.h index 674df8cb58c0..42e69d63dd75 100644 --- a/js/src/vm/NumericConversions.h +++ b/js/src/vm/NumericConversions.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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/. */ #ifndef NumericConversions_h___ #define NumericConversions_h___ diff --git a/js/src/vm/ObjectImpl-inl.h b/js/src/vm/ObjectImpl-inl.h index a4048fac745a..8423dacb09ad 100644 --- a/js/src/vm/ObjectImpl-inl.h +++ b/js/src/vm/ObjectImpl-inl.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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/. */ #ifndef ObjectImpl_inl_h___ #define ObjectImpl_inl_h___ diff --git a/js/src/vm/ObjectImpl.cpp b/js/src/vm/ObjectImpl.cpp index 7375b3da6419..c009fc680b5e 100644 --- a/js/src/vm/ObjectImpl.cpp +++ b/js/src/vm/ObjectImpl.cpp @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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 "mozilla/Assertions.h" #include "mozilla/Attributes.h" diff --git a/js/src/vm/ObjectImpl.h b/js/src/vm/ObjectImpl.h index a765088b45fe..d683b4380ef6 100644 --- a/js/src/vm/ObjectImpl.h +++ b/js/src/vm/ObjectImpl.h @@ -1,8 +1,9 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ + * 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/. */ #ifndef ObjectImpl_h___ #define ObjectImpl_h___ diff --git a/js/src/vm/ParallelDo.cpp b/js/src/vm/ParallelDo.cpp index 461e5acff556..6f4b63fdb064 100644 --- a/js/src/vm/ParallelDo.cpp +++ b/js/src/vm/ParallelDo.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/ParallelDo.h b/js/src/vm/ParallelDo.h index 3188c147bd54..807174528857 100644 --- a/js/src/vm/ParallelDo.h +++ b/js/src/vm/ParallelDo.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/PropertyKey.cpp b/js/src/vm/PropertyKey.cpp index 0935cd377c8b..d7ca7b371607 100644 --- a/js/src/vm/PropertyKey.cpp +++ b/js/src/vm/PropertyKey.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h index d1f3371356d2..d6a0f04fac13 100644 --- a/js/src/vm/RegExpObject-inl.h +++ b/js/src/vm/RegExpObject-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index e26bb82834be..e5dc014b5ba6 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h index 929d7147ee06..61d329dedc73 100644 --- a/js/src/vm/RegExpObject.h +++ b/js/src/vm/RegExpObject.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/RegExpStatics-inl.h b/js/src/vm/RegExpStatics-inl.h index 8b8842e40c71..d70fdf2dccec 100644 --- a/js/src/vm/RegExpStatics-inl.h +++ b/js/src/vm/RegExpStatics-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/RegExpStatics.cpp b/js/src/vm/RegExpStatics.cpp index 662c8e68596f..ff4b46b514b8 100644 --- a/js/src/vm/RegExpStatics.cpp +++ b/js/src/vm/RegExpStatics.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/RegExpStatics.h b/js/src/vm/RegExpStatics.h index 422424f91a0a..9a7a84e934da 100644 --- a/js/src/vm/RegExpStatics.h +++ b/js/src/vm/RegExpStatics.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/SPSProfiler.cpp b/js/src/vm/SPSProfiler.cpp index d39903b61960..8e44d71ca853 100644 --- a/js/src/vm/SPSProfiler.cpp +++ b/js/src/vm/SPSProfiler.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/SPSProfiler.h b/js/src/vm/SPSProfiler.h index 16defd8a6f94..80c6b09e6baf 100644 --- a/js/src/vm/SPSProfiler.h +++ b/js/src/vm/SPSProfiler.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/ScopeObject-inl.h b/js/src/vm/ScopeObject-inl.h index d85c8879ac26..63daedcba784 100644 --- a/js/src/vm/ScopeObject-inl.h +++ b/js/src/vm/ScopeObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/ScopeObject.cpp b/js/src/vm/ScopeObject.cpp index e9fffddbb290..d101aaf222c4 100644 --- a/js/src/vm/ScopeObject.cpp +++ b/js/src/vm/ScopeObject.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 6; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/ScopeObject.h b/js/src/vm/ScopeObject.h index b9cb94f584eb..fdb9303803e9 100644 --- a/js/src/vm/ScopeObject.h +++ b/js/src/vm/ScopeObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 356fec739a0d..a6aa8f4f0212 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index 2abc80cfaa94..b0d0ab45f502 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -1,6 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 674e67958f74..8e3c7996f461 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index 73986fa1294c..46ed68612c14 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99: + * * 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/. */ diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h index a925de1e4e9c..4d77179b9a29 100644 --- a/js/src/vm/Stack-inl.h +++ b/js/src/vm/Stack-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index 2bd273a71dae..5780e66b656c 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index e197fc03fcec..e10c627d5f22 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/String-inl.h b/js/src/vm/String-inl.h index 981a9651b55d..7be763b696d9 100644 --- a/js/src/vm/String-inl.h +++ b/js/src/vm/String-inl.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/String.cpp b/js/src/vm/String.cpp index 1bb9b86c641f..d6d550fd40bf 100644 --- a/js/src/vm/String.cpp +++ b/js/src/vm/String.cpp @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/String.h b/js/src/vm/String.h index e7769c0e4ec9..9fd5899cd988 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -1,5 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: + * * 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/. */ diff --git a/js/src/vm/StringBuffer.cpp b/js/src/vm/StringBuffer.cpp index 1ecc31c7f046..459571a70dc6 100644 --- a/js/src/vm/StringBuffer.cpp +++ b/js/src/vm/StringBuffer.cpp @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ + * 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 "vm/StringBuffer.h" diff --git a/js/src/vm/StringBuffer.h b/js/src/vm/StringBuffer.h index 92ab4f8c6eeb..7706e83032dd 100644 --- a/js/src/vm/StringBuffer.h +++ b/js/src/vm/StringBuffer.h @@ -1,8 +1,8 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ + * 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/. */ #ifndef StringBuffer_h___ #define StringBuffer_h___ diff --git a/js/src/vm/StringObject-inl.h b/js/src/vm/StringObject-inl.h index b1b01bbdddc3..0940081d9e0e 100644 --- a/js/src/vm/StringObject-inl.h +++ b/js/src/vm/StringObject-inl.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/StringObject.h b/js/src/vm/StringObject.h index 59510956a0e6..75446443365c 100644 --- a/js/src/vm/StringObject.h +++ b/js/src/vm/StringObject.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/ThreadPool.cpp b/js/src/vm/ThreadPool.cpp index 754ad507d2cd..7eee4965cc11 100644 --- a/js/src/vm/ThreadPool.cpp +++ b/js/src/vm/ThreadPool.cpp @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- */ +/* vim: set ts=4 sw=4 et tw=99: */ +/* 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/. */ diff --git a/js/src/vm/ThreadPool.h b/js/src/vm/ThreadPool.h index 75698d526ad5..901894137ad8 100644 --- a/js/src/vm/ThreadPool.h +++ b/js/src/vm/ThreadPool.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/vm/Unicode.h b/js/src/vm/Unicode.h index 27fde7a60373..a83a0925de36 100644 --- a/js/src/vm/Unicode.h +++ b/js/src/vm/Unicode.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* 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/. */ diff --git a/js/src/vm/Xdr.cpp b/js/src/vm/Xdr.cpp index d248926f9cca..34fc4b6b0668 100644 --- a/js/src/vm/Xdr.cpp +++ b/js/src/vm/Xdr.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * * 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/. */ diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 46a00ba9de51..3ad573a6de0f 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -1,5 +1,6 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: + * vim: set ts=8 sw=4 et tw=78: + * * 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/. */ diff --git a/js/src/yarr/ASCIICType.h b/js/src/yarr/ASCIICType.h index 2082b758bc56..a3ae9f4455e2 100644 --- a/js/src/yarr/ASCIICType.h +++ b/js/src/yarr/ASCIICType.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. diff --git a/js/src/yarr/BumpPointerAllocator.h b/js/src/yarr/BumpPointerAllocator.h index a43a5d8ba2d4..6d23a684831e 100644 --- a/js/src/yarr/BumpPointerAllocator.h +++ b/js/src/yarr/BumpPointerAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/CheckedArithmetic.h b/js/src/yarr/CheckedArithmetic.h index 21aa188bd969..0f60971d0f1f 100644 --- a/js/src/yarr/CheckedArithmetic.h +++ b/js/src/yarr/CheckedArithmetic.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2011 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/MatchResult.h b/js/src/yarr/MatchResult.h index 4ebc936779d5..e28ac4bbf42f 100644 --- a/js/src/yarr/MatchResult.h +++ b/js/src/yarr/MatchResult.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/OSAllocator.h b/js/src/yarr/OSAllocator.h index c8b815b52d2e..ecfdc3b042ec 100644 --- a/js/src/yarr/OSAllocator.h +++ b/js/src/yarr/OSAllocator.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorOS2.cpp b/js/src/yarr/OSAllocatorOS2.cpp index 466b9e949d81..ead003084dd1 100644 --- a/js/src/yarr/OSAllocatorOS2.cpp +++ b/js/src/yarr/OSAllocatorOS2.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorPosix.cpp b/js/src/yarr/OSAllocatorPosix.cpp index 013b6af0771a..99bf061467ca 100644 --- a/js/src/yarr/OSAllocatorPosix.cpp +++ b/js/src/yarr/OSAllocatorPosix.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/OSAllocatorWin.cpp b/js/src/yarr/OSAllocatorWin.cpp index a5d5fa7db823..08df9e98aefb 100644 --- a/js/src/yarr/OSAllocatorWin.cpp +++ b/js/src/yarr/OSAllocatorWin.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageAllocation.h b/js/src/yarr/PageAllocation.h index 42a57f6ae5fe..a86f37116e50 100644 --- a/js/src/yarr/PageAllocation.h +++ b/js/src/yarr/PageAllocation.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.cpp b/js/src/yarr/PageBlock.cpp index 0ffc1bc95157..047172d6476f 100644 --- a/js/src/yarr/PageBlock.cpp +++ b/js/src/yarr/PageBlock.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/PageBlock.h b/js/src/yarr/PageBlock.h index ea98f42f2237..145bb0a8d63a 100644 --- a/js/src/yarr/PageBlock.h +++ b/js/src/yarr/PageBlock.h @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: * * ***** BEGIN LICENSE BLOCK ***** * Copyright (C) 2010 Apple Inc. All rights reserved. diff --git a/js/src/yarr/VMTags.h b/js/src/yarr/VMTags.h index f44136907fe7..fe6a006d3601 100644 --- a/js/src/yarr/VMTags.h +++ b/js/src/yarr/VMTags.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/Yarr.h b/js/src/yarr/Yarr.h index da9a0ec70f33..110ae4124bed 100644 --- a/js/src/yarr/Yarr.h +++ b/js/src/yarr/Yarr.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * All rights reserved. diff --git a/js/src/yarr/YarrCanonicalizeUCS2.cpp b/js/src/yarr/YarrCanonicalizeUCS2.cpp index e6d334212fd3..ce3a372a6a63 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.cpp +++ b/js/src/yarr/YarrCanonicalizeUCS2.cpp @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrCanonicalizeUCS2.h b/js/src/yarr/YarrCanonicalizeUCS2.h index 874af40e8693..735064ac803b 100644 --- a/js/src/yarr/YarrCanonicalizeUCS2.h +++ b/js/src/yarr/YarrCanonicalizeUCS2.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrInterpreter.cpp b/js/src/yarr/YarrInterpreter.cpp index 176fa381ac6e..296e7d5c9559 100644 --- a/js/src/yarr/YarrInterpreter.cpp +++ b/js/src/yarr/YarrInterpreter.cpp @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged * diff --git a/js/src/yarr/YarrInterpreter.h b/js/src/yarr/YarrInterpreter.h index 0a3da2fbb1c9..ae40fa7d1cac 100644 --- a/js/src/yarr/YarrInterpreter.h +++ b/js/src/yarr/YarrInterpreter.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrJIT.cpp b/js/src/yarr/YarrJIT.cpp index d570f4697d42..225933ff5a5a 100644 --- a/js/src/yarr/YarrJIT.cpp +++ b/js/src/yarr/YarrJIT.cpp @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrJIT.h b/js/src/yarr/YarrJIT.h index b4c03b7e9b23..fad19adfdf44 100644 --- a/js/src/yarr/YarrJIT.h +++ b/js/src/yarr/YarrJIT.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrParser.h b/js/src/yarr/YarrParser.h index 7cbeea0f010d..f5d1aca6095c 100644 --- a/js/src/yarr/YarrParser.h +++ b/js/src/yarr/YarrParser.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2009 Apple Inc. All rights reserved. * diff --git a/js/src/yarr/YarrPattern.cpp b/js/src/yarr/YarrPattern.cpp index 3de728032c18..f091b984884c 100644 --- a/js/src/yarr/YarrPattern.cpp +++ b/js/src/yarr/YarrPattern.cpp @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrPattern.h b/js/src/yarr/YarrPattern.h index 3baaf5369ed1..737de608199f 100644 --- a/js/src/yarr/YarrPattern.h +++ b/js/src/yarr/YarrPattern.h @@ -1,5 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: +/* vim: set ts=4 sw=4 tw=99 et: * * Copyright (C) 2009 Apple Inc. All rights reserved. * Copyright (C) 2010 Peter Varga (pvarga@inf.u-szeged.hu), University of Szeged diff --git a/js/src/yarr/YarrSyntaxChecker.cpp b/js/src/yarr/YarrSyntaxChecker.cpp index bd4b8dc05025..34fb5010cfc9 100644 --- a/js/src/yarr/YarrSyntaxChecker.cpp +++ b/js/src/yarr/YarrSyntaxChecker.cpp @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/YarrSyntaxChecker.h b/js/src/yarr/YarrSyntaxChecker.h index e42d8afa8184..b6848e752681 100644 --- a/js/src/yarr/YarrSyntaxChecker.h +++ b/js/src/yarr/YarrSyntaxChecker.h @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * +/* * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h index 890b269355f0..a7646b87ea34 100644 --- a/js/src/yarr/wtfbridge.h +++ b/js/src/yarr/wtfbridge.h @@ -1,6 +1,6 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=8 sw=4 et tw=99 ft=cpp: */ +/* 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/. */ From 6ce54168afa84cf50fe897242f4e08006c14d959 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 15 Apr 2013 22:00:06 +0200 Subject: [PATCH 186/438] Bug 856368 - Remove DEBUG_TRACEMALLOC_PRESARENA. r=roc --- layout/base/nsIPresShell.h | 6 +++--- layout/base/nsPresArena.cpp | 32 -------------------------------- layout/base/nsPresArena.h | 12 ------------ 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 82d35f2160fc..175b812ee3cb 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -228,7 +228,7 @@ public: #ifdef DEBUG mPresArenaAllocCount--; #endif - if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying) + if (!mIsDestroying) mFrameArena.FreeByFrameID(aID, aPtr); } @@ -253,7 +253,7 @@ public: #ifdef DEBUG mPresArenaAllocCount--; #endif - if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying) + if (!mIsDestroying) mFrameArena.FreeByObjectID(aID, aPtr); } @@ -279,7 +279,7 @@ public: #ifdef DEBUG mPresArenaAllocCount--; #endif - if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying) + if (!mIsDestroying) mFrameArena.FreeBySize(aSize, aPtr); } diff --git a/layout/base/nsPresArena.cpp b/layout/base/nsPresArena.cpp index 8b833b0ae3c0..a3896190506d 100644 --- a/layout/base/nsPresArena.cpp +++ b/layout/base/nsPresArena.cpp @@ -239,8 +239,6 @@ ARENA_POISON_init() return PR_SUCCESS; } -#ifndef DEBUG_TRACEMALLOC_PRESARENA - // All keys to this hash table fit in 32 bits (see below) so we do not // bother actually hashing them. @@ -467,36 +465,6 @@ nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf, mState->SizeOfIncludingThis(aMallocSizeOf, aArenaStats); } -#else -// Stub implementation that forwards everything to malloc and does not -// poison allocations (it still initializes the poison value though, -// for external use through GetPoisonValue()). - -struct nsPresArena::State -{ - - State() - { - PR_CallOnce(&ARENA_POISON_guard, ARENA_POISON_init); - } - - void* Allocate(uint32_t /* unused */, size_t aSize) - { - return moz_malloc(aSize); - } - - void Free(uint32_t /* unused */, void* aPtr) - { - moz_free(aPtr); - } -}; - -void -nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun, nsArenaMemoryStats*) -{} - -#endif // DEBUG_TRACEMALLOC_PRESARENA - // Public interface nsPresArena::nsPresArena() : mState(new nsPresArena::State()) diff --git a/layout/base/nsPresArena.h b/layout/base/nsPresArena.h index 8670b4048173..234d904e3987 100644 --- a/layout/base/nsPresArena.h +++ b/layout/base/nsPresArena.h @@ -15,18 +15,6 @@ struct nsArenaMemoryStats; -// Uncomment this to disable arenas, instead forwarding to -// malloc for every allocation. -//#define DEBUG_TRACEMALLOC_PRESARENA 1 - -// The debugging version of nsPresArena does not free all the memory it -// allocated when the arena itself is destroyed. -#ifdef DEBUG_TRACEMALLOC_PRESARENA -#define PRESARENA_MUST_FREE_DURING_DESTROY true -#else -#define PRESARENA_MUST_FREE_DURING_DESTROY false -#endif - class nsPresArena { public: nsPresArena(); From 62e2d164d65c1d1a462aa5470f09ee908e487717 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 15 Apr 2013 22:00:06 +0200 Subject: [PATCH 187/438] Bug 856368 - Merge nsPresArena::mState into nsPresArena itself. r=roc --- layout/base/nsPresArena.cpp | 389 ++++++++++++---------------- layout/base/nsPresArena.h | 52 +++- layout/style/nsCSSRuleProcessor.cpp | 14 +- 3 files changed, 222 insertions(+), 233 deletions(-) diff --git a/layout/base/nsPresArena.cpp b/layout/base/nsPresArena.cpp index a3896190506d..e81bd32b2c40 100644 --- a/layout/base/nsPresArena.cpp +++ b/layout/base/nsPresArena.cpp @@ -7,13 +7,20 @@ /* arena allocation for the frame tree and closely-related objects */ +// Even on 32-bit systems, we allocate objects from the frame arena +// that require 8-byte alignment. The cast to uintptr_t is needed +// because plarena isn't as careful about mask construction as it +// ought to be. +#define ALIGN_SHIFT 3 +#define PL_ARENA_CONST_ALIGN_MASK ((uintptr_t(1) << ALIGN_SHIFT) - 1) +#include "plarena.h" +// plarena.h needs to be included first to make it use the above +// PL_ARENA_CONST_ALIGN_MASK in this file. + #include "nsPresArena.h" #include "nsCRT.h" #include "nsDebug.h" -#include "nsTArray.h" -#include "nsTHashtable.h" #include "prinit.h" -#include "prlog.h" #include "nsArenaMemoryStats.h" #include "nsCOMPtr.h" #include "nsServiceManagerUtils.h" @@ -23,17 +30,6 @@ #include "nsICrashReporter.h" #endif -#include "mozilla/StandardInteger.h" -#include "mozilla/MemoryChecking.h" - -// Even on 32-bit systems, we allocate objects from the frame arena -// that require 8-byte alignment. The cast to uintptr_t is needed -// because plarena isn't as careful about mask construction as it -// ought to be. -#define ALIGN_SHIFT 3 -#define PL_ARENA_CONST_ALIGN_MASK ((uintptr_t(1) << ALIGN_SHIFT) - 1) -#include "plarena.h" - #ifdef _WIN32 # include #elif !defined(__OS2__) @@ -239,277 +235,226 @@ ARENA_POISON_init() return PR_SUCCESS; } -// All keys to this hash table fit in 32 bits (see below) so we do not -// bother actually hashing them. - -namespace { - -class FreeList : public PLDHashEntryHdr +nsPresArena::nsPresArena() { -public: - typedef uint32_t KeyType; - nsTArray mEntries; - size_t mEntrySize; - size_t mEntriesEverAllocated; - - typedef const void* KeyTypePointer; - KeyTypePointer mKey; - - FreeList(KeyTypePointer aKey) - : mEntrySize(0), mEntriesEverAllocated(0), mKey(aKey) {} - // Default copy constructor and destructor are ok. - - bool KeyEquals(KeyTypePointer const aKey) const - { return mKey == aKey; } - - static KeyTypePointer KeyToPointer(KeyType aKey) - { return NS_INT32_TO_PTR(aKey); } - - static PLDHashNumber HashKey(KeyTypePointer aKey) - { return NS_PTR_TO_INT32(aKey); } - - enum { ALLOW_MEMMOVE = false }; -}; - + mFreeLists.Init(); + PL_INIT_ARENA_POOL(&mPool, "PresArena", ARENA_PAGE_SIZE); + PR_CallOnce(&ARENA_POISON_guard, ARENA_POISON_init); } -struct nsPresArena::State { - nsTHashtable mFreeLists; - PLArenaPool mPool; - - State() - { - mFreeLists.Init(); - PL_INIT_ARENA_POOL(&mPool, "PresArena", ARENA_PAGE_SIZE); - PR_CallOnce(&ARENA_POISON_guard, ARENA_POISON_init); - } - +nsPresArena::~nsPresArena() +{ #if defined(MOZ_HAVE_MEM_CHECKS) - static PLDHashOperator UnpoisonFreeList(FreeList* aEntry, void*) - { - nsTArray::index_type len; - while ((len = aEntry->mEntries.Length())) { - void* result = aEntry->mEntries.ElementAt(len - 1); - aEntry->mEntries.RemoveElementAt(len - 1); - MOZ_MAKE_MEM_UNDEFINED(result, aEntry->mEntrySize); - } - return PL_DHASH_NEXT; - } + mFreeLists.EnumerateEntries(UnpoisonFreeList, nullptr); #endif + PL_FinishArenaPool(&mPool); +} - ~State() - { -#if defined(MOZ_HAVE_MEM_CHECKS) - mFreeLists.EnumerateEntries(UnpoisonFreeList, nullptr); -#endif - PL_FinishArenaPool(&mPool); +void* +nsPresArena::Allocate(uint32_t aCode, size_t aSize) +{ + NS_ABORT_IF_FALSE(aSize > 0, "PresArena cannot allocate zero bytes"); + + // We only hand out aligned sizes + aSize = PL_ARENA_ALIGN(&mPool, aSize); + + // If there is no free-list entry for this type already, we have + // to create one now, to record its size. + FreeList* list = mFreeLists.PutEntry(aCode); + + nsTArray::index_type len = list->mEntries.Length(); + if (list->mEntrySize == 0) { + NS_ABORT_IF_FALSE(len == 0, "list with entries but no recorded size"); + list->mEntrySize = aSize; + } else { + NS_ABORT_IF_FALSE(list->mEntrySize == aSize, + "different sizes for same object type code"); } - void* Allocate(uint32_t aCode, size_t aSize) - { - NS_ABORT_IF_FALSE(aSize > 0, "PresArena cannot allocate zero bytes"); - - // We only hand out aligned sizes - aSize = PL_ARENA_ALIGN(&mPool, aSize); - - // If there is no free-list entry for this type already, we have - // to create one now, to record its size. - FreeList* list = mFreeLists.PutEntry(aCode); - - nsTArray::index_type len = list->mEntries.Length(); - if (list->mEntrySize == 0) { - NS_ABORT_IF_FALSE(len == 0, "list with entries but no recorded size"); - list->mEntrySize = aSize; - } else { - NS_ABORT_IF_FALSE(list->mEntrySize == aSize, - "different sizes for same object type code"); - } - - void* result; - if (len > 0) { - // LIFO behavior for best cache utilization - result = list->mEntries.ElementAt(len - 1); - list->mEntries.RemoveElementAt(len - 1); + void* result; + if (len > 0) { + // LIFO behavior for best cache utilization + result = list->mEntries.ElementAt(len - 1); + list->mEntries.RemoveElementAt(len - 1); #if defined(DEBUG) - { - MOZ_MAKE_MEM_DEFINED(result, list->mEntrySize); - char* p = reinterpret_cast(result); - char* limit = p + list->mEntrySize; - for (; p < limit; p += sizeof(uintptr_t)) { - uintptr_t val = *reinterpret_cast(p); - NS_ABORT_IF_FALSE(val == ARENA_POISON, - nsPrintfCString("PresArena: poison overwritten; " - "wanted %.16llx " - "found %.16llx " - "errors in bits %.16llx", - uint64_t(ARENA_POISON), - uint64_t(val), - uint64_t(ARENA_POISON ^ val) - ).get()); - } + { + MOZ_MAKE_MEM_DEFINED(result, list->mEntrySize); + char* p = reinterpret_cast(result); + char* limit = p + list->mEntrySize; + for (; p < limit; p += sizeof(uintptr_t)) { + uintptr_t val = *reinterpret_cast(p); + NS_ABORT_IF_FALSE(val == ARENA_POISON, + nsPrintfCString("PresArena: poison overwritten; " + "wanted %.16llx " + "found %.16llx " + "errors in bits %.16llx", + uint64_t(ARENA_POISON), + uint64_t(val), + uint64_t(ARENA_POISON ^ val) + ).get()); } + } #endif - MOZ_MAKE_MEM_UNDEFINED(result, list->mEntrySize); - return result; - } - - // Allocate a new chunk from the arena - list->mEntriesEverAllocated++; - PL_ARENA_ALLOCATE(result, &mPool, aSize); - if (!result) { - NS_RUNTIMEABORT("out of memory"); - } + MOZ_MAKE_MEM_UNDEFINED(result, list->mEntrySize); return result; } - void Free(uint32_t aCode, void* aPtr) - { - // Try to recycle this entry. - FreeList* list = mFreeLists.GetEntry(aCode); - NS_ABORT_IF_FALSE(list, "no free list for pres arena object"); - NS_ABORT_IF_FALSE(list->mEntrySize > 0, "PresArena cannot free zero bytes"); + // Allocate a new chunk from the arena + list->mEntriesEverAllocated++; + PL_ARENA_ALLOCATE(result, &mPool, aSize); + if (!result) { + NS_RUNTIMEABORT("out of memory"); + } + return result; +} - char* p = reinterpret_cast(aPtr); - char* limit = p + list->mEntrySize; - for (; p < limit; p += sizeof(uintptr_t)) { - *reinterpret_cast(p) = ARENA_POISON; - } +void +nsPresArena::Free(uint32_t aCode, void* aPtr) +{ + // Try to recycle this entry. + FreeList* list = mFreeLists.GetEntry(aCode); + NS_ABORT_IF_FALSE(list, "no free list for pres arena object"); + NS_ABORT_IF_FALSE(list->mEntrySize > 0, "PresArena cannot free zero bytes"); - MOZ_MAKE_MEM_NOACCESS(aPtr, list->mEntrySize); - list->mEntries.AppendElement(aPtr); + char* p = reinterpret_cast(aPtr); + char* limit = p + list->mEntrySize; + for (; p < limit; p += sizeof(uintptr_t)) { + *reinterpret_cast(p) = ARENA_POISON; } - static size_t SizeOfFreeListEntryExcludingThis(FreeList* aEntry, - nsMallocSizeOfFun aMallocSizeOf, - void *) - { - return aEntry->mEntries.SizeOfExcludingThis(aMallocSizeOf); + MOZ_MAKE_MEM_NOACCESS(aPtr, list->mEntrySize); + list->mEntries.AppendElement(aPtr); +} + +/* static */ size_t +nsPresArena::SizeOfFreeListEntryExcludingThis( + FreeList* aEntry, nsMallocSizeOfFun aMallocSizeOf, void*) +{ + return aEntry->mEntries.SizeOfExcludingThis(aMallocSizeOf); +} + +size_t +nsPresArena::SizeOfIncludingThisFromMalloc(nsMallocSizeOfFun aMallocSizeOf) const +{ + size_t n = aMallocSizeOf(this); + n += PL_SizeOfArenaPoolExcludingPool(&mPool, aMallocSizeOf); + n += mFreeLists.SizeOfExcludingThis(SizeOfFreeListEntryExcludingThis, + aMallocSizeOf); + return n; +} + +struct EnumerateData { + nsArenaMemoryStats* stats; + size_t total; +}; + +#if defined(MOZ_HAVE_MEM_CHECKS) +/* static */ PLDHashOperator +nsPresArena::UnpoisonFreeList(FreeList* aEntry, void*) +{ + nsTArray::index_type len; + while ((len = aEntry->mEntries.Length())) { + void* result = aEntry->mEntries.ElementAt(len - 1); + aEntry->mEntries.RemoveElementAt(len - 1); + MOZ_MAKE_MEM_UNDEFINED(result, aEntry->mEntrySize); } + return PL_DHASH_NEXT; +} +#endif - size_t SizeOfIncludingThisFromMalloc(nsMallocSizeOfFun aMallocSizeOf) const - { - size_t n = aMallocSizeOf(this); - n += PL_SizeOfArenaPoolExcludingPool(&mPool, aMallocSizeOf); - n += mFreeLists.SizeOfExcludingThis(SizeOfFreeListEntryExcludingThis, - aMallocSizeOf); - return n; - } +/* static */ PLDHashOperator +nsPresArena::FreeListEnumerator(FreeList* aEntry, void* aData) +{ + EnumerateData* data = static_cast(aData); + // Note that we're not measuring the size of the entries on the free + // list here. The free list knows how many objects we've allocated + // ever (which includes any objects that may be on the FreeList's + // |mEntries| at this point) and we're using that to determine the + // total size of objects allocated with a given ID. + size_t totalSize = aEntry->mEntrySize * aEntry->mEntriesEverAllocated; + size_t* p; - struct EnumerateData { - nsArenaMemoryStats* stats; - size_t total; - }; - - static PLDHashOperator FreeListEnumerator(FreeList* aEntry, void* aData) - { - EnumerateData* data = static_cast(aData); - // Note that we're not measuring the size of the entries on the free - // list here. The free list knows how many objects we've allocated - // ever (which includes any objects that may be on the FreeList's - // |mEntries| at this point) and we're using that to determine the - // total size of objects allocated with a given ID. - size_t totalSize = aEntry->mEntrySize * aEntry->mEntriesEverAllocated; - size_t* p; - - switch (NS_PTR_TO_INT32(aEntry->mKey)) { -#define FRAME_ID(classname) \ - case nsQueryFrame::classname##_id: \ - p = &data->stats->FRAME_ID_STAT_FIELD(classname); \ - break; + switch (NS_PTR_TO_INT32(aEntry->mKey)) { +#define FRAME_ID(classname) \ + case nsQueryFrame::classname##_id: \ + p = &data->stats->FRAME_ID_STAT_FIELD(classname); \ + break; #include "nsFrameIdList.h" #undef FRAME_ID - case nsLineBox_id: - p = &data->stats->mLineBoxes; - break; - case nsRuleNode_id: - p = &data->stats->mRuleNodes; - break; - case nsStyleContext_id: - p = &data->stats->mStyleContexts; - break; - default: - return PL_DHASH_NEXT; - } - - *p += totalSize; - data->total += totalSize; - + case nsLineBox_id: + p = &data->stats->mLineBoxes; + break; + case nsRuleNode_id: + p = &data->stats->mRuleNodes; + break; + case nsStyleContext_id: + p = &data->stats->mStyleContexts; + break; + default: return PL_DHASH_NEXT; } - void SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf, - nsArenaMemoryStats* aArenaStats) - { - // We do a complicated dance here because we want to measure the - // space taken up by the different kinds of objects in the arena, - // but we don't have pointers to those objects. And even if we did, - // we wouldn't be able to use aMallocSizeOf on them, since they were - // allocated out of malloc'd chunks of memory. So we compute the - // size of the arena as known by malloc and we add up the sizes of - // all the objects that we care about. Subtracting these two - // quantities gives us a catch-all "other" number, which includes - // slop in the arena itself as well as the size of objects that - // we've not measured explicitly. + *p += totalSize; + data->total += totalSize; - size_t mallocSize = SizeOfIncludingThisFromMalloc(aMallocSizeOf); - EnumerateData data = { aArenaStats, 0 }; - mFreeLists.EnumerateEntries(FreeListEnumerator, &data); - aArenaStats->mOther = mallocSize - data.total; - } -}; + return PL_DHASH_NEXT; +} void nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf, nsArenaMemoryStats* aArenaStats) { - mState->SizeOfIncludingThis(aMallocSizeOf, aArenaStats); -} + // We do a complicated dance here because we want to measure the + // space taken up by the different kinds of objects in the arena, + // but we don't have pointers to those objects. And even if we did, + // we wouldn't be able to use aMallocSizeOf on them, since they were + // allocated out of malloc'd chunks of memory. So we compute the + // size of the arena as known by malloc and we add up the sizes of + // all the objects that we care about. Subtracting these two + // quantities gives us a catch-all "other" number, which includes + // slop in the arena itself as well as the size of objects that + // we've not measured explicitly. -// Public interface -nsPresArena::nsPresArena() - : mState(new nsPresArena::State()) -{} - -nsPresArena::~nsPresArena() -{ - delete mState; + size_t mallocSize = SizeOfIncludingThisFromMalloc(aMallocSizeOf); + EnumerateData data = { aArenaStats, 0 }; + mFreeLists.EnumerateEntries(FreeListEnumerator, &data); + aArenaStats->mOther = mallocSize - data.total; } void* nsPresArena::AllocateBySize(size_t aSize) { - return mState->Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), - aSize); + return Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aSize); } void nsPresArena::FreeBySize(size_t aSize, void* aPtr) { - mState->Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr); + Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr); } void* nsPresArena::AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize) { - return mState->Allocate(aID, aSize); + return Allocate(aID, aSize); } void nsPresArena::FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr) { - mState->Free(aID, aPtr); + Free(aID, aPtr); } void* nsPresArena::AllocateByObjectID(ObjectID aID, size_t aSize) { - return mState->Allocate(aID, aSize); + return Allocate(aID, aSize); } void nsPresArena::FreeByObjectID(ObjectID aID, void* aPtr) { - mState->Free(aID, aPtr); + Free(aID, aPtr); } /* static */ uintptr_t diff --git a/layout/base/nsPresArena.h b/layout/base/nsPresArena.h index 234d904e3987..424f65590b1a 100644 --- a/layout/base/nsPresArena.h +++ b/layout/base/nsPresArena.h @@ -8,10 +8,13 @@ #ifndef nsPresArena_h___ #define nsPresArena_h___ +#include "mozilla/MemoryChecking.h" +#include "mozilla/StandardInteger.h" #include "nscore.h" #include "nsQueryFrame.h" - -#include "mozilla/StandardInteger.h" +#include "nsTArray.h" +#include "nsTHashtable.h" +#include "plarena.h" struct nsArenaMemoryStats; @@ -66,8 +69,49 @@ public: static uintptr_t GetPoisonValue(); private: - struct State; - State* mState; + void* Allocate(uint32_t aCode, size_t aSize); + void Free(uint32_t aCode, void* aPtr); + + // All keys to this hash table fit in 32 bits (see below) so we do not + // bother actually hashing them. + class FreeList : public PLDHashEntryHdr + { + public: + typedef uint32_t KeyType; + nsTArray mEntries; + size_t mEntrySize; + size_t mEntriesEverAllocated; + + typedef const void* KeyTypePointer; + KeyTypePointer mKey; + + FreeList(KeyTypePointer aKey) + : mEntrySize(0), mEntriesEverAllocated(0), mKey(aKey) {} + // Default copy constructor and destructor are ok. + + bool KeyEquals(KeyTypePointer const aKey) const + { return mKey == aKey; } + + static KeyTypePointer KeyToPointer(KeyType aKey) + { return NS_INT32_TO_PTR(aKey); } + + static PLDHashNumber HashKey(KeyTypePointer aKey) + { return NS_PTR_TO_INT32(aKey); } + + enum { ALLOW_MEMMOVE = false }; + }; + +#if defined(MOZ_HAVE_MEM_CHECKS) + static PLDHashOperator UnpoisonFreeList(FreeList* aEntry, void*); +#endif + static PLDHashOperator FreeListEnumerator(FreeList* aEntry, void* aData); + static size_t SizeOfFreeListEntryExcludingThis(FreeList* aEntry, + nsMallocSizeOfFun aMallocSizeOf, + void*); + size_t SizeOfIncludingThisFromMalloc(nsMallocSizeOfFun aMallocSizeOf) const; + + nsTHashtable mFreeLists; + PLArenaPool mPool; }; #endif diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index b76fffa4a1df..bce620102a63 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -9,17 +9,16 @@ * matching and cascading */ -#include "mozilla/Util.h" +#define PL_ARENA_CONST_ALIGN_MASK 7 +// We want page-sized arenas so there's no fragmentation involved. +// Including plarena.h must come first to avoid it being included by some +// header file thereby making PL_ARENA_CONST_ALIGN_MASK ineffective. +#define NS_CASCADEENUMDATA_ARENA_BLOCK_SIZE (4096) +#include "plarena.h" #include "nsCSSRuleProcessor.h" #include "nsRuleProcessorData.h" #include - -#define PL_ARENA_CONST_ALIGN_MASK 7 -// We want page-sized arenas so there's no fragmentation involved. -#define NS_CASCADEENUMDATA_ARENA_BLOCK_SIZE (4096) -#include "plarena.h" - #include "nsCRT.h" #include "nsIAtom.h" #include "pldhash.h" @@ -60,6 +59,7 @@ #include "mozilla/Preferences.h" #include "mozilla/LookAndFeel.h" #include "mozilla/Likely.h" +#include "mozilla/Util.h" using namespace mozilla; using namespace mozilla::dom; From 11a4e4ae9f6c3cb9c70920f86529f7dc868e3baa Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 15 Apr 2013 22:00:06 +0200 Subject: [PATCH 188/438] Bug 856368 - Adjust memory reporter SizeOf methods accordingly. r=roc --- layout/base/nsPresArena.cpp | 15 ++++----------- layout/base/nsPresArena.h | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/layout/base/nsPresArena.cpp b/layout/base/nsPresArena.cpp index e81bd32b2c40..c3e051ae6385 100644 --- a/layout/base/nsPresArena.cpp +++ b/layout/base/nsPresArena.cpp @@ -333,16 +333,6 @@ nsPresArena::SizeOfFreeListEntryExcludingThis( return aEntry->mEntries.SizeOfExcludingThis(aMallocSizeOf); } -size_t -nsPresArena::SizeOfIncludingThisFromMalloc(nsMallocSizeOfFun aMallocSizeOf) const -{ - size_t n = aMallocSizeOf(this); - n += PL_SizeOfArenaPoolExcludingPool(&mPool, aMallocSizeOf); - n += mFreeLists.SizeOfExcludingThis(SizeOfFreeListEntryExcludingThis, - aMallocSizeOf); - return n; -} - struct EnumerateData { nsArenaMemoryStats* stats; size_t total; @@ -415,7 +405,10 @@ nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf, // slop in the arena itself as well as the size of objects that // we've not measured explicitly. - size_t mallocSize = SizeOfIncludingThisFromMalloc(aMallocSizeOf); + size_t mallocSize = PL_SizeOfArenaPoolExcludingPool(&mPool, aMallocSizeOf); + mallocSize += mFreeLists.SizeOfExcludingThis(SizeOfFreeListEntryExcludingThis, + aMallocSizeOf); + EnumerateData data = { aArenaStats, 0 }; mFreeLists.EnumerateEntries(FreeListEnumerator, &data); aArenaStats->mOther = mallocSize - data.total; diff --git a/layout/base/nsPresArena.h b/layout/base/nsPresArena.h index 424f65590b1a..cdc89a527ef2 100644 --- a/layout/base/nsPresArena.h +++ b/layout/base/nsPresArena.h @@ -108,7 +108,6 @@ private: static size_t SizeOfFreeListEntryExcludingThis(FreeList* aEntry, nsMallocSizeOfFun aMallocSizeOf, void*); - size_t SizeOfIncludingThisFromMalloc(nsMallocSizeOfFun aMallocSizeOf) const; nsTHashtable mFreeLists; PLArenaPool mPool; From d7cb6e0ea44494cda8c577722d58d1cb841e492a Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 15 Apr 2013 22:00:06 +0200 Subject: [PATCH 189/438] Bug 856368 - Inline the AllocateBy* and FreeBy* methods into the header. r=roc --- layout/base/nsPresArena.cpp | 40 ++------------------------------- layout/base/nsPresArena.h | 44 ++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 51 deletions(-) diff --git a/layout/base/nsPresArena.cpp b/layout/base/nsPresArena.cpp index c3e051ae6385..4459247c8a19 100644 --- a/layout/base/nsPresArena.cpp +++ b/layout/base/nsPresArena.cpp @@ -250,7 +250,7 @@ nsPresArena::~nsPresArena() PL_FinishArenaPool(&mPool); } -void* +NS_HIDDEN_(void*) nsPresArena::Allocate(uint32_t aCode, size_t aSize) { NS_ABORT_IF_FALSE(aSize > 0, "PresArena cannot allocate zero bytes"); @@ -308,7 +308,7 @@ nsPresArena::Allocate(uint32_t aCode, size_t aSize) return result; } -void +NS_HIDDEN_(void) nsPresArena::Free(uint32_t aCode, void* aPtr) { // Try to recycle this entry. @@ -414,42 +414,6 @@ nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf, aArenaStats->mOther = mallocSize - data.total; } -void* -nsPresArena::AllocateBySize(size_t aSize) -{ - return Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aSize); -} - -void -nsPresArena::FreeBySize(size_t aSize, void* aPtr) -{ - Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr); -} - -void* -nsPresArena::AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize) -{ - return Allocate(aID, aSize); -} - -void -nsPresArena::FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr) -{ - Free(aID, aPtr); -} - -void* -nsPresArena::AllocateByObjectID(ObjectID aID, size_t aSize) -{ - return Allocate(aID, aSize); -} - -void -nsPresArena::FreeByObjectID(ObjectID aID, void* aPtr) -{ - Free(aID, aPtr); -} - /* static */ uintptr_t nsPresArena::GetPoisonValue() { diff --git a/layout/base/nsPresArena.h b/layout/base/nsPresArena.h index cdc89a527ef2..33638d1320a8 100644 --- a/layout/base/nsPresArena.h +++ b/layout/base/nsPresArena.h @@ -23,15 +23,6 @@ public: nsPresArena(); ~nsPresArena(); - // Pool allocation with recycler lists indexed by object size, aSize. - NS_HIDDEN_(void*) AllocateBySize(size_t aSize); - NS_HIDDEN_(void) FreeBySize(size_t aSize, void* aPtr); - - // Pool allocation with recycler lists indexed by frame-type ID. - // Every aID must always be used with the same object size, aSize. - NS_HIDDEN_(void*) AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize); - NS_HIDDEN_(void) FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr); - enum ObjectID { nsLineBox_id = nsQueryFrame::NON_FRAME_MARKER, nsRuleNode_id, @@ -47,10 +38,37 @@ public: NON_OBJECT_MARKER = 0x40000000 }; + // Pool allocation with recycler lists indexed by object size, aSize. + NS_HIDDEN_(void*) AllocateBySize(size_t aSize) + { + return Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aSize); + } + NS_HIDDEN_(void) FreeBySize(size_t aSize, void* aPtr) + { + Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr); + } + + // Pool allocation with recycler lists indexed by frame-type ID. + // Every aID must always be used with the same object size, aSize. + NS_HIDDEN_(void*) AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize) + { + return Allocate(aID, aSize); + } + NS_HIDDEN_(void) FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr) + { + Free(aID, aPtr); + } + // Pool allocation with recycler lists indexed by object-type ID (see above). // Every aID must always be used with the same object size, aSize. - NS_HIDDEN_(void*) AllocateByObjectID(ObjectID aID, size_t aSize); - NS_HIDDEN_(void) FreeByObjectID(ObjectID aID, void* aPtr); + NS_HIDDEN_(void*) AllocateByObjectID(ObjectID aID, size_t aSize) + { + return Allocate(aID, aSize); + } + NS_HIDDEN_(void) FreeByObjectID(ObjectID aID, void* aPtr) + { + Free(aID, aPtr); + } /** * Fill aArenaStats with sizes of interesting objects allocated in @@ -69,8 +87,8 @@ public: static uintptr_t GetPoisonValue(); private: - void* Allocate(uint32_t aCode, size_t aSize); - void Free(uint32_t aCode, void* aPtr); + NS_HIDDEN_(void*) Allocate(uint32_t aCode, size_t aSize); + NS_HIDDEN_(void) Free(uint32_t aCode, void* aPtr); // All keys to this hash table fit in 32 bits (see below) so we do not // bother actually hashing them. From 479bcdbb382b4663f04924291b9a33c9fde93fee Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 15 Apr 2013 22:00:06 +0200 Subject: [PATCH 190/438] Bug 856368 - Convert some comments into proper doc-comments. r=roc --- layout/base/nsPresArena.h | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/layout/base/nsPresArena.h b/layout/base/nsPresArena.h index 33638d1320a8..be3c6f9639f2 100644 --- a/layout/base/nsPresArena.h +++ b/layout/base/nsPresArena.h @@ -5,6 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* arena allocation for the frame tree and closely-related objects */ + #ifndef nsPresArena_h___ #define nsPresArena_h___ @@ -29,16 +31,20 @@ public: nsStyleContext_id, nsFrameList_id, - // The PresArena implementation uses this bit to distinguish objects - // allocated by size from objects allocated by type ID (that is, frames - // using AllocateByFrameID and other objects using AllocateByObjectID). - // It should not collide with any Object ID (above) or frame ID (in - // nsQueryFrame.h). It is not 0x80000000 to avoid the question of - // whether enumeration constants are signed. + /** + * The PresArena implementation uses this bit to distinguish objects + * allocated by size from objects allocated by type ID (that is, frames + * using AllocateByFrameID and other objects using AllocateByObjectID). + * It should not collide with any Object ID (above) or frame ID (in + * nsQueryFrame.h). It is not 0x80000000 to avoid the question of + * whether enumeration constants are signed. + */ NON_OBJECT_MARKER = 0x40000000 }; - // Pool allocation with recycler lists indexed by object size, aSize. + /** + * Pool allocation with recycler lists indexed by object size, aSize. + */ NS_HIDDEN_(void*) AllocateBySize(size_t aSize) { return Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aSize); @@ -48,8 +54,10 @@ public: Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr); } - // Pool allocation with recycler lists indexed by frame-type ID. - // Every aID must always be used with the same object size, aSize. + /** + * Pool allocation with recycler lists indexed by frame-type ID. + * Every aID must always be used with the same object size, aSize. + */ NS_HIDDEN_(void*) AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize) { return Allocate(aID, aSize); @@ -59,8 +67,10 @@ public: Free(aID, aPtr); } - // Pool allocation with recycler lists indexed by object-type ID (see above). - // Every aID must always be used with the same object size, aSize. + /** + * Pool allocation with recycler lists indexed by object-type ID (see above). + * Every aID must always be used with the same object size, aSize. + */ NS_HIDDEN_(void*) AllocateByObjectID(ObjectID aID, size_t aSize) { return Allocate(aID, aSize); From d9a1cad09472b93b9e68a4b0146e545dafc01ef7 Mon Sep 17 00:00:00 2001 From: Jason Duell Date: Mon, 18 Mar 2013 10:51:00 -0700 Subject: [PATCH 191/438] Bug 851214 - Allow OOP mozbrowser w/o enclosing app r?honza --- netwerk/ipc/NeckoParent.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp index 0bf17fd51d76..ee620e7acbab 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -98,13 +98,6 @@ NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized, if (tabParent->HasOwnApp()) { return "TabParent reports NECKO_NO_APP_ID but also is an app"; } - if (UsingNeckoIPCSecurity() && tabParent->IsBrowserElement()) { - // + - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html b/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html index ccc3bddef131..d033f5b00be0 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html @@ -1,6 +1,6 @@ + Content="0; URL=http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html"> Redirecting by meta tag... diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs index ab58786d9240..ea93b80b7d58 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs +++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs @@ -1,5 +1,5 @@ function handleRequest(request, response) { response.setStatusLine(request.httpVersion, 307, "Moved temporarly"); - response.setHeader("Location", "https://example.com/tests/security/ssl/mixedcontent/iframe.html"); + response.setHeader("Location", "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html"); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs index 5cb51671e1a4..937e29954f3f 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs +++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs @@ -1,5 +1,5 @@ function handleRequest(request, response) { response.setStatusLine(request.httpVersion, 307, "Moved temporarly"); - response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/iframe.html"); + response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html"); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs index 1a5bcc62d1b6..7af6116e1018 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs +++ b/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs @@ -1,5 +1,5 @@ function handleRequest(request, response) { response.setStatusLine(request.httpVersion, 307, "Moved temporarly"); - response.setHeader("Location", "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"); + response.setHeader("Location", "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs index ba15359c1bad..a8eb26642ae8 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs +++ b/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs @@ -1,5 +1,5 @@ function handleRequest(request, response) { response.setStatusLine(request.httpVersion, 307, "Moved temporarly"); - response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"); + response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js index 73c3495a0c55..26142541affe 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js +++ b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js @@ -128,8 +128,8 @@ function finish() window.setTimeout(function() { window.location.assign(navigateToInsecure ? - "http://example.com/tests/security/ssl/mixedcontent/backward.html" : - "https://example.com/tests/security/ssl/mixedcontent/backward.html"); + "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/backward.html" : + "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/backward.html"); }, 0); } else diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs index 1f9a520f5162..4d85e1658171 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs +++ b/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs @@ -1,5 +1,5 @@ function handleRequest(request, response) { response.setStatusLine(request.httpVersion, 307, "Moved temporarly"); - response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/emptyimage.sjs"); + response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/emptyimage.sjs"); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html index 889b84c130e1..49d5c41c633d 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html @@ -16,7 +16,7 @@ window.setTimeout(function() { var newElement = document.createElement("script"); - newElement.src= "http://example.org/tests/security/ssl/mixedcontent/bug329869.js"; + newElement.src= "http://example.org/tests/security/manager/ssl/tests/mochitest/mixedcontent/bug329869.js"; document.body.appendChild(newElement); }, 0); } diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html index 3b57e92a8e80..c0b6e3ebbe60 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html @@ -28,6 +28,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html index 176c4725af0b..427e0fd70f42 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html @@ -21,7 +21,7 @@ { var img1 = document.getElementById("img1"); img1.addEventListener("load", onLoadFunction, false); - img1.src = "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"; + img1.src = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; } function runTest() @@ -40,6 +40,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html index 9b06e08e3f52..9d9d4de09fe6 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html @@ -16,7 +16,7 @@ function runTest() { - window.location = "https://example.com/tests/security/ssl/mixedcontent/nocontent.sjs"; + window.location = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/nocontent.sjs"; window.setTimeout(function() { isSecurityState("insecure", "location.href doesn't effect the security state"); is(document.body.innerHTML, "This is an unsecure page!", "Document has not changed content"); diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html index a4a24167877a..59d2fa7a9dbb 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html @@ -12,7 +12,7 @@ diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html index 1b347d435c9c..347382000a0d 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html @@ -13,7 +13,7 @@ diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html index aa5e813bc451..dfcd7dd76199 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html @@ -20,7 +20,7 @@ { isSecurityState("secure"); document.getElementById("para").style.content = - "url('http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg')"; + "url('http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg')"; waitForSecurityState("broken", function() { diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html index 7e2356b009f1..b95a5caca349 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html @@ -30,7 +30,7 @@ diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html index 61fec12dcef1..a92288b7acdd 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html @@ -32,7 +32,7 @@ diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html index a441b1045fb2..c0684718faae 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html @@ -18,7 +18,7 @@ window.setTimeout(function() { // Don't do this synchronously from onload handler document.getElementById("image1").src = - "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"; + "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; }, 0); waitForSecurityState("broken", function() @@ -31,7 +31,7 @@ function afterNavigationTest() { is(document.getElementById("image1").src, - "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg", + "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg", "img.src secure again"); isSecurityState("secure", "security full after navigation"); finish(); @@ -41,6 +41,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html index c77053b6a8b5..d566a35947f7 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html @@ -22,7 +22,7 @@ try { var req = new XMLHttpRequest(); - req.open("GET", "http://example.com/tests/security/ssl/mixedcontent/alloworigin.sjs", false); + req.open("GET", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/alloworigin.sjs", false); req.send(null); // Change should be immediate, the request was sent synchronously diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html index 4ab5cc3df776..352ae52efc66 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html @@ -18,7 +18,7 @@ { isSecurityState("secure"); document.body.background = - "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"; + "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; waitForSecurityState("broken", function() { @@ -30,7 +30,7 @@ function afterNavigationTest() { is(document.body.background, - "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg", + "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg", "document backround secure again"); isSecurityState("secure", "secure after re-navigation"); finish(); @@ -39,6 +39,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html index 9dfb31a2244c..a9967228b4c5 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html @@ -25,7 +25,7 @@ } iframe.src = - "https://example.com/tests/security/ssl/mixedcontent/iframeunsecredirect.sjs"; + "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs"; } function afterNavigationTest() @@ -38,6 +38,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html index b11189693910..aca7be9d1195 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html @@ -18,7 +18,7 @@ { isSecurityState("secure"); document.getElementById("image1").src = - "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg"; + "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg"; window.setTimeout(function() { isSecurityState("broken", "src='http://...' changed to broken"); @@ -29,7 +29,7 @@ function afterNavigationTest() { is(document.getElementById("image1").src, - "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg", + "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg", "img.src secure again"); isSecurityState("secure", "security full after navigation"); finish(); @@ -39,6 +39,6 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html index e379730faacc..916245c303bd 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html @@ -13,7 +13,7 @@ - + diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html index d868ce34cb40..8985fc7d85d2 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html +++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html @@ -11,7 +11,7 @@ + href="http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/somestyle.css" /> - + diff --git a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html index 48f5b9cc31c0..58d2b215d122 100644 --- a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html +++ b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html @@ -60,7 +60,7 @@ function waitForTrue(fn, onWaitComplete) { const kRed = "rgb(255, 0, 0)"; const kBlue = "rgb(0, 0, 255)"; -var testpath = "/tests/toolkit/components/places/tests/mochitest/../bug_461710/"; +var testpath = "/tests/toolkit/components/places/tests/mochitest/bug_461710/"; var prefix = "http://mochi.test:8888" + testpath; var subtests = [ "visited_page.html", // 1 @@ -163,7 +163,7 @@ var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor) .rootTreeItem .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindow); -var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/../bug_461710/iframe.html"; +var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/bug_461710/iframe.html"; function testOnWindow(aIsPrivate, aCallback) { var win = mainWindow.OpenBrowserWindow({private: aIsPrivate}); From 05b690b216a86a209773cf8626af7b282722624f Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 17 Apr 2013 15:34:26 -0700 Subject: [PATCH 227/438] Bug 863043: Move CompositorOGL::Initialize's helper-nsRunnable from function-scope to class-scope to fix build warning about ignored visibility attribute. r=Bas --- gfx/layers/opengl/CompositorOGL.cpp | 20 +++++++++++--------- gfx/layers/opengl/CompositorOGL.h | 6 ++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index bbccca900d6f..082001c4944c 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -311,6 +311,16 @@ CompositorOGL::CleanupResources() mGLContext = nullptr; } +// Impl of a a helper-runnable's "Run" method, used in Initialize() +NS_IMETHODIMP +CompositorOGL::ReadDrawFPSPref::Run() +{ + // NOTE: This must match the code in Initialize()'s NS_IsMainThread check. + Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps"); + Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter"); + return NS_OK; +} + bool CompositorOGL::Initialize() { @@ -481,19 +491,11 @@ CompositorOGL::Initialize() } if (NS_IsMainThread()) { + // NOTE: This must match the code in ReadDrawFPSPref::Run(). Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps"); Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter"); } else { // We have to dispatch an event to the main thread to read the pref. - class ReadDrawFPSPref : public nsRunnable { - public: - NS_IMETHOD Run() - { - Preferences::AddBoolVarCache(&sDrawFPS, "layers.acceleration.draw-fps"); - Preferences::AddBoolVarCache(&sFrameCounter, "layers.acceleration.frame-counter"); - return NS_OK; - } - }; NS_DispatchToMainThread(new ReadDrawFPSPref()); } diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index 43c965d15289..5959d57354f4 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -141,6 +141,12 @@ private: /** The size of the surface we are rendering to */ nsIntSize mSurfaceSize; + /** Helper-class used by Initialize **/ + class ReadDrawFPSPref MOZ_FINAL : public nsRunnable { + public: + NS_IMETHOD Run() MOZ_OVERRIDE; + }; + already_AddRefed CreateContext(); /** Shader Programs */ From 69fb03370e9b3c5ae0ff458140691f1fa0d06b2e Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Wed, 10 Apr 2013 15:03:50 +1200 Subject: [PATCH 228/438] Bug 846122 - Handle split multi-track Cues in nestegg. r=padenot --- media/libnestegg/README_MOZILLA | 2 +- media/libnestegg/src/nestegg.c | 71 ++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/media/libnestegg/README_MOZILLA b/media/libnestegg/README_MOZILLA index 49ac6a10434d..d58c4d8c06ba 100644 --- a/media/libnestegg/README_MOZILLA +++ b/media/libnestegg/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The nestegg git repository is: git://github.com/kinetiknz/nestegg.git -The git commit ID used was ebdbb688fb13dd315fc9d16e6897adb5ee42b7bb. +The git commit ID used was 7d0f6d22b5a332ce47b95bc19dc259f204d339e1. diff --git a/media/libnestegg/src/nestegg.c b/media/libnestegg/src/nestegg.c index 59a1a4734c77..c6d685f2db97 100644 --- a/media/libnestegg/src/nestegg.c +++ b/media/libnestegg/src/nestegg.c @@ -1406,8 +1406,34 @@ ne_find_seek_for_id(struct ebml_list_node * seek_head, uint64_t id) return NULL; } +static struct cue_track_positions * +ne_find_cue_position_for_track(nestegg * ctx, struct ebml_list_node * node, unsigned int track) +{ + struct cue_track_positions * pos = NULL; + uint64_t track_number; + unsigned int t; + + while (node) { + assert(node->id == ID_CUE_TRACK_POSITIONS); + pos = node->data; + if (ne_get_uint(pos->track, &track_number) != 0) + return NULL; + + if (ne_map_track_number_to_index(ctx, track_number, &t) != 0) + return NULL; + + if (t == track) { + return pos; + } + + node = node->next; + } + + return NULL; +} + static struct cue_point * -ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, uint64_t tstamp) +ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, unsigned int track, uint64_t scale, uint64_t tstamp) { uint64_t time; struct cue_point * c, * prev = NULL; @@ -1422,7 +1448,9 @@ ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp) break; - prev = cue_point->data; + if (ne_find_cue_position_for_track(ctx, c->cue_track_positions.head, track) != NULL) + prev = c; + cue_point = cue_point->next; } @@ -1506,7 +1534,6 @@ ne_init_cue_points(nestegg * ctx, int64_t max_offset) return 0; } - /* Three functions that implement the nestegg_io interface, operating on a * sniff_buffer. */ struct sniff_buffer { @@ -1831,49 +1858,29 @@ nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp) int r; struct cue_point * cue_point; struct cue_track_positions * pos; - uint64_t seek_pos, tc_scale, track_number; - unsigned int t; - struct ebml_list_node * node = ctx->segment.cues.cue_point.head; + uint64_t seek_pos, tc_scale; /* If there are no cues loaded, check for cues element in the seek head and load it. */ - if (!node) { + if (!ctx->segment.cues.cue_point.head) { r = ne_init_cue_points(ctx, -1); if (r != 0) return -1; - - /* Check cues were loaded. */ - node = ctx->segment.cues.cue_point.head; - if (!node) - return -1; } tc_scale = ne_get_timecode_scale(ctx); - cue_point = ne_find_cue_point_for_tstamp(ctx->segment.cues.cue_point.head, tc_scale, tstamp); + cue_point = ne_find_cue_point_for_tstamp(ctx, ctx->segment.cues.cue_point.head, + track, tc_scale, tstamp); if (!cue_point) return -1; - node = cue_point->cue_track_positions.head; + pos = ne_find_cue_position_for_track(ctx, cue_point->cue_track_positions.head, track); + if (pos == NULL) + return -1; - seek_pos = 0; - - while (node) { - assert(node->id == ID_CUE_TRACK_POSITIONS); - pos = node->data; - if (ne_get_uint(pos->track, &track_number) != 0) - return -1; - - if (ne_map_track_number_to_index(ctx, track_number, &t) != 0) - return -1; - - if (t == track) { - if (ne_get_uint(pos->cluster_position, &seek_pos) != 0) - return -1; - break; - } - node = node->next; - } + if (ne_get_uint(pos->cluster_position, &seek_pos) != 0) + return -1; /* Seek and set up parser state for segment-level element (Cluster). */ r = nestegg_offset_seek(ctx, ctx->segment_offset + seek_pos); From ece74ec63fa41d52114a526ecf63b2486850596a Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 18 Apr 2013 09:15:09 +1000 Subject: [PATCH 229/438] Bug 862673 - ensure assertions in test_mousecapture_area are attributed to that test rather than the following test. r=gavin --- toolkit/content/tests/widgets/test_mousecapture_area.html | 6 +++++- toolkit/content/tests/widgets/test_videocontrols.html | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toolkit/content/tests/widgets/test_mousecapture_area.html b/toolkit/content/tests/widgets/test_mousecapture_area.html index b91748329240..660cbb2bcfae 100644 --- a/toolkit/content/tests/widgets/test_mousecapture_area.html +++ b/toolkit/content/tests/widgets/test_mousecapture_area.html @@ -52,7 +52,7 @@
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html b/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html
index d033f5b00be0..ccc3bddef131 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframeMetaRedirect.html
@@ -1,6 +1,6 @@
 
 
+      Content="0; URL=http://example.com/tests/security/ssl/mixedcontent/iframe.html">
 
   
     Redirecting by meta tag...
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs
index ea93b80b7d58..ab58786d9240 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframesecredirect.sjs
@@ -1,5 +1,5 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html");
+  response.setHeader("Location", "https://example.com/tests/security/ssl/mixedcontent/iframe.html");
 }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs
index 937e29954f3f..5cb51671e1a4 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs
@@ -1,5 +1,5 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html");
+  response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/iframe.html");
 }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs
index 7af6116e1018..1a5bcc62d1b6 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/imgsecredirect.sjs
@@ -1,5 +1,5 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg");
+  response.setHeader("Location", "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg");
 }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs
index a8eb26642ae8..ba15359c1bad 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/imgunsecredirect.sjs
@@ -1,5 +1,5 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg");
+  response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg");
 }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
index 26142541affe..73c3495a0c55 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
@@ -128,8 +128,8 @@ function finish()
     window.setTimeout(function()
     {
       window.location.assign(navigateToInsecure ?
-        "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/backward.html" :
-        "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/backward.html");
+        "http://example.com/tests/security/ssl/mixedcontent/backward.html" :
+        "https://example.com/tests/security/ssl/mixedcontent/backward.html");
     }, 0);
   }
   else
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs b/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs
index 4d85e1658171..1f9a520f5162 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/redirecttoemptyimage.sjs
@@ -1,5 +1,5 @@
 function handleRequest(request, response)
 {
   response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
-  response.setHeader("Location", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/emptyimage.sjs");
+  response.setHeader("Location", "http://example.com/tests/security/ssl/mixedcontent/emptyimage.sjs");
 }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html
index 49d5c41c633d..889b84c130e1 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug329869.html
@@ -16,7 +16,7 @@
     window.setTimeout(function() 
     {
       var newElement = document.createElement("script");
-      newElement.src= "http://example.org/tests/security/manager/ssl/tests/mochitest/mixedcontent/bug329869.js";
+      newElement.src= "http://example.org/tests/security/ssl/mixedcontent/bug329869.js";
       document.body.appendChild(newElement);
     }, 0);
   }
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html
index c0b6e3ebbe60..3b57e92a8e80 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug455367.html
@@ -28,6 +28,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html
index 427e0fd70f42..176c4725af0b 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug472986.html
@@ -21,7 +21,7 @@
   {
     var img1 = document.getElementById("img1");
     img1.addEventListener("load", onLoadFunction, false);
-    img1.src = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
+    img1.src = "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
   }
 
   function runTest()
@@ -40,6 +40,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
index 9d9d4de09fe6..9b06e08e3f52 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_bug521461.html
@@ -16,7 +16,7 @@
 
   function runTest()
   {
-    window.location = "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/nocontent.sjs";
+    window.location = "https://example.com/tests/security/ssl/mixedcontent/nocontent.sjs";
     window.setTimeout(function() {
       isSecurityState("insecure", "location.href doesn't effect the security state");
       is(document.body.innerHTML, "This is an unsecure page!", "Document has not changed content");
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html
index 59d2fa7a9dbb..a4a24167877a 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssBefore1.html
@@ -12,7 +12,7 @@
   
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
index 347382000a0d..1b347d435c9c 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
@@ -13,7 +13,7 @@
   
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
index dfcd7dd76199..aa5e813bc451 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
@@ -20,7 +20,7 @@
   {
     isSecurityState("secure");
     document.getElementById("para").style.content =
-      "url('http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg')";
+      "url('http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg')";
 
     waitForSecurityState("broken", function()
     {
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
index b95a5caca349..7e2356b009f1 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
@@ -30,7 +30,7 @@
 
   
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
index a92288b7acdd..61fec12dcef1 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
@@ -32,7 +32,7 @@
 
   
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
index c0684718faae..a441b1045fb2 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
@@ -18,7 +18,7 @@
     window.setTimeout(function() {
       // Don't do this synchronously from onload handler
       document.getElementById("image1").src =
-        "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
+        "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
     }, 0);
 
     waitForSecurityState("broken", function()
@@ -31,7 +31,7 @@
   function afterNavigationTest()
   {
     is(document.getElementById("image1").src,
-      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
       "img.src secure again");
     isSecurityState("secure", "security full after navigation");
     finish();
@@ -41,6 +41,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
index d566a35947f7..c77053b6a8b5 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
@@ -22,7 +22,7 @@
       try
       {
         var req = new XMLHttpRequest();
-        req.open("GET", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/alloworigin.sjs", false);
+        req.open("GET", "http://example.com/tests/security/ssl/mixedcontent/alloworigin.sjs", false);
         req.send(null);
 
         // Change should be immediate, the request was sent synchronously
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
index 352ae52efc66..4ab5cc3df776 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
@@ -18,7 +18,7 @@
   {
     isSecurityState("secure");
     document.body.background =
-      "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
+      "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
 
     waitForSecurityState("broken", function() 
     {
@@ -30,7 +30,7 @@
   function afterNavigationTest()
   {
     is(document.body.background,
-      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
       "document backround secure again");
     isSecurityState("secure", "secure after re-navigation");
     finish();
@@ -39,6 +39,6 @@
   
 
 
-
+
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
index a9967228b4c5..9dfb31a2244c 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
@@ -25,7 +25,7 @@
     }
     
     iframe.src =
-      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs";
+      "https://example.com/tests/security/ssl/mixedcontent/iframeunsecredirect.sjs";
   }
 
   function afterNavigationTest()
@@ -38,6 +38,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
index aca7be9d1195..b11189693910 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
@@ -18,7 +18,7 @@
   {
     isSecurityState("secure");
     document.getElementById("image1").src =
-      "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
+      "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
 
     window.setTimeout(function() {
       isSecurityState("broken", "src='http://...' changed to broken");
@@ -29,7 +29,7 @@
   function afterNavigationTest()
   {
     is(document.getElementById("image1").src,
-      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
       "img.src secure again");
     isSecurityState("secure", "security full after navigation");
     finish();
@@ -39,6 +39,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
index 916245c303bd..e379730faacc 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
@@ -13,7 +13,7 @@
   
 
 
-
+
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
index 8985fc7d85d2..d868ce34cb40 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
@@ -11,7 +11,7 @@
   
   
   
+    href="http://example.com/tests/security/ssl/mixedcontent/somestyle.css" />
 
   
-    
+    
     
   
   
diff --git a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
index 58d2b215d122..48f5b9cc31c0 100644
--- a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
+++ b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
@@ -60,7 +60,7 @@ function waitForTrue(fn, onWaitComplete) {
 const kRed = "rgb(255, 0, 0)";
 const kBlue = "rgb(0, 0, 255)";
 
-var testpath = "/tests/toolkit/components/places/tests/mochitest/bug_461710/";
+var testpath = "/tests/toolkit/components/places/tests/mochitest/../bug_461710/";
 var prefix = "http://mochi.test:8888" + testpath;
 var subtests = [
                    "visited_page.html",   // 1
@@ -163,7 +163,7 @@ var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
-var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/bug_461710/iframe.html";
+var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/../bug_461710/iframe.html";
 
 function testOnWindow(aIsPrivate, aCallback) {
   var win = mainWindow.OpenBrowserWindow({private: aIsPrivate});

From d5c07891687283a34476dbac0376d1923de1e566 Mon Sep 17 00:00:00 2001
From: Daniel Holbert 
Date: Wed, 17 Apr 2013 17:13:02 -0700
Subject: [PATCH 235/438] backout 8e0af273404e (Bug 847279) for android M-8
 orange

---
 dom/imptests/Makefile.in                                        | 2 +-
 dom/permission/tests/Makefile.in                                | 2 +-
 dom/plugins/test/mochitest/Makefile.in                          | 2 +-
 dom/tests/mochitest/crypto/Makefile.in                          | 2 +-
 layout/base/tests/chrome/Makefile.in                            | 2 +-
 security/manager/ssl/tests/mochitest/bugs/Makefile.in           | 2 +-
 security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in   | 2 +-
 .../ssl/tests/mochitest/stricttransportsecurity/Makefile.in     | 2 +-
 .../components/places/tests/mochitest/bug_411966/Makefile.in    | 2 +-
 .../components/places/tests/mochitest/bug_461710/Makefile.in    | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dom/imptests/Makefile.in b/dom/imptests/Makefile.in
index 332c8967f760..ee1693503333 100644
--- a/dom/imptests/Makefile.in
+++ b/dom/imptests/Makefile.in
@@ -6,7 +6,7 @@ DEPTH = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
-relativesrcdir = @relativesrcdir@
+relativesrcdir = dom/imported-tests
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
diff --git a/dom/permission/tests/Makefile.in b/dom/permission/tests/Makefile.in
index af97961cd4de..9f8a8bdec7d9 100644
--- a/dom/permission/tests/Makefile.in
+++ b/dom/permission/tests/Makefile.in
@@ -7,7 +7,7 @@ topsrcdir        = @top_srcdir@
 srcdir           = @srcdir@
 VPATH            = @srcdir@
 
-relativesrcdir   = @relativesrcdir@
+relativesrcdir   = dom/permission/tests
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/dom/plugins/test/mochitest/Makefile.in b/dom/plugins/test/mochitest/Makefile.in
index b9c4d65cb0cb..51e95374ae26 100644
--- a/dom/plugins/test/mochitest/Makefile.in
+++ b/dom/plugins/test/mochitest/Makefile.in
@@ -7,7 +7,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir  = @relativesrcdir@
+relativesrcdir  = dom/plugins/test
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/dom/tests/mochitest/crypto/Makefile.in b/dom/tests/mochitest/crypto/Makefile.in
index ce2e344a677d..494c85ab3805 100644
--- a/dom/tests/mochitest/crypto/Makefile.in
+++ b/dom/tests/mochitest/crypto/Makefile.in
@@ -6,7 +6,7 @@ DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir	= @relativesrcdir@
+relativesrcdir	= dom/tests/mochitest/crypto
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
diff --git a/layout/base/tests/chrome/Makefile.in b/layout/base/tests/chrome/Makefile.in
index b7f155c51d7c..591358eef435 100644
--- a/layout/base/tests/chrome/Makefile.in
+++ b/layout/base/tests/chrome/Makefile.in
@@ -6,7 +6,7 @@ DEPTH     = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
-relativesrcdir  = @relativesrcdir@
+relativesrcdir  = layout/base/test/chrome
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/security/manager/ssl/tests/mochitest/bugs/Makefile.in b/security/manager/ssl/tests/mochitest/bugs/Makefile.in
index d08b4551b44e..8981ea47a8d9 100644
--- a/security/manager/ssl/tests/mochitest/bugs/Makefile.in
+++ b/security/manager/ssl/tests/mochitest/bugs/Makefile.in
@@ -7,7 +7,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir	= @relativesrcdir@
+relativesrcdir	= security/ssl/bugs
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in b/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in
index 582ff18ba911..6c89bba737a6 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in
@@ -7,7 +7,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir	= @relativesrcdir@
+relativesrcdir	= security/ssl/mixedcontent
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in
index 1dde9f22d25f..e431550c2bc7 100644
--- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in
+++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in
@@ -6,7 +6,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir	= @relativesrcdir@
+relativesrcdir	= security/ssl/stricttransportsecurity
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in b/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in
index 69bdc35452f3..8d4991e3e04f 100644
--- a/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in
+++ b/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in
@@ -7,7 +7,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = @relativesrcdir@
+relativesrcdir = toolkit/components/places/tests/bug_411966
 
 include $(DEPTH)/config/autoconf.mk
 
diff --git a/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in b/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in
index aac587d78a81..090b499b7228 100644
--- a/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in
+++ b/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in
@@ -7,7 +7,7 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
-relativesrcdir = @relativesrcdir@
+relativesrcdir = toolkit/components/places/tests/bug_461710
 
 include $(DEPTH)/config/autoconf.mk
 

From e0b70017ca397ff061bb66b370256f6dab23a1ea Mon Sep 17 00:00:00 2001
From: Sriram Ramasubramanian 
Date: Wed, 17 Apr 2013 17:18:03 -0700
Subject: [PATCH 236/438] Bug 861658 - Make Android Sync styles use Gecko
 themes. r=nalexander

This avoids using "@android:style/TextAppearance" or
"@android:style/{TextView,Button,EditText}" and avoids a crash on
pre-Gingerbread devices.
---
 mobile/android/base/resources/values/sync_styles.xml | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mobile/android/base/resources/values/sync_styles.xml b/mobile/android/base/resources/values/sync_styles.xml
index 3f08a2bd77cf..db41525ad68e 100644
--- a/mobile/android/base/resources/values/sync_styles.xml
+++ b/mobile/android/base/resources/values/sync_styles.xml
@@ -16,14 +16,14 @@
   
 
   
-  
-  
   
-  
 
-  
 
   
-  
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
index 1b347d435c9c..347382000a0d 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent1.html
@@ -13,7 +13,7 @@
   
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
index aa5e813bc451..dfcd7dd76199 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_cssContent2.html
@@ -20,7 +20,7 @@
   {
     isSecurityState("secure");
     document.getElementById("para").style.content =
-      "url('http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg')";
+      "url('http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg')";
 
     waitForSecurityState("broken", function()
     {
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
index 7e2356b009f1..b95a5caca349 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite1.html
@@ -30,7 +30,7 @@
 
   
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
index 61fec12dcef1..a92288b7acdd 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_documentWrite2.html
@@ -32,7 +32,7 @@
 
   
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
index a441b1045fb2..c0684718faae 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecurePicture.html
@@ -18,7 +18,7 @@
     window.setTimeout(function() {
       // Don't do this synchronously from onload handler
       document.getElementById("image1").src =
-        "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
+        "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
     }, 0);
 
     waitForSecurityState("broken", function()
@@ -31,7 +31,7 @@
   function afterNavigationTest()
   {
     is(document.getElementById("image1").src,
-      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
       "img.src secure again");
     isSecurityState("secure", "security full after navigation");
     finish();
@@ -41,6 +41,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
index c77053b6a8b5..d566a35947f7 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
@@ -22,7 +22,7 @@
       try
       {
         var req = new XMLHttpRequest();
-        req.open("GET", "http://example.com/tests/security/ssl/mixedcontent/alloworigin.sjs", false);
+        req.open("GET", "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/alloworigin.sjs", false);
         req.send(null);
 
         // Change should be immediate, the request was sent synchronously
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
index 4ab5cc3df776..352ae52efc66 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureBackground.html
@@ -18,7 +18,7 @@
   {
     isSecurityState("secure");
     document.body.background =
-      "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
+      "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
 
     waitForSecurityState("broken", function() 
     {
@@ -30,7 +30,7 @@
   function afterNavigationTest()
   {
     is(document.body.background,
-      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
       "document backround secure again");
     isSecurityState("secure", "secure after re-navigation");
     finish();
@@ -39,6 +39,6 @@
   
 
 
-
+
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
index 9dfb31a2244c..a9967228b4c5 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecureIframeRedirect.html
@@ -25,7 +25,7 @@
     }
     
     iframe.src =
-      "https://example.com/tests/security/ssl/mixedcontent/iframeunsecredirect.sjs";
+      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframeunsecredirect.sjs";
   }
 
   function afterNavigationTest()
@@ -38,6 +38,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
index b11189693910..aca7be9d1195 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicture.html
@@ -18,7 +18,7 @@
   {
     isSecurityState("secure");
     document.getElementById("image1").src =
-      "http://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg";
+      "http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg";
 
     window.setTimeout(function() {
       isSecurityState("broken", "src='http://...' changed to broken");
@@ -29,7 +29,7 @@
   function afterNavigationTest()
   {
     is(document.getElementById("image1").src,
-      "https://example.com/tests/security/ssl/mixedcontent/moonsurface.jpg",
+      "https://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/moonsurface.jpg",
       "img.src secure again");
     isSecurityState("secure", "security full after navigation");
     finish();
@@ -39,6 +39,6 @@
 
 
 
-  
+  
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
index e379730faacc..916245c303bd 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynUnsecurePicturePreload.html
@@ -13,7 +13,7 @@
   
 
 
-
+
 
 
diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
index d868ce34cb40..8985fc7d85d2 100644
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_unsecureCSS.html
@@ -11,7 +11,7 @@
   
   
   
+    href="http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/somestyle.css" />
 
   
-    
+    
     
   
   
diff --git a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
index 48f5b9cc31c0..58d2b215d122 100644
--- a/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
+++ b/toolkit/components/places/tests/mochitest/test_bug_461710_perwindowpb.html
@@ -60,7 +60,7 @@ function waitForTrue(fn, onWaitComplete) {
 const kRed = "rgb(255, 0, 0)";
 const kBlue = "rgb(0, 0, 255)";
 
-var testpath = "/tests/toolkit/components/places/tests/mochitest/../bug_461710/";
+var testpath = "/tests/toolkit/components/places/tests/mochitest/bug_461710/";
 var prefix = "http://mochi.test:8888" + testpath;
 var subtests = [
                    "visited_page.html",   // 1
@@ -163,7 +163,7 @@ var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
-var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/../bug_461710/iframe.html";
+var contentPage = "http://mochi.test:8888/tests/toolkit/components/places/tests/mochitest/bug_461710/iframe.html";
 
 function testOnWindow(aIsPrivate, aCallback) {
   var win = mainWindow.OpenBrowserWindow({private: aIsPrivate});

From dfbc7a12f914bd475d1e77e56d5222f75674a7a6 Mon Sep 17 00:00:00 2001
From: Ben Kelly 
Date: Thu, 18 Apr 2013 10:32:25 -0400
Subject: [PATCH 265/438] Bug 847279 - Update the android.json test exclusions
 to make new relativesrcdir paths. r=mbrubeck

---
 testing/mochitest/android.json | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/testing/mochitest/android.json b/testing/mochitest/android.json
index 7bc47e773d3a..0f83f1aaa84f 100644
--- a/testing/mochitest/android.json
+++ b/testing/mochitest/android.json
@@ -295,12 +295,12 @@
  "parser/htmlparser/tests/mochitest/test_html5_tree_construction.html": "TIMED_OUT",
  "parser/htmlparser/tests/mochitest/test_html5_tree_construction_part2.html": "TIMED_OUT",
  "robocop": "TIMED_OUT",
- "security/ssl/bugs/test_bug480509.html": "",
- "security/ssl/bugs/test_bug483440.html": "",
- "security/ssl/bugs/test_bug484111.html": "",
- "security/ssl/mixedcontent": "TIMED_OUT",
- "security/ssl/stricttransportsecurity/test_stricttransportsecurity.html": "TIMED_OUT",
- "security/ssl/stricttransportsecurity/test_sts_privatebrowsing.html": "TIMED_OUT",
+ "security/manager/ssl/tests/mochitest/bugs/test_bug480509.html": "",
+ "security/manager/ssl/tests/mochitest/bugs/test_bug483440.html": "",
+ "security/manager/ssl/tests/mochitest/bugs/test_bug484111.html": "",
+ "security/manager/ssl/tests/mochitest/mixedcontent": "TIMED_OUT",
+ "security/manager/ssl/tests/mochitest/stricttransportsecurity/test_stricttransportsecurity.html": "TIMED_OUT",
+ "security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing.html": "TIMED_OUT",
  "toolkit/components/alerts/test/test_alerts.html": "",
  "toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html": "",
  "toolkit/components/passwordmgr/test/test_master_password.html": "TIMED_OUT",

From 09696472291f87f867637f6741a4c52d85fd3bfd Mon Sep 17 00:00:00 2001
From: Ryan VanderMeulen 
Date: Thu, 18 Apr 2013 10:32:26 -0400
Subject: [PATCH 266/438] Backed out 4 changesets (bug 834835) for making bug
 786539 nearly perma-orange.

---
 content/media/AudioStreamTrack.cpp          |  20 ---
 content/media/AudioStreamTrack.h            |  30 ----
 content/media/DOMMediaStream.cpp            | 157 +-------------------
 content/media/DOMMediaStream.h              |  30 +---
 content/media/Makefile.in                   |  11 +-
 content/media/MediaStreamTrack.cpp          |  51 -------
 content/media/MediaStreamTrack.h            |  63 --------
 content/media/VideoStreamTrack.cpp          |  20 ---
 content/media/VideoStreamTrack.h            |  30 ----
 content/media/moz.build                     |   6 -
 content/media/test/Makefile.in              |   1 -
 content/media/test/manifest.js              |  13 +-
 content/media/test/test_mozHasAudio.html    |   4 +-
 content/media/test/test_streams_tracks.html |  54 -------
 dom/bindings/Bindings.conf                  |  20 +--
 dom/webidl/AudioStreamTrack.webidl          |  16 --
 dom/webidl/MediaStream.webidl               |   4 +-
 dom/webidl/MediaStreamTrack.webidl          |  33 ----
 dom/webidl/VideoStreamTrack.webidl          |  19 ---
 dom/webidl/WebIDL.mk                        |   3 -
 20 files changed, 26 insertions(+), 559 deletions(-)
 delete mode 100644 content/media/AudioStreamTrack.cpp
 delete mode 100644 content/media/AudioStreamTrack.h
 delete mode 100644 content/media/MediaStreamTrack.cpp
 delete mode 100644 content/media/MediaStreamTrack.h
 delete mode 100644 content/media/VideoStreamTrack.cpp
 delete mode 100644 content/media/VideoStreamTrack.h
 delete mode 100644 content/media/test/test_streams_tracks.html
 delete mode 100644 dom/webidl/AudioStreamTrack.webidl
 delete mode 100644 dom/webidl/MediaStreamTrack.webidl
 delete mode 100644 dom/webidl/VideoStreamTrack.webidl

diff --git a/content/media/AudioStreamTrack.cpp b/content/media/AudioStreamTrack.cpp
deleted file mode 100644
index 1aa07d5f2506..000000000000
--- a/content/media/AudioStreamTrack.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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 "AudioStreamTrack.h"
-
-#include "mozilla/dom/AudioStreamTrackBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-JSObject*
-AudioStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope)
-{
-  return AudioStreamTrackBinding::Wrap(aCx, aScope, this);
-}
-
-}
-}
diff --git a/content/media/AudioStreamTrack.h b/content/media/AudioStreamTrack.h
deleted file mode 100644
index db99bcd92621..000000000000
--- a/content/media/AudioStreamTrack.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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/. */
-
-#ifndef AUDIOSTREAMTRACK_H_
-#define AUDIOSTREAMTRACK_H_
-
-#include "MediaStreamTrack.h"
-
-namespace mozilla {
-namespace dom {
-
-class AudioStreamTrack : public MediaStreamTrack {
-public:
-  AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-    : MediaStreamTrack(aStream, aTrackID) {}
-
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope);
-
-  virtual AudioStreamTrack* AsAudioStreamTrack() { return this; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("audio"); }
-};
-
-}
-}
-
-#endif /* AUDIOSTREAMTRACK_H_ */
diff --git a/content/media/DOMMediaStream.cpp b/content/media/DOMMediaStream.cpp
index c69c1ce2dc6b..fe5bb77c0415 100644
--- a/content/media/DOMMediaStream.cpp
+++ b/content/media/DOMMediaStream.cpp
@@ -9,11 +9,8 @@
 #include "mozilla/dom/MediaStreamBinding.h"
 #include "mozilla/dom/LocalMediaStreamBinding.h"
 #include "MediaStreamGraph.h"
-#include "AudioStreamTrack.h"
-#include "VideoStreamTrack.h"
 
 using namespace mozilla;
-using namespace mozilla::dom;
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMMediaStream)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -23,95 +20,13 @@ NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMMediaStream)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMMediaStream)
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(DOMMediaStream, mWindow, mTracks)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMMediaStream, mWindow)
 
 NS_IMPL_ISUPPORTS_INHERITED1(DOMLocalMediaStream, DOMMediaStream,
                              nsIDOMLocalMediaStream)
 
-class DOMMediaStream::StreamListener : public MediaStreamListener {
-public:
-  StreamListener(DOMMediaStream* aStream)
-    : mStream(aStream)
-  {}
-
-  // Main thread only
-  void Forget() { mStream = nullptr; }
-  DOMMediaStream* GetStream() { return mStream; }
-
-  class TrackChange : public nsRunnable {
-  public:
-    TrackChange(StreamListener* aListener,
-                TrackID aID, TrackTicks aTrackOffset,
-                uint32_t aEvents, MediaSegment::Type aType)
-      : mListener(aListener), mID(aID), mEvents(aEvents), mType(aType)
-    {
-    }
-
-    NS_IMETHOD Run()
-    {
-      NS_ASSERTION(NS_IsMainThread(), "main thread only");
-
-      DOMMediaStream* stream = mListener->GetStream();
-      if (!stream) {
-        return NS_OK;
-      }
-
-      nsRefPtr track;
-      if (mEvents & MediaStreamListener::TRACK_EVENT_CREATED) {
-        track = stream->CreateDOMTrack(mID, mType);
-      } else {
-        track = stream->GetDOMTrackFor(mID);
-      }
-      if (mEvents & MediaStreamListener::TRACK_EVENT_ENDED) {
-        track->NotifyEnded();
-      }
-      return NS_OK;
-    }
-
-    StreamTime mEndTime;
-    nsRefPtr mListener;
-    TrackID mID;
-    uint32_t mEvents;
-    MediaSegment::Type mType;
-  };
-
-  /**
-   * Notify that changes to one of the stream tracks have been queued.
-   * aTrackEvents can be any combination of TRACK_EVENT_CREATED and
-   * TRACK_EVENT_ENDED. aQueuedMedia is the data being added to the track
-   * at aTrackOffset (relative to the start of the stream).
-   * aQueuedMedia can be null if there is no output.
-   */
-  virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
-                                        TrackRate aTrackRate,
-                                        TrackTicks aTrackOffset,
-                                        uint32_t aTrackEvents,
-                                        const MediaSegment& aQueuedMedia)
-  {
-    if (aTrackEvents & (TRACK_EVENT_CREATED | TRACK_EVENT_ENDED)) {
-      nsRefPtr runnable =
-        new TrackChange(this, aID, aTrackOffset, aTrackEvents,
-                        aQueuedMedia.GetType());
-      NS_DispatchToMainThread(runnable);
-    }
-  }
-
-private:
-  // These fields may only be accessed on the main thread
-  DOMMediaStream* mStream;
-};
-
-DOMMediaStream::DOMMediaStream()
-  : mStream(nullptr), mHintContents(0)
-{
-  SetIsDOMBinding();
-}
-
 DOMMediaStream::~DOMMediaStream()
 {
-  if (mListener) {
-    mListener->Forget();
-  }
   if (mStream) {
     mStream->Destroy();
   }
@@ -129,28 +44,6 @@ DOMMediaStream::CurrentTime()
   return mStream ? MediaTimeToSeconds(mStream->GetCurrentTime()) : 0.0;
 }
 
-void
-DOMMediaStream::GetAudioTracks(nsTArray >& aTracks)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    AudioStreamTrack* t = mTracks[i]->AsAudioStreamTrack();
-    if (t) {
-      aTracks.AppendElement(t);
-    }
-  }
-}
-
-void
-DOMMediaStream::GetVideoTracks(nsTArray >& aTracks)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    VideoStreamTrack* t = mTracks[i]->AsVideoStreamTrack();
-    if (t) {
-      aTracks.AppendElement(t);
-    }
-  }
-}
-
 bool
 DOMMediaStream::IsFinished()
 {
@@ -163,7 +56,7 @@ DOMMediaStream::InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents)
   mWindow = aWindow;
   SetHintContents(aHintContents);
   MediaStreamGraph* gm = MediaStreamGraph::GetInstance();
-  InitStreamCommon(gm->CreateSourceStream(this));
+  mStream = gm->CreateSourceStream(this);
 }
 
 void
@@ -172,17 +65,7 @@ DOMMediaStream::InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintConten
   mWindow = aWindow;
   SetHintContents(aHintContents);
   MediaStreamGraph* gm = MediaStreamGraph::GetInstance();
-  InitStreamCommon(gm->CreateTrackUnionStream(this));
-}
-
-void
-DOMMediaStream::InitStreamCommon(MediaStream* aStream)
-{
-  mStream = aStream;
-
-  // Setup track listener
-  mListener = new StreamListener(this);
-  aStream->AddListener(mListener);
+  mStream = gm->CreateTrackUnionStream(this);
 }
 
 already_AddRefed
@@ -207,40 +90,6 @@ DOMMediaStream::CombineWithPrincipal(nsIPrincipal* aPrincipal)
   return nsContentUtils::CombineResourcePrincipals(&mPrincipal, aPrincipal);
 }
 
-MediaStreamTrack*
-DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
-{
-  MediaStreamTrack* track;
-  switch (aType) {
-  case MediaSegment::AUDIO:
-    track = new AudioStreamTrack(this, aTrackID);
-    break;
-  case MediaSegment::VIDEO:
-    track = new VideoStreamTrack(this, aTrackID);
-    break;
-  default:
-    MOZ_NOT_REACHED("Unhandled track type");
-    return nullptr;
-  }
-
-  mTracks.AppendElement(track);
-  return track;
-}
-
-MediaStreamTrack*
-DOMMediaStream::GetDOMTrackFor(TrackID aTrackID)
-{
-  for (uint32_t i = 0; i < mTracks.Length(); ++i) {
-    MediaStreamTrack* t = mTracks[i];
-    // We may add streams to our track list that are actually owned by
-    // a different DOMMediaStream. Ignore those.
-    if (t->GetTrackID() == aTrackID && t->GetStream() == this) {
-      return t;
-    }
-  }
-  return nullptr;
-}
-
 DOMLocalMediaStream::~DOMLocalMediaStream()
 {
   if (mStream) {
diff --git a/content/media/DOMMediaStream.h b/content/media/DOMMediaStream.h
index 868481fb590d..ce2946cea31c 100644
--- a/content/media/DOMMediaStream.h
+++ b/content/media/DOMMediaStream.h
@@ -11,7 +11,6 @@
 #include "nsIPrincipal.h"
 #include "nsWrapperCache.h"
 #include "nsIDOMWindow.h"
-#include "StreamBuffer.h"
 
 class nsXPCClassInfo;
 
@@ -31,12 +30,6 @@ namespace mozilla {
 
 class MediaStream;
 
-namespace dom {
-class MediaStreamTrack;
-class AudioStreamTrack;
-class VideoStreamTrack;
-}
-
 /**
  * DOM wrapper for MediaStreams.
  */
@@ -44,12 +37,12 @@ class DOMMediaStream : public nsIDOMMediaStream,
                        public nsWrapperCache
 {
   friend class DOMLocalMediaStream;
-  typedef dom::MediaStreamTrack MediaStreamTrack;
-  typedef dom::AudioStreamTrack AudioStreamTrack;
-  typedef dom::VideoStreamTrack VideoStreamTrack;
 
 public:
-  DOMMediaStream();
+  DOMMediaStream() : mStream(nullptr), mHintContents(0)
+  {
+    SetIsDOMBinding();
+  }
   virtual ~DOMMediaStream();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMMediaStream)
@@ -61,11 +54,7 @@ public:
   }
   virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) MOZ_OVERRIDE;
 
-  // WebIDL
   double CurrentTime();
-  void GetAudioTracks(nsTArray >& aTracks);
-  void GetVideoTracks(nsTArray >& aTracks);
-
   MediaStream* GetStream() { return mStream; }
   bool IsFinished();
   /**
@@ -103,17 +92,9 @@ public:
   static already_AddRefed
   CreateTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents = 0);
 
-  // Notifications from StreamListener
-  MediaStreamTrack* CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType);
-  MediaStreamTrack* GetDOMTrackFor(TrackID aTrackID);
-
 protected:
   void InitSourceStream(nsIDOMWindow* aWindow, uint32_t aHintContents);
   void InitTrackUnionStream(nsIDOMWindow* aWindow, uint32_t aHintContents);
-  void InitStreamCommon(MediaStream* aStream);
-
-  class StreamListener;
-  friend class StreamListener;
 
   // We need this to track our parent object.
   nsCOMPtr mWindow;
@@ -125,9 +106,6 @@ protected:
   // If null, this stream can be used by anyone because it has no content yet.
   nsCOMPtr mPrincipal;
 
-  nsAutoTArray,2> mTracks;
-  nsRefPtr mListener;
-
   // tells the SDP generator about whether this
   // MediaStream probably has audio and/or video
   uint32_t mHintContents;
diff --git a/content/media/Makefile.in b/content/media/Makefile.in
index 763b1fc28e1a..71e88e1dae73 100644
--- a/content/media/Makefile.in
+++ b/content/media/Makefile.in
@@ -16,27 +16,24 @@ FAIL_ON_WARNINGS := 1
 endif # !_MSC_VER
 
 CPPSRCS = \
-  AudioAvailableEventManager.cpp \
   AudioChannelFormat.cpp \
   AudioNodeEngine.cpp \
   AudioNodeStream.cpp \
   AudioSegment.cpp \
   AudioStream.cpp \
-  AudioStreamTrack.cpp \
   DecoderTraits.cpp \
   DOMMediaStream.cpp \
   FileBlockCache.cpp \
-  MediaCache.cpp \
+  MediaResource.cpp \
+  MediaStreamGraph.cpp \
+  AudioAvailableEventManager.cpp \
   MediaDecoder.cpp \
   MediaDecoderStateMachine.cpp \
   MediaDecoderReader.cpp \
-  MediaResource.cpp \
-  MediaStreamGraph.cpp \
-  MediaStreamTrack.cpp \
+  MediaCache.cpp \
   StreamBuffer.cpp \
   VideoFrameContainer.cpp \
   VideoSegment.cpp \
-  VideoStreamTrack.cpp \
   VideoUtils.cpp \
   $(NULL)
 
diff --git a/content/media/MediaStreamTrack.cpp b/content/media/MediaStreamTrack.cpp
deleted file mode 100644
index 01b108f3bc40..000000000000
--- a/content/media/MediaStreamTrack.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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 "MediaStreamTrack.h"
-
-#include "DOMMediaStream.h"
-#include "nsIUUIDGenerator.h"
-#include "nsServiceManagerUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-MediaStreamTrack::MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-  : mStream(aStream), mTrackID(aTrackID), mEnded(false)
-{
-  SetIsDOMBinding();
-
-  memset(&mID, 0, sizeof(mID));
-
-  nsresult rv;
-  nsCOMPtr uuidgen =
-    do_GetService("@mozilla.org/uuid-generator;1", &rv);
-  if (uuidgen) {
-    uuidgen->GenerateUUIDInPlace(&mID);
-  }
-}
-
-MediaStreamTrack::~MediaStreamTrack()
-{
-}
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED_1(MediaStreamTrack, nsDOMEventTargetHelper,
-                                     mStream)
-
-NS_IMPL_ADDREF_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MediaStreamTrack)
-NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
-
-void
-MediaStreamTrack::GetId(nsAString& aID)
-{
-  char chars[NSID_LENGTH];
-  mID.ToProvidedString(chars);
-  aID = NS_ConvertASCIItoUTF16(chars);
-}
-
-}
-}
diff --git a/content/media/MediaStreamTrack.h b/content/media/MediaStreamTrack.h
deleted file mode 100644
index 61416a988c74..000000000000
--- a/content/media/MediaStreamTrack.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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/. */
-
-#ifndef MEDIASTREAMTRACK_H_
-#define MEDIASTREAMTRACK_H_
-
-#include "nsDOMEventTargetHelper.h"
-#include "nsID.h"
-#include "StreamBuffer.h"
-
-namespace mozilla {
-
-class DOMMediaStream;
-
-namespace dom {
-
-class AudioStreamTrack;
-class VideoStreamTrack;
-
-/**
- * Class representing a track in a DOMMediaStream.
- */
-class MediaStreamTrack : public nsDOMEventTargetHelper {
-public:
-  /**
-   * aTrackID is the MediaStreamGraph track ID for the track in the
-   * MediaStream owned by aStream.
-   */
-  MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID);
-  virtual ~MediaStreamTrack();
-
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamTrack, nsDOMEventTargetHelper)
-
-  DOMMediaStream* GetParentObject() const { return mStream; }
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) = 0;
-
-  DOMMediaStream* GetStream() const { return mStream; }
-  TrackID GetTrackID() const { return mTrackID; }
-  virtual AudioStreamTrack* AsAudioStreamTrack() { return nullptr; }
-  virtual VideoStreamTrack* AsVideoStreamTrack() { return nullptr; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) = 0;
-  void GetId(nsAString& aID);
-  void GetLabel(nsAString& aLabel) { aLabel.Truncate(); }
-
-  // Notifications from the MediaStreamGraph
-  void NotifyEnded() { mEnded = true; }
-
-protected:
-  nsRefPtr mStream;
-  TrackID mTrackID;
-  nsID mID;
-  bool mEnded;
-};
-
-}
-}
-
-#endif /* MEDIASTREAMTRACK_H_ */
diff --git a/content/media/VideoStreamTrack.cpp b/content/media/VideoStreamTrack.cpp
deleted file mode 100644
index bacbad1045a1..000000000000
--- a/content/media/VideoStreamTrack.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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 "VideoStreamTrack.h"
-
-#include "mozilla/dom/VideoStreamTrackBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-JSObject*
-VideoStreamTrack::WrapObject(JSContext* aCx, JSObject* aScope)
-{
-  return VideoStreamTrackBinding::Wrap(aCx, aScope, this);
-}
-
-}
-}
diff --git a/content/media/VideoStreamTrack.h b/content/media/VideoStreamTrack.h
deleted file mode 100644
index 9fcd4acad1dd..000000000000
--- a/content/media/VideoStreamTrack.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
-/* 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/. */
-
-#ifndef VIDEOSTREAMTRACK_H_
-#define VIDEOSTREAMTRACK_H_
-
-#include "MediaStreamTrack.h"
-
-namespace mozilla {
-namespace dom {
-
-class VideoStreamTrack : public MediaStreamTrack {
-public:
-  VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID)
-    : MediaStreamTrack(aStream, aTrackID) {}
-
-  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope);
-
-  virtual VideoStreamTrack* AsVideoStreamTrack() { return this; }
-
-  // WebIDL
-  virtual void GetKind(nsAString& aKind) { aKind.AssignLiteral("video"); }
-};
-
-}
-}
-
-#endif /* VIDEOSTREAMTRACK_H_ */
diff --git a/content/media/moz.build b/content/media/moz.build
index 464766e849de..5f256159bd2a 100644
--- a/content/media/moz.build
+++ b/content/media/moz.build
@@ -74,9 +74,3 @@ EXPORTS += [
     'VorbisUtils.h',
 ]
 
-EXPORTS.mozilla.dom += [
-    'AudioStreamTrack.h',
-    'MediaStreamTrack.h',
-    'VideoStreamTrack.h',
-]
-
diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in
index df2849053cba..dbf727d81bf1 100644
--- a/content/media/test/Makefile.in
+++ b/content/media/test/Makefile.in
@@ -135,7 +135,6 @@ MOCHITEST_FILES = \
 		test_streams_srcObject.html \
 		test_reset_src.html \
 		test_streams_gc.html \
-		test_streams_tracks.html \
 		test_streams_autoplay.html \
 		$(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \
 		$(NULL)
diff --git a/content/media/test/manifest.js b/content/media/test/manifest.js
index 205bebd7c87a..e6cf4d88364b 100644
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -62,13 +62,12 @@ var gPausedAfterEndedTests = gSmallTests.concat([
   { name:"small-shot.ogg", type:"video/ogg", duration:0.276 }
 ]);
 
-// Test the mozHasAudio property, and APIs that detect different kinds of
-// tracks
-var gTrackTests = [
-  { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:true, hasVideo:false },
-  { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false, hasVideo:true },
-  { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true, hasVideo:true },
-  { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false, hasVideo:true },
+// Test the mozHasAudio property
+var gMozHasAudioTests = [
+  { name:"big.wav", type:"audio/x-wav", duration:9.278981, size:102444, hasAudio:undefined },
+  { name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, size:28942, hasAudio:false },
+  { name:"short-video.ogv", type:"video/ogg", duration:1.081, hasAudio:true },
+  { name:"seek.webm", type:"video/webm", duration:3.966, size:215529, hasAudio:false },
   { name:"bogus.duh", type:"bogus/duh" }
 ];
 
diff --git a/content/media/test/test_mozHasAudio.html b/content/media/test/test_mozHasAudio.html
index 2a0bb341fbec..fff84baaad44 100644
--- a/content/media/test/test_mozHasAudio.html
+++ b/content/media/test/test_mozHasAudio.html
@@ -27,13 +27,13 @@ function startTest(test, token) {
 
   element.src = test.name;
   element.name = test.name;
-  element.hasAudio = elemType == "video" ? test.hasAudio : undefined;
+  element.hasAudio = test.hasAudio;
   element.addEventListener("loadedmetadata", onloadedmetadata, false);
 
   element.load();
 }
 
-manager.runTests(gTrackTests, startTest);
+manager.runTests(gMozHasAudioTests, startTest);
 
 
 
diff --git a/content/media/test/test_streams_tracks.html b/content/media/test/test_streams_tracks.html deleted file mode 100644 index 3ece1d4f26ba..000000000000 --- a/content/media/test/test_streams_tracks.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - Test MediaStreamTrack interfaces - - - - - -
-
-
- - diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 30d6c3b07dad..0fb4a3e8065f 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -126,9 +126,6 @@ DOMInterfaces = { 'nativeType': 'nsDOMBeforeUnloadEvent', }, -'AudioStreamTrack': { -}, - 'BiquadFilterNode': { 'resultNotAddRefed': [ 'frequency', 'q', 'gain' ], }, @@ -552,11 +549,6 @@ DOMInterfaces = { 'workers': True, }], -'LocalMediaStream': { - 'headerFile': 'DOMMediaStream.h', - 'nativeType': 'mozilla::DOMLocalMediaStream' -}, - 'Location': { # NOTE: Before you turn on codegen for Location, make sure all the # Unforgeable stuff is dealt with. @@ -575,6 +567,11 @@ DOMInterfaces = { 'skipGen': True }], +'LocalMediaStream': { + 'headerFile': 'DOMMediaStream.h', + 'nativeType': 'mozilla::DOMLocalMediaStream' +}, + 'MediaStreamList': { 'headerFile': 'MediaStreamList.h', 'wrapperCache': False, @@ -583,10 +580,6 @@ DOMInterfaces = { 'binaryNames': { '__indexedGetter': 'IndexedGetter' } }, -'MediaStreamTrack': { - 'concrete': False -}, - 'MessageEvent': { 'nativeType': 'nsDOMMessageEvent', }, @@ -1025,9 +1018,6 @@ DOMInterfaces = { 'workers': True, }], -'VideoStreamTrack': { -}, - 'WebGLActiveInfo': { 'nativeType': 'mozilla::WebGLActiveInfo', 'headerFile': 'WebGLContext.h', diff --git a/dom/webidl/AudioStreamTrack.webidl b/dom/webidl/AudioStreamTrack.webidl deleted file mode 100644 index 9fff71cedc36..000000000000 --- a/dom/webidl/AudioStreamTrack.webidl +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * http://dev.w3.org/2011/webrtc/editor/getusermedia.html - * - * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C - * liability, trademark and document use rules apply. - */ - -// [Constructor(optional MediaTrackConstraints audioConstraints)] -interface AudioStreamTrack : MediaStreamTrack { -// static sequence getSourceIds (); -}; diff --git a/dom/webidl/MediaStream.webidl b/dom/webidl/MediaStream.webidl index 7c1cc6df8cdd..632bbf569ea7 100644 --- a/dom/webidl/MediaStream.webidl +++ b/dom/webidl/MediaStream.webidl @@ -12,8 +12,8 @@ interface MediaStream { // readonly attribute DOMString id; - sequence getAudioTracks (); - sequence getVideoTracks (); + // sequence getAudioTracks (); + // sequence getVideoTracks (); // MediaStreamTrack getTrackById (DOMString trackId); // void addTrack (MediaStreamTrack track); // void removeTrack (MediaStreamTrack track); diff --git a/dom/webidl/MediaStreamTrack.webidl b/dom/webidl/MediaStreamTrack.webidl deleted file mode 100644 index 3daaa3827681..000000000000 --- a/dom/webidl/MediaStreamTrack.webidl +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * http://dev.w3.org/2011/webrtc/editor/getusermedia.html - * - * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C - * liability, trademark and document use rules apply. - */ - -interface MediaStreamTrack { - readonly attribute DOMString kind; - readonly attribute DOMString id; - readonly attribute DOMString label; -// attribute boolean enabled; -// readonly attribute MediaStreamTrackState readyState; -// readonly attribute SourceTypeEnum sourceType; -// readonly attribute DOMString sourceId; -// attribute EventHandler onstarted; -// attribute EventHandler onmute; -// attribute EventHandler onunmute; -// attribute EventHandler onended; -// any getConstraint (DOMString constraintName, optional boolean mandatory = false); -// void setConstraint (DOMString constraintName, any constraintValue, optional boolean mandatory = false); -// MediaTrackConstraints? constraints (); -// void applyConstraints (MediaTrackConstraints constraints); -// void prependConstraint (DOMString constraintName, any constraintValue); -// void appendConstraint (DOMString constraintName, any constraintValue); -// attribute EventHandler onoverconstrained; -// void stop (); -}; diff --git a/dom/webidl/VideoStreamTrack.webidl b/dom/webidl/VideoStreamTrack.webidl deleted file mode 100644 index b194d5c9fae1..000000000000 --- a/dom/webidl/VideoStreamTrack.webidl +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * http://dev.w3.org/2011/webrtc/editor/getusermedia.html - * - * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C - * liability, trademark and document use rules apply. - */ - -// [Constructor(optional MediaTrackConstraints videoConstraints)] -interface VideoStreamTrack : MediaStreamTrack { -// static sequence getSourceIds (); -// void takePhoto (); -// attribute EventHandler onphoto; -// attribute EventHandler onphotoerror; -}; diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk index ff086114c60e..e3be80f1894f 100644 --- a/dom/webidl/WebIDL.mk +++ b/dom/webidl/WebIDL.mk @@ -20,7 +20,6 @@ webidl_files = \ AudioListener.webidl \ AudioNode.webidl \ AudioParam.webidl \ - AudioStreamTrack.webidl \ Attr.webidl \ BatteryManager.webidl \ BeforeUnloadEvent.webidl \ @@ -155,7 +154,6 @@ webidl_files = \ Location.webidl \ MediaError.webidl \ MediaStream.webidl \ - MediaStreamTrack.webidl \ MessageEvent.webidl \ MouseEvent.webidl \ MouseScrollEvent.webidl \ @@ -300,7 +298,6 @@ webidl_files = \ UndoManager.webidl \ URLUtils.webidl \ USSDReceivedEvent.webidl \ - VideoStreamTrack.webidl \ XMLDocument.webidl \ XMLHttpRequest.webidl \ XMLHttpRequestEventTarget.webidl \ From 6734d048dda81e7bdfa0bae7388d8b6bfe0a7bf2 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Thu, 18 Apr 2013 16:48:37 +0200 Subject: [PATCH 267/438] Bug 825739 - Add logging for intermittent browser_bookmark_titles.js failure --- browser/base/content/test/browser_bookmark_titles.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/browser/base/content/test/browser_bookmark_titles.js b/browser/base/content/test/browser_bookmark_titles.js index 709ce02d7514..5f7c11053501 100644 --- a/browser/base/content/test/browser_bookmark_titles.js +++ b/browser/base/content/test/browser_bookmark_titles.js @@ -24,7 +24,14 @@ function generatorTest() { let browser = gBrowser.selectedBrowser; browser.stop(); // stop the about:blank load. - browser.addEventListener("DOMContentLoaded", nextStep, true); + browser.addEventListener("DOMContentLoaded", event => { + if (event.originalTarget != browser.contentDocument || + event.target.location.href == "about:blank") { + info("skipping spurious load event"); + return; + } + nextStep(); + }, true); registerCleanupFunction(function () { browser.removeEventListener("DOMContentLoaded", nextStep, true); gBrowser.removeCurrentTab(); @@ -66,6 +73,8 @@ function generatorTest() { // Bookmark the current page and confirm that the new bookmark has the expected // title. (Then delete the bookmark.) function checkBookmark(uri, expected_title) { + is(gBrowser.selectedBrowser.currentURI.spec, uri, + "Trying to bookmark the expected uri"); PlacesCommandHook.bookmarkCurrentPage(false); let id = PlacesUtils.getMostRecentBookmarkForURI(PlacesUtils._uri(uri)); From 9a696d5e68448b8fbe2cb12d70f0ae01b15dfea2 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 18 Apr 2013 16:50:13 +0200 Subject: [PATCH 268/438] Fixup for bug 859705 - Add missing return. r=me. DONTBUILD --- testing/xpcshell/remotexpcshelltests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py index e460b2e3ccf8..d4eb8f593825 100644 --- a/testing/xpcshell/remotexpcshelltests.py +++ b/testing/xpcshell/remotexpcshelltests.py @@ -155,6 +155,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object): self.device.pushFile(os.path.join(dir, info.filename), remoteFile) finally: shutil.rmtree(dir) + return for file in os.listdir(self.localLib): if (file.endswith(".so")): From d2e3f9737a66d5aec4a4ea64f3390825ef602949 Mon Sep 17 00:00:00 2001 From: Yiming Yang Date: Wed, 10 Apr 2013 16:55:43 -0700 Subject: [PATCH 269/438] Bug 850819 - Send touch/mouse/click events in action chains, r=mdas --- .../client/marionette/marionette.py | 4 + .../tests/unit/test_single_finger.py | 58 +++++- .../client/marionette/tests/unit/test_tap.py | 64 +++++++ .../marionette/tests/unit/unit-tests.ini | 4 + .../client/marionette/www/testAction.html | 85 +++++++++ testing/marionette/marionette-actors.js | 18 ++ testing/marionette/marionette-listener.js | 176 ++++++++++++++++-- 7 files changed, 392 insertions(+), 17 deletions(-) create mode 100644 testing/marionette/client/marionette/tests/unit/test_tap.py diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/client/marionette/marionette.py index 49b9da3601df..e11986308a58 100644 --- a/testing/marionette/client/marionette/marionette.py +++ b/testing/marionette/client/marionette/marionette.py @@ -449,6 +449,10 @@ class Marionette(object): response = self._send_message('setSearchTimeout', 'ok', value=timeout) return response + def send_mouse_event(self, send): + response = self._send_message('sendMouseEvent', 'ok', value=send) + return response + @property def current_window_handle(self): self.window = self._send_message('getWindow', 'value') diff --git a/testing/marionette/client/marionette/tests/unit/test_single_finger.py b/testing/marionette/client/marionette/tests/unit/test_single_finger.py index 3d2659999cd4..2971ba972faf 100644 --- a/testing/marionette/client/marionette/tests/unit/test_single_finger.py +++ b/testing/marionette/client/marionette/tests/unit/test_single_finger.py @@ -5,7 +5,7 @@ import time from marionette_test import MarionetteTestCase from marionette import Actions -from errors import NoSuchElementException +from errors import NoSuchElementException, MarionetteException class testSingleFinger(MarionetteTestCase): def test_wait(self): @@ -60,6 +60,56 @@ class testSingleFinger(MarionetteTestCase): action.release() self.assertRaises(NoSuchElementException, action.perform) + def test_mouse_wait(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + action = Actions(self.marionette) + button = self.marionette.find_element("id", "mozMouse") + action.press(button).wait().release().perform() + time.sleep(15) + self.assertEqual("MouseClick", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_mouse_wait_more(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + action = Actions(self.marionette) + button = self.marionette.find_element("id", "mozMouse") + action.press(button).wait(0.1).release().perform() + time.sleep(15) + self.assertEqual("MouseClick", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_mouse_no_wait(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + action = Actions(self.marionette) + button = self.marionette.find_element("id", "mozMouse") + action.press(button).release().perform() + time.sleep(15) + self.assertEqual("MouseClick", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_no_mouse_wait(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(False) + action = Actions(self.marionette) + button = self.marionette.find_element("id", "mozMouse") + action.press(button).wait().release().perform() + time.sleep(15) + self.assertEqual("TouchEnd", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_no_mouse_no_wait(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(False) + action = Actions(self.marionette) + button = self.marionette.find_element("id", "mozMouse") + action.press(button).release().perform() + time.sleep(15) + self.assertEqual("TouchEnd", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + def test_long_press(self): testTouch = self.marionette.absolute_url("testAction.html") self.marionette.navigate(testTouch) @@ -71,3 +121,9 @@ class testSingleFinger(MarionetteTestCase): action.release().perform() time.sleep(10) self.assertEqual("End", self.marionette.execute_script("return document.getElementById('mozLinkCopy').innerHTML;")) + + def test_wrong_value(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.assertRaises(MarionetteException, self.marionette.send_mouse_event, "boolean") + diff --git a/testing/marionette/client/marionette/tests/unit/test_tap.py b/testing/marionette/client/marionette/tests/unit/test_tap.py new file mode 100644 index 000000000000..d4c25eb15b08 --- /dev/null +++ b/testing/marionette/client/marionette/tests/unit/test_tap.py @@ -0,0 +1,64 @@ +# 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/. + +import time +from marionette_test import MarionetteTestCase +from marionette import HTMLElement + +class testSingleFinger(MarionetteTestCase): + def test_mouse_single_tap(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + button = self.marionette.find_element("id", "mozMouse") + button.single_tap() + time.sleep(15) + self.assertEqual("MouseClick", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_mouse_double_tap(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + button = self.marionette.find_element("id", "mozMouse") + button.double_tap() + time.sleep(15) + self.assertEqual("MouseClick2", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_touch(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(False) + button = self.marionette.find_element("id", "mozMouse") + button.single_tap() + time.sleep(10) + self.assertEqual("TouchEnd", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_dbtouch(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(False) + button = self.marionette.find_element("id", "mozMouse") + button.double_tap() + time.sleep(10) + self.assertEqual("TouchEnd2", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_press_release(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(True) + button = self.marionette.find_element("id", "mozMouse") + button_id = button.press(0, 0) + button.release(button_id, 0, 0) + time.sleep(10) + self.assertEqual("MouseClick", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) + + def test_no_press_release(self): + testTouch = self.marionette.absolute_url("testAction.html") + self.marionette.navigate(testTouch) + self.marionette.send_mouse_event(False) + button = self.marionette.find_element("id", "mozMouse") + button_id = button.press() + button.release(button_id) + time.sleep(10) + self.assertEqual("TouchEnd", self.marionette.execute_script("return document.getElementById('mozMouse').innerHTML;")) diff --git a/testing/marionette/client/marionette/tests/unit/unit-tests.ini b/testing/marionette/client/marionette/tests/unit/unit-tests.ini index ab7567e215d9..c8f1dc275403 100644 --- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini +++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini @@ -64,6 +64,10 @@ browser = false b2g = true browser = false +[test_tap.py] +b2g = true +browser = false + [test_simpletest_pass.js] [test_simpletest_sanity.py] [test_simpletest_chrome.js] diff --git a/testing/marionette/client/marionette/www/testAction.html b/testing/marionette/client/marionette/www/testAction.html index 1c0026058836..502925f1fb8c 100644 --- a/testing/marionette/client/marionette/www/testAction.html +++ b/testing/marionette/client/marionette/www/testAction.html @@ -22,6 +22,8 @@ + + + + + + + + diff --git a/browser/devtools/framework/toolbox.css b/browser/devtools/framework/toolbox.css index 03a48c9aaab4..efd054db508b 100644 --- a/browser/devtools/framework/toolbox.css +++ b/browser/devtools/framework/toolbox.css @@ -13,3 +13,17 @@ .command-button > .toolbarbutton-text { display: none; } + +#options-panel { + overflow-y: auto; + display: block; +} + +.options-vertical-pane { + display: inline; + float: left; +} + +.options-vertical-pane > label { + display: block; +} diff --git a/browser/devtools/framework/toolbox.xul b/browser/devtools/framework/toolbox.xul index 297e0c296ad6..16c269615920 100644 --- a/browser/devtools/framework/toolbox.xul +++ b/browser/devtools/framework/toolbox.xul @@ -18,6 +18,12 @@ + + + @@ -28,6 +34,10 @@ #endif + @@ -41,6 +51,14 @@ #endif + + + diff --git a/browser/devtools/jar.mn b/browser/devtools/jar.mn index dbed935bab48..8c49610729e4 100644 --- a/browser/devtools/jar.mn +++ b/browser/devtools/jar.mn @@ -57,6 +57,8 @@ browser.jar: content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml) content/browser/devtools/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml) content/browser/devtools/framework/toolbox-window.xul (framework/toolbox-window.xul) + content/browser/devtools/framework/toolbox-options.xul (framework/toolbox-options.xul) + content/browser/devtools/framework/toolbox-options.js (framework/toolbox-options.js) * content/browser/devtools/framework/toolbox.xul (framework/toolbox.xul) content/browser/devtools/framework/toolbox.css (framework/toolbox.css) content/browser/devtools/inspector/inspector.xul (inspector/inspector.xul) diff --git a/browser/devtools/shared/theme-switching.js b/browser/devtools/shared/theme-switching.js index 044ae9bde168..ce25a8217906 100644 --- a/browser/devtools/shared/theme-switching.js +++ b/browser/devtools/shared/theme-switching.js @@ -3,15 +3,65 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ (function() { + const DEVTOOLS_SKIN_URL = "chrome://browser/skin/devtools/"; + + function forceStyle() { + let computedStyle = window.getComputedStyle(document.documentElement); + if (!computedStyle) { + // Null when documentElement is not ready. This method is anyways not + // required then as scrollbars would be in their state without flushing. + return; + } + let display = computedStyle.display; // Save display value + document.documentElement.style.display = "none"; + window.getComputedStyle(document.documentElement).display; // Flush + document.documentElement.style.display = display; // Restore + } + + function switchTheme(theme, oldTheme) { + let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + if (oldTheme && theme != oldTheme) { + let old_theme_url = Services.io.newURI(DEVTOOLS_SKIN_URL + oldTheme + + "-theme.css", null, null); + try { + winUtils.removeSheet(old_theme_url, window.AUTHOR_SHEET); + } catch(ex) {} + } + let theme_url = Services.io.newURI( + + theme + "-theme.css", null, null); + winUtils.loadSheet(theme_url, window.AUTHOR_SHEET); + let scrollbar_url = + Services.io.newURI(DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", + null, null); + if (theme == "dark") { + winUtils.loadSheet(scrollbar_url, window.AGENT_SHEET); + forceStyle(); + } + else if (oldTheme == "dark") { + try { + winUtils.removeSheet(scrollbar_url, window.AGENT_SHEET); + } catch(ex) {} + forceStyle(); + } + document.documentElement.classList.remove("theme-" + oldTheme); + document.documentElement.classList.add("theme-" + theme); + } + + function handlePrefChange(event, data) { + switch(data.pref) { + case "devtools.theme": + switchTheme(data.newValue, data.oldValue); + } + } + const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/Services.jsm"); + Cu.import("resource:///modules/devtools/gDevTools.jsm"); let theme = Services.prefs.getCharPref("devtools.theme"); - let theme_url = Services.io.newURI("chrome://browser/skin/devtools/" + theme + "-theme.css", null, null); - let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); - winUtils.loadSheet(theme_url, window.AUTHOR_SHEET); - if (theme == "dark") { - let scrollbar_url = Services.io.newURI("chrome://browser/skin/devtools/floating-scrollbars-light.css", null, null); - winUtils.loadSheet(scrollbar_url, window.AGENT_SHEET); - } - document.documentElement.classList.add("theme-" + theme); + switchTheme(theme); + gDevTools.on("pref-changed", handlePrefChange); + window.addEventListener("unload", function() { + gDevTools.off("pref-changed", handlePrefChange); + }); })() diff --git a/browser/devtools/shared/widgets/SideMenuWidget.jsm b/browser/devtools/shared/widgets/SideMenuWidget.jsm index d11c898f23b6..5e98ee6a88a5 100644 --- a/browser/devtools/shared/widgets/SideMenuWidget.jsm +++ b/browser/devtools/shared/widgets/SideMenuWidget.jsm @@ -117,7 +117,9 @@ SideMenuWidget.prototype = { * The element associated with the displayed item. */ removeChild: function SMW_removeChild(aChild) { - aChild.parentNode.removeChild(aChild); + // Remove the item itself, not the contents. + let item = aChild.parentNode; + item.parentNode.removeChild(item); this._orderedMenuElementsArray.splice( this._orderedMenuElementsArray.indexOf(aChild), 1); diff --git a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd index 57efe9e36dfa..86339ba8713b 100644 --- a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd @@ -4,4 +4,19 @@ - + + + + + + + + + + + + + + + + diff --git a/browser/themes/linux/devtools/toolbox.css b/browser/themes/linux/devtools/toolbox.css index ed42d821296e..42807bb0aef8 100644 --- a/browser/themes/linux/devtools/toolbox.css +++ b/browser/themes/linux/devtools/toolbox.css @@ -128,6 +128,19 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } +#toolbox-tab-options { + list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); + -moz-image-region: rect(0px 16px 16px 0px); +} + +#toolbox-tab-options[checked=true] { + -moz-image-region: rect(0px 32px 16px 16px); +} + +#toolbox-tab-options > image { + opacity: 1; + -moz-margin-start: 0; +} /* Tabs */ @@ -224,3 +237,28 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } + +#options-panel { + background-image: url("chrome://browser/skin/newtab/noise.png"); +} + +.options-vertical-pane { + margin: 15px; + width: calc(50% - 30px); + min-width: 400px; + -moz-padding-start: 5px; +} + +.options-vertical-pane > label { + padding: 5px 0; + font-size: 1.4rem; +} + +.options-groupbox { + -moz-margin-start: 15px; + padding: 4px; +} + +.options-groupbox > * { + padding: 2px; +} diff --git a/browser/themes/osx/devtools/toolbox.css b/browser/themes/osx/devtools/toolbox.css index cca78b2264b0..4866fcc45923 100644 --- a/browser/themes/osx/devtools/toolbox.css +++ b/browser/themes/osx/devtools/toolbox.css @@ -116,6 +116,19 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } +#toolbox-tab-options { + list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); + -moz-image-region: rect(0px 16px 16px 0px); +} + +#toolbox-tab-options[checked=true] { + -moz-image-region: rect(0px 32px 16px 16px); +} + +#toolbox-tab-options > image { + opacity: 1; + -moz-margin-start: 0; +} /* Tabs */ @@ -211,3 +224,28 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } + +#options-panel { + background-image: url("chrome://browser/skin/newtab/noise.png"); +} + +.options-vertical-pane { + margin: 15px; + width: calc(50% - 30px); + min-width: 400px; + -moz-padding-start: 5px; +} + +.options-vertical-pane > label { + padding: 5px 0; + font-size: 1.4rem; +} + +.options-groupbox { + -moz-margin-start: 15px; + padding: 4px; +} + +.options-groupbox > * { + padding: 2px; +} diff --git a/browser/themes/windows/devtools/toolbox.css b/browser/themes/windows/devtools/toolbox.css index 2361d5f196e6..4540653bf553 100644 --- a/browser/themes/windows/devtools/toolbox.css +++ b/browser/themes/windows/devtools/toolbox.css @@ -131,6 +131,19 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } +#toolbox-tab-options { + list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); + -moz-image-region: rect(0px 16px 16px 0px); +} + +#toolbox-tab-options[checked=true] { + -moz-image-region: rect(0px 32px 16px 16px); +} + +#toolbox-tab-options > image { + opacity: 1; + -moz-margin-start: 0; +} /* Tabs */ @@ -220,3 +233,28 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } + +#options-panel { + background-image: url("chrome://browser/skin/newtab/noise.png"); +} + +.options-vertical-pane { + margin: 15px; + width: calc(50% - 30px); + min-width: 400px; + -moz-padding-start: 5px; +} + +.options-vertical-pane > label { + padding: 5px 0; + font-size: 1.4rem; +} + +.options-groupbox { + -moz-margin-start: 15px; + padding: 4px; +} + +.options-groupbox > * { + padding: 2px; +} From 8742b77656979a2de91ec19f5feda23b8d4ae12d Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Mon, 8 Apr 2013 10:54:20 -0700 Subject: [PATCH 302/438] Bug 855371 - @MOZ_UPDATE_CHANNEL@ in health report prefs. r=gps --- services/healthreport/healthreport-prefs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/healthreport/healthreport-prefs.js b/services/healthreport/healthreport-prefs.js index 7ae5f0164d49..b38439d5821b 100644 --- a/services/healthreport/healthreport-prefs.js +++ b/services/healthreport/healthreport-prefs.js @@ -1,3 +1,4 @@ +#filter substitution /* 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/. */ @@ -26,6 +27,8 @@ pref("datareporting.healthreport.service.loadDelayFirstRunMsec", 60000); pref("datareporting.healthreport.service.providerCategories", #if MOZ_UPDATE_CHANNEL == release "healthreport-js-provider-default" +#elif MOZ_UPDATE_CHANNEL == default + "healthreport-js-provider-default" #else "healthreport-js-provider-default,healthreport-js-provider-@MOZ_UPDATE_CHANNEL@" #endif From 184851d10fcd12a406d921f62c9a30894080549a Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Mon, 8 Apr 2013 20:26:23 -0700 Subject: [PATCH 303/438] Bug 853138 - Follow-up: change category name in tests. r=gps --- browser/base/content/test/browser_aboutHome.js | 2 +- browser/base/content/test/browser_contextSearchTabPosition.js | 2 +- browser/base/content/test/browser_urlbar_search_healthreport.js | 2 +- browser/components/search/test/browser_healthreport.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/base/content/test/browser_aboutHome.js b/browser/base/content/test/browser_aboutHome.js index 589b151a2b7f..ab0033a9fed7 100644 --- a/browser/base/content/test/browser_aboutHome.js +++ b/browser/base/content/test/browser_aboutHome.js @@ -114,7 +114,7 @@ let gTests = [ run: function () { try { let cm = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager); - cm.getCategoryEntry("healthreport-js-provider", "SearchesProvider"); + cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider"); } catch (ex) { // Health Report disabled, or no SearchesProvider. return Promise.resolve(); diff --git a/browser/base/content/test/browser_contextSearchTabPosition.js b/browser/base/content/test/browser_contextSearchTabPosition.js index 8cd456d6728d..38dbc2adf18b 100644 --- a/browser/base/content/test/browser_contextSearchTabPosition.js +++ b/browser/base/content/test/browser_contextSearchTabPosition.js @@ -29,7 +29,7 @@ function test() { try { let cm = Components.classes["@mozilla.org/categorymanager;1"] .getService(Components.interfaces.nsICategoryManager); - cm.getCategoryEntry("healthreport-js-provider", "SearchesProvider"); + cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider"); } catch (ex) { // Health Report disabled, or no SearchesProvider. finish(); diff --git a/browser/base/content/test/browser_urlbar_search_healthreport.js b/browser/base/content/test/browser_urlbar_search_healthreport.js index fef76cf139b5..215aa63141bc 100644 --- a/browser/base/content/test/browser_urlbar_search_healthreport.js +++ b/browser/base/content/test/browser_urlbar_search_healthreport.js @@ -7,7 +7,7 @@ function test() { waitForExplicitFinish(); try { let cm = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager); - cm.getCategoryEntry("healthreport-js-provider", "SearchesProvider"); + cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider"); } catch (ex) { // Health Report disabled, or no SearchesProvider. ok(true, "Firefox Health Report is not enabled."); diff --git a/browser/components/search/test/browser_healthreport.js b/browser/components/search/test/browser_healthreport.js index 90460ffda241..d70191560df0 100644 --- a/browser/components/search/test/browser_healthreport.js +++ b/browser/components/search/test/browser_healthreport.js @@ -9,7 +9,7 @@ function test() { try { let cm = Components.classes["@mozilla.org/categorymanager;1"] .getService(Components.interfaces.nsICategoryManager); - cm.getCategoryEntry("healthreport-js-provider", "SearchesProvider"); + cm.getCategoryEntry("healthreport-js-provider-default", "SearchesProvider"); } catch (ex) { // Health Report disabled, or no SearchesProvider. // We need a test or else we'll be marked as failure. From 868d22199f836fe42c961c9611804d4e86c835c2 Mon Sep 17 00:00:00 2001 From: Panos Astithas Date: Mon, 15 Apr 2013 11:51:19 +0300 Subject: [PATCH 304/438] Backed out changeset 371ecfa8df92 (bug 851546) for breakage --- browser/app/profile/firefox.js | 1 - browser/devtools/framework/Toolbox.jsm | 65 ++------ browser/devtools/framework/gDevTools.jsm | 20 +-- browser/devtools/framework/test/Makefile.in | 1 - .../framework/test/browser_toolbox_options.js | 142 ------------------ browser/devtools/framework/test/head.js | 26 ---- browser/devtools/framework/toolbox-options.js | 105 ------------- .../devtools/framework/toolbox-options.xul | 44 ------ browser/devtools/framework/toolbox.css | 14 -- browser/devtools/framework/toolbox.xul | 18 --- browser/devtools/jar.mn | 2 - browser/devtools/shared/theme-switching.js | 66 +------- .../shared/widgets/SideMenuWidget.jsm | 4 +- .../en-US/chrome/browser/devtools/toolbox.dtd | 17 +-- browser/themes/linux/devtools/toolbox.css | 38 ----- browser/themes/osx/devtools/toolbox.css | 38 ----- browser/themes/windows/devtools/toolbox.css | 38 ----- 17 files changed, 25 insertions(+), 614 deletions(-) delete mode 100644 browser/devtools/framework/test/browser_toolbox_options.js delete mode 100644 browser/devtools/framework/toolbox-options.js delete mode 100644 browser/devtools/framework/toolbox-options.xul diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 271d8cd0b42d..3dc3ef227516 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1038,7 +1038,6 @@ pref("devtools.toolbox.host", "bottom"); pref("devtools.toolbox.selectedTool", "webconsole"); pref("devtools.toolbox.toolbarSpec", '["paintflashing toggle","tilt toggle","scratchpad","resize toggle"]'); pref("devtools.toolbox.sideEnabled", true); -pref("devtools.toolbox.disabledTools", "[]"); // Enable the Inspector pref("devtools.inspector.enabled", true); diff --git a/browser/devtools/framework/Toolbox.jsm b/browser/devtools/framework/Toolbox.jsm index d31b8e3e7bb9..0d2209b3ff20 100644 --- a/browser/devtools/framework/Toolbox.jsm +++ b/browser/devtools/framework/Toolbox.jsm @@ -135,7 +135,7 @@ this.Toolbox = function Toolbox(target, selectedTool, hostType) { selectedTool = Services.prefs.getCharPref(this._prefs.LAST_TOOL); } let definitions = gDevTools.getToolDefinitionMap(); - if (!definitions.get(selectedTool) && selectedTool != "options") { + if (!definitions.get(selectedTool)) { selectedTool = "webconsole"; } this._defaultToolId = selectedTool; @@ -263,7 +263,6 @@ Toolbox.prototype = { closeButton.addEventListener("command", this.destroy, true); this._buildDockButtons(); - this._buildOptions(); this._buildTabs(); this._buildButtons(); this._addKeysToWindow(); @@ -281,21 +280,6 @@ Toolbox.prototype = { return deferred.promise; }, - _buildOptions: function TBOX__buildOptions() { - this.optionsButton = this.doc.getElementById("toolbox-tab-options"); - this.optionsButton.addEventListener("command", function() { - this.selectTool("options"); - }.bind(this), false); - - let iframe = this.doc.getElementById("toolbox-panel-iframe-options"); - this._toolPanels.set("options", iframe); - - let key = this.doc.getElementById("toolbox-options-key"); - key.addEventListener("command", function(toolId) { - this.selectTool(toolId); - }.bind(this, "options"), true); - }, - /** * Adds the keys and commands to the Toolbox Window in window mode. */ @@ -304,7 +288,7 @@ Toolbox.prototype = { return; } let doc = this.doc.defaultView.parent.document; - for (let [id, toolDefinition] of gDevTools.getToolDefinitionMap()) { + for (let [id, toolDefinition] of gDevTools._tools) { if (toolDefinition.key) { // Prevent multiple entries for the same tool. if (doc.getElementById("key_" + id)) { @@ -491,30 +475,16 @@ Toolbox.prototype = { break; } } - tabstrip.selectedItem = tab; + tabstrip.selectedIndex = index; // and select the right iframe let deck = this.doc.getElementById("toolbox-deck"); - // offset by 1 due to options panel - if (id == "options") { - deck.selectedIndex = 0; - this.optionsButton.setAttribute("checked", true); - } - else { - deck.selectedIndex = index != -1 ? index + 1: -1; - this.optionsButton.removeAttribute("checked"); - } + deck.selectedIndex = index; let definition = gDevTools.getToolDefinitionMap().get(id); this._currentToolId = id; - let resolveSelected = panel => { - this.emit("select", id); - this.emit(id + "-selected", panel); - deferred.resolve(panel); - }; - let iframe = this.doc.getElementById("toolbox-panel-iframe-" + id); if (!iframe) { iframe = this.doc.createElement("iframe"); @@ -535,9 +505,11 @@ Toolbox.prototype = { this._toolPanels.set(id, panel); this.emit(id + "-ready", panel); + this.emit("select", id); + this.emit(id + "-selected", panel); gDevTools.emit(id + "-ready", this, panel); - resolveSelected(panel); + deferred.resolve(panel); }.bind(this)); }.bind(this); @@ -546,22 +518,14 @@ Toolbox.prototype = { } else { let panel = this._toolPanels.get(id); // only emit 'select' event if the iframe has been loaded - if (panel && (!panel.contentDocument || - panel.contentDocument.readyState == "complete")) { - resolveSelected(panel); - } - else if (panel) { - let boundLoad = function() { - panel.removeEventListener("DOMContentLoaded", boundLoad, true); - resolveSelected(panel); - }; - panel.addEventListener("DOMContentLoaded", boundLoad, true); + if (panel) { + this.emit("select", id); + this.emit(id + "-selected", panel); + deferred.resolve(panel); } } - if (id != "options") { - Services.prefs.setCharPref(this._prefs.LAST_TOOL, id); - } + Services.prefs.setCharPref(this._prefs.LAST_TOOL, id); return deferred.promise; }, @@ -579,8 +543,8 @@ Toolbox.prototype = { _refreshHostTitle: function TBOX_refreshHostTitle() { let toolName; let toolId = this.currentToolId; - let toolDef = gDevTools.getToolDefinitionMap().get(toolId); - if (toolDef) { + if (toolId) { + let toolDef = gDevTools.getToolDefinitionMap().get(toolId); toolName = toolDef.label; } else { // no tool is selected @@ -746,7 +710,6 @@ Toolbox.prototype = { let outstanding = []; - this._toolPanels.delete("options"); for (let [id, panel] of this._toolPanels) { outstanding.push(panel.destroy()); } diff --git a/browser/devtools/framework/gDevTools.jsm b/browser/devtools/framework/gDevTools.jsm index 7bc6f659d0bb..c5820d7431aa 100644 --- a/browser/devtools/framework/gDevTools.jsm +++ b/browser/devtools/framework/gDevTools.jsm @@ -97,20 +97,6 @@ DevTools.prototype = { } }, - getDefaultTools: function DT_getDefaultTools() { - return defaultTools; - }, - - getAdditionalTools: function DT_getAdditionalTools() { - let tools = []; - for (let [key, value] of this._tools) { - if (defaultTools.indexOf(value) == -1) { - tools.push(value); - } - } - return tools; - }, - /** * Allow ToolBoxes to get at the list of tools that they should populate * themselves with. @@ -120,10 +106,6 @@ DevTools.prototype = { */ getToolDefinitionMap: function DT_getToolDefinitionMap() { let tools = new Map(); - let disabledTools = []; - try { - disabledTools = JSON.parse(Services.prefs.getCharPref("devtools.toolbox.disabledTools")); - } catch(ex) {} for (let [key, value] of this._tools) { let enabled; @@ -134,7 +116,7 @@ DevTools.prototype = { enabled = true; } - if (enabled && disabledTools.indexOf(key) == -1) { + if (enabled) { tools.set(key, value); } } diff --git a/browser/devtools/framework/test/Makefile.in b/browser/devtools/framework/test/Makefile.in index d4c667541d54..5cc458519284 100644 --- a/browser/devtools/framework/test/Makefile.in +++ b/browser/devtools/framework/test/Makefile.in @@ -23,7 +23,6 @@ MOCHITEST_BROWSER_FILES = \ browser_toolbox_sidebar.js \ browser_toolbox_window_shortcuts.js \ browser_toolbox_window_title_changes.js \ - browser_toolbox_options.js \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/browser/devtools/framework/test/browser_toolbox_options.js b/browser/devtools/framework/test/browser_toolbox_options.js deleted file mode 100644 index 7fbd4efdf71f..000000000000 --- a/browser/devtools/framework/test/browser_toolbox_options.js +++ /dev/null @@ -1,142 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -let tempScope = {}; -Cu.import("resource:///modules/devtools/Target.jsm", tempScope); -let TargetFactory = tempScope.TargetFactory; -let doc = null, toolbox = null, panelWin = null, index = 0, prefValues = [], prefNodes = []; - -function test() { - waitForExplicitFinish(); - - gBrowser.selectedTab = gBrowser.addTab(); - let target = TargetFactory.forTab(gBrowser.selectedTab); - - gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { - gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); - gDevTools.showToolbox(target).then(testSelectTool); - }, true); - - content.location = "data:text/html,test for dynamically registering and unregistering tools"; -} - -function testSelectTool(aToolbox) { - toolbox = aToolbox; - doc = toolbox.doc; - toolbox.once("options-selected", testOptionsShortcut); - toolbox.selectTool("options"); -} - -function testOptionsShortcut() { - ok(true, "Toolbox selected via selectTool method"); - toolbox.once("options-selected", testOptionsButtonClick); - toolbox.selectTool("webconsole") - .then(() => synthesizeKeyFromKeyTag("toolbox-options-key", doc)); -} - -function testOptionsButtonClick() { - ok(true, "Toolbox selected via shortcut"); - toolbox.once("options-selected", testOptions); - toolbox.selectTool("webconsole") - .then(() => doc.getElementById("toolbox-tab-options").click()); -} - -function testOptions(event, iframe) { - ok(true, "Toolbox selected via button click"); - panelWin = iframe.contentWindow; - let panelDoc = iframe.contentDocument; - // Testing pref changes - let prefCheckboxes = panelDoc.querySelectorAll("checkbox[data-pref]"); - for (let checkbox of prefCheckboxes) { - prefNodes.push(checkbox); - prefValues.push(Services.prefs.getBoolPref(checkbox.getAttribute("data-pref"))); - } - // Do again with opposite values to reset prefs - for (let checkbox of prefCheckboxes) { - prefNodes.push(checkbox); - prefValues.push(!Services.prefs.getBoolPref(checkbox.getAttribute("data-pref"))); - } - testMouseClicks(); -} - -function testMouseClicks() { - if (index == prefValues.length) { - checkTools(); - return; - } - gDevTools.once("pref-changed", prefChanged); - info("Click event synthesized for index " + index); - EventUtils.synthesizeMouse(prefNodes[index], 10, 10, {}, panelWin); -} - -function prefChanged(event, data) { - if (data.pref == prefNodes[index].getAttribute("data-pref")) { - ok(true, "Correct pref was changed"); - is(data.oldValue, prefValues[index], "Previous value is correct"); - is(data.newValue, !prefValues[index], "New value is correct"); - index++; - testMouseClicks(); - return; - } - ok(false, "Pref was not changed correctly"); - cleanup(); -} - -function checkTools() { - let toolsPref = panelWin.document.querySelectorAll("#default-tools-box > checkbox"); - prefNodes = []; - index = 0; - for (let tool of toolsPref) { - prefNodes.push(tool); - } - toggleTools(); -} - -function toggleTools() { - if (index < prefNodes.length) { - gDevTools.once("tool-unregistered", checkUnregistered); - EventUtils.synthesizeMouse(prefNodes[index], 10, 10, {}, panelWin); - } - else if (index < 2*prefNodes.length) { - gDevTools.once("tool-registered", checkRegistered); - EventUtils.synthesizeMouse(prefNodes[index - prefNodes.length], 10, 10, {}, panelWin); - } - else { - cleanup(); - return; - } -} - -function checkUnregistered(event, data) { - if (data == prefNodes[index].getAttribute("id")) { - ok(true, "Correct tool removed"); - // checking tab on the toolbox - ok(!doc.getElementById("toolbox-tab-" + data), "Tab removed for " + data); - index++; - toggleTools(); - return; - } - ok(false, "Something went wrong, " + data + " was not unregistered"); - cleanup(); -} - -function checkRegistered(event, data) { - if (data == prefNodes[index - prefNodes.length].getAttribute("id")) { - ok(true, "Correct tool added back"); - // checking tab on the toolbox - ok(doc.getElementById("toolbox-tab-" + data), "Tab added back for " + data); - index++; - toggleTools(); - return; - } - ok(false, "Something went wrong, " + data + " was not registered back"); - cleanup(); -} - -function cleanup() { - toolbox.destroy().then(function() { - gBrowser.removeCurrentTab(); - toolbox = doc = prefNodes = prefValues = panelWin = null; - finish(); - }); -} diff --git a/browser/devtools/framework/test/head.js b/browser/devtools/framework/test/head.js index 144a9ed5d484..66df4ab8f0e1 100644 --- a/browser/devtools/framework/test/head.js +++ b/browser/devtools/framework/test/head.js @@ -47,29 +47,3 @@ registerCleanupFunction(function tearDown() { gBrowser.removeCurrentTab(); } }); - -function synthesizeKeyFromKeyTag(aKeyId, document) { - let key = document.getElementById(aKeyId); - isnot(key, null, "Successfully retrieved the node"); - - let modifiersAttr = key.getAttribute("modifiers"); - - let name = null; - - if (key.getAttribute("keycode")) - name = key.getAttribute("keycode"); - else if (key.getAttribute("key")) - name = key.getAttribute("key"); - - isnot(name, null, "Successfully retrieved keycode/key"); - - let modifiers = { - shiftKey: modifiersAttr.match("shift"), - ctrlKey: modifiersAttr.match("ctrl"), - altKey: modifiersAttr.match("alt"), - metaKey: modifiersAttr.match("meta"), - accelKey: modifiersAttr.match("accel") - } - - EventUtils.synthesizeKey(name, modifiers); -} diff --git a/browser/devtools/framework/toolbox-options.js b/browser/devtools/framework/toolbox-options.js deleted file mode 100644 index fc4525529989..000000000000 --- a/browser/devtools/framework/toolbox-options.js +++ /dev/null @@ -1,105 +0,0 @@ - -const { utils: Cu } = Components; -const DISABLED_TOOLS = "devtools.toolbox.disabledTools"; -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource:///modules/devtools/gDevTools.jsm"); - -window.addEventListener("load", function onLoad() { - window.removeEventListener("load", onLoad); - setupToolsList(); - populatePreferences(); -}); - -function setupToolsList() { - let disabledTools = []; - try { - disabledTools = JSON.parse(Services.prefs.getCharPref(DISABLED_TOOLS)); - } catch(ex) { - Cu.reportError("Error parsing pref " + DISABLED_TOOLS + " as JSON."); - } - let defaultToolsBox = document.getElementById("default-tools-box"); - let additionalToolsBox = document.getElementById("additional-tools-box"); - - defaultToolsBox.textContent = ""; - additionalToolsBox.textContent = ""; - - let onCheckboxClick = function(id) { - if (disabledTools.indexOf(id) > -1) { - disabledTools.splice(disabledTools.indexOf(id), 1); - Services.prefs.setCharPref(DISABLED_TOOLS, JSON.stringify(disabledTools)); - gDevTools.emit("tool-registered", id); - } - else { - disabledTools.push(id); - Services.prefs.setCharPref(DISABLED_TOOLS, JSON.stringify(disabledTools)); - gDevTools.emit("tool-unregistered", id); - } - }; - - // Populating the default tools lists - for (let tool of gDevTools.getDefaultTools()) { - let checkbox = document.createElement("checkbox"); - checkbox.setAttribute("id", tool.id); - checkbox.setAttribute("label", tool.label); - checkbox.setAttribute("tooltiptext", tool.tooltip || ""); - checkbox.setAttribute("checked", disabledTools.indexOf(tool.id) == -1); - checkbox.addEventListener("command", onCheckboxClick.bind(null, tool.id)); - defaultToolsBox.appendChild(checkbox); - } - - // Populating the additional tools list that came from add-ons. - let atleastOneAddon = false; - for (let tool of gDevTools.getAdditionalTools()) { - atleastOneAddon = true; - let checkbox = document.createElement("checkbox"); - checkbox.setAttribute("id", tool.id); - checkbox.setAttribute("label", tool.label); - checkbox.setAttribute("tooltiptext", tool.tooltip || ""); - checkbox.setAttribute("checked", disabledTools.indexOf(tool.id) == -1); - checkbox.addEventListener("command", onCheckboxClick.bind(null, tool.id)); - additionalToolsBox.appendChild(checkbox); - } - - if (!atleastOneAddon) { - additionalToolsBox.style.display = "none"; - additionalToolsBox.previousSibling.style.display = "none"; - } - - window.focus(); -} - -function populatePreferences() { - let prefCheckboxes = document.querySelectorAll("checkbox[data-pref]"); - for (let checkbox of prefCheckboxes) { - checkbox.checked = Services.prefs.getBoolPref(checkbox.getAttribute("data-pref")); - checkbox.addEventListener("command", function() { - let data = { - pref: this.getAttribute("data-pref"), - newValue: this.checked - }; - data.oldValue = Services.prefs.getBoolPref(data.pref); - Services.prefs.setBoolPref(data.pref, data.newValue); - gDevTools.emit("pref-changed", data); - }.bind(checkbox)); - } - let prefRadiogroups = document.querySelectorAll("radiogroup[data-pref]"); - for (let radiogroup of prefRadiogroups) { - let selectedValue = Services.prefs.getCharPref(radiogroup.getAttribute("data-pref")); - for (let radio of radiogroup.childNodes) { - radiogroup.selectedIndex = -1; - if (radio.getAttribute("value") == selectedValue) { - radiogroup.selectedItem = radio; - break; - } - } - radiogroup.addEventListener("select", function() { - let data = { - pref: this.getAttribute("data-pref"), - newValue: this.selectedItem.getAttribute("value") - }; - data.oldValue = Services.prefs.getCharPref(data.pref); - Services.prefs.setCharPref(data.pref, data.newValue); - gDevTools.emit("pref-changed", data); - }.bind(radiogroup)); - } -} diff --git a/browser/devtools/framework/toolbox-options.xul b/browser/devtools/framework/toolbox-options.xul deleted file mode 100644 index dbd4e8357614..000000000000 --- a/browser/devtools/framework/toolbox-options.xul +++ /dev/null @@ -1,44 +0,0 @@ - - - - %toolboxDTD; -]> - - - - - - - - - - - - diff --git a/browser/devtools/framework/toolbox.css b/browser/devtools/framework/toolbox.css index efd054db508b..03a48c9aaab4 100644 --- a/browser/devtools/framework/toolbox.css +++ b/browser/devtools/framework/toolbox.css @@ -13,17 +13,3 @@ .command-button > .toolbarbutton-text { display: none; } - -#options-panel { - overflow-y: auto; - display: block; -} - -.options-vertical-pane { - display: inline; - float: left; -} - -.options-vertical-pane > label { - display: block; -} diff --git a/browser/devtools/framework/toolbox.xul b/browser/devtools/framework/toolbox.xul index 16c269615920..297e0c296ad6 100644 --- a/browser/devtools/framework/toolbox.xul +++ b/browser/devtools/framework/toolbox.xul @@ -18,12 +18,6 @@ - - - @@ -34,10 +28,6 @@ #endif - @@ -51,14 +41,6 @@ #endif - - - diff --git a/browser/devtools/jar.mn b/browser/devtools/jar.mn index 8c49610729e4..dbed935bab48 100644 --- a/browser/devtools/jar.mn +++ b/browser/devtools/jar.mn @@ -57,8 +57,6 @@ browser.jar: content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml) content/browser/devtools/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml) content/browser/devtools/framework/toolbox-window.xul (framework/toolbox-window.xul) - content/browser/devtools/framework/toolbox-options.xul (framework/toolbox-options.xul) - content/browser/devtools/framework/toolbox-options.js (framework/toolbox-options.js) * content/browser/devtools/framework/toolbox.xul (framework/toolbox.xul) content/browser/devtools/framework/toolbox.css (framework/toolbox.css) content/browser/devtools/inspector/inspector.xul (inspector/inspector.xul) diff --git a/browser/devtools/shared/theme-switching.js b/browser/devtools/shared/theme-switching.js index ce25a8217906..044ae9bde168 100644 --- a/browser/devtools/shared/theme-switching.js +++ b/browser/devtools/shared/theme-switching.js @@ -3,65 +3,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ (function() { - const DEVTOOLS_SKIN_URL = "chrome://browser/skin/devtools/"; - - function forceStyle() { - let computedStyle = window.getComputedStyle(document.documentElement); - if (!computedStyle) { - // Null when documentElement is not ready. This method is anyways not - // required then as scrollbars would be in their state without flushing. - return; - } - let display = computedStyle.display; // Save display value - document.documentElement.style.display = "none"; - window.getComputedStyle(document.documentElement).display; // Flush - document.documentElement.style.display = display; // Restore - } - - function switchTheme(theme, oldTheme) { - let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - if (oldTheme && theme != oldTheme) { - let old_theme_url = Services.io.newURI(DEVTOOLS_SKIN_URL + oldTheme + - "-theme.css", null, null); - try { - winUtils.removeSheet(old_theme_url, window.AUTHOR_SHEET); - } catch(ex) {} - } - let theme_url = Services.io.newURI( + - theme + "-theme.css", null, null); - winUtils.loadSheet(theme_url, window.AUTHOR_SHEET); - let scrollbar_url = - Services.io.newURI(DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", - null, null); - if (theme == "dark") { - winUtils.loadSheet(scrollbar_url, window.AGENT_SHEET); - forceStyle(); - } - else if (oldTheme == "dark") { - try { - winUtils.removeSheet(scrollbar_url, window.AGENT_SHEET); - } catch(ex) {} - forceStyle(); - } - document.documentElement.classList.remove("theme-" + oldTheme); - document.documentElement.classList.add("theme-" + theme); - } - - function handlePrefChange(event, data) { - switch(data.pref) { - case "devtools.theme": - switchTheme(data.newValue, data.oldValue); - } - } - const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/Services.jsm"); - Cu.import("resource:///modules/devtools/gDevTools.jsm"); let theme = Services.prefs.getCharPref("devtools.theme"); - switchTheme(theme); - gDevTools.on("pref-changed", handlePrefChange); - window.addEventListener("unload", function() { - gDevTools.off("pref-changed", handlePrefChange); - }); + let theme_url = Services.io.newURI("chrome://browser/skin/devtools/" + theme + "-theme.css", null, null); + let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); + winUtils.loadSheet(theme_url, window.AUTHOR_SHEET); + if (theme == "dark") { + let scrollbar_url = Services.io.newURI("chrome://browser/skin/devtools/floating-scrollbars-light.css", null, null); + winUtils.loadSheet(scrollbar_url, window.AGENT_SHEET); + } + document.documentElement.classList.add("theme-" + theme); })() diff --git a/browser/devtools/shared/widgets/SideMenuWidget.jsm b/browser/devtools/shared/widgets/SideMenuWidget.jsm index 5e98ee6a88a5..d11c898f23b6 100644 --- a/browser/devtools/shared/widgets/SideMenuWidget.jsm +++ b/browser/devtools/shared/widgets/SideMenuWidget.jsm @@ -117,9 +117,7 @@ SideMenuWidget.prototype = { * The element associated with the displayed item. */ removeChild: function SMW_removeChild(aChild) { - // Remove the item itself, not the contents. - let item = aChild.parentNode; - item.parentNode.removeChild(item); + aChild.parentNode.removeChild(aChild); this._orderedMenuElementsArray.splice( this._orderedMenuElementsArray.indexOf(aChild), 1); diff --git a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd index 86339ba8713b..57efe9e36dfa 100644 --- a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd @@ -4,19 +4,4 @@ - - - - - - - - - - - - - - - - + diff --git a/browser/themes/linux/devtools/toolbox.css b/browser/themes/linux/devtools/toolbox.css index 42807bb0aef8..ed42d821296e 100644 --- a/browser/themes/linux/devtools/toolbox.css +++ b/browser/themes/linux/devtools/toolbox.css @@ -128,19 +128,6 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } -#toolbox-tab-options { - list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); - -moz-image-region: rect(0px 16px 16px 0px); -} - -#toolbox-tab-options[checked=true] { - -moz-image-region: rect(0px 32px 16px 16px); -} - -#toolbox-tab-options > image { - opacity: 1; - -moz-margin-start: 0; -} /* Tabs */ @@ -237,28 +224,3 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } - -#options-panel { - background-image: url("chrome://browser/skin/newtab/noise.png"); -} - -.options-vertical-pane { - margin: 15px; - width: calc(50% - 30px); - min-width: 400px; - -moz-padding-start: 5px; -} - -.options-vertical-pane > label { - padding: 5px 0; - font-size: 1.4rem; -} - -.options-groupbox { - -moz-margin-start: 15px; - padding: 4px; -} - -.options-groupbox > * { - padding: 2px; -} diff --git a/browser/themes/osx/devtools/toolbox.css b/browser/themes/osx/devtools/toolbox.css index 4866fcc45923..cca78b2264b0 100644 --- a/browser/themes/osx/devtools/toolbox.css +++ b/browser/themes/osx/devtools/toolbox.css @@ -116,19 +116,6 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } -#toolbox-tab-options { - list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); - -moz-image-region: rect(0px 16px 16px 0px); -} - -#toolbox-tab-options[checked=true] { - -moz-image-region: rect(0px 32px 16px 16px); -} - -#toolbox-tab-options > image { - opacity: 1; - -moz-margin-start: 0; -} /* Tabs */ @@ -224,28 +211,3 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } - -#options-panel { - background-image: url("chrome://browser/skin/newtab/noise.png"); -} - -.options-vertical-pane { - margin: 15px; - width: calc(50% - 30px); - min-width: 400px; - -moz-padding-start: 5px; -} - -.options-vertical-pane > label { - padding: 5px 0; - font-size: 1.4rem; -} - -.options-groupbox { - -moz-margin-start: 15px; - padding: 4px; -} - -.options-groupbox > * { - padding: 2px; -} diff --git a/browser/themes/windows/devtools/toolbox.css b/browser/themes/windows/devtools/toolbox.css index 4540653bf553..2361d5f196e6 100644 --- a/browser/themes/windows/devtools/toolbox.css +++ b/browser/themes/windows/devtools/toolbox.css @@ -131,19 +131,6 @@ -moz-image-region: rect(0px, 48px, 16px, 32px); } -#toolbox-tab-options { - list-style-image: url("chrome://browser/skin/devtools/option-icon.png"); - -moz-image-region: rect(0px 16px 16px 0px); -} - -#toolbox-tab-options[checked=true] { - -moz-image-region: rect(0px 32px 16px 16px); -} - -#toolbox-tab-options > image { - opacity: 1; - -moz-margin-start: 0; -} /* Tabs */ @@ -233,28 +220,3 @@ background-position: top right, top left, left, right; box-shadow: 1px -1px 0 hsla(206,37%,4%,.2) inset; } - -#options-panel { - background-image: url("chrome://browser/skin/newtab/noise.png"); -} - -.options-vertical-pane { - margin: 15px; - width: calc(50% - 30px); - min-width: 400px; - -moz-padding-start: 5px; -} - -.options-vertical-pane > label { - padding: 5px 0; - font-size: 1.4rem; -} - -.options-groupbox { - -moz-margin-start: 15px; - padding: 4px; -} - -.options-groupbox > * { - padding: 2px; -} From 1be192843a36da22929c905a70ef61132bf8f4f5 Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Mon, 15 Apr 2013 19:10:04 +0300 Subject: [PATCH 305/438] Bug 851231 - Output Console.jsm API calls to the browser console; r=jwalker --- browser/devtools/webconsole/test/Makefile.in | 1 + .../test/browser_console_consolejsm_output.js | 118 +++++++++ .../test/browser_longstring_hang.js | 19 +- browser/devtools/webconsole/test/head.js | 241 ++++++++++++++++-- toolkit/devtools/Console.jsm | 170 ++++++++++-- 5 files changed, 490 insertions(+), 59 deletions(-) create mode 100644 browser/devtools/webconsole/test/browser_console_consolejsm_output.js diff --git a/browser/devtools/webconsole/test/Makefile.in b/browser/devtools/webconsole/test/Makefile.in index bea96298e458..caa8fa267f0f 100644 --- a/browser/devtools/webconsole/test/Makefile.in +++ b/browser/devtools/webconsole/test/Makefile.in @@ -121,6 +121,7 @@ MOCHITEST_BROWSER_FILES = \ browser_console_variables_view_while_debugging.js \ browser_console.js \ browser_longstring_hang.js \ + browser_console_consolejsm_output.js \ head.js \ $(NULL) diff --git a/browser/devtools/webconsole/test/browser_console_consolejsm_output.js b/browser/devtools/webconsole/test/browser_console_consolejsm_output.js new file mode 100644 index 000000000000..9bd8b10c192f --- /dev/null +++ b/browser/devtools/webconsole/test/browser_console_consolejsm_output.js @@ -0,0 +1,118 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// Test that Console.jsm outputs messages to the Browser Console, bug 851231. + +function test() +{ + HUDConsoleUI.toggleBrowserConsole().then(consoleOpened); + let hud = null; + + function consoleOpened(aHud) + { + hud = aHud; + hud.jsterm.clearOutput(true); + + let console = Cu.import("resource://gre/modules/devtools/Console.jsm", {}).console; + + console.time("foobarTimer"); + let foobar = { bug851231prop: "bug851231value" }; + + console.log("bug851231-log"); + console.info("bug851231-info"); + console.warn("bug851231-warn"); + console.error("bug851231-error", foobar); + console.debug("bug851231-debug"); + console.trace(); + console.dir(document); + console.timeEnd("foobarTimer"); + + info("wait for the Console.jsm messages"); + + waitForMessages({ + webconsole: hud, + messages: [ + { + name: "console.log output", + text: "bug851231-log", + category: CATEGORY_WEBDEV, + severity: SEVERITY_LOG, + }, + { + name: "console.info output", + text: "bug851231-info", + category: CATEGORY_WEBDEV, + severity: SEVERITY_INFO, + }, + { + name: "console.warn output", + text: "bug851231-warn", + category: CATEGORY_WEBDEV, + severity: SEVERITY_WARNING, + }, + { + name: "console.error output", + text: /\bbug851231-error\b.+\[object Object\]/, + category: CATEGORY_WEBDEV, + severity: SEVERITY_ERROR, + objects: true, + }, + { + name: "console.debug output", + text: "bug851231-debug", + category: CATEGORY_WEBDEV, + severity: SEVERITY_LOG, + }, + { + name: "console.trace output", + consoleTrace: { + file: "browser_console_consolejsm_output.js", + fn: "consoleOpened", + }, + }, + { + name: "console.dir output", + consoleDir: "[object XULDocument]", + }, + { + name: "console.time output", + consoleTime: "foobarTimer", + }, + { + name: "console.timeEnd output", + consoleTimeEnd: "foobarTimer", + }, + ], + }).then((aResults) => { + let consoleErrorMsg = aResults[3]; + ok(consoleErrorMsg, "console.error message element found"); + let clickable = consoleErrorMsg.clickableElements[0]; + ok(clickable, "clickable object found for console.error"); + + let onFetch = (aEvent, aVar) => { + // Skip the notification from console.dir variablesview-fetched. + if (aVar._variablesView != hud.jsterm._variablesView) { + return; + } + hud.jsterm.off("variablesview-fetched", onFetch); + + ok(aVar, "object inspector opened on click"); + + findVariableViewProperties(aVar, [{ + name: "bug851231prop", + value: "bug851231value", + }], { webconsole: hud }).then(finishTest); + }; + + hud.jsterm.on("variablesview-fetched", onFetch); + + scrollOutputToNode(clickable); + + info("wait for variablesview-fetched"); + executeSoon(() => + EventUtils.synthesizeMouse(clickable, 2, 2, {}, hud.iframeWindow)); + }); + } +} diff --git a/browser/devtools/webconsole/test/browser_longstring_hang.js b/browser/devtools/webconsole/test/browser_longstring_hang.js index 4ec5b2070be5..0a36006801e6 100644 --- a/browser/devtools/webconsole/test/browser_longstring_hang.js +++ b/browser/devtools/webconsole/test/browser_longstring_hang.js @@ -42,13 +42,10 @@ function test() function onInitialString(aResults) { - let msg = [...aResults[0].matched][0]; - ok(msg, "console.log result message element"); - - let clickable = msg.querySelector(".longStringEllipsis"); + let clickable = aResults[0].longStrings[0]; ok(clickable, "long string ellipsis is shown"); - scrollToVisible(clickable); + scrollOutputToNode(clickable); executeSoon(() => { EventUtils.synthesizeMouse(clickable, 2, 2, {}, hud.iframeWindow); @@ -73,16 +70,4 @@ function test() }).then(finishTest); }); } - - function scrollToVisible(aNode) - { - let richListBoxNode = aNode.parentNode; - while (richListBoxNode.tagName != "richlistbox") { - richListBoxNode = richListBoxNode.parentNode; - } - - let boxObject = richListBoxNode.scrollBoxObject; - let nsIScrollBoxObject = boxObject.QueryInterface(Ci.nsIScrollBoxObject); - nsIScrollBoxObject.ensureElementIsVisible(aNode); - } } diff --git a/browser/devtools/webconsole/test/head.js b/browser/devtools/webconsole/test/head.js index 97e84c9a0cbc..4f15d19d4a55 100644 --- a/browser/devtools/webconsole/test/head.js +++ b/browser/devtools/webconsole/test/head.js @@ -252,7 +252,7 @@ function waitForOpenContextMenu(aContextMenu, aOptions) { function dumpConsoles() { if (gPendingOutputTest) { - console.log("dumpConsoles"); + console.log("dumpConsoles start"); for each (let hud in HUDService.hudReferences) { if (!hud.outputNode) { console.debug("no output content for", hud.hudId); @@ -261,25 +261,38 @@ function dumpConsoles() console.debug("output content for", hud.hudId); for (let elem of hud.outputNode.childNodes) { - let text = getMessageElementText(elem); - let repeats = elem.querySelector(".webconsole-msg-repeat"); - if (repeats) { - repeats = repeats.getAttribute("value"); - } - console.debug("date", elem.timestamp, - "class", elem.className, - "category", elem.category, - "severity", elem.severity, - "repeats", repeats, - "clipboardText", elem.clipboardText, - "text", text); + dumpMessageElement(elem); } } + console.log("dumpConsoles end"); gPendingOutputTest = 0; } } +/** + * Dump to output debug information for the given webconsole message. + * + * @param nsIDOMNode aMessage + * The message element you want to display. + */ +function dumpMessageElement(aMessage) +{ + let text = getMessageElementText(aMessage); + let repeats = aMessage.querySelector(".webconsole-msg-repeat"); + if (repeats) { + repeats = repeats.getAttribute("value"); + } + console.debug("id", aMessage.getAttribute("id"), + "date", aMessage.timestamp, + "class", aMessage.className, + "category", aMessage.category, + "severity", aMessage.severity, + "repeats", repeats, + "clipboardText", aMessage.clipboardText, + "text", text); +} + function finishTest() { browser = hudId = hud = filterBox = outputNode = cs = null; @@ -888,6 +901,104 @@ function waitForMessages(aOptions) return result; } + function checkConsoleTrace(aRule, aElement) + { + let elemText = getMessageElementText(aElement); + let trace = aRule.consoleTrace; + + if (!checkText("Stack trace from ", elemText)) { + return false; + } + + let clickable = aElement.querySelector(".hud-clickable"); + if (!clickable) { + ok(false, "console.trace() message is missing .hud-clickable"); + displayErrorContext(aRule, aElement); + return false; + } + aRule.clickableElements = [clickable]; + + if (trace.file && + !checkText("from " + trace.file + ", ", elemText)) { + ok(false, "console.trace() message is missing the file name: " + + trace.file); + displayErrorContext(aRule, aElement); + return false; + } + + if (trace.fn && + !checkText(", function " + trace.fn + ", ", elemText)) { + ok(false, "console.trace() message is missing the function name: " + + trace.fn); + displayErrorContext(aRule, aElement); + return false; + } + + if (trace.line && + !checkText(", line " + trace.line + ".", elemText)) { + ok(false, "console.trace() message is missing the line number: " + + trace.line); + displayErrorContext(aRule, aElement); + return false; + } + + aRule.category = CATEGORY_WEBDEV; + aRule.severity = SEVERITY_LOG; + + return true; + } + + function checkConsoleTime(aRule, aElement) + { + let elemText = getMessageElementText(aElement); + let time = aRule.consoleTime; + + if (!checkText(time + ": timer started", elemText)) { + return false; + } + + aRule.category = CATEGORY_WEBDEV; + aRule.severity = SEVERITY_LOG; + + return true; + } + + function checkConsoleTimeEnd(aRule, aElement) + { + let elemText = getMessageElementText(aElement); + let time = aRule.consoleTimeEnd; + let regex = new RegExp(time + ": \\d+ms"); + + if (!checkText(regex, elemText)) { + return false; + } + + aRule.category = CATEGORY_WEBDEV; + aRule.severity = SEVERITY_LOG; + + return true; + } + + function checkConsoleDir(aRule, aElement) + { + if (!aElement.classList.contains("webconsole-msg-inspector")) { + return false; + } + + let elemText = getMessageElementText(aElement); + if (!checkText(aRule.consoleDir, elemText)) { + return false; + } + + let iframe = aElement.querySelector("iframe"); + if (!iframe) { + ok(false, "console.dir message has no iframe"); + return false; + } + + return true; + } + function checkMessage(aRule, aElement) { let elemText = getMessageElementText(aElement); @@ -900,16 +1011,41 @@ function waitForMessages(aOptions) return false; } - if (aRule.category) { - if (aElement.category != aRule.category) { - return false; - } + if (aRule.consoleTrace && !checkConsoleTrace(aRule, aElement)) { + return false; } - if (aRule.severity) { - if (aElement.severity != aRule.severity) { - return false; + if (aRule.consoleTime && !checkConsoleTime(aRule, aElement)) { + return false; + } + + if (aRule.consoleTimeEnd && !checkConsoleTimeEnd(aRule, aElement)) { + return false; + } + + if (aRule.consoleDir && !checkConsoleDir(aRule, aElement)) { + return false; + } + + let partialMatch = !!(aRule.consoleTrace || aRule.consoleTime || + aRule.consoleTimeEnd); + + if (aRule.category && aElement.category != aRule.category) { + if (partialMatch) { + is(aElement.category, aRule.category, + "message category for rule: " + displayRule(aRule)); + displayErrorContext(aRule, aElement); } + return false; + } + + if (aRule.severity && aElement.severity != aRule.severity) { + if (partialMatch) { + is(aElement.severity, aRule.severity, + "message severity for rule: " + displayRule(aRule)); + displayErrorContext(aRule, aElement); + } + return false; } if (aRule.repeats) { @@ -919,9 +1055,32 @@ function waitForMessages(aOptions) } } - let longString = !!aElement.querySelector(".longStringEllipsis"); - if ("longString" in aRule && aRule.longString != longString) { - return false; + if ("longString" in aRule) { + let longStrings = aElement.querySelectorAll(".longStringEllipsis"); + if (aRule.longString != !!longStrings[0]) { + if (partialMatch) { + is(!!longStrings[0], aRule.longString, + "long string existence check failed for message rule: " + + displayRule(aRule)); + displayErrorContext(aRule, aElement); + } + return false; + } + aRule.longStrings = longStrings; + } + + if ("objects" in aRule) { + let clickables = aElement.querySelectorAll(".hud-clickable"); + if (aRule.objects != !!clickables[0]) { + if (partialMatch) { + is(!!clickables[0], aRule.objects, + "objects existence check failed for message rule: " + + displayRule(aRule)); + displayErrorContext(aRule, aElement); + } + return false; + } + aRule.clickableElements = clickables; } let count = aRule.count || 1; @@ -936,6 +1095,16 @@ function waitForMessages(aOptions) function onMessagesAdded(aEvent, aNewElements) { for (let elem of aNewElements) { + let location = elem.querySelector(".webconsole-location"); + if (location) { + let url = location.getAttribute("title"); + // Prevent recursion with the browser console and any potential + // messages coming from head.js. + if (url.indexOf("browser/devtools/webconsole/test/head.js") != -1) { + continue; + } + } + for (let rule of rules) { if (rule._ruleMatched) { continue; @@ -989,6 +1158,13 @@ function waitForMessages(aOptions) return aRule.name || aRule.text; } + function displayErrorContext(aRule, aElement) + { + console.log("error occured during rule " + displayRule(aRule)); + console.log("while checking the following message"); + dumpMessageElement(aElement); + } + executeSoon(() => { onMessagesAdded("messages-added", webconsole.outputNode.childNodes); if (rulesMatched != rules.length) { @@ -1001,3 +1177,22 @@ function waitForMessages(aOptions) return deferred.promise; } + + +/** + * Scroll the Web Console output to the given node. + * + * @param nsIDOMNode aNode + * The node to scroll to. + */ +function scrollOutputToNode(aNode) +{ + let richListBoxNode = aNode.parentNode; + while (richListBoxNode.tagName != "richlistbox") { + richListBoxNode = richListBoxNode.parentNode; + } + + let boxObject = richListBoxNode.scrollBoxObject; + let nsIScrollBoxObject = boxObject.QueryInterface(Ci.nsIScrollBoxObject); + nsIScrollBoxObject.ensureElementIsVisible(aNode); +} diff --git a/toolkit/devtools/Console.jsm b/toolkit/devtools/Console.jsm index 8d78dfabd21a..6a90d079ceb5 100644 --- a/toolkit/devtools/Console.jsm +++ b/toolkit/devtools/Console.jsm @@ -24,6 +24,11 @@ this.EXPORTED_SYMBOLS = [ "console" ]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Services", + "resource://gre/modules/Services.jsm"); + +let gTimerRegistry = new Map(); + /** * String utility to ensure that strings are a specified length. Strings * that are too long are truncated to the max length and the last char is @@ -250,7 +255,7 @@ function logProperty(aProp, aValue) { /** * Parse a stack trace, returning an array of stack frame objects, where - * each has file/line/call members + * each has filename/lineNumber/functionName members * * @param {string} aStack * The serialized stack trace @@ -266,35 +271,42 @@ function parseStack(aStack) { let at = line.lastIndexOf("@"); let posn = line.substring(at + 1); trace.push({ - file: posn.split(":")[0], - line: posn.split(":")[1], - call: line.substring(0, at) + filename: posn.split(":")[0], + lineNumber: posn.split(":")[1], + functionName: line.substring(0, at) }); }); return trace; } /** - * parseStack() takes output from an exception from which it creates the an - * array of stack frame objects, this has the same output but using data from - * Components.stack + * Format a frame coming from Components.stack such that it can be used by the + * Browser Console, via console-api-log-event notifications. * - * @param {string} aFrame - * The stack frame from which to begin the walk + * @param {object} aFrame + * The stack frame from which to begin the walk. + * @param {number=0} aMaxDepth + * Maximum stack trace depth. Default is 0 - no depth limit. * @return {object[]} - * Array of { file: "...", line: NNN, call: "..." } objects + * An array of {filename, lineNumber, functionName, language} objects. + * These objects follow the same format as other console-api-log-event + * messages. */ -function getStack(aFrame) { +function getStack(aFrame, aMaxDepth = 0) { if (!aFrame) { aFrame = Components.stack.caller; } let trace = []; while (aFrame) { trace.push({ - file: aFrame.filename, - line: aFrame.lineNumber, - call: aFrame.name + filename: aFrame.filename, + lineNumber: aFrame.lineNumber, + functionName: aFrame.name, + language: aFrame.language, }); + if (aMaxDepth == trace.length) { + break; + } aFrame = aFrame.caller; } return trace; @@ -311,13 +323,52 @@ function getStack(aFrame) { function formatTrace(aTrace) { let reply = ""; aTrace.forEach(function(frame) { - reply += fmt(frame.file, 20, 20, { truncate: "start" }) + " " + - fmt(frame.line, 5, 5) + " " + - fmt(frame.call, 75, 75) + "\n"; + reply += fmt(frame.filename, 20, 20, { truncate: "start" }) + " " + + fmt(frame.lineNumber, 5, 5) + " " + + fmt(frame.functionName, 75, 75) + "\n"; }); return reply; } +/** + * Create a new timer by recording the current time under the specified name. + * + * @param {string} aName + * The name of the timer. + * @param {number} [aTimestamp=Date.now()] + * Optional timestamp that tells when the timer was originally started. + * @return {object} + * The name property holds the timer name and the started property + * holds the time the timer was started. In case of error, it returns + * an object with the single property "error" that contains the key + * for retrieving the localized error message. + */ +function startTimer(aName, aTimestamp) { + let key = aName.toString(); + if (!gTimerRegistry.has(key)) { + gTimerRegistry.set(key, aTimestamp || Date.now()); + } + return { name: aName, started: gTimerRegistry.get(key) }; +} + +/** + * Stop the timer with the specified name and retrieve the elapsed time. + * + * @param {string} aName + * The name of the timer. + * @param {number} [aTimestamp=Date.now()] + * Optional timestamp that tells when the timer was originally stopped. + * @return {object} + * The name property holds the timer name and the duration property + * holds the number of milliseconds since the timer was started. + */ +function stopTimer(aName, aTimestamp) { + let key = aName.toString(); + let duration = (aTimestamp || Date.now()) - gTimerRegistry.get(key); + gTimerRegistry.delete(key); + return { name: aName, duration: duration }; +} + /** * Create a function which will output a concise level of output when used * as a logging function @@ -332,6 +383,8 @@ function formatTrace(aTrace) { function createDumper(aLevel) { return function() { let args = Array.prototype.slice.call(arguments, 0); + let frame = getStack(Components.stack.caller, 1)[0]; + sendConsoleAPIMessage(aLevel, frame, args); let data = args.map(function(arg) { return stringify(arg); }); @@ -354,12 +407,72 @@ function createMultiLineDumper(aLevel) { return function() { dump("console." + aLevel + ": \n"); let args = Array.prototype.slice.call(arguments, 0); + let frame = getStack(Components.stack.caller, 1)[0]; + sendConsoleAPIMessage(aLevel, frame, args); args.forEach(function(arg) { dump(log(arg)); }); }; } +/** + * Send a Console API message. This function will send a console-api-log-event + * notification through the nsIObserverService. + * + * @param {string} aLevel + * Message severity level. This is usually the name of the console method + * that was called. + * @param {object} aFrame + * The youngest stack frame coming from Components.stack, as formatted by + * getStack(). + * @param {array} aArgs + * The arguments given to the console method. + * @param {object} aOptions + * Object properties depend on the console method that was invoked: + * - timer: for time() and timeEnd(). Holds the timer information. + * - groupName: for group(), groupCollapsed() and groupEnd(). + * - stacktrace: for trace(). Holds the array of stack frames as given by + * getStack(). + */ +function sendConsoleAPIMessage(aLevel, aFrame, aArgs, aOptions = {}) +{ + let consoleEvent = { + ID: aFrame.filename, + level: aLevel, + filename: aFrame.filename, + lineNumber: aFrame.lineNumber, + functionName: aFrame.functionName, + timeStamp: Date.now(), + arguments: aArgs, + }; + + consoleEvent.wrappedJSObject = consoleEvent; + + switch (aLevel) { + case "trace": + consoleEvent.stacktrace = aOptions.stacktrace; + break; + case "time": + case "timeEnd": + consoleEvent.timer = aOptions.timer; + break; + case "group": + case "groupCollapsed": + case "groupEnd": + try { + consoleEvent.groupName = Array.prototype.join.call(aArgs, " "); + } + catch (ex) { + Cu.reportError(ex); + Cu.reportError(ex.stack); + return; + } + break; + } + + Services.obs.notifyObservers(consoleEvent, "console-api-log-event", null); +} + /** * This creates a console object that somewhat replicates Firebug's console * object. It currently writes to dump(), but should write to the web @@ -373,13 +486,32 @@ this.console = { error: createMultiLineDumper("error"), trace: function Console_trace() { + let args = Array.prototype.slice.call(arguments, 0); let trace = getStack(Components.stack.caller); - dump(formatTrace(trace) + "\n"); + sendConsoleAPIMessage("trace", trace[0], args, + { stacktrace: trace }); + dump("console.trace:\n" + formatTrace(trace) + "\n"); }, clear: function Console_clear() {}, dir: createMultiLineDumper("dir"), dirxml: createMultiLineDumper("dirxml"), group: createDumper("group"), - groupEnd: createDumper("groupEnd") + groupEnd: createDumper("groupEnd"), + + time: function Console_time() { + let args = Array.prototype.slice.call(arguments, 0); + let frame = getStack(Components.stack.caller, 1)[0]; + let timer = startTimer(args[0]); + sendConsoleAPIMessage("time", frame, args, { timer: timer }); + dump("console.time: '" + timer.name + "' @ " + (new Date()) + "\n"); + }, + + timeEnd: function Console_timeEnd() { + let args = Array.prototype.slice.call(arguments, 0); + let frame = getStack(Components.stack.caller, 1)[0]; + let timer = stopTimer(args[0]); + sendConsoleAPIMessage("timeEnd", frame, args, { timer: timer }); + dump("console.timeEnd: '" + timer.name + "' " + timer.duration + "ms\n"); + }, }; From fd614541960c6090fc6b2adc72f7dda83d6c96d9 Mon Sep 17 00:00:00 2001 From: Panos Astithas Date: Tue, 16 Apr 2013 08:52:55 +0300 Subject: [PATCH 306/438] Bug 861852 - Telemetry data from the remote protocol always appear in the remote buckets; r=rcampbell --- toolkit/devtools/debugger/dbg-client.jsm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolkit/devtools/debugger/dbg-client.jsm b/toolkit/devtools/debugger/dbg-client.jsm index f1c037aa3af8..bd1db6e50a73 100644 --- a/toolkit/devtools/debugger/dbg-client.jsm +++ b/toolkit/devtools/debugger/dbg-client.jsm @@ -245,7 +245,7 @@ DebuggerClient.requester = function DC_requester(aPacketSkeleton, { telemetry, return function (...args) { let histogram, startTime; if (telemetry) { - let transportType = this._transport instanceof LocalDebuggerTransport + let transportType = this._transport.onOutputStreamReady === undefined ? "LOCAL_" : "REMOTE_"; let histogramId = "DEVTOOLS_DEBUGGER_RDP_" @@ -253,7 +253,6 @@ DebuggerClient.requester = function DC_requester(aPacketSkeleton, { telemetry, histogram = Services.telemetry.getHistogramById(histogramId); startTime = +new Date; } - let outgoingPacket = { to: aPacketSkeleton.to || this.actor }; @@ -831,6 +830,7 @@ function TabClient(aClient, aActor) { TabClient.prototype = { get actor() { return this._actor }, + get _transport() { return this._client._transport; }, /** * Detach the client from the tab actor. @@ -885,6 +885,7 @@ ThreadClient.prototype = { get actor() { return this._actor; }, get compat() { return this._client.compat; }, + get _transport() { return this._client._transport; }, _assertPaused: function TC_assertPaused(aCommand) { if (!this.paused) { @@ -1410,6 +1411,7 @@ function GripClient(aClient, aGrip) GripClient.prototype = { get actor() { return this._grip.actor }, + get _transport() { return this._client._transport; }, valid: true, @@ -1500,6 +1502,7 @@ LongStringClient.prototype = { get actor() { return this._grip.actor; }, get length() { return this._grip.length; }, get initial() { return this._grip.initial; }, + get _transport() { return this._client._transport; }, valid: true, @@ -1536,6 +1539,8 @@ function SourceClient(aClient, aForm) { } SourceClient.prototype = { + get _transport() { return this._client._transport; }, + /** * Get a long string grip for this SourceClient's source. */ @@ -1593,6 +1598,7 @@ BreakpointClient.prototype = { _actor: null, get actor() { return this._actor; }, + get _transport() { return this._client._transport; }, /** * Remove the breakpoint from the server. From 0c7a23a850d0f83e43d9f3427aa8525789e3c9e0 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 16 Apr 2013 00:07:00 +0300 Subject: [PATCH 307/438] Bug 772119 - expose source mapped sources over the remote debugging protocol; r=past --- browser/app/profile/firefox.js | 1 + .../devtools/debugger/debugger-controller.js | 4 +- browser/devtools/debugger/test/Makefile.in | 5 + .../debugger/test/binary_search.coffee | 18 + .../devtools/debugger/test/binary_search.html | 12 + .../devtools/debugger/test/binary_search.js | 30 + .../devtools/debugger/test/binary_search.map | 9 + ...rowser_dbg_bug731394_editor-contextmenu.js | 19 +- .../test/browser_dbg_source_maps-01.js | 156 ++++ toolkit/devtools/debugger/dbg-client.jsm | 104 +-- .../debugger/server/dbg-script-actors.js | 678 ++++++++++++------ .../devtools/debugger/server/dbg-server.js | 53 +- .../devtools/debugger/tests/unit/head_dbg.js | 4 +- .../debugger/tests/unit/test_breakpoint-04.js | 4 +- .../debugger/tests/unit/test_dbgactor.js | 1 + .../tests/unit/test_listsources-02.js | 2 +- .../tests/unit/test_listsources-03.js | 52 ++ .../tests/unit/test_profiler_actor.js | 20 +- .../debugger/tests/unit/test_sourcemaps-01.js | 64 ++ .../debugger/tests/unit/test_sourcemaps-02.js | 73 ++ .../debugger/tests/unit/test_sourcemaps-03.js | 149 ++++ .../debugger/tests/unit/testcompatactors.js | 38 +- .../devtools/debugger/tests/unit/xpcshell.ini | 4 + toolkit/devtools/sourcemap/SourceMap.jsm | 476 ++++++++++-- .../devtools/sourcemap/tests/unit/Utils.jsm | 133 +++- .../tests/unit/test_source_map_consumer.js | 111 +++ .../tests/unit/test_source_map_generator.js | 106 ++- .../sourcemap/tests/unit/test_source_node.js | 121 +++- 28 files changed, 2046 insertions(+), 401 deletions(-) create mode 100644 browser/devtools/debugger/test/binary_search.coffee create mode 100644 browser/devtools/debugger/test/binary_search.html create mode 100644 browser/devtools/debugger/test/binary_search.js create mode 100644 browser/devtools/debugger/test/binary_search.map create mode 100644 browser/devtools/debugger/test/browser_dbg_source_maps-01.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_listsources-03.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_sourcemaps-01.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_sourcemaps-02.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_sourcemaps-03.js diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 3dc3ef227516..90dac6abad64 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1060,6 +1060,7 @@ pref("devtools.debugger.remote-host", "localhost"); pref("devtools.debugger.remote-autoconnect", false); pref("devtools.debugger.remote-connection-retries", 3); pref("devtools.debugger.remote-timeout", 20000); +pref("devtools.debugger.source-maps-enabled", false); // The default Debugger UI settings pref("devtools.debugger.ui.win-x", 0); diff --git a/browser/devtools/debugger/debugger-controller.js b/browser/devtools/debugger/debugger-controller.js index fc2f51a50879..9df4b43e1269 100644 --- a/browser/devtools/debugger/debugger-controller.js +++ b/browser/devtools/debugger/debugger-controller.js @@ -253,6 +253,8 @@ let DebuggerController = { if (aCallback) { aCallback(); } + }, { + useSourceMaps: Services.prefs.getBoolPref("devtools.debugger.source-maps-enabled") }); }, @@ -1102,7 +1104,7 @@ SourceScripts.prototype = { */ _onSourcesAdded: function SS__onSourcesAdded(aResponse) { if (aResponse.error) { - Cu.reportError("Error getting sources: " + aResponse.message); + Cu.reportError(new Error("Error getting sources: " + aResponse.message)); return; } diff --git a/browser/devtools/debugger/test/Makefile.in b/browser/devtools/debugger/test/Makefile.in index 7f01762ad840..07eeed6da264 100644 --- a/browser/devtools/debugger/test/Makefile.in +++ b/browser/devtools/debugger/test/Makefile.in @@ -96,6 +96,7 @@ MOCHITEST_BROWSER_TESTS = \ browser_dbg_bfcache.js \ browser_dbg_progress-listener-bug.js \ browser_dbg_chrome-debugging.js \ + browser_dbg_source_maps-01.js \ head.js \ helpers.js \ $(NULL) @@ -127,6 +128,10 @@ MOCHITEST_BROWSER_PAGES = \ test-function-search-01.js \ test-function-search-02.js \ test-function-search-03.js \ + binary_search.html \ + binary_search.coffee \ + binary_search.js \ + binary_search.map \ $(NULL) MOCHITEST_BROWSER_FILES_PARTS = MOCHITEST_BROWSER_TESTS MOCHITEST_BROWSER_PAGES diff --git a/browser/devtools/debugger/test/binary_search.coffee b/browser/devtools/debugger/test/binary_search.coffee new file mode 100644 index 000000000000..e3dacdaaab50 --- /dev/null +++ b/browser/devtools/debugger/test/binary_search.coffee @@ -0,0 +1,18 @@ +# Uses a binary search algorithm to locate a value in the specified array. +window.binary_search = (items, value) -> + + start = 0 + stop = items.length - 1 + pivot = Math.floor (start + stop) / 2 + + while items[pivot] isnt value and start < stop + + # Adjust the search area. + stop = pivot - 1 if value < items[pivot] + start = pivot + 1 if value > items[pivot] + + # Recalculate the pivot. + pivot = Math.floor (stop + start) / 2 + + # Make sure we've found the correct value. + if items[pivot] is value then pivot else -1 \ No newline at end of file diff --git a/browser/devtools/debugger/test/binary_search.html b/browser/devtools/debugger/test/binary_search.html new file mode 100644 index 000000000000..f9615da7c40d --- /dev/null +++ b/browser/devtools/debugger/test/binary_search.html @@ -0,0 +1,12 @@ + + + + + Browser Debugger Source Map Test + + + + + + diff --git a/browser/devtools/debugger/test/binary_search.js b/browser/devtools/debugger/test/binary_search.js new file mode 100644 index 000000000000..ce77903e1b07 --- /dev/null +++ b/browser/devtools/debugger/test/binary_search.js @@ -0,0 +1,30 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + + window.binary_search = function(items, value) { + var pivot, start, stop; + start = 0; + stop = items.length - 1; + pivot = Math.floor((start + stop) / 2); + while (items[pivot] !== value && start < stop) { + if (value < items[pivot]) { + stop = pivot - 1; + } + if (value > items[pivot]) { + start = pivot + 1; + } + pivot = Math.floor((stop + start) / 2); + } + if (items[pivot] === value) { + return pivot; + } else { + return -1; + } + }; + +}).call(this); + +// TODO bug 849069: this should just be "binary_search.map", not a full path. +/* +//@ sourceMappingURL=http://example.com/browser/browser/devtools/debugger/test/binary_search.map +*/ diff --git a/browser/devtools/debugger/test/binary_search.map b/browser/devtools/debugger/test/binary_search.map new file mode 100644 index 000000000000..a86e74783f11 --- /dev/null +++ b/browser/devtools/debugger/test/binary_search.map @@ -0,0 +1,9 @@ +{ + "version": 3, + "file": "binary_search.js", + "sources": [ + "http://example.com/browser/browser/devtools/debugger/test/binary_search.coffee" + ], + "names": [], + "mappings": ";AACA;CAAA;CAAA,CAAA,CAAuB,EAAA,CAAjB,GAAkB,IAAxB;CAEE,OAAA,UAAA;CAAA,EAAQ,CAAR,CAAA;CAAA,EACQ,CAAR,CAAa,CAAL;CADR,EAEQ,CAAR,CAAA;CAEA,EAA0C,CAAR,CAAtB,MAAN;CAGJ,EAA6B,CAAR,CAAA,CAArB;CAAA,EAAQ,CAAR,CAAQ,GAAR;QAAA;CACA,EAA6B,CAAR,CAAA,CAArB;CAAA,EAAQ,EAAR,GAAA;QADA;CAAA,EAIQ,CAAI,CAAZ,CAAA;CAXF,IAIA;CAUA,GAAA,CAAS;CAAT,YAA8B;MAA9B;AAA0C,CAAD,YAAA;MAhBpB;CAAvB,EAAuB;CAAvB" +} \ No newline at end of file diff --git a/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js b/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js index 93ae5ff0e492..fc3b2efb54b4 100644 --- a/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js +++ b/browser/devtools/debugger/test/browser_dbg_bug731394_editor-contextmenu.js @@ -27,19 +27,22 @@ function test() gDebugger = gPane.panelWin; resumed = true; - gDebugger.addEventListener("Debugger:SourceShown", onScriptShown); + gDebugger.addEventListener("Debugger:SourceShown", onSourceShown); - gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() { - framesAdded = true; - executeSoon(startTest); - }); + gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", + onFramesAdded); executeSoon(function() { gDebuggee.firstCall(); }); }); - function onScriptShown(aEvent) { + function onFramesAdded(aEvent) { + framesAdded = true; + executeSoon(startTest); + } + + function onSourceShown(aEvent) { scriptShown = aEvent.detail.url.indexOf("-02.js") != -1; executeSoon(startTest); } @@ -48,8 +51,8 @@ function test() { if (scriptShown && framesAdded && resumed && !testStarted) { testStarted = true; - gDebugger.removeEventListener("Debugger:SourceShown", onScriptShown); - Services.tm.currentThread.dispatch({ run: performTest }, 0); + gDebugger.removeEventListener("Debugger:SourceShown", onSourceShown); + executeSoon(performTest); } } diff --git a/browser/devtools/debugger/test/browser_dbg_source_maps-01.js b/browser/devtools/debugger/test/browser_dbg_source_maps-01.js new file mode 100644 index 000000000000..c8ff8aae95f0 --- /dev/null +++ b/browser/devtools/debugger/test/browser_dbg_source_maps-01.js @@ -0,0 +1,156 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test that we can set breakpoints and step through source mapped coffee + * script. + */ + +const TAB_URL = EXAMPLE_URL + "binary_search.html"; + +var gPane = null; +var gTab = null; +var gDebuggee = null; +var gDebugger = null; + +function test() +{ + let scriptShown = false; + let framesAdded = false; + let resumed = false; + let testStarted = false; + + Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", true); + + debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) { + resumed = true; + gTab = aTab; + gDebuggee = aDebuggee; + gPane = aPane; + gDebugger = gPane.panelWin; + + gDebugger.addEventListener("Debugger:SourceShown", function _onSourceShown(aEvent) { + gDebugger.removeEventListener("Debugger:SourceShown", _onSourceShown); + ok(aEvent.detail.url.indexOf(".coffee") != -1, + "The debugger should show the source mapped coffee script file."); + ok(gDebugger.editor.getText().search(/isnt/) != -1, + "The debugger's editor should have the coffee script source displayed."); + + testSetBreakpoint(); + }); + }); +} + +function testSetBreakpoint() { + let { activeThread } = gDebugger.DebuggerController; + activeThread.interrupt(function (aResponse) { + activeThread.setBreakpoint({ + url: EXAMPLE_URL + "binary_search.coffee", + line: 5 + }, function (aResponse, bpClient) { + ok(!aResponse.error, + "Should be able to set a breakpoint in a coffee script file."); + testSetBreakpointBlankLine(); + }); + }); +} + +function testSetBreakpointBlankLine() { + let { activeThread } = gDebugger.DebuggerController; + activeThread.setBreakpoint({ + url: EXAMPLE_URL + "binary_search.coffee", + line: 3 + }, function (aResponse, bpClient) { + ok(aResponse.actualLocation, + "Because 3 is empty, we should have an actualLocation"); + is(aResponse.actualLocation.url, EXAMPLE_URL + "binary_search.coffee", + "actualLocation.url should be source mapped to the coffee file"); + is(aResponse.actualLocation.line, 2, + "actualLocation.line should be source mapped back to 2"); + testHitBreakpoint(); + }); +} + +function testHitBreakpoint() { + let { activeThread } = gDebugger.DebuggerController; + activeThread.resume(function (aResponse) { + ok(!aResponse.error, "Shouldn't get an error resuming"); + is(aResponse.type, "resumed", "Type should be 'resumed'"); + + activeThread.addOneTimeListener("paused", function (aEvent, aPacket) { + is(aPacket.type, "paused", + "We should now be paused again"); + is(aPacket.why.type, "breakpoint", + "and the reason we should be paused is because we hit a breakpoint"); + + // Check that we stopped at the right place, by making sure that the + // environment is in the state that we expect. + is(aPacket.frame.environment.bindings.variables.start.value, 0, + "'start' is 0"); + is(aPacket.frame.environment.bindings.variables.stop.value.type, "undefined", + "'stop' hasn't been assigned to yet"); + is(aPacket.frame.environment.bindings.variables.pivot.value.type, "undefined", + "'pivot' hasn't been assigned to yet"); + + waitForCaretPos(4, testStepping); + }); + + // This will cause the breakpoint to be hit, and put us back in the paused + // state. + executeSoon(function() { + gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5); + }); + }); +} + +function testStepping() { + let { activeThread } = gDebugger.DebuggerController; + activeThread.stepIn(function (aResponse) { + ok(!aResponse.error, "Shouldn't get an error resuming"); + is(aResponse.type, "resumed", "Type should be 'resumed'"); + + // After stepping, we will pause again, so listen for that. + activeThread.addOneTimeListener("paused", function (aEvent, aPacket) { + + // Check that we stopped at the right place, by making sure that the + // environment is in the state that we expect. + is(aPacket.frame.environment.bindings.variables.start.value, 0, + "'start' is 0"); + is(aPacket.frame.environment.bindings.variables.stop.value, 5, + "'stop' hasn't been assigned to yet"); + is(aPacket.frame.environment.bindings.variables.pivot.value.type, "undefined", + "'pivot' hasn't been assigned to yet"); + + waitForCaretPos(5, closeDebuggerAndFinish); + }); + }); +} + +function waitForCaretPos(number, callback) +{ + // Poll every few milliseconds until the source editor line is active. + let count = 0; + let intervalID = window.setInterval(function() { + info("count: " + count + " "); + if (++count > 50) { + ok(false, "Timed out while polling for the line."); + window.clearInterval(intervalID); + return closeDebuggerAndFinish(); + } + if (gDebugger.DebuggerView.editor.getCaretPosition().line != number) { + return; + } + // We got the source editor at the expected line, it's safe to callback. + window.clearInterval(intervalID); + callback(); + }, 100); +} + +registerCleanupFunction(function() { + Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", false); + removeTab(gTab); + gPane = null; + gTab = null; + gDebuggee = null; + gDebugger = null; +}); diff --git a/toolkit/devtools/debugger/dbg-client.jsm b/toolkit/devtools/debugger/dbg-client.jsm index bd1db6e50a73..03f47948351d 100644 --- a/toolkit/devtools/debugger/dbg-client.jsm +++ b/toolkit/devtools/debugger/dbg-client.jsm @@ -412,7 +412,10 @@ DebuggerClient.prototype = { */ attachTab: function DC_attachTab(aTabActor, aOnResponse) { let self = this; - let packet = { to: aTabActor, type: "attach" }; + let packet = { + to: aTabActor, + type: "attach" + }; this.request(packet, function(aResponse) { let tabClient; if (!aResponse.error) { @@ -462,10 +465,17 @@ DebuggerClient.prototype = { * @param function aOnResponse * Called with the response packet and a ThreadClient * (which will be undefined on error). + * @param object aOptions + * Configuration options. + * - useSourceMaps: whether to use source maps or not. */ - attachThread: function DC_attachThread(aThreadActor, aOnResponse) { + attachThread: function DC_attachThread(aThreadActor, aOnResponse, aOptions={}) { let self = this; - let packet = { to: aThreadActor, type: "attach" }; + let packet = { + to: aThreadActor, + type: "attach", + options: aOptions + }; this.request(packet, function(aResponse) { if (!aResponse.error) { var threadClient = new ThreadClient(self, aThreadActor); @@ -522,7 +532,7 @@ DebuggerClient.prototype = { */ _sendRequests: function DC_sendRequests() { let self = this; - this._pendingRequests = this._pendingRequests.filter(function(request) { + this._pendingRequests = this._pendingRequests.filter(function (request) { if (request.to in self._activeRequests) { return true; } @@ -549,7 +559,7 @@ DebuggerClient.prototype = { ? aPacket : this.compat.onPacket(aPacket); - resolve(packet).then(function (aPacket) { + resolve(packet).then((aPacket) => { if (!this._connected) { // Hello packet. this._connected = true; @@ -559,55 +569,53 @@ DebuggerClient.prototype = { return; } - try { - if (!aPacket.from) { - let msg = "Server did not specify an actor, dropping packet: " + - JSON.stringify(aPacket); - Cu.reportError(msg); - dumpn(msg); - return; - } + if (!aPacket.from) { + let msg = "Server did not specify an actor, dropping packet: " + + JSON.stringify(aPacket); + Cu.reportError(msg); + dumpn(msg); + return; + } - let onResponse; - // Don't count unsolicited notifications or pauses as responses. - if (aPacket.from in this._activeRequests && - !(aPacket.type in UnsolicitedNotifications) && - !(aPacket.type == ThreadStateTypes.paused && - aPacket.why.type in UnsolicitedPauses)) { - onResponse = this._activeRequests[aPacket.from].onResponse; - delete this._activeRequests[aPacket.from]; - } + let onResponse; + // Don't count unsolicited notifications or pauses as responses. + if (aPacket.from in this._activeRequests && + !(aPacket.type in UnsolicitedNotifications) && + !(aPacket.type == ThreadStateTypes.paused && + aPacket.why.type in UnsolicitedPauses)) { + onResponse = this._activeRequests[aPacket.from].onResponse; + delete this._activeRequests[aPacket.from]; + } - // Packets that indicate thread state changes get special treatment. - if (aPacket.type in ThreadStateTypes && - aPacket.from in this._threadClients) { - this._threadClients[aPacket.from]._onThreadState(aPacket); - } - // On navigation the server resumes, so the client must resume as well. - // We achieve that by generating a fake resumption packet that triggers - // the client's thread state change listeners. - if (this.activeThread && - aPacket.type == UnsolicitedNotifications.tabNavigated && - aPacket.from in this._tabClients) { - let resumption = { from: this.activeThread._actor, type: "resumed" }; - this.activeThread._onThreadState(resumption); - } - // Only try to notify listeners on events, not responses to requests - // that lack a packet type. - if (aPacket.type) { - this.notify(aPacket.type, aPacket); - } + // Packets that indicate thread state changes get special treatment. + if (aPacket.type in ThreadStateTypes && + aPacket.from in this._threadClients) { + this._threadClients[aPacket.from]._onThreadState(aPacket); + } + // On navigation the server resumes, so the client must resume as well. + // We achieve that by generating a fake resumption packet that triggers + // the client's thread state change listeners. + if (this.activeThread && + aPacket.type == UnsolicitedNotifications.tabNavigated && + aPacket.from in this._tabClients) { + let resumption = { from: this.activeThread._actor, type: "resumed" }; + this.activeThread._onThreadState(resumption); + } + // Only try to notify listeners on events, not responses to requests + // that lack a packet type. + if (aPacket.type) { + this.notify(aPacket.type, aPacket); + } - if (onResponse) { - onResponse(aPacket); - } - } catch(ex) { - dumpn("Error handling response: " + ex + " - stack:\n" + ex.stack); - Cu.reportError(ex + "\n" + ex.stack); + if (onResponse) { + onResponse(aPacket); } this._sendRequests(); - }.bind(this)); + }, function (ex) { + dumpn("Error handling response: " + ex + " - stack:\n" + ex.stack); + Cu.reportError(ex.message + "\n" + ex.stack); + }); }, /** diff --git a/toolkit/devtools/debugger/server/dbg-script-actors.js b/toolkit/devtools/debugger/server/dbg-script-actors.js index a5875e1e3a8b..d7fd8a061a9c 100644 --- a/toolkit/devtools/debugger/server/dbg-script-actors.js +++ b/toolkit/devtools/debugger/server/dbg-script-actors.js @@ -30,7 +30,6 @@ function ThreadActor(aHooks, aGlobal) this._frameActors = []; this._environmentActors = []; this._hooks = aHooks; - this._sources = {}; this.global = aGlobal; // A cache of prototype chains for objects that have received a @@ -46,6 +45,11 @@ function ThreadActor(aHooks, aGlobal) this.findGlobals = this.globalManager.findGlobals.bind(this); this.onNewGlobal = this.globalManager.onNewGlobal.bind(this); + this.onNewSource = this.onNewSource.bind(this); + + this._options = { + useSourceMaps: false + }; } /** @@ -73,13 +77,21 @@ ThreadActor.prototype = { return this._threadLifetimePool; }, + get sources() { + if (!this._sources) { + this._sources = new ThreadSources(this, this._options.useSourceMaps, + this._allowSource, this.onNewSource); + } + return this._sources; + }, + clearDebuggees: function TA_clearDebuggees() { if (this.dbg) { this.dbg.removeAllDebuggees(); } this.conn.removeActorPool(this._threadLifetimePool || undefined); this._threadLifetimePool = null; - this._sources = {}; + this._sources = null; }, /** @@ -202,6 +214,8 @@ ThreadActor.prototype = { this._state = "attached"; + update(this._options, aRequest.options || {}); + if (!this.dbg) { this._initDebugger(); } @@ -226,15 +240,17 @@ ThreadActor.prototype = { // We already sent a response to this request, don't send one // now. return null; - } catch(e) { - Cu.reportError(e); + } catch (e) { + reportError(e); return { error: "notAttached", message: e.toString() }; } }, onDetach: function TA_onDetach(aRequest) { this.disconnect(); - return { type: "detached" }; + return { + type: "detached" + }; }, /** @@ -245,15 +261,19 @@ ThreadActor.prototype = { * The newest debuggee frame in the stack. * @param object aReason * An object with a 'type' property containing the reason for the pause. + * @param function onPacket + * Hook to modify the packet before it is sent. Feel free to return a + * promise. */ - _pauseAndRespond: function TA__pauseAndRespond(aFrame, aReason) { + _pauseAndRespond: function TA__pauseAndRespond(aFrame, aReason, + onPacket=function (k) k) { try { let packet = this._paused(aFrame); if (!packet) { return undefined; } packet.why = aReason; - this.conn.send(packet); + resolve(onPacket(packet)).then(this.conn.send.bind(this.conn)); return this._nest(); } catch(e) { let msg = "Got an exception during TA__pauseAndRespond: " + e + @@ -268,6 +288,14 @@ ThreadActor.prototype = { * Handle a protocol request to resume execution of the debuggee. */ onResume: function TA_onResume(aRequest) { + if (this._state !== "paused") { + return { + error: "wrongState", + message: "Can't resume when debuggee isn't paused. Current state is '" + + this._state + "'" + }; + } + // In case of multiple nested event loops (due to multiple debuggers open in // different tabs or multiple debugger clients connected to the same tab) // only allow resumption in a LIFO order. @@ -439,14 +467,23 @@ ThreadActor.prototype = { // Return request.count frames, or all remaining // frames if count is not defined. let frames = []; - for (; frame && (!count || i < (start + count)); i++) { + let promises = []; + for (; frame && (!count || i < (start + count)); i++, frame=frame.older) { let form = this._createFrameActor(frame).form(); form.depth = i; frames.push(form); - frame = frame.older; + + let promise = this.sources.getOriginalLocation(form.where.url, + form.where.line) + .then(function (aOrigLocation) { + form.where = aOrigLocation; + }); + promises.push(promise); } - return { frames: frames }; + return resolveAll(promises).then(function () { + return { frames: frames }; + }); }, onReleaseMany: function TA_onReleaseMany(aRequest) { @@ -479,25 +516,58 @@ ThreadActor.prototype = { message: "Breakpoints can only be set while the debuggee is paused."}; } - let location = aRequest.location; - let line = location.line; - if (this.dbg.findScripts({ url: location.url }).length == 0 || line < 0) { - return { error: "noScript" }; - } + // XXX: `originalColumn` is never used. See bug 827639. + let { url: originalSource, + line: originalLine, + column: originalColumn } = aRequest.location; - // Add the breakpoint to the store for later reuse, in case it belongs to a - // script that hasn't appeared yet. - if (!this._breakpointStore[location.url]) { - this._breakpointStore[location.url] = []; - } - let scriptBreakpoints = this._breakpointStore[location.url]; - scriptBreakpoints[line] = { - url: location.url, - line: line, - column: location.column - }; + let locationPromise = this.sources.getGeneratedLocation(originalSource, + originalLine) + return locationPromise.then((aLocation) => { + let line = aLocation.line; + if (this.dbg.findScripts({ url: aLocation.url }).length == 0 || line < 0) { + return { error: "noScript" }; + } - return this._setBreakpoint(location); + // Add the breakpoint to the store for later reuse, in case it belongs to a + // script that hasn't appeared yet. + if (!this._breakpointStore[aLocation.url]) { + this._breakpointStore[aLocation.url] = []; + } + let scriptBreakpoints = this._breakpointStore[aLocation.url]; + scriptBreakpoints[line] = { + url: aLocation.url, + line: line, + column: aLocation.column + }; + + let response = this._setBreakpoint(aLocation); + // If the original location of our generated location is different from + // the original location we attempted to set the breakpoint on, we will + // need to know so that we can set actualLocation on the response. + let originalLocation = this.sources.getOriginalLocation(aLocation.url, + aLocation.line); + + return resolveAll([response, originalLocation]) + .then(([aResponse, {url, line}]) => { + if (aResponse.actualLocation) { + let actualOrigLocation = this.sources.getOriginalLocation( + aResponse.actualLocation.url, aResponse.actualLocation.line); + return actualOrigLocation.then(function ({ url, line }) { + if (url !== originalSource || line !== originalLine) { + aResponse.actualLocation = { url: url, line: line }; + } + return aResponse; + }); + } + + if (url !== originalSource || line !== originalLine) { + aResponse.actualLocation = { url: url, line: line }; + } + + return aResponse; + }); + }); }, /** @@ -608,17 +678,16 @@ ThreadActor.prototype = { * Get the script and source lists from the debugger. */ _discoverScriptsAndSources: function TA__discoverScriptsAndSources() { - for (let s of this.dbg.findScripts()) { - this._addScript(s); - } + return resolveAll([this._addScript(s) + for (s of this.dbg.findScripts())]); }, onSources: function TA_onSources(aRequest) { - this._discoverScriptsAndSources(); - let urls = Object.getOwnPropertyNames(this._sources); - return { - sources: [this._getSource(url).form() for (url of urls)] - }; + return this._discoverScriptsAndSources().then(() => { + return { + sources: [s.form() for (s of this.sources.iter())] + }; + }); }, /** @@ -655,8 +724,8 @@ ThreadActor.prototype = { // We already sent a response to this request, don't send one // now. return null; - } catch(e) { - Cu.reportError(e); + } catch (e) { + reportError(e); return { error: "notInterrupted", message: e.toString() }; } }, @@ -1029,26 +1098,6 @@ ThreadActor.prototype = { return aString.length >= DebuggerServer.LONG_STRING_LENGTH; }, - /** - * Create a source grip for the given script. - */ - sourceGrip: function TA_sourceGrip(aScript) { - // TODO: Once we have Debugger.Source, this should be replaced with a - // weakmap mapping Debugger.Source instances to SourceActor instances. - if (!this.threadLifetimePool.sourceActors) { - this.threadLifetimePool.sourceActors = {}; - } - - if (this.threadLifetimePool.sourceActors[aScript.url]) { - return this.threadLifetimePool.sourceActors[aScript.url].grip(); - } - - let actor = new SourceActor(aScript.url, this); - this.threadLifetimePool.addActor(actor); - this.threadLifetimePool.sourceActors[aScript.url] = actor; - return actor.form(); - }, - // JS Debugger API hooks. /** @@ -1114,6 +1163,14 @@ ThreadActor.prototype = { this._addScript(aScript); }, + onNewSource: function TA_onNewSource(aSource) { + this.conn.send({ + from: this.actorID, + type: "newSource", + source: aSource.form() + }); + }, + /** * Check if scripts from the provided source URL are allowed to be stored in * the cache. @@ -1122,7 +1179,7 @@ ThreadActor.prototype = { * The url of the script's source that will be stored. * @returns true, if the script can be added, false otherwise. */ - _allowSource: function TA__allowScript(aSourceUrl) { + _allowSource: function TA__allowSource(aSourceUrl) { // Ignore anything we don't have a URL for (eval scripts, for example). if (!aSourceUrl) return false; @@ -1146,28 +1203,30 @@ ThreadActor.prototype = { */ _addScript: function TA__addScript(aScript) { if (!this._allowSource(aScript.url)) { - return false; + return resolve(false); } // TODO bug 637572: we should be dealing with sources directly, not // inferring them through scripts. - this._addSource(aScript.url); + return this.sources.sourcesForScript(aScript).then(() => { - // Set any stored breakpoints. - let existing = this._breakpointStore[aScript.url]; - if (existing) { - let endLine = aScript.startLine + aScript.lineCount - 1; - // Iterate over the lines backwards, so that sliding breakpoints don't - // affect the loop. - for (let line = existing.length - 1; line >= 0; line--) { - let bp = existing[line]; - // Limit search to the line numbers contained in the new script. - if (bp && line >= aScript.startLine && line <= endLine) { - this._setBreakpoint(bp); + // Set any stored breakpoints. + let existing = this._breakpointStore[aScript.url]; + if (existing) { + let endLine = aScript.startLine + aScript.lineCount - 1; + // Iterate over the lines backwards, so that sliding breakpoints don't + // affect the loop. + for (let line = existing.length - 1; line >= 0; line--) { + let bp = existing[line]; + // Limit search to the line numbers contained in the new script. + if (bp && line >= aScript.startLine && line <= endLine) { + this._setBreakpoint(bp); + } } } - } - return true; + + return true; + }); }, /** @@ -1215,48 +1274,6 @@ ThreadActor.prototype = { return retval; }, - /** - * Add a source to the current set of sources. - * - * Right now this takes an url, but in the future it should - * take a Debugger.Source. - * - * @param string the source URL. - * @returns a SourceActor representing the source. - */ - _addSource: function TA__addSource(aURL) { - if (!this._allowSource(aURL)) { - return false; - } - - if (aURL in this._sources) { - return true; - } - - let actor = new SourceActor(aURL, this); - this.threadLifetimePool.addActor(actor); - this._sources[aURL] = actor; - - this.conn.send({ - from: this.actorID, - type: "newSource", - source: actor.form() - }); - - return true; - }, - - /** - * Get the source actor for the given URL. - */ - _getSource: function TA__getSource(aUrl) { - let source = this._sources[aUrl]; - if (!source) { - throw new Error("No source for '" + aUrl + "'"); - } - return source; - }, - }; ThreadActor.prototype.requestTypes = { @@ -1340,7 +1357,7 @@ PauseScopedActor.prototype = { error: "wrongState", message: this.constructor.name + " actors can only be accessed while the thread is paused." - } + }; } }; @@ -1362,7 +1379,8 @@ SourceActor.prototype = { constructor: SourceActor, actorPrefix: "source", - get threadActor() { return this._threadActor; }, + get threadActor() this._threadActor, + get url() this._url, form: function SA_form() { return { @@ -1382,10 +1400,9 @@ SourceActor.prototype = { * Handler for the "source" packet. */ onSource: function SA_onSource(aRequest) { - return this - ._loadSource() + return fetch(this._url) .then(function(aSource) { - return this._threadActor.createValueGrip( + return this.threadActor.createValueGrip( aSource, this.threadActor.threadLifetimePool); }.bind(this)) .then(function (aSourceGrip) { @@ -1394,121 +1411,17 @@ SourceActor.prototype = { source: aSourceGrip }; }.bind(this), function (aError) { + let msg = "Got an exception during SA_onSource: " + aError + + "\n" + aError.stack; + Cu.reportError(msg); + dumpn(msg); return { "from": this.actorID, "error": "loadSourceError", "message": "Could not load the source for " + this._url + "." }; }.bind(this)); - }, - - /** - * Convert a given string, encoded in a given character set, to unicode. - * @param string aString - * A string. - * @param string aCharset - * A character set. - * @return string - * A unicode string. - */ - _convertToUnicode: function SS__convertToUnicode(aString, aCharset) { - // Decoding primitives. - let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] - .createInstance(Ci.nsIScriptableUnicodeConverter); - - try { - converter.charset = aCharset || "UTF-8"; - return converter.ConvertToUnicode(aString); - } catch(e) { - return aString; - } - }, - - /** - * Performs a request to load the desired URL and returns a promise. - * - * @param aURL String - * The URL we will request. - * @returns Promise - * - * XXX: It may be better to use nsITraceableChannel to get to the sources - * without relying on caching when we can (not for eval, etc.): - * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/ - */ - _loadSource: function SA__loadSource() { - let deferred = defer(); - let scheme; - let url = this._url.split(" -> ").pop(); - - try { - scheme = Services.io.extractScheme(url); - } catch (e) { - // In the xpcshell tests, the script url is the absolute path of the test - // file, which will make a malformed URI error be thrown. Add the file - // scheme prefix ourselves. - url = "file://" + url; - scheme = Services.io.extractScheme(url); - } - - switch (scheme) { - case "file": - case "chrome": - case "resource": - try { - NetUtil.asyncFetch(url, function onFetch(aStream, aStatus) { - if (!Components.isSuccessCode(aStatus)) { - deferred.reject(new Error("Request failed")); - return; - } - - let source = NetUtil.readInputStreamToString(aStream, aStream.available()); - deferred.resolve(this._convertToUnicode(source)); - aStream.close(); - }.bind(this)); - } catch (ex) { - deferred.reject(new Error("Request failed")); - } - break; - - default: - let channel; - try { - channel = Services.io.newChannel(url, null, null); - } catch (e if e.name == "NS_ERROR_UNKNOWN_PROTOCOL") { - // On Windows xpcshell tests, c:/foo/bar can pass as a valid URL, but - // newChannel won't be able to handle it. - url = "file:///" + url; - channel = Services.io.newChannel(url, null, null); - } - let chunks = []; - let streamListener = { - onStartRequest: function(aRequest, aContext, aStatusCode) { - if (!Components.isSuccessCode(aStatusCode)) { - deferred.reject("Request failed"); - } - }, - onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) { - chunks.push(NetUtil.readInputStreamToString(aStream, aCount)); - }, - onStopRequest: function(aRequest, aContext, aStatusCode) { - if (!Components.isSuccessCode(aStatusCode)) { - deferred.reject("Request failed"); - return; - } - - deferred.resolve(this._convertToUnicode(chunks.join(""), - channel.contentCharset)); - }.bind(this) - }; - - channel.loadFlags = channel.LOAD_FROM_CACHE; - channel.asyncOpen(streamListener, null); - break; - } - - return deferred.promise; } - }; SourceActor.prototype.requestTypes = { @@ -2095,7 +2008,14 @@ BreakpointActor.prototype = { hit: function BA_hit(aFrame) { // TODO: add the rest of the breakpoints on that line (bug 676602). let reason = { type: "breakpoint", actors: [ this.actorID ] }; - return this.threadActor._pauseAndRespond(aFrame, reason); + return this.threadActor._pauseAndRespond(aFrame, reason, (aPacket) => { + let { url, line } = aPacket.frame.where; + return this.threadActor.sources.getOriginalLocation(url, line) + .then(function (aOrigPosition) { + aPacket.frame.where = aOrigPosition; + return aPacket; + }); + }); }, /** @@ -2417,6 +2337,183 @@ update(ChromeDebuggerActor.prototype, { }); +/** + * Manages the sources for a thread. Handles source maps, locations in the + * sources, etc for ThreadActors. + */ +function ThreadSources(aThreadActor, aUseSourceMaps, + aAllowPredicate, aOnNewSource) { + this._thread = aThreadActor; + this._useSourceMaps = aUseSourceMaps; + this._allow = aAllowPredicate; + this._onNewSource = aOnNewSource; + + // source map URL --> promise of SourceMapConsumer + this._sourceMaps = Object.create(null); + // generated source url --> promise of SourceMapConsumer + this._sourceMapsByGeneratedSource = Object.create(null); + // original source url --> promise of SourceMapConsumer + this._sourceMapsByOriginalSource = Object.create(null); + // source url --> SourceActor + this._sourceActors = Object.create(null); + // original url --> generated url + this._generatedUrlsByOriginalUrl = Object.create(null); +} + +ThreadSources.prototype = { + /** + * Add a source to the current set of sources. + * + * Right now this takes a URL, but in the future it should + * take a Debugger.Source. See bug 637572. + * + * @param string the source URL. + * @returns a SourceActor representing the source or null. + */ + source: function TS_source(aURL) { + if (!this._allow(aURL)) { + return null; + } + + if (aURL in this._sourceActors) { + return this._sourceActors[aURL]; + } + + let actor = new SourceActor(aURL, this._thread); + this._thread.threadLifetimePool.addActor(actor); + this._sourceActors[aURL] = actor; + try { + this._onNewSource(actor); + } catch (e) { + reportError(e); + } + return actor; + }, + + /** + * Add all of the sources associated with the given script. + */ + sourcesForScript: function TS_sourcesForScript(aScript) { + if (!this._useSourceMaps || !aScript.sourceMapURL) { + return resolve([this.source(aScript.url)].filter(isNotNull)); + } + + return this.sourceMap(aScript) + .then((aSourceMap) => { + return [ + this.source(s) for (s of aSourceMap.sources) + ]; + }, (e) => { + reportError(e); + delete this._sourceMaps[aScript.sourceMapURL]; + delete this._sourceMapsByGeneratedSource[aScript.url]; + return [this.source(aScript.url)]; + }) + .then(function (aSources) { + return aSources.filter(isNotNull); + }); + }, + + /** + * Add the source map for the given script. + */ + sourceMap: function TS_sourceMap(aScript) { + if (aScript.url in this._sourceMapsByGeneratedSource) { + return this._sourceMapsByGeneratedSource[aScript.url]; + } + dbg_assert(aScript.sourceMapURL); + let map = this._fetchSourceMap(aScript.sourceMapURL) + .then((aSourceMap) => { + for (let s of aSourceMap.sources) { + this._generatedUrlsByOriginalUrl[s] = aScript.url; + this._sourceMapsByOriginalSource[s] = resolve(aSourceMap); + } + return aSourceMap; + }); + this._sourceMapsByGeneratedSource[aScript.url] = map; + return map; + }, + + /** + * Fetch the source map located at the given url. + */ + _fetchSourceMap: function TS__featchSourceMap(aSourceMapURL) { + if (aSourceMapURL in this._sourceMaps) { + return this._sourceMaps[aSourceMapURL]; + } else { + let promise = fetch(aSourceMapURL).then(function (rawSourceMap) { + return new SourceMapConsumer(rawSourceMap); + }); + this._sourceMaps[aSourceMapURL] = promise; + return promise; + } + }, + + /** + * Returns a promise for the location in the original source if the source is + * source mapped, otherwise a promise of the same location. + * + * TODO bug 637572: take/return a column + */ + getOriginalLocation: function TS_getOriginalLocation(aSourceUrl, aLine) { + if (aSourceUrl in this._sourceMapsByGeneratedSource) { + return this._sourceMapsByGeneratedSource[aSourceUrl] + .then(function (aSourceMap) { + let { source, line } = aSourceMap.originalPositionFor({ + source: aSourceUrl, + line: aLine, + column: Infinity + }); + return { + url: source, + line: line + }; + }); + } + + // No source map + return resolve({ + url: aSourceUrl, + line: aLine + }); + }, + + /** + * Returns a promise of the location in the generated source corresponding to + * the original source and line given. + * + * TODO bug 637572: take/return a column + */ + getGeneratedLocation: function TS_getGeneratedLocation(aSourceUrl, aLine) { + if (aSourceUrl in this._sourceMapsByOriginalSource) { + return this._sourceMapsByOriginalSource[aSourceUrl] + .then((aSourceMap) => { + let { line } = aSourceMap.generatedPositionFor({ + source: aSourceUrl, + line: aLine, + column: Infinity + }); + return { + url: this._generatedUrlsByOriginalUrl[aSourceUrl], + line: line + }; + }); + } + + // No source map + return resolve({ + url: aSourceUrl, + line: aLine + }); + }, + + iter: function TS_iter() { + for (let url in this._sourceActors) { + yield this._sourceActors[url]; + } + } +}; + // Utility functions. /** @@ -2437,3 +2534,126 @@ function update(aTarget, aNewAttrs) { } } } + +/** + * Returns true if its argument is not null. + */ +function isNotNull(aThing) { + return aThing !== null; +} + +/** + * Performs a request to load the desired URL and returns a promise. + * + * @param aURL String + * The URL we will request. + * @returns Promise + * + * XXX: It may be better to use nsITraceableChannel to get to the sources + * without relying on caching when we can (not for eval, etc.): + * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/ + */ +function fetch(aURL) { + let deferred = defer(); + let scheme; + let url = aURL.split(" -> ").pop(); + let charset; + + try { + scheme = Services.io.extractScheme(url); + } catch (e) { + // In the xpcshell tests, the script url is the absolute path of the test + // file, which will make a malformed URI error be thrown. Add the file + // scheme prefix ourselves. + url = "file://" + url; + scheme = Services.io.extractScheme(url); + } + + switch (scheme) { + case "file": + case "chrome": + case "resource": + try { + NetUtil.asyncFetch(url, function onFetch(aStream, aStatus) { + if (!Components.isSuccessCode(aStatus)) { + deferred.reject("Request failed: " + url); + return; + } + + let source = NetUtil.readInputStreamToString(aStream, aStream.available()); + deferred.resolve(source); + aStream.close(); + }); + } catch (ex) { + deferred.reject("Request failed: " + url); + } + break; + + default: + let channel; + try { + channel = Services.io.newChannel(url, null, null); + } catch (e if e.name == "NS_ERROR_UNKNOWN_PROTOCOL") { + // On Windows xpcshell tests, c:/foo/bar can pass as a valid URL, but + // newChannel won't be able to handle it. + url = "file:///" + url; + channel = Services.io.newChannel(url, null, null); + } + let chunks = []; + let streamListener = { + onStartRequest: function(aRequest, aContext, aStatusCode) { + if (!Components.isSuccessCode(aStatusCode)) { + deferred.reject("Request failed: " + url); + } + }, + onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) { + chunks.push(NetUtil.readInputStreamToString(aStream, aCount)); + }, + onStopRequest: function(aRequest, aContext, aStatusCode) { + if (!Components.isSuccessCode(aStatusCode)) { + deferred.reject("Request failed: " + url); + return; + } + + charset = channel.contentCharset; + deferred.resolve(chunks.join("")); + } + }; + + channel.loadFlags = channel.LOAD_FROM_CACHE; + channel.asyncOpen(streamListener, null); + break; + } + + return deferred.promise.then(function (source) { + return convertToUnicode(source, charset); + }); +} + +/** + * Convert a given string, encoded in a given character set, to unicode. + * + * @param string aString + * A string. + * @param string aCharset + * A character set. + */ +function convertToUnicode(aString, aCharset=null) { + // Decoding primitives. + let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] + .createInstance(Ci.nsIScriptableUnicodeConverter); + try { + converter.charset = aCharset || "UTF-8"; + return converter.ConvertToUnicode(aString); + } catch(e) { + return aString; + } +} + +/** + * Report the given error in the error console and to stdout. + */ +function reportError(aError) { + Cu.reportError(aError); + dumpn(aError.message + ":\n" + aError.stack); +} diff --git a/toolkit/devtools/debugger/server/dbg-server.js b/toolkit/devtools/debugger/server/dbg-server.js index d7a89b8202a4..74c3fd1500eb 100644 --- a/toolkit/devtools/debugger/server/dbg-server.js +++ b/toolkit/devtools/debugger/server/dbg-server.js @@ -26,6 +26,12 @@ addDebuggerToGlobal(this); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); const { defer, resolve, reject } = Promise; +let promisedArray = Promise.promised(Array); +function resolveAll(aPromises) { + return promisedArray.apply(null, aPromises); +}; + +Cu.import("resource://gre/modules/devtools/SourceMap.jsm"); function dumpn(str) { if (wantLogging) { @@ -600,6 +606,17 @@ DebuggerServerConnection.prototype = { return null; }, + _unknownError: function DSC__unknownError(aPrefix, aError) { + let errorString = safeErrorString(aError); + errorString += "\n" + aError.stack; + Cu.reportError(errorString); + dumpn(errorString); + return { + error: "unknownError", + message: (aPrefix + "': " + errorString) + }; + }, + // Transport hooks. /** @@ -622,12 +639,9 @@ DebuggerServerConnection.prototype = { try { instance = new actor(); } catch (e) { - Cu.reportError(e); - this.transport.send({ - error: "unknownError", - message: ("error occurred while creating actor '" + actor.name + - "': " + safeErrorString(e)) - }); + this.transport.send(this._unknownError( + "Error occurred while creating actor '" + actor.name, + e)); } instance.parentID = actor.parentID; // We want the newly-constructed actor to completely replace the factory @@ -639,16 +653,14 @@ DebuggerServerConnection.prototype = { } var ret = null; - // Dispatch the request to the actor. if (actor.requestTypes && actor.requestTypes[aPacket.type]) { try { ret = actor.requestTypes[aPacket.type].bind(actor)(aPacket); } catch(e) { - Cu.reportError(e); - ret = { error: "unknownError", - message: ("error occurred while processing '" + aPacket.type + - "' request: " + safeErrorString(e)) }; + this.transport.send(this._unknownError( + "error occurred while processing '" + aPacket.type, + e)); } } else { ret = { error: "unrecognizedPacketType", @@ -663,12 +675,19 @@ DebuggerServerConnection.prototype = { return; } - resolve(ret).then(function(returnPacket) { - if (!returnPacket.from) { - returnPacket.from = aPacket.to; - } - this.transport.send(returnPacket); - }.bind(this)); + resolve(ret) + .then(null, (e) => { + return this._unknownError( + "error occurred while processing '" + aPacket.type, + e); + }) + .then(function (aResponse) { + if (!aResponse.from) { + aResponse.from = aPacket.to; + } + return aResponse; + }) + .then(this.transport.send.bind(this.transport)); }, /** diff --git a/toolkit/devtools/debugger/tests/unit/head_dbg.js b/toolkit/devtools/debugger/tests/unit/head_dbg.js index 1e13cf8b8168..525ae7e46552 100644 --- a/toolkit/devtools/debugger/tests/unit/head_dbg.js +++ b/toolkit/devtools/debugger/tests/unit/head_dbg.js @@ -111,7 +111,7 @@ function getTestGlobalContext(aClient, aName, aCallback) { function attachTestGlobalClient(aClient, aName, aCallback) { getTestGlobalContext(aClient, aName, function(aContext) { - aClient.attachThread(aContext.actor, aCallback); + aClient.attachThread(aContext.actor, aCallback, { useSourceMaps: true }); }); } @@ -147,7 +147,7 @@ function attachTestTabAndResume(aClient, aName, aCallback) { aThreadClient.resume(function (aResponse) { aCallback(aResponse, aTabClient, aThreadClient); }); - }); + }, { useSourceMaps: true }); }); } diff --git a/toolkit/devtools/debugger/tests/unit/test_breakpoint-04.js b/toolkit/devtools/debugger/tests/unit/test_breakpoint-04.js index 6c91aa956ef7..c83c26c445aa 100644 --- a/toolkit/devtools/debugger/tests/unit/test_breakpoint-04.js +++ b/toolkit/devtools/debugger/tests/unit/test_breakpoint-04.js @@ -61,8 +61,8 @@ function test_child_breakpoint() gDebuggee.eval("var line0 = Error().lineNumber;\n" + "function foo() {\n" + // line0 + 1 - " this.a = 1;\n" + // line0 + 2 - " this.b = 2;\n" + // line0 + 3 + " this.a = 1;\n" + // line0 + 2 + " this.b = 2;\n" + // line0 + 3 "}\n" + // line0 + 4 "debugger;\n" + // line0 + 5 "foo();\n"); // line0 + 6 diff --git a/toolkit/devtools/debugger/tests/unit/test_dbgactor.js b/toolkit/devtools/debugger/tests/unit/test_dbgactor.js index 9802638048e2..131acda9fb23 100644 --- a/toolkit/devtools/debugger/tests/unit/test_dbgactor.js +++ b/toolkit/devtools/debugger/tests/unit/test_dbgactor.js @@ -38,6 +38,7 @@ function run_test() function test_attach(aContext) { gClient.request({ to: aContext.actor, type: "attach" }, function(aResponse) { + do_check_true(!aResponse.error); do_check_eq(aResponse.type, "paused"); // Resume the thread and test the debugger statement. diff --git a/toolkit/devtools/debugger/tests/unit/test_listsources-02.js b/toolkit/devtools/debugger/tests/unit/test_listsources-02.js index 044f5eaba267..91eabf3df6bb 100644 --- a/toolkit/devtools/debugger/tests/unit/test_listsources-02.js +++ b/toolkit/devtools/debugger/tests/unit/test_listsources-02.js @@ -47,6 +47,6 @@ function test_listing_zero_sources() "Should only send one sources request at most, even though we" + " might have had to send one to determine feature support."); - finishClient(gClient); + finishClient(gClient); }); } diff --git a/toolkit/devtools/debugger/tests/unit/test_listsources-03.js b/toolkit/devtools/debugger/tests/unit/test_listsources-03.js new file mode 100644 index 000000000000..7325f4a887e5 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_listsources-03.js @@ -0,0 +1,52 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check getSources functionality when there are lots of sources. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-sources"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function () { + attachTestGlobalClientAndResume(gClient, "test-sources", function (aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_simple_listsources(); + }); + }); + do_test_pending(); +} + +function test_simple_listsources() +{ + gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { + gThreadClient.getSources(function (aResponse) { + do_check_true( + !aResponse.error, + "There shouldn't be an error fetching large amounts of sources."); + + do_check_true(aResponse.sources.some(function (s) { + return s.url.match(/foo-999.js$/); + })); + + gThreadClient.resume(function () { + finishClient(gClient); + }); + }); + }); + + for (let i = 0; i < 1000; i++) { + Cu.evalInSandbox("function foo###() {return ###;}".replace(/###/g, i), + gDebuggee, + "1.8", + "http://example.com/foo-" + i + ".js", + 1); + } + gDebuggee.eval("debugger;"); +} diff --git a/toolkit/devtools/debugger/tests/unit/test_profiler_actor.js b/toolkit/devtools/debugger/tests/unit/test_profiler_actor.js index ef38552ccbe4..64d11bcea9ad 100644 --- a/toolkit/devtools/debugger/tests/unit/test_profiler_actor.js +++ b/toolkit/devtools/debugger/tests/unit/test_profiler_actor.js @@ -114,21 +114,15 @@ function test_profile(aClient, aProfiler) do_check_eq(typeof aResponse.profile.threads[0].samples, "object"); do_check_neq(aResponse.profile.threads[0].samples.length, 0); - function some(array, cb) { - for (var i = array.length; i; i--) { - if (cb(array[i - 1])) - return true; - } - return false; - } + let location = stack.name + " (" + stack.filename + ":" + funcLine + ")"; // At least one sample is expected to have been in the busy wait above. - do_check_true(some(aResponse.profile.threads[0].samples, function(sample) { + do_check_true(aResponse.profile.threads[0].samples.some(function(sample) { return sample.name == "(root)" && typeof sample.frames == "object" && sample.frames.length != 0 && sample.frames.some(function(f) { return (f.line == stack.lineNumber) && - (f.location == stack.name + " (" + stack.filename + ":" + funcLine + ")"); + (f.location == location); }); })); @@ -161,9 +155,13 @@ function test_profiler_status() var profiler = aResponse.profilerActor; do_check_false(Profiler.IsActive()); - client.request({ to: profiler, type: "startProfiler", features: [] }, (aResponse) => { + client.request({ + to: profiler, + type: "startProfiler", + features: [] + }, function (aResponse) { do_check_true(Profiler.IsActive()); - client.close(function () {}); + client.close(); }); }); }); diff --git a/toolkit/devtools/debugger/tests/unit/test_sourcemaps-01.js b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-01.js new file mode 100644 index 000000000000..3c00183ccd63 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-01.js @@ -0,0 +1,64 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check basic source map integration with the "newSource" packet in the RDP. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +Components.utils.import('resource:///modules/devtools/SourceMap.jsm'); + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-source-map"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-source-map", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_simple_source_map(); + }); + }); + do_test_pending(); +} + +function test_simple_source_map() +{ + // Because we are source mapping, we should be notified of a.js, b.js, and + // c.js as sources, and shouldn't receive abc.js or test_sourcemaps-01.js. + let expectedSources = new Set(["http://example.com/www/js/a.js", + "http://example.com/www/js/b.js", + "http://example.com/www/js/c.js"]); + + gClient.addListener("newSource", function _onNewSource(aEvent, aPacket) { + do_check_eq(aEvent, "newSource"); + do_check_eq(aPacket.type, "newSource"); + do_check_true(!!aPacket.source); + + do_check_true(expectedSources.has(aPacket.source.url), + "The source url should be one of our original sources."); + expectedSources.delete(aPacket.source.url); + + if (expectedSources.size === 0) { + gClient.removeListener("newSource", _onNewSource); + finishClient(gClient); + } + }); + + let { code, map } = (new SourceNode(null, null, null, [ + new SourceNode(1, 0, "a.js", "function a() { return 'a'; }\n"), + new SourceNode(1, 0, "b.js", "function b() { return 'b'; }\n"), + new SourceNode(1, 0, "c.js", "function c() { return 'c'; }\n"), + ])).toStringWithSourceMap({ + file: "abc.js", + sourceRoot: "http://example.com/www/js/" + }); + + code += "//@ sourceMappingURL=data:text/json;base64," + btoa(map.toString()); + + Components.utils.evalInSandbox(code, gDebuggee, "1.8", + "http://example.com/www/js/abc.js", 1); +} diff --git a/toolkit/devtools/debugger/tests/unit/test_sourcemaps-02.js b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-02.js new file mode 100644 index 000000000000..4310884a08bd --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-02.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check basic source map integration with the "sources" packet in the RDP. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +Components.utils.import("resource:///modules/devtools/SourceMap.jsm"); + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-source-map"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-source-map", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_simple_source_map(); + }); + }); + do_test_pending(); +} + +function test_simple_source_map() +{ + // Because we are source mapping, we should be notified of a.js, b.js, and + // c.js as sources, and shouldn"t receive abc.js or test_sourcemaps-01.js. + let expectedSources = new Set(["http://example.com/www/js/a.js", + "http://example.com/www/js/b.js", + "http://example.com/www/js/c.js"]); + + let numNewSources = 0; + + gClient.addListener("newSource", function _onNewSource(aEvent, aPacket) { + if (++numNewSources !== 3) { + return; + } + gClient.removeListener("newSource", _onNewSource); + + gThreadClient.getSources(function (aResponse) { + do_check_true(!aResponse.error, "Should not get an error"); + + for (let s of aResponse.sources) { + do_check_true(expectedSources.has(s.url), + "The source's url should be one of our original sources"); + expectedSources.delete(s.url); + } + + do_check_eq(expectedSources.size, 0, + "Shouldn't be expecting any more sources"); + + finishClient(gClient); + }); + }); + + let { code, map } = (new SourceNode(null, null, null, [ + new SourceNode(1, 0, "a.js", "function a() { return 'a'; }\n"), + new SourceNode(1, 0, "b.js", "function b() { return 'b'; }\n"), + new SourceNode(1, 0, "c.js", "function c() { return 'c'; }\n"), + ])).toStringWithSourceMap({ + file: "abc.js", + sourceRoot: "http://example.com/www/js/" + }); + + code += "//@ sourceMappingURL=data:text/json;base64," + btoa(map.toString()); + + Components.utils.evalInSandbox(code, gDebuggee, "1.8", + "http://example.com/www/js/abc.js", 1); +} diff --git a/toolkit/devtools/debugger/tests/unit/test_sourcemaps-03.js b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-03.js new file mode 100644 index 000000000000..802277861c9b --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-03.js @@ -0,0 +1,149 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check setting breakpoints in source mapped sources. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +Components.utils.import('resource:///modules/devtools/SourceMap.jsm'); + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-source-map"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-source-map", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_simple_source_map(); + }); + }); + do_test_pending(); +} + +function testBreakpointMapping(aName, aCallback) +{ + // Pause so we can set a breakpoint. + gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { + do_check_true(!aPacket.error); + do_check_eq(aPacket.why.type, "debuggerStatement"); + + gThreadClient.setBreakpoint({ + url: "http://example.com/www/js/" + aName + ".js", + // Setting the breakpoint on an empty line so that it is pushed down one + // line and we can check the source mapped actualLocation later. + line: 3, + column: 0 + }, function (aResponse) { + do_check_true(!aResponse.error); + + // Actual location should come back source mapped still so that + // breakpoints are displayed in the UI correctly, etc. + do_check_eq(aResponse.actualLocation.line, 4); + do_check_eq(aResponse.actualLocation.url, + "http://example.com/www/js/" + aName + ".js"); + + // The eval will cause us to resume, then we get an unsolicited pause + // because of our breakpoint, we resume again to finish the eval, and + // finally receive our last pause which has the result of the client + // evaluation. + gThreadClient.eval(null, aName + "()", function (aResponse) { + do_check_true(!aResponse.error, "Shouldn't be an error resuming to eval"); + do_check_eq(aResponse.type, "resumed"); + + gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { + do_check_eq(aPacket.why.type, "breakpoint"); + // Assert that we paused because of the breakpoint at the correct + // location in the code by testing that the value of `ret` is still + // undefined. + do_check_eq(aPacket.frame.environment.bindings.variables.ret.value.type, + "undefined"); + + gThreadClient.resume(function (aResponse) { + do_check_true(!aResponse.error); + + gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { + do_check_eq(aPacket.why.type, "clientEvaluated"); + do_check_eq(aPacket.why.frameFinished.return, aName); + + gThreadClient.resume(function (aResponse) { + do_check_true(!aResponse.error); + aCallback(); + }); + }); + }); + }); + }); + }); + }); + + gDebuggee.eval("(" + function () { + debugger; + } + "());"); +} + +function test_simple_source_map() +{ + let expectedSources = new Set([ + "http://example.com/www/js/a.js", + "http://example.com/www/js/b.js", + "http://example.com/www/js/c.js" + ]); + + gClient.addListener("newSource", function _onNewSource(aEvent, aPacket) { + expectedSources.delete(aPacket.source.url); + if (expectedSources.size > 0) { + return; + } + gClient.removeListener("newSource", _onNewSource); + + testBreakpointMapping("a", function () { + testBreakpointMapping("b", function () { + testBreakpointMapping("c", function () { + finishClient(gClient); + }); + }); + }); + }); + + let a = new SourceNode(null, null, null, [ + new SourceNode(1, 0, "a.js", "function a() {\n"), + new SourceNode(2, 0, "a.js", " var ret;\n"), + new SourceNode(3, 0, "a.js", " // Empty line\n"), + new SourceNode(4, 0, "a.js", " ret = 'a';\n"), + new SourceNode(5, 0, "a.js", " return ret;\n"), + new SourceNode(6, 0, "a.js", "}\n") + ]); + let b = new SourceNode(null, null, null, [ + new SourceNode(1, 0, "b.js", "function b() {\n"), + new SourceNode(2, 0, "b.js", " var ret;\n"), + new SourceNode(3, 0, "b.js", " // Empty line\n"), + new SourceNode(4, 0, "b.js", " ret = 'b';\n"), + new SourceNode(5, 0, "b.js", " return ret;\n"), + new SourceNode(6, 0, "b.js", "}\n") + ]); + let c = new SourceNode(null, null, null, [ + new SourceNode(1, 0, "c.js", "function c() {\n"), + new SourceNode(2, 0, "c.js", " var ret;\n"), + new SourceNode(3, 0, "c.js", " // Empty line\n"), + new SourceNode(4, 0, "c.js", " ret = 'c';\n"), + new SourceNode(5, 0, "c.js", " return ret;\n"), + new SourceNode(6, 0, "c.js", "}\n") + ]); + + let { code, map } = (new SourceNode(null, null, null, [ + a, b, c + ])).toStringWithSourceMap({ + file: "http://example.com/www/js/abc.js", + sourceRoot: "http://example.com/www/js/" + }); + + code += "//@ sourceMappingURL=data:text/json;base64," + btoa(map.toString()); + + Components.utils.evalInSandbox(code, gDebuggee, "1.8", + "http://example.com/www/js/abc.js", 1); +} diff --git a/toolkit/devtools/debugger/tests/unit/testcompatactors.js b/toolkit/devtools/debugger/tests/unit/testcompatactors.js index 7eb44846ff2f..0b778e51e1b3 100644 --- a/toolkit/devtools/debugger/tests/unit/testcompatactors.js +++ b/toolkit/devtools/debugger/tests/unit/testcompatactors.js @@ -30,26 +30,26 @@ function createRootActor() }; actor.thread.requestTypes["scripts"] = function (aRequest) { - this._discoverScriptsAndSources(); - - let scripts = []; - for (let s of this.dbg.findScripts()) { - if (!s.url) { - continue; + return this._discoverScriptsAndSources().then(function () { + let scripts = []; + for (let s of this.dbg.findScripts()) { + if (!s.url) { + continue; + } + let script = { + url: s.url, + startLine: s.startLine, + lineCount: s.lineCount, + source: this.sources.source(s.url).form() + }; + scripts.push(script); } - let script = { - url: s.url, - startLine: s.startLine, - lineCount: s.lineCount, - source: this._getSource(s.url).form() - }; - scripts.push(script); - } - return { - from: this.actorID, - scripts: scripts - }; + return { + from: this.actorID, + scripts: scripts + }; + }.bind(this)); }; // Pretend that we do not know about the "sources" packet to force the @@ -70,7 +70,7 @@ function createRootActor() url: aScript.url, startLine: aScript.startLine, lineCount: aScript.lineCount, - source: actor.thread._getSource(aScript.url).form() + source: actor.thread.sources.source(aScript.url).form() }); }; }(actor.thread.onNewScript)); diff --git a/toolkit/devtools/debugger/tests/unit/xpcshell.ini b/toolkit/devtools/debugger/tests/unit/xpcshell.ini index 21b3aaa6be10..bdf4d89ad351 100644 --- a/toolkit/devtools/debugger/tests/unit/xpcshell.ini +++ b/toolkit/devtools/debugger/tests/unit/xpcshell.ini @@ -74,9 +74,13 @@ skip-if = toolkit == "gonk" reason = bug 820380 [test_listsources-01.js] [test_listsources-02.js] +[test_listsources-03.js] [test_new_source-01.js] [test_sources_backwards_compat-01.js] [test_sources_backwards_compat-02.js] +[test_sourcemaps-01.js] +[test_sourcemaps-02.js] +[test_sourcemaps-03.js] [test_objectgrips-01.js] [test_objectgrips-02.js] [test_objectgrips-03.js] diff --git a/toolkit/devtools/sourcemap/SourceMap.jsm b/toolkit/devtools/sourcemap/SourceMap.jsm index 0dc4063c10cf..b8f9bd4258a3 100644 --- a/toolkit/devtools/sourcemap/SourceMap.jsm +++ b/toolkit/devtools/sourcemap/SourceMap.jsm @@ -44,6 +44,7 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: The generated file this source map is associated with. * @@ -70,6 +71,7 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou var sources = util.getArg(sourceMap, 'sources'); var names = util.getArg(sourceMap, 'names'); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file'); @@ -79,7 +81,8 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou this._names = ArraySet.fromArray(names); this._sources = ArraySet.fromArray(sources); - this._sourceRoot = sourceRoot; + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; this.file = file; // `this._generatedMappings` and `this._originalMappings` hold the parsed @@ -121,7 +124,7 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou Object.defineProperty(SourceMapConsumer.prototype, 'sources', { get: function () { return this._sources.toArray().map(function (s) { - return this._sourceRoot ? util.join(this._sourceRoot, s) : s; + return this.sourceRoot ? util.join(this.sourceRoot, s) : s; }, this); } }); @@ -165,12 +168,7 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { // Original source. temp = base64VLQ.decode(str); - if (aSourceRoot) { - mapping.source = util.join(aSourceRoot, this._sources.at(previousSource + temp.value)); - } - else { - mapping.source = this._sources.at(previousSource + temp.value); - } + mapping.source = this._sources.at(previousSource + temp.value); previousSource += temp.value; str = temp.rest; if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { @@ -204,7 +202,9 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou } this._generatedMappings.push(mapping); - this._originalMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + this._originalMappings.push(mapping); + } } } @@ -291,11 +291,15 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou this._generatedMappings, "generatedLine", "generatedColumn", - this._compareGeneratedPositions) + this._compareGeneratedPositions); if (mapping) { + var source = util.getArg(mapping, 'source', null); + if (source && this.sourceRoot) { + source = util.join(this.sourceRoot, source); + } return { - source: util.getArg(mapping, 'source', null), + source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: util.getArg(mapping, 'name', null) @@ -310,6 +314,32 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou }; }; + /** + * Returns the original source content. The only argument is + * the url of the original source file. Returns null if no + * original source content is availible. + */ + SourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot) { + // Try to remove the sourceRoot + var relativeUrl = util.relative(this.sourceRoot, aSource); + if (this._sources.has(relativeUrl)) { + return this.sourcesContent[this._sources.indexOf(relativeUrl)]; + } + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + throw new Error('"' + aSource + '" is not in the SourceMap.'); + }; + /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with @@ -332,11 +362,15 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou originalColumn: util.getArg(aArgs, 'column') }; + if (this.sourceRoot) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + var mapping = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", - this._compareOriginalPositions) + this._compareOriginalPositions); if (mapping) { return { @@ -359,8 +393,7 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou * generated line/column in this source map. * * @param Function aCallback - * The function that is called with each mapping. This function should - * not mutate the mapping. + * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. @@ -388,7 +421,21 @@ define('source-map/source-map-consumer', ['require', 'exports', 'module' , 'sou throw new Error("Unknown order of iteration."); } - mappings.forEach(aCallback, context); + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source; + if (source && sourceRoot) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name + }; + }).forEach(aCallback, context); }; exports.SourceMapConsumer = SourceMapConsumer; @@ -426,10 +473,37 @@ define('source-map/util', ['require', 'exports', 'module' , ], function(require, function join(aRoot, aPath) { return aPath.charAt(0) === '/' ? aPath - : aRoot.replace(/\/*$/, '') + '/' + aPath; + : aRoot.replace(/\/$/, '') + '/' + aPath; } exports.join = join; + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + return '$' + aStr; + } + exports.toSetString = toSetString; + + function fromSetString(aStr) { + return aStr.substr(1); + } + exports.fromSetString = fromSetString; + + function relative(aRoot, aPath) { + aRoot = aRoot.replace(/\/$/, ''); + return aPath.indexOf(aRoot + '/') === 0 + ? aPath.substr(aRoot.length + 1) + : aPath; + } + exports.relative = relative; + }); /* -*- Mode: js; js-indent-level: 2; -*- */ /* @@ -515,7 +589,9 @@ define('source-map/binary-search', ['require', 'exports', 'module' , ], function * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ -define('source-map/array-set', ['require', 'exports', 'module' , ], function(require, exports, module) { +define('source-map/array-set', ['require', 'exports', 'module' , 'source-map/util'], function(require, exports, module) { + + var util = require('source-map/util'); /** * A data structure which is a combination of an array and a set. Adding a new @@ -539,19 +615,6 @@ define('source-map/array-set', ['require', 'exports', 'module' , ], function(req return set; }; - /** - * Because behavior goes wacky when you set `__proto__` on `this._set`, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - ArraySet.prototype._toSetString = function ArraySet__toSetString (aStr) { - return "$" + aStr; - }; - /** * Add the given string to this set. * @@ -564,7 +627,7 @@ define('source-map/array-set', ['require', 'exports', 'module' , ], function(req } var idx = this._array.length; this._array.push(aStr); - this._set[this._toSetString(aStr)] = idx; + this._set[util.toSetString(aStr)] = idx; }; /** @@ -574,7 +637,7 @@ define('source-map/array-set', ['require', 'exports', 'module' , ], function(req */ ArraySet.prototype.has = function ArraySet_has(aStr) { return Object.prototype.hasOwnProperty.call(this._set, - this._toSetString(aStr)); + util.toSetString(aStr)); }; /** @@ -584,7 +647,7 @@ define('source-map/array-set', ['require', 'exports', 'module' , ], function(req */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (this.has(aStr)) { - return this._set[this._toSetString(aStr)]; + return this._set[util.toSetString(aStr)]; } throw new Error('"' + aStr + '" is not in the set.'); }; @@ -819,10 +882,58 @@ define('source-map/source-map-generator', ['require', 'exports', 'module' , 'so this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = []; + this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source) { + newMapping.source = mapping.source; + if (sourceRoot) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping @@ -858,6 +969,110 @@ define('source-map/source-map-generator', ['require', 'exports', 'module' , 'so }); }; + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent !== null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = {}; + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (!aSourceFile) { + aSourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "aSourceFile" relative if an absolute Url is passed. + if (sourceRoot) { + aSourceFile = util.relative(sourceRoot, aSourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "aSourceFile" + this._mappings.forEach(function (mapping) { + if (mapping.source === aSourceFile && mapping.original) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.original.line, + column: mapping.original.column + }); + if (original.source !== null) { + // Copy mapping + if (sourceRoot) { + mapping.source = util.relative(sourceRoot, original.source); + } else { + mapping.source = original.source; + } + mapping.original.line = original.line; + mapping.original.column = original.column; + if (original.name !== null && mapping.name !== null) { + // Only use the identifier name if it's an identifier + // in both SourceMaps + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content) { + if (sourceRoot) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + /** * A mapping can have one of the three levels of data: * @@ -978,6 +1193,17 @@ define('source-map/source-map-generator', ['require', 'exports', 'module' , 'so if (this._sourceRoot) { map.sourceRoot = this._sourceRoot; } + if (this._sourcesContents) { + map.sourcesContent = map.sources.map(function (source) { + if (map.sourceRoot) { + source = util.relative(map.sourceRoot, source); + } + return Object.prototype.hasOwnProperty.call( + this._sourcesContents, util.toSetString(source)) + ? this._sourcesContents[util.toSetString(source)] + : null; + }, this); + } return map; }; @@ -998,9 +1224,10 @@ define('source-map/source-map-generator', ['require', 'exports', 'module' , 'so * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ -define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/source-map-generator'], function(require, exports, module) { +define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/source-map-generator', 'source-map/util'], function(require, exports, module) { var SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; + var util = require('source-map/util'); /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -1012,15 +1239,121 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. + * @param aName The original identifier. */ - function SourceNode(aLine, aColumn, aSource, aChunks) { + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; - this.line = aLine; - this.column = aColumn; - this.source = aSource; + this.sourceContents = {}; + this.line = aLine === undefined ? null : aLine; + this.column = aColumn === undefined ? null : aColumn; + this.source = aSource === undefined ? null : aSource; + this.name = aName === undefined ? null : aName; if (aChunks != null) this.add(aChunks); } + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // The generated code + // Processed fragments are removed from this array. + var remainingLines = aGeneratedCode.split('\n'); + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping === null) { + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(remainingLines.shift() + "\n"); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[0]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[0] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + } else { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + var code = ""; + // Associate full lines with "lastMapping" + do { + code += remainingLines.shift() + "\n"; + lastGeneratedLine++; + lastGeneratedColumn = 0; + } while (lastGeneratedLine < mapping.generatedLine); + // When we reached the correct line, we add code until we + // reach the correct column too. + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[0]; + code += nextLine.substr(0, mapping.generatedColumn); + remainingLines[0] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + // Create the SourceNode. + addMappingWithCode(lastMapping, code); + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[0]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[0] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + } + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + // Associate the remaining code in the current line with "lastMapping" + // and add the remaining lines without any mapping + addMappingWithCode(lastMapping, remainingLines.join("\n")); + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content) { + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping.source === undefined) { + node.add(code); + } else { + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + mapping.source, + code, + mapping.name)); + } + } + }; + /** * Add a chunk of generated JS to this source node. * @@ -1083,7 +1416,10 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ } else { if (chunk !== '') { - aFn(chunk, { source: this.source, line: this.line, column: this.column }); + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); } } }, this); @@ -1098,7 +1434,7 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; - var len = this.children.length + var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len-1; i++) { @@ -1132,6 +1468,36 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ return this; }; + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + this.children.forEach(function (chunk) { + if (chunk instanceof SourceNode) { + chunk.walkSourceContents(aFn); + } + }, this); + Object.keys(this.sourceContents).forEach(function (sourceFileKey) { + aFn(util.fromSetString(sourceFileKey), this.sourceContents[sourceFileKey]); + }, this); + }; + /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. @@ -1155,25 +1521,36 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ column: 0 }; var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; this.walk(function (chunk, original) { generated.code += chunk; - if (original.source != null - && original.line != null - && original.column != null) { + if (original.source !== null + && original.line !== null + && original.column !== null) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ generated: { line: generated.line, column: generated.column } }); + sourceMappingActive = false; } - chunk.split('').forEach(function (char) { - if (char === '\n') { + chunk.split('').forEach(function (ch) { + if (ch === '\n') { generated.line++; generated.column = 0; } else { @@ -1181,6 +1558,9 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ } }); }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); return { code: generated.code, map: map }; }; @@ -1191,6 +1571,6 @@ define('source-map/source-node', ['require', 'exports', 'module' , 'source-map/ /* -*- Mode: js; js-indent-level: 2; -*- */ /////////////////////////////////////////////////////////////////////////////// -let SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; -let SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; -let SourceNode = require('source-map/source-node').SourceNode; +this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; +this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; +this.SourceNode = require('source-map/source-node').SourceNode; diff --git a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm index 5f7c81d529f2..ceb12e0141d3 100644 --- a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm +++ b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm @@ -15,7 +15,7 @@ Components.utils.import('resource://gre/modules/devtools/Require.jsm'); Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); -let EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; +this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -78,7 +78,9 @@ define('test/source-map/assert', ['exports'], function (exports) { * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ -define('test/source-map/util', ['require', 'exports', 'module' , ], function(require, exports, module) { +define('test/source-map/util', ['require', 'exports', 'module' , 'lib/source-map/util'], function(require, exports, module) { + + var util = require('source-map/util'); // This is a test mapping which maps functions from two different files // (one.js and two.js) to a minified generated source. @@ -99,6 +101,8 @@ define('test/source-map/util', ['require', 'exports', 'module' , ], function(req // // ONE.foo=function(a){return baz(a);}; // TWO.inc=function(a){return a+1;}; + exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+ + " TWO.inc=function(a){return a+1;};"; exports.testMap = { version: 3, file: 'min.js', @@ -107,6 +111,22 @@ define('test/source-map/util', ['require', 'exports', 'module' , ], function(req sourceRoot: '/the/root', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; + exports.testMapWithSourcesContent = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourcesContent: [ + ' ONE.foo = function (bar) {\n' + + ' return baz(bar);\n' + + ' };', + ' TWO.inc = function (n) {\n' + + ' return n + 1;\n' + + ' };' + ], + sourceRoot: '/the/root', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' + }; function assertMapping(generatedLine, generatedColumn, originalSource, originalLine, originalColumn, name, map, assert, @@ -125,7 +145,8 @@ define('test/source-map/util', ['require', 'exports', 'module' , ], function(req assert.equal(origMapping.column, originalColumn, 'Incorrect column, expected ' + JSON.stringify(originalColumn) + ', got ' + JSON.stringify(origMapping.column)); - assert.equal(origMapping.source, originalSource, + assert.equal(origMapping.source, + originalSource ? util.join(map._sourceRoot, originalSource) : null, 'Incorrect source, expected ' + JSON.stringify(originalSource) + ', got ' + JSON.stringify(origMapping.source)); } @@ -146,6 +167,111 @@ define('test/source-map/util', ['require', 'exports', 'module' , ], function(req } exports.assertMapping = assertMapping; + function assertEqualMaps(assert, actualMap, expectedMap) { + assert.equal(actualMap.version, expectedMap.version, "version mismatch"); + assert.equal(actualMap.file, expectedMap.file, "file mismatch"); + assert.equal(actualMap.names.length, + expectedMap.names.length, + "names length mismatch: " + + actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); + for (var i = 0; i < actualMap.names.length; i++) { + assert.equal(actualMap.names[i], + expectedMap.names[i], + "names[" + i + "] mismatch: " + + actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); + } + assert.equal(actualMap.sources.length, + expectedMap.sources.length, + "sources length mismatch: " + + actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); + for (var i = 0; i < actualMap.sources.length; i++) { + assert.equal(actualMap.sources[i], + expectedMap.sources[i], + "sources[" + i + "] length mismatch: " + + actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); + } + assert.equal(actualMap.sourceRoot, + expectedMap.sourceRoot, + "sourceRoot mismatch: " + + actualMap.sourceRoot + " != " + expectedMap.sourceRoot); + assert.equal(actualMap.mappings, expectedMap.mappings, "mappings mismatch"); + if (actualMap.sourcesContent) { + assert.equal(actualMap.sourcesContent.length, + expectedMap.sourcesContent.length, + "sourcesContent length mismatch"); + for (var i = 0; i < actualMap.sourcesContent.length; i++) { + assert.equal(actualMap.sourcesContent[i], + expectedMap.sourcesContent[i], + "sourcesContent[" + i + "] mismatch"); + } + } + } + exports.assertEqualMaps = assertEqualMaps; + +}); +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +define('lib/source-map/util', ['require', 'exports', 'module' , ], function(require, exports, module) { + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + function join(aRoot, aPath) { + return aPath.charAt(0) === '/' + ? aPath + : aRoot.replace(/\/$/, '') + '/' + aPath; + } + exports.join = join; + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + return '$' + aStr; + } + exports.toSetString = toSetString; + + function fromSetString(aStr) { + return aStr.substr(1); + } + exports.fromSetString = fromSetString; + + function relative(aRoot, aPath) { + aRoot = aRoot.replace(/\/$/, ''); + return aPath.indexOf(aRoot + '/') === 0 + ? aPath.substr(aRoot.length + 1) + : aPath; + } + exports.relative = relative; + }); /* -*- Mode: js; js-indent-level: 2; -*- */ /* @@ -167,3 +293,4 @@ function runSourceMapTests(modName, do_throw) { } } +this.runSourceMapTests = runSourceMapTests; diff --git a/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js b/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js index e3438fc87f6a..3b7a59e7e11d 100644 --- a/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js +++ b/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js @@ -15,6 +15,7 @@ Components.utils.import('resource://test/Utils.jsm'); define("test/source-map/test-source-map-consumer", ["require", "exports", "module"], function (require, exports, module) { var SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; + var SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; exports['test that we can instantiate with a string or an objects'] = function (assert, util) { assert.doesNotThrow(function () { @@ -97,6 +98,10 @@ define("test/source-map/test-source-map-consumer", ["require", "exports", "modul map.eachMapping(function (mapping) { assert.ok(mapping.generatedLine >= previousLine); + if (mapping.source) { + assert.equal(mapping.source.indexOf(util.testMap.sourceRoot), 0); + } + if (mapping.generatedLine === previousLine) { assert.ok(mapping.generatedColumn >= previousColumn); previousColumn = mapping.generatedColumn; @@ -144,6 +149,112 @@ define("test/source-map/test-source-map-consumer", ["require", "exports", "modul }, context); }; + exports['test that the `sourcesContent` field has the original sources'] = function (assert, util) { + var map = new SourceMapConsumer(util.testMapWithSourcesContent); + var sourcesContent = map.sourcesContent; + + assert.equal(sourcesContent[0], ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(sourcesContent[1], ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.equal(sourcesContent.length, 2); + }; + + exports['test that we can get the original sources for the sources'] = function (assert, util) { + var map = new SourceMapConsumer(util.testMapWithSourcesContent); + var sources = map.sources; + + assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.throws(function () { + map.sourceContentFor(""); + }, Error); + assert.throws(function () { + map.sourceContentFor("/the/root/three.js"); + }, Error); + assert.throws(function () { + map.sourceContentFor("three.js"); + }, Error); + }; + + exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { + var map = new SourceMapGenerator({ + sourceRoot: 'foo/bar', + file: 'baz.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bang.coffee' + }); + map.addMapping({ + original: { line: 5, column: 5 }, + generated: { line: 6, column: 6 }, + source: 'bang.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + // Should handle without sourceRoot. + var pos = map.generatedPositionFor({ + line: 1, + column: 1, + source: 'bang.coffee' + }); + + assert.equal(pos.line, 2); + assert.equal(pos.column, 2); + + // Should handle with sourceRoot. + var pos = map.generatedPositionFor({ + line: 1, + column: 1, + source: 'foo/bar/bang.coffee' + }); + + assert.equal(pos.line, 2); + assert.equal(pos.column, 2); + }; + + exports['test sourceRoot + originalPositionFor'] = function (assert, util) { + var map = new SourceMapGenerator({ + sourceRoot: 'foo/bar', + file: 'baz.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bang.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var pos = map.originalPositionFor({ + line: 2, + column: 2, + }); + + // Should always have the prepended source root + assert.equal(pos.source, 'foo/bar/bang.coffee'); + assert.equal(pos.line, 1); + assert.equal(pos.column, 1); + }; + + exports['test github issue #56'] = function (assert, util) { + var map = new SourceMapGenerator({ + sourceRoot: 'http://', + file: 'www.example.com/foo.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'www.example.com/original.js' + }); + map = new SourceMapConsumer(map.toString()); + + var sources = map.sources; + assert.equal(map.sources.length, 1); + assert.equal(map.sources[0], 'http://www.example.com/original.js'); + }; + }); function run_test() { runSourceMapTests('test/source-map/test-source-map-consumer', do_throw); diff --git a/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js b/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js index e585755e22d2..4811438935dc 100644 --- a/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js +++ b/toolkit/devtools/sourcemap/tests/unit/test_source_map_generator.js @@ -15,6 +15,9 @@ Components.utils.import('resource://test/Utils.jsm'); define("test/source-map/test-source-map-generator", ["require", "exports", "module"], function (require, exports, module) { var SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; + var SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; + var SourceNode = require('source-map/source-node').SourceNode; + var util = require('source-map/util'); exports['test some simple stuff'] = function (assert, util) { var map = new SourceMapGenerator({ @@ -176,19 +179,100 @@ define("test/source-map/test-source-map-generator", ["require", "exports", "modu map = JSON.parse(map.toString()); - assert.equal(map.version, 3); - assert.equal(map.file, 'min.js'); - assert.equal(map.names.length, 3); - assert.equal(map.names[0], 'bar'); - assert.equal(map.names[1], 'baz'); - assert.equal(map.names[2], 'n'); - assert.equal(map.sources.length, 2); - assert.equal(map.sources[0], 'one.js'); - assert.equal(map.sources[1], 'two.js'); - assert.equal(map.sourceRoot, '/the/root'); - assert.equal(map.mappings, 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'); + util.assertEqualMaps(assert, map, util.testMap); }; + exports['test that source content can be set'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'min.js', + sourceRoot: '/the/root' + }); + map.addMapping({ + generated: { line: 1, column: 1 }, + original: { line: 1, column: 1 }, + source: 'one.js' + }); + map.addMapping({ + generated: { line: 2, column: 1 }, + original: { line: 1, column: 1 }, + source: 'two.js' + }); + map.setSourceContent('one.js', 'one file content'); + + map = JSON.parse(map.toString()); + assert.equal(map.sources[0], 'one.js'); + assert.equal(map.sources[1], 'two.js'); + assert.equal(map.sourcesContent[0], 'one file content'); + assert.equal(map.sourcesContent[1], null); + }; + + exports['test .fromSourceMap'] = function (assert, util) { + var map = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(util.testMap)); + util.assertEqualMaps(assert, map.toJSON(), util.testMap); + }; + + exports['test .fromSourceMap with sourcesContent'] = function (assert, util) { + var map = SourceMapGenerator.fromSourceMap( + new SourceMapConsumer(util.testMapWithSourcesContent)); + util.assertEqualMaps(assert, map.toJSON(), util.testMapWithSourcesContent); + }; + + exports['test applySourceMap'] = function (assert, util) { + var node = new SourceNode(null, null, null, [ + new SourceNode(2, 0, 'fileX', 'lineX2\n'), + 'genA1\n', + new SourceNode(2, 0, 'fileY', 'lineY2\n'), + 'genA2\n', + new SourceNode(1, 0, 'fileX', 'lineX1\n'), + 'genA3\n', + new SourceNode(1, 0, 'fileY', 'lineY1\n') + ]); + var mapStep1 = node.toStringWithSourceMap({ + file: 'fileA' + }).map; + mapStep1.setSourceContent('fileX', 'lineX1\nlineX2\n'); + mapStep1 = mapStep1.toJSON(); + + node = new SourceNode(null, null, null, [ + 'gen1\n', + new SourceNode(1, 0, 'fileA', 'lineA1\n'), + new SourceNode(2, 0, 'fileA', 'lineA2\n'), + new SourceNode(3, 0, 'fileA', 'lineA3\n'), + new SourceNode(4, 0, 'fileA', 'lineA4\n'), + new SourceNode(1, 0, 'fileB', 'lineB1\n'), + new SourceNode(2, 0, 'fileB', 'lineB2\n'), + 'gen2\n' + ]); + var mapStep2 = node.toStringWithSourceMap({ + file: 'fileGen' + }).map; + mapStep2.setSourceContent('fileB', 'lineB1\nlineB2\n'); + mapStep2 = mapStep2.toJSON(); + + node = new SourceNode(null, null, null, [ + 'gen1\n', + new SourceNode(2, 0, 'fileX', 'lineA1\n'), + new SourceNode(2, 0, 'fileA', 'lineA2\n'), + new SourceNode(2, 0, 'fileY', 'lineA3\n'), + new SourceNode(4, 0, 'fileA', 'lineA4\n'), + new SourceNode(1, 0, 'fileB', 'lineB1\n'), + new SourceNode(2, 0, 'fileB', 'lineB2\n'), + 'gen2\n' + ]); + var expectedMap = node.toStringWithSourceMap({ + file: 'fileGen' + }).map; + expectedMap.setSourceContent('fileX', 'lineX1\nlineX2\n'); + expectedMap.setSourceContent('fileB', 'lineB1\nlineB2\n'); + expectedMap = expectedMap.toJSON(); + + // apply source map "mapStep1" to "mapStep2" + var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapStep2)); + generator.applySourceMap(new SourceMapConsumer(mapStep1)); + var actualMap = generator.toJSON(); + + util.assertEqualMaps(assert, actualMap, expectedMap); + }; }); function run_test() { runSourceMapTests('test/source-map/test-source-map-generator', do_throw); diff --git a/toolkit/devtools/sourcemap/tests/unit/test_source_node.js b/toolkit/devtools/sourcemap/tests/unit/test_source_node.js index afdbc781d9d4..5b0163282a05 100644 --- a/toolkit/devtools/sourcemap/tests/unit/test_source_node.js +++ b/toolkit/devtools/sourcemap/tests/unit/test_source_node.js @@ -136,7 +136,10 @@ define("test/source-map/test-source-node", ["require", "exports", "module"], fun exports['test .toStringWithSourceMap()'] = function (assert, util) { var node = new SourceNode(null, null, null, ['(function () {\n', - ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n', + ' ', + new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'), + new SourceNode(1, 8, 'a.js', '()'), + ';\n', ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n', '}());']); var map = node.toStringWithSourceMap({ @@ -148,6 +151,14 @@ define("test/source-map/test-source-node", ["require", "exports", "module"], fun var actual; + actual = map.originalPositionFor({ + line: 1, + column: 4 + }); + assert.equal(actual.source, null); + assert.equal(actual.line, null); + assert.equal(actual.column, null); + actual = map.originalPositionFor({ line: 2, column: 2 @@ -155,6 +166,7 @@ define("test/source-map/test-source-node", ["require", "exports", "module"], fun assert.equal(actual.source, 'a.js'); assert.equal(actual.line, 1); assert.equal(actual.column, 0); + assert.equal(actual.name, 'originalCall'); actual = map.originalPositionFor({ line: 3, @@ -163,8 +175,115 @@ define("test/source-map/test-source-node", ["require", "exports", "module"], fun assert.equal(actual.source, 'b.js'); assert.equal(actual.line, 2); assert.equal(actual.column, 0); + + actual = map.originalPositionFor({ + line: 3, + column: 16 + }); + assert.equal(actual.source, null); + assert.equal(actual.line, null); + assert.equal(actual.column, null); + + actual = map.originalPositionFor({ + line: 4, + column: 2 + }); + assert.equal(actual.source, null); + assert.equal(actual.line, null); + assert.equal(actual.column, null); }; + exports['test .fromStringWithSourceMap()'] = function (assert, util) { + var node = SourceNode.fromStringWithSourceMap( + util.testGeneratedCode, + new SourceMapConsumer(util.testMap)); + + var result = node.toStringWithSourceMap({ + file: 'min.js' + }); + var map = result.map; + var code = result.code; + + assert.equal(code, util.testGeneratedCode); + assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); + map = map.toJSON(); + assert.equal(map.version, util.testMap.version); + assert.equal(map.file, util.testMap.file); + assert.equal(map.mappings, util.testMap.mappings); + }; + + exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) { + var input = new SourceNode(null, null, null, [ + "(function() {\n", + " var Test = {};\n", + " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };\n"), + " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), "\n", + "}());\n", + "/* Generated Source */"]); + input = input.toStringWithSourceMap({ + file: 'foo.js' + }); + + var node = SourceNode.fromStringWithSourceMap( + input.code, + new SourceMapConsumer(input.map.toString())); + + var result = node.toStringWithSourceMap({ + file: 'foo.js' + }); + var map = result.map; + var code = result.code; + + assert.equal(code, input.code); + assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); + map = map.toJSON(); + var inputMap = input.map.toJSON(); + util.assertEqualMaps(assert, map, inputMap); + }; + + exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) { + var aNode = new SourceNode(1, 1, 'a.js', 'a'); + aNode.setSourceContent('a.js', 'someContent'); + var node = new SourceNode(null, null, null, + ['(function () {\n', + ' ', aNode, + ' ', new SourceNode(1, 1, 'b.js', 'b'), + '}());']); + node.setSourceContent('b.js', 'otherContent'); + var map = node.toStringWithSourceMap({ + file: 'foo.js' + }).map; + + assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); + map = new SourceMapConsumer(map.toString()); + + assert.equal(map.sources.length, 2); + assert.equal(map.sources[0], 'a.js'); + assert.equal(map.sources[1], 'b.js'); + assert.equal(map.sourcesContent.length, 2); + assert.equal(map.sourcesContent[0], 'someContent'); + assert.equal(map.sourcesContent[1], 'otherContent'); + }; + + exports['test walkSourceContents'] = function (assert, util) { + var aNode = new SourceNode(1, 1, 'a.js', 'a'); + aNode.setSourceContent('a.js', 'someContent'); + var node = new SourceNode(null, null, null, + ['(function () {\n', + ' ', aNode, + ' ', new SourceNode(1, 1, 'b.js', 'b'), + '}());']); + node.setSourceContent('b.js', 'otherContent'); + var results = []; + node.walkSourceContents(function (sourceFile, sourceContent) { + results.push([sourceFile, sourceContent]); + }); + assert.equal(results.length, 2); + assert.equal(results[0][0], 'a.js'); + assert.equal(results[0][1], 'someContent'); + assert.equal(results[1][0], 'b.js'); + assert.equal(results[1][1], 'otherContent'); + }; }); function run_test() { runSourceMapTests('test/source-map/test-source-node', do_throw); From 02353a9c27c8089353fcc8863ce68ceae63fa7b6 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 9 Apr 2013 11:40:00 +0300 Subject: [PATCH 308/438] Bug 849069 - relative source map URLs should be resolved according to the spec's rules; r=past --- .../devtools/debugger/test/binary_search.js | 3 +- .../devtools/debugger/test/binary_search.map | 3 +- .../debugger/server/dbg-script-actors.js | 42 ++++++++++++---- .../devtools/debugger/tests/unit/head_dbg.js | 25 ++++++++++ .../unit/source-map-data/sourcemapped.coffee | 6 +++ .../unit/source-map-data/sourcemapped.map | 10 ++++ .../debugger/tests/unit/sourcemapped.js | 16 +++++++ .../debugger/tests/unit/test_source-01.js | 10 +--- .../debugger/tests/unit/test_sourcemaps-04.js | 48 +++++++++++++++++++ .../debugger/tests/unit/test_sourcemaps-05.js | 48 +++++++++++++++++++ .../devtools/debugger/tests/unit/xpcshell.ini | 6 +++ toolkit/devtools/sourcemap/SourceMap.jsm | 30 ++++++++++-- .../devtools/sourcemap/tests/unit/Utils.jsm | 48 ++++++++++++++++--- .../tests/unit/test_source_map_consumer.js | 42 +++++++++++++++- 14 files changed, 305 insertions(+), 32 deletions(-) create mode 100644 toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.coffee create mode 100644 toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.map create mode 100644 toolkit/devtools/debugger/tests/unit/sourcemapped.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_sourcemaps-04.js create mode 100644 toolkit/devtools/debugger/tests/unit/test_sourcemaps-05.js diff --git a/browser/devtools/debugger/test/binary_search.js b/browser/devtools/debugger/test/binary_search.js index ce77903e1b07..aa3dff3bc827 100644 --- a/browser/devtools/debugger/test/binary_search.js +++ b/browser/devtools/debugger/test/binary_search.js @@ -24,7 +24,6 @@ }).call(this); -// TODO bug 849069: this should just be "binary_search.map", not a full path. /* -//@ sourceMappingURL=http://example.com/browser/browser/devtools/debugger/test/binary_search.map +//@ sourceMappingURL=binary_search.map */ diff --git a/browser/devtools/debugger/test/binary_search.map b/browser/devtools/debugger/test/binary_search.map index a86e74783f11..c5aaeab2f011 100644 --- a/browser/devtools/debugger/test/binary_search.map +++ b/browser/devtools/debugger/test/binary_search.map @@ -1,8 +1,9 @@ { "version": 3, "file": "binary_search.js", + "sourceRoot": "", "sources": [ - "http://example.com/browser/browser/devtools/debugger/test/binary_search.coffee" + "binary_search.coffee" ], "names": [], "mappings": ";AACA;CAAA;CAAA,CAAA,CAAuB,EAAA,CAAjB,GAAkB,IAAxB;CAEE,OAAA,UAAA;CAAA,EAAQ,CAAR,CAAA;CAAA,EACQ,CAAR,CAAa,CAAL;CADR,EAEQ,CAAR,CAAA;CAEA,EAA0C,CAAR,CAAtB,MAAN;CAGJ,EAA6B,CAAR,CAAA,CAArB;CAAA,EAAQ,CAAR,CAAQ,GAAR;QAAA;CACA,EAA6B,CAAR,CAAA,CAArB;CAAA,EAAQ,EAAR,GAAA;QADA;CAAA,EAIQ,CAAI,CAAZ,CAAA;CAXF,IAIA;CAUA,GAAA,CAAS;CAAT,YAA8B;MAA9B;AAA0C,CAAD,YAAA;MAhBpB;CAAvB,EAAuB;CAAvB" diff --git a/toolkit/devtools/debugger/server/dbg-script-actors.js b/toolkit/devtools/debugger/server/dbg-script-actors.js index d7fd8a061a9c..efb59d4f1fb5 100644 --- a/toolkit/devtools/debugger/server/dbg-script-actors.js +++ b/toolkit/devtools/debugger/server/dbg-script-actors.js @@ -525,7 +525,9 @@ ThreadActor.prototype = { originalLine) return locationPromise.then((aLocation) => { let line = aLocation.line; - if (this.dbg.findScripts({ url: aLocation.url }).length == 0 || line < 0) { + if (this.dbg.findScripts({ url: aLocation.url }).length == 0 || + line < 0 || + line == null) { return { error: "noScript" }; } @@ -2405,7 +2407,7 @@ ThreadSources.prototype = { ]; }, (e) => { reportError(e); - delete this._sourceMaps[aScript.sourceMapURL]; + delete this._sourceMaps[this._normalize(aScript.sourceMapURL, aScript.url)]; delete this._sourceMapsByGeneratedSource[aScript.url]; return [this.source(aScript.url)]; }) @@ -2422,7 +2424,9 @@ ThreadSources.prototype = { return this._sourceMapsByGeneratedSource[aScript.url]; } dbg_assert(aScript.sourceMapURL); - let map = this._fetchSourceMap(aScript.sourceMapURL) + let sourceMapURL = this._normalize(aScript.sourceMapURL, + aScript.url); + let map = this._fetchSourceMap(sourceMapURL) .then((aSourceMap) => { for (let s of aSourceMap.sources) { this._generatedUrlsByOriginalUrl[s] = aScript.url; @@ -2437,14 +2441,21 @@ ThreadSources.prototype = { /** * Fetch the source map located at the given url. */ - _fetchSourceMap: function TS__featchSourceMap(aSourceMapURL) { - if (aSourceMapURL in this._sourceMaps) { - return this._sourceMaps[aSourceMapURL]; + _fetchSourceMap: function TS__fetchSourceMap(aAbsSourceMapURL) { + if (aAbsSourceMapURL in this._sourceMaps) { + return this._sourceMaps[aAbsSourceMapURL]; } else { - let promise = fetch(aSourceMapURL).then(function (rawSourceMap) { - return new SourceMapConsumer(rawSourceMap); + let promise = fetch(aAbsSourceMapURL).then((rawSourceMap) => { + let map = new SourceMapConsumer(rawSourceMap); + let base = aAbsSourceMapURL.replace(/\/[^\/]+$/, '/'); + if (base.indexOf("data:") !== 0) { + map.sourceRoot = map.sourceRoot + ? this._normalize(map.sourceRoot, base) + : base; + } + return map; }); - this._sourceMaps[aSourceMapURL] = promise; + this._sourceMaps[aAbsSourceMapURL] = promise; return promise; } }, @@ -2507,6 +2518,19 @@ ThreadSources.prototype = { }); }, + /** + * Normalize multiple relative paths towards the base paths on the right. + */ + _normalize: function TS__normalize(...aURLs) { + dbg_assert(aURLs.length > 1); + let base = Services.io.newURI(aURLs.pop(), null, null); + let url; + while ((url = aURLs.pop())) { + base = Services.io.newURI(url, null, base); + } + return base.spec; + }, + iter: function TS_iter() { for (let url in this._sourceActors) { yield this._sourceActors[url]; diff --git a/toolkit/devtools/debugger/tests/unit/head_dbg.js b/toolkit/devtools/debugger/tests/unit/head_dbg.js index 525ae7e46552..69207ed93589 100644 --- a/toolkit/devtools/debugger/tests/unit/head_dbg.js +++ b/toolkit/devtools/debugger/tests/unit/head_dbg.js @@ -175,6 +175,14 @@ function finishClient(aClient) }); } +/** + * Takes a relative file path and returns the absolute file url for it. + */ +function getFileUrl(aName) { + let file = do_get_file(aName); + return Services.io.newFileURI(file).spec; +} + /** * Returns the full path of the file with the specified name in a * platform-independent and URL-like form. @@ -190,3 +198,20 @@ function getFilePath(aName) } return path.slice(filePrePath.length); } + +Cu.import("resource://gre/modules/NetUtil.jsm"); + +/** + * Returns the full text contents of the given file. + */ +function readFile(aFileName) { + let f = do_get_file(aFileName); + let s = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + s.init(f, -1, -1, false); + try { + return NetUtil.readInputStreamToString(s, s.available()); + } finally { + s.close(); + } +} diff --git a/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.coffee b/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.coffee new file mode 100644 index 000000000000..73a400a219d9 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.coffee @@ -0,0 +1,6 @@ +foo = (n) -> + return "foo" + i for i in [0...n] + +[first, second, third] = foo(3) + +debugger \ No newline at end of file diff --git a/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.map b/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.map new file mode 100644 index 000000000000..dcee3c33c393 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/source-map-data/sourcemapped.map @@ -0,0 +1,10 @@ +{ + "version": 3, + "file": "sourcemapped.js", + "sourceRoot": "", + "sources": [ + "sourcemapped.coffee" + ], + "names": [], + "mappings": ";AAAA;CAAA,KAAA,yBAAA;CAAA;CAAA,CAAA,CAAA,MAAO;CACL,IAAA,GAAA;AAAA,CAAA,EAAA,MAA0B,qDAA1B;CAAA,EAAe,EAAR,QAAA;CAAP,IADI;CAAN,EAAM;;CAAN,CAGA,CAAyB,IAAA;;CAEzB,UALA;CAAA" +} \ No newline at end of file diff --git a/toolkit/devtools/debugger/tests/unit/sourcemapped.js b/toolkit/devtools/debugger/tests/unit/sourcemapped.js new file mode 100644 index 000000000000..7dbcb2d14939 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/sourcemapped.js @@ -0,0 +1,16 @@ +// Generated by CoffeeScript 1.6.1 +(function() { + var first, foo, second, third, _ref; + + foo = function(n) { + var i, _i; + for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) { + return "foo" + i; + } + }; + + _ref = foo(3), first = _ref[0], second = _ref[1], third = _ref[2]; + + debugger; + +}).call(this); diff --git a/toolkit/devtools/debugger/tests/unit/test_source-01.js b/toolkit/devtools/debugger/tests/unit/test_source-01.js index a1fd94e4c484..684e38f44d85 100644 --- a/toolkit/devtools/debugger/tests/unit/test_source-01.js +++ b/toolkit/devtools/debugger/tests/unit/test_source-01.js @@ -10,8 +10,6 @@ var gThreadClient; // and that they can communicate over the protocol to fetch the source text for // a given script. -Cu.import("resource://gre/modules/NetUtil.jsm"); - function run_test() { initTestDebuggerServer(); @@ -60,15 +58,9 @@ function test_source() do_check_true(!aResponse.error); do_check_true(!!aResponse.source); - let f = do_get_file("test_source-01.js", false); - let s = Cc["@mozilla.org/network/file-input-stream;1"] - .createInstance(Ci.nsIFileInputStream); - s.init(f, -1, -1, false); - - do_check_eq(NetUtil.readInputStreamToString(s, s.available()), + do_check_eq(readFile("test_source-01.js"), aResponse.source); - s.close(); gThreadClient.resume(function () { finishClient(gClient); }); diff --git a/toolkit/devtools/debugger/tests/unit/test_sourcemaps-04.js b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-04.js new file mode 100644 index 000000000000..af61f6c48962 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-04.js @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check that absolute source map urls work. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +Components.utils.import('resource:///modules/devtools/SourceMap.jsm'); + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-source-map"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-source-map", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_absolute_source_map(); + }); + }); + do_test_pending(); +} + +function test_absolute_source_map() +{ + gClient.addOneTimeListener("newSource", function _onNewSource(aEvent, aPacket) { + do_check_eq(aEvent, "newSource"); + do_check_eq(aPacket.type, "newSource"); + do_check_true(!!aPacket.source); + + do_check_true(aPacket.source.url.indexOf("sourcemapped.coffee") !== -1, + "The new source should be a coffee file."); + do_check_eq(aPacket.source.url.indexOf("sourcemapped.js"), -1, + "The new source should not be a js file."); + + finishClient(gClient); + }); + + code = readFile("sourcemapped.js") + + "\n//@ sourceMappingURL=" + getFileUrl("source-map-data/sourcemapped.map"); + + Components.utils.evalInSandbox(code, gDebuggee, "1.8", + getFileUrl("sourcemapped.js"), 1); +} diff --git a/toolkit/devtools/debugger/tests/unit/test_sourcemaps-05.js b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-05.js new file mode 100644 index 000000000000..352fab415435 --- /dev/null +++ b/toolkit/devtools/debugger/tests/unit/test_sourcemaps-05.js @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Check that relative source map urls work. + */ + +var gDebuggee; +var gClient; +var gThreadClient; + +Components.utils.import('resource:///modules/devtools/SourceMap.jsm'); + +function run_test() +{ + initTestDebuggerServer(); + gDebuggee = addTestGlobal("test-source-map"); + gClient = new DebuggerClient(DebuggerServer.connectPipe()); + gClient.connect(function() { + attachTestGlobalClientAndResume(gClient, "test-source-map", function(aResponse, aThreadClient) { + gThreadClient = aThreadClient; + test_relative_source_map(); + }); + }); + do_test_pending(); +} + +function test_relative_source_map() +{ + gClient.addOneTimeListener("newSource", function _onNewSource(aEvent, aPacket) { + do_check_eq(aEvent, "newSource"); + do_check_eq(aPacket.type, "newSource"); + do_check_true(!!aPacket.source); + + do_check_true(aPacket.source.url.indexOf("sourcemapped.coffee") !== -1, + "The new source should be a coffee file."); + do_check_eq(aPacket.source.url.indexOf("sourcemapped.js"), -1, + "The new source should not be a js file."); + + finishClient(gClient); + }); + + code = readFile("sourcemapped.js") + + "\n//@ sourceMappingURL=source-map-data/sourcemapped.map"; + + Components.utils.evalInSandbox(code, gDebuggee, "1.8", + getFileUrl("sourcemapped.js"), 1); +} diff --git a/toolkit/devtools/debugger/tests/unit/xpcshell.ini b/toolkit/devtools/debugger/tests/unit/xpcshell.ini index bdf4d89ad351..a273cdff5944 100644 --- a/toolkit/devtools/debugger/tests/unit/xpcshell.ini +++ b/toolkit/devtools/debugger/tests/unit/xpcshell.ini @@ -81,6 +81,12 @@ reason = bug 820380 [test_sourcemaps-01.js] [test_sourcemaps-02.js] [test_sourcemaps-03.js] +[test_sourcemaps-04.js] +skip-if = toolkit == "gonk" +reason = bug 820380 +[test_sourcemaps-05.js] +skip-if = toolkit == "gonk" +reason = bug 820380 [test_objectgrips-01.js] [test_objectgrips-02.js] [test_objectgrips-03.js] diff --git a/toolkit/devtools/sourcemap/SourceMap.jsm b/toolkit/devtools/sourcemap/SourceMap.jsm index b8f9bd4258a3..05139f7969d9 100644 --- a/toolkit/devtools/sourcemap/SourceMap.jsm +++ b/toolkit/devtools/sourcemap/SourceMap.jsm @@ -470,10 +470,34 @@ define('source-map/util', ['require', 'exports', 'module' , ], function(require, } exports.getArg = getArg; + var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[3], + host: match[4], + port: match[6], + path: match[7] + }; + } + function join(aRoot, aPath) { - return aPath.charAt(0) === '/' - ? aPath - : aRoot.replace(/\/$/, '') + '/' + aPath; + var url; + + if (aPath.match(urlRegexp)) { + return aPath; + } + + if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { + return aRoot.replace(url.path, '') + aPath; + } + + return aRoot.replace(/\/$/, '') + '/' + aPath; } exports.join = join; diff --git a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm index ceb12e0141d3..d78371f3757b 100644 --- a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm +++ b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm @@ -145,9 +145,21 @@ define('test/source-map/util', ['require', 'exports', 'module' , 'lib/source-ma assert.equal(origMapping.column, originalColumn, 'Incorrect column, expected ' + JSON.stringify(originalColumn) + ', got ' + JSON.stringify(origMapping.column)); - assert.equal(origMapping.source, - originalSource ? util.join(map._sourceRoot, originalSource) : null, - 'Incorrect source, expected ' + JSON.stringify(originalSource) + + var expectedSource; + + if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) { + expectedSource = originalSource; + } else if (originalSource) { + expectedSource = map.sourceRoot + ? util.join(map.sourceRoot, originalSource) + : originalSource; + } else { + expectedSource = null; + } + + assert.equal(origMapping.source, expectedSource, + 'Incorrect source, expected ' + JSON.stringify(expectedSource) + ', got ' + JSON.stringify(origMapping.source)); } @@ -238,10 +250,34 @@ define('lib/source-map/util', ['require', 'exports', 'module' , ], function(requ } exports.getArg = getArg; + var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[3], + host: match[4], + port: match[6], + path: match[7] + }; + } + function join(aRoot, aPath) { - return aPath.charAt(0) === '/' - ? aPath - : aRoot.replace(/\/$/, '') + '/' + aPath; + var url; + + if (aPath.match(urlRegexp)) { + return aPath; + } + + if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { + return aRoot.replace(url.path, '') + aPath; + } + + return aRoot.replace(/\/$/, '') + '/' + aPath; } exports.join = join; diff --git a/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js b/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js index 3b7a59e7e11d..515287004df1 100644 --- a/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js +++ b/toolkit/devtools/sourcemap/tests/unit/test_source_map_consumer.js @@ -251,8 +251,46 @@ define("test/source-map/test-source-map-consumer", ["require", "exports", "modul map = new SourceMapConsumer(map.toString()); var sources = map.sources; - assert.equal(map.sources.length, 1); - assert.equal(map.sources[0], 'http://www.example.com/original.js'); + assert.equal(sources.length, 1); + assert.equal(sources[0], 'http://www.example.com/original.js'); + }; + + exports['test github issue #43'] = function (assert, util) { + var map = new SourceMapGenerator({ + sourceRoot: 'http://example.com', + file: 'foo.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'http://cdn.example.com/original.js' + }); + map = new SourceMapConsumer(map.toString()); + + var sources = map.sources; + assert.equal(sources.length, 1, + 'Should only be one source.'); + assert.equal(sources[0], 'http://cdn.example.com/original.js', + 'Should not be joined with the sourceRoot.'); + }; + + exports['test absolute path, but same host sources'] = function (assert, util) { + var map = new SourceMapGenerator({ + sourceRoot: 'http://example.com/foo/bar', + file: 'foo.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: '/original.js' + }); + map = new SourceMapConsumer(map.toString()); + + var sources = map.sources; + assert.equal(sources.length, 1, + 'Should only be one source.'); + assert.equal(sources[0], 'http://example.com/original.js', + 'Source should be relative the host of the source root.'); }; }); From ef5fbc29f79f9053eba16becad5ff44e1086e9ae Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Tue, 9 Apr 2013 12:26:11 -0700 Subject: [PATCH 309/438] Bug 859920 - Some TPS tests failed due to removed autoHide pref. r=trivial, a=test-only --- services/sync/tests/tps/test_bug530717.js | 4 ++-- services/sync/tests/tps/test_client_wipe.js | 4 ++-- services/sync/tests/tps/test_prefs.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/sync/tests/tps/test_bug530717.js b/services/sync/tests/tps/test_bug530717.js index a9b25209e225..4df756eed411 100644 --- a/services/sync/tests/tps/test_bug530717.js +++ b/services/sync/tests/tps/test_bug530717.js @@ -23,7 +23,7 @@ var prefs1 = [ { name: "browser.urlbar.maxRichResults", value: 20 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: true } ]; @@ -35,7 +35,7 @@ var prefs2 = [ { name: "browser.urlbar.maxRichResults", value: 18 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: false } ]; diff --git a/services/sync/tests/tps/test_client_wipe.js b/services/sync/tests/tps/test_client_wipe.js index c5e05d095e99..13265d13b553 100644 --- a/services/sync/tests/tps/test_client_wipe.js +++ b/services/sync/tests/tps/test_client_wipe.js @@ -108,7 +108,7 @@ var prefs1 = [ { name: "browser.urlbar.maxRichResults", value: 20 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: true } ]; @@ -120,7 +120,7 @@ var prefs2 = [ { name: "browser.urlbar.maxRichResults", value: 18 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: false } ]; diff --git a/services/sync/tests/tps/test_prefs.js b/services/sync/tests/tps/test_prefs.js index a8447d6e4e54..3771a2118b98 100644 --- a/services/sync/tests/tps/test_prefs.js +++ b/services/sync/tests/tps/test_prefs.js @@ -19,7 +19,7 @@ var prefs1 = [ { name: "browser.urlbar.maxRichResults", value: 20 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: true } ]; @@ -31,7 +31,7 @@ var prefs2 = [ { name: "browser.urlbar.maxRichResults", value: 18 }, - { name: "browser.tabs.autoHide", + { name: "browser.link.open_newwindow", value: false } ]; From 105a94f13b43f851b65b72e4bcfd0cf8a38375ac Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 15 Apr 2013 13:31:24 -0700 Subject: [PATCH 310/438] Back out ecd327272240 (bug 733712) for Linux oth assertions CLOSED TREE --- accessible/src/atk/AccessibleWrap.cpp | 44 ++++++--------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/accessible/src/atk/AccessibleWrap.cpp b/accessible/src/atk/AccessibleWrap.cpp index 2d28a2d022da..916c739d0f9e 100644 --- a/accessible/src/atk/AccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -141,8 +141,6 @@ struct MaiAtkObjectClass static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, }; -static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName); - G_BEGIN_DECLS /* callbacks for MaiAtkObject */ static void classInitCB(AtkObjectClass *aClass); @@ -602,41 +600,16 @@ getNameCB(AtkObject* aAtkObj) if (!accWrap) return nullptr; - nsAutoString name; - accWrap->Name(name); + nsAutoString uniName; + accWrap->Name(uniName); - // XXX Firing an event from here does not seem right - MaybeFireNameChange(aAtkObj, name); + NS_ConvertUTF8toUTF16 objName(aAtkObj->name); + if (!uniName.Equals(objName)) + atk_object_set_name(aAtkObj, NS_ConvertUTF16toUTF8(uniName).get()); return aAtkObj->name; } -static void -MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName) -{ - NS_ConvertUTF16toUTF8 newNameUTF8(aNewName); - if (newNameUTF8.Equals(aAtkObj->name)) - return; - - // Below we duplicate the functionality of atk_object_set_name(), - // but without calling atk_object_get_name(). Instead of - // atk_object_get_name() we directly access aAtkObj->name. This is because - // atk_object_get_name() would call getNameCB() which would call - // MaybeFireNameChange() (or atk_object_set_name() before this problem was - // fixed) and we would get an infinite recursion. - // See http://bugzilla.mozilla.org/733712 - - // Do not notify for initial name setting. - // See bug http://bugzilla.gnome.org/665870 - bool notify = !!aAtkObj->name; - - free(aAtkObj->name); - aAtkObj->name = strdup(newNameUTF8.get()); - - if (notify) - g_object_notify(G_OBJECT(aAtkObj), "accessible-name"); -} - const gchar * getDescriptionCB(AtkObject *aAtkObj) { @@ -644,7 +617,7 @@ getDescriptionCB(AtkObject *aAtkObj) if (!accWrap || accWrap->IsDefunct()) return nullptr; - /* nsIAccessible is responsible for the nonnull description */ + /* nsIAccessible is responsible for the non-nullptr description */ nsAutoString uniDesc; accWrap->Description(uniDesc); @@ -1002,8 +975,9 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent) { nsAutoString newName; accessible->Name(newName); - - MaybeFireNameChange(atkObj, newName); + NS_ConvertUTF16toUTF8 utf8Name(newName); + if (!atkObj->name || !utf8Name.Equals(atkObj->name)) + atk_object_set_name(atkObj, utf8Name.get()); break; } From 6d424caaff8b46e43e6fd3f712778e0a1130ffd7 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Wed, 10 Apr 2013 15:45:05 -0700 Subject: [PATCH 311/438] Bug 859512 - Do not use StackFrame.exec.fun after it may be relocated; r=luke --HG-- extra : rebase_source : c756c53b78ee456f3d71009d5030c1061802af74 --- js/src/vm/Stack.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index 5780e66b656c..c38bbc188ea6 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -1209,7 +1209,6 @@ ContextStack::popGeneratorFrame(const GeneratorFrameGuard &gfg) { JSGenerator *gen = gfg.gen_; HeapValue *genvp = gen->stackSnapshot; - JS_ASSERT(genvp == HeapValueify(gen->fp->generatorArgsSnapshotBegin())); const FrameRegs &stackRegs = gfg.regs_; StackFrame *stackfp = stackRegs.fp(); From 9836e4b371e97b10381d76c01b0726d7efda63e8 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Wed, 10 Apr 2013 17:57:42 -0700 Subject: [PATCH 312/438] Bug 856925 - Sqlite.jsm tests to demonstrate errors. r=gps --- toolkit/modules/tests/xpcshell/test_sqlite.js | 84 ++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/toolkit/modules/tests/xpcshell/test_sqlite.js b/toolkit/modules/tests/xpcshell/test_sqlite.js index 6c503e3f16d2..bf33150a1e4c 100644 --- a/toolkit/modules/tests/xpcshell/test_sqlite.js +++ b/toolkit/modules/tests/xpcshell/test_sqlite.js @@ -9,8 +9,11 @@ do_get_profile(); Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js"); Cu.import("resource://gre/modules/osfile.jsm"); +Cu.import("resource://gre/modules/FileUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Sqlite.jsm"); Cu.import("resource://gre/modules/Task.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); // To spin the event loop in test. Cu.import("resource://services-common/async.js"); @@ -516,7 +519,7 @@ add_task(function test_in_progress_counts() { outer(); }); - // … and wait for both queries to have finished before we go on and + // … and wait for both queries to have finished before we go on and // test postconditions. outer.wait(); @@ -572,3 +575,82 @@ add_task(function test_discard_cached() { yield c.close(); }); +/** + * Test that direct binding of params and execution through mozStorage doesn't + * error when we manually create a transaction. See Bug 856925. + */ +add_task(function test_direct() { + let file = FileUtils.getFile("TmpD", ["test_direct.sqlite"]); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE); + print("Opening " + file.path); + + let db = Services.storage.openDatabase(file); + print("Opened " + db); + + db.executeSimpleSQL("CREATE TABLE types (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, UNIQUE (name))"); + print("Executed setup."); + + let statement = db.createAsyncStatement("INSERT INTO types (name) VALUES (:name)"); + let params = statement.newBindingParamsArray(); + let one = params.newBindingParams(); + one.bindByName("name", null); + params.addParams(one); + let two = params.newBindingParams(); + two.bindByName("name", "bar"); + params.addParams(two); + + print("Beginning transaction."); + let begin = db.createAsyncStatement("BEGIN DEFERRED TRANSACTION"); + let end = db.createAsyncStatement("COMMIT TRANSACTION"); + + let deferred = Promise.defer(); + begin.executeAsync({ + handleCompletion: function (reason) { + deferred.resolve(); + } + }); + yield deferred.promise; + + statement.bindParameters(params); + + deferred = Promise.defer(); + print("Executing async."); + statement.executeAsync({ + handleResult: function (resultSet) { + }, + + handleError: function (error) { + print("Error when executing SQL (" + error.result + "): " + + error.message); + print("Original error: " + error.error); + errors.push(error); + deferred.reject(); + }, + + handleCompletion: function (reason) { + print("Completed."); + deferred.resolve(); + } + }); + + yield deferred.promise; + + deferred = Promise.defer(); + end.executeAsync({ + handleCompletion: function (reason) { + deferred.resolve(); + } + }); + yield deferred.promise; + + statement.finalize(); + begin.finalize(); + end.finalize(); + + deferred = Promise.defer(); + db.asyncClose(function () { + deferred.resolve() + }); + yield deferred.promise; +}); + From 74a6f95698d0d8cc0990633ed17e65c5f8d9a40b Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Wed, 10 Apr 2013 17:57:42 -0700 Subject: [PATCH 313/438] Bug 833965 - Sqlite.jsm should support an array of binding parameters. r=gps --- toolkit/modules/Sqlite.jsm | 57 +++++++-- toolkit/modules/tests/xpcshell/test_sqlite.js | 112 ++++++++++++++++++ 2 files changed, 157 insertions(+), 12 deletions(-) diff --git a/toolkit/modules/Sqlite.jsm b/toolkit/modules/Sqlite.jsm index b9b8afd690e9..6d392ff863f5 100644 --- a/toolkit/modules/Sqlite.jsm +++ b/toolkit/modules/Sqlite.jsm @@ -689,6 +689,50 @@ OpenedConnection.prototype = Object.freeze({ return count; }, + /** + * Helper method to bind parameters of various kinds through + * reflection. + */ + _bindParameters: function (statement, params) { + if (!params) { + return; + } + + if (Array.isArray(params)) { + // It's an array of separate params. + if (params.length && (typeof(params[0]) == "object")) { + let paramsArray = statement.newBindingParamsArray(); + for (let p of params) { + let bindings = paramsArray.newBindingParams(); + for (let [key, value] of Iterator(p)) { + bindings.bindByName(key, value); + } + paramsArray.addParams(bindings); + } + + statement.bindParameters(paramsArray); + return; + } + + // Indexed params. + for (let i = 0; i < params.length; i++) { + statement.bindByIndex(i, params[i]); + } + return; + } + + // Named params. + if (params && typeof(params) == "object") { + for (let k in params) { + statement.bindByName(k, params[k]); + } + return; + } + + throw new Error("Invalid type for bound parameters. Expected Array or " + + "object. Got: " + params); + }, + _executeStatement: function (sql, statement, params, onRow) { if (statement.state != statement.MOZ_STORAGE_STATEMENT_READY) { throw new Error("Statement is not ready for execution."); @@ -698,18 +742,7 @@ OpenedConnection.prototype = Object.freeze({ throw new Error("onRow must be a function. Got: " + onRow); } - if (Array.isArray(params)) { - for (let i = 0; i < params.length; i++) { - statement.bindByIndex(i, params[i]); - } - } else if (params && typeof(params) == "object") { - for (let k in params) { - statement.bindByName(k, params[k]); - } - } else if (params) { - throw new Error("Invalid type for bound parameters. Expected Array or " + - "object. Got: " + params); - } + this._bindParameters(statement, params); let index = this._statementCounter++; diff --git a/toolkit/modules/tests/xpcshell/test_sqlite.js b/toolkit/modules/tests/xpcshell/test_sqlite.js index bf33150a1e4c..3d41800cffbc 100644 --- a/toolkit/modules/tests/xpcshell/test_sqlite.js +++ b/toolkit/modules/tests/xpcshell/test_sqlite.js @@ -575,6 +575,118 @@ add_task(function test_discard_cached() { yield c.close(); }); +add_task(function test_programmatic_binding() { + let c = yield getDummyDatabase("programmatic_binding"); + + let bindings = [ + {id: 1, path: "foobar"}, + {id: null, path: "baznoo"}, + {id: 5, path: "toofoo"}, + ]; + + let sql = "INSERT INTO dirs VALUES (:id, :path)"; + let result = yield c.execute(sql, bindings); + do_check_eq(result.length, 0); + + let rows = yield c.executeCached("SELECT * from dirs"); + do_check_eq(rows.length, 3); + yield c.close(); +}); + +add_task(function test_programmatic_binding_transaction() { + let c = yield getDummyDatabase("programmatic_binding_transaction"); + + let bindings = [ + {id: 1, path: "foobar"}, + {id: null, path: "baznoo"}, + {id: 5, path: "toofoo"}, + ]; + + let sql = "INSERT INTO dirs VALUES (:id, :path)"; + yield c.executeTransaction(function transaction() { + let result = yield c.execute(sql, bindings); + do_check_eq(result.length, 0); + + let rows = yield c.executeCached("SELECT * from dirs"); + do_check_eq(rows.length, 3); + }); + + // Transaction committed. + let rows = yield c.executeCached("SELECT * from dirs"); + do_check_eq(rows.length, 3); + yield c.close(); +}); + +add_task(function test_programmatic_binding_transaction_partial_rollback() { + let c = yield getDummyDatabase("programmatic_binding_transaction_partial_rollback"); + + let bindings = [ + {id: 2, path: "foobar"}, + {id: 3, path: "toofoo"}, + ]; + + let sql = "INSERT INTO dirs VALUES (:id, :path)"; + + // Add some data in an implicit transaction before beginning the batch insert. + yield c.execute(sql, {id: 1, path: "works"}); + + let secondSucceeded = false; + try { + yield c.executeTransaction(function transaction() { + // Insert one row. This won't implicitly start a transaction. + let result = yield c.execute(sql, bindings[0]); + + // Insert multiple rows. mozStorage will want to start a transaction. + // One of the inserts will fail, so the transaction should be rolled back. + let result = yield c.execute(sql, bindings); + secondSucceeded = true; + }); + } catch (ex) { + print("Caught expected exception: " + ex); + } + + // We did not get to the end of our in-transaction block. + do_check_false(secondSucceeded); + + // Everything that happened in *our* transaction, not mozStorage's, got + // rolled back, but the first row still exists. + let rows = yield c.executeCached("SELECT * from dirs"); + do_check_eq(rows.length, 1); + do_check_eq(rows[0].getResultByName("path"), "works"); + yield c.close(); +}); + +/** + * Just like the previous test, but relying on the implicit + * transaction established by mozStorage. + */ +add_task(function test_programmatic_binding_implicit_transaction() { + let c = yield getDummyDatabase("programmatic_binding_implicit_transaction"); + + let bindings = [ + {id: 2, path: "foobar"}, + {id: 1, path: "toofoo"}, + ]; + + let sql = "INSERT INTO dirs VALUES (:id, :path)"; + let secondSucceeded = false; + yield c.execute(sql, {id: 1, path: "works"}); + try { + let result = yield c.execute(sql, bindings); + secondSucceeded = true; + } catch (ex) { + print("Caught expected exception: " + ex); + } + + do_check_false(secondSucceeded); + + // The entire batch failed. + let rows = yield c.executeCached("SELECT * from dirs"); + do_check_eq(rows.length, 1); + do_check_eq(rows[0].getResultByName("path"), "works"); + yield c.close(); +}); + /** * Test that direct binding of params and execution through mozStorage doesn't * error when we manually create a transaction. See Bug 856925. From eab1b226e32fce60f7072b8130ef0b3a3f1bcb38 Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Tue, 16 Apr 2013 14:01:13 +0200 Subject: [PATCH 314/438] Bug 862247 - Fix Contacts/Settings tests not running individually. r=gwagner --HG-- extra : rebase_source : c9048a4680383576f329c4dcfb139a8e05633076 --- dom/contacts/tests/test_contacts_basics.html | 6 +++--- dom/contacts/tests/test_contacts_blobs.html | 16 ++++++++++------ dom/contacts/tests/test_contacts_getall.html | 9 +++++---- .../tests/test_contacts_international.html | 15 ++++++++++----- dom/settings/tests/test_settings_blobs.html | 7 ++++++- .../tests/test_settings_onsettingchange.html | 13 +++++++++---- 6 files changed, 43 insertions(+), 23 deletions(-) diff --git a/dom/contacts/tests/test_contacts_basics.html b/dom/contacts/tests/test_contacts_basics.html index 2e3fd21dec64..8393efda2732 100644 --- a/dom/contacts/tests/test_contacts_basics.html +++ b/dom/contacts/tests/test_contacts_basics.html @@ -1,17 +1,17 @@ - Test for Bug {674720} WebContacts + Test for Bug 674720 WebContacts -Mozilla Bug {674720} +Mozilla Bug 674720