Merge mass backout to tip. a=me

This commit is contained in:
Kyle Huey 2010-11-24 01:09:17 -05:00
Родитель a49f3412d8 1011f26801
Коммит 2fc4305399
128 изменённых файлов: 2974 добавлений и 1359 удалений

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

@ -652,35 +652,31 @@ case "$target" in
if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
fi
if test "$_CC_MAJOR_VERSION" = "13"; then
_CC_SUITE=7
elif test "$_CC_MAJOR_VERSION" = "14"; then
if test "$_CC_MAJOR_VERSION" = "14"; then
dnl Require VC8SP1 or newer.
dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762.
if test "$_CC_RELEASE" -lt 50727 -o \
\( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. You probably need to install Service Pack 1 of Visual Studio 2005. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
_CC_SUITE=8
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
dnl so be very specific here!
dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
if test $_CC_RELEASE -gt 50727; then
_USE_DYNAMICBASE=1
elif test $_CC_BUILD -ge 762; then
_USE_DYNAMICBASE=1
fi
AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
elif test "$_CC_MAJOR_VERSION" = "15"; then
_CC_SUITE=9
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
_USE_DYNAMICBASE=1
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
elif test "$_CC_MAJOR_VERSION" = "16"; then
_CC_SUITE=10
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
_USE_DYNAMICBASE=1
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
else
AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
_MOZ_RTTI_FLAGS_ON='-GR'
@ -691,33 +687,32 @@ case "$target" in
if test -n "$WIN32_REDIST_DIR"; then
WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
fi
# bug #249782
# ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
if test "$_CC_SUITE" -ge "8"; then
changequote(,)
_MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
changequote([,])
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
if test -n "$MSMT_TOOL"; then
MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
if test -z "$MSMANIFEST_TOOL_VERSION"; then
AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
fi
MSMANIFEST_TOOL=1
unset MSMT_TOOL
else
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
fi
dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
dnl not something else like "magnetic tape manipulation utility".
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
if test -z "$MSMT_TOOL"; then
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
fi
changequote(,)
_MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
changequote([,])
MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
if test -z "$MSMANIFEST_TOOL_VERSION"; then
AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
fi
MSMANIFEST_TOOL=1
unset MSMT_TOOL
# Check linker version
_LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
_LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
fi
INCREMENTAL_LINKER=1
# Check midl version
@ -2430,9 +2425,7 @@ ia64*-hpux*)
dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
dnl Probably also a compiler bug, but what can you do?
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
if test -n "$_USE_DYNAMICBASE"; then
LDFLAGS="$LDFLAGS -DYNAMICBASE"
fi
LDFLAGS="$LDFLAGS -DYNAMICBASE"
fi
fi
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg32$(VERSION_NUMBER),$(DEPTH)/jpeg)'
@ -2493,7 +2486,7 @@ ia64*-hpux*)
case "$host_os" in
cygwin*|msvc*|mks*)
AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
;;
*)

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

@ -107,7 +107,6 @@ struct JSObject;
class nsFrameLoader;
class nsIBoxObject;
class imgIRequest;
class nsISHEntry;
namespace mozilla {
namespace css {
@ -451,16 +450,11 @@ public:
nsIPresShell* GetShell() const
{
return GetBFCacheEntry() ? nsnull : mPresShell;
return mShellIsHidden ? nsnull : mPresShell;
}
void SetBFCacheEntry(nsISHEntry* aSHEntry) {
mSHEntry = aSHEntry;
// Doing this just to keep binary compat for the gecko 2.0 release
mShellIsHidden = !!aSHEntry;
}
nsISHEntry* GetBFCacheEntry() const { return mSHEntry; }
void SetShellHidden(PRBool aHide) { mShellIsHidden = aHide; }
PRBool ShellIsHidden() const { return mShellIsHidden; }
/**
* Return the parent document of this document. Will return null
@ -1600,8 +1594,6 @@ protected:
// document in it.
PRPackedBool mIsInitialDocumentInWindow;
// True if we're currently bfcached. This is only here for binary compat.
// Remove once the gecko 2.0 has branched and just use mSHEntry instead.
PRPackedBool mShellIsHidden;
PRPackedBool mIsRegularHTML;
@ -1714,10 +1706,6 @@ protected:
nsCOMPtr<nsIDocumentEncoder> mCachedEncoder;
AnimationListenerList mAnimationFrameListeners;
// The session history entry in which we're currently bf-cached. Non-null
// if and only if we're currently in the bfcache.
nsISHEntry* mSHEntry;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID)

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

@ -3176,7 +3176,7 @@ nsDocument::doCreateShell(nsPresContext* aContext,
NS_ASSERTION(!mPresShell, "We have a presshell already!");
NS_ENSURE_FALSE(GetBFCacheEntry(), NS_ERROR_FAILURE);
NS_ENSURE_FALSE(mShellIsHidden, NS_ERROR_FAILURE);
FillStyleSet(aStyleSet);

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

@ -588,6 +588,7 @@ GK_ATOM(mouseover, "mouseover")
GK_ATOM(mousethrough, "mousethrough")
GK_ATOM(mouseup, "mouseup")
GK_ATOM(moz_opaque, "moz-opaque")
GK_ATOM(moz_action_hint, "mozactionhint")
GK_ATOM(x_moz_errormessage, "x-moz-errormessage")
GK_ATOM(msthemecompatible, "msthemecompatible")
GK_ATOM(multicol, "multicol")

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

@ -274,10 +274,14 @@ nsIMEStateManager::SetIMEState(PRUint32 aState,
PRUint32 state = nsContentUtils::GetWidgetStatusFromIMEStatus(aState);
IMEContext context;
context.mStatus = state;
if (aContent && aContent->Tag() == nsGkAtoms::input) {
if (aContent && aContent->GetNameSpaceID() == kNameSpaceID_XHTML &&
(aContent->Tag() == nsGkAtoms::input ||
aContent->Tag() == nsGkAtoms::textarea)) {
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type,
context.mHTMLInputType);
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::moz_action_hint,
context.mActionHint);
}
widget2->SetInputMode(context);

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

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg">
<g><animateTransform attributeName="transform" by="1"/></g>
</svg>

После

Ширина:  |  Высота:  |  Размер: 110 B

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

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<animate attributeName="stroke-width"/>
<animate attributeName="stroke-width" by="10em"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 142 B

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

@ -6,6 +6,7 @@ load 526536-1.svg
load 526875-1.svg
load 526875-2.svg
load 529387-1.xhtml
load 531550-1.svg
load 537157-1.svg
load 541297-1.svg
load 547333-1.svg
@ -30,3 +31,4 @@ load 605345-1.svg
load 606101-1.svg
load 608549-1.svg
load 608295-1.html
load 611927-1.svg

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

@ -72,7 +72,8 @@ GetRefreshDriverForDoc(nsIDocument* aDoc)
// ctors, dtors, factory methods
nsSMILAnimationController::nsSMILAnimationController()
: mResampleNeeded(PR_FALSE),
: mAvgTimeBetweenSamples(0),
mResampleNeeded(PR_FALSE),
mDeferredStartSampling(PR_FALSE),
mRunningSample(PR_FALSE),
mDocument(nsnull)
@ -142,6 +143,9 @@ void
nsSMILAnimationController::Resume(PRUint32 aType)
{
PRBool wasPaused = (mPauseState != 0);
// Update mCurrentSampleTime so that calls to GetParentTime--used for
// calculating parent offsets--are accurate
mCurrentSampleTime = mozilla::TimeStamp::Now();
nsSMILTimeContainer::Resume(aType);
@ -176,7 +180,42 @@ nsSMILAnimationController::WillRefresh(mozilla::TimeStamp aTime)
// doing so we get sampled by a refresh driver whose most recent refresh time
// predates when we were initialised, so to be safe we make sure to take the
// most recent time here.
mCurrentSampleTime = NS_MAX(mCurrentSampleTime, aTime);
aTime = NS_MAX(mCurrentSampleTime, aTime);
// Sleep detection: If the time between samples is a whole lot greater than we
// were expecting then we assume the computer went to sleep or someone's
// messing with the clock. In that case, fiddle our parent offset and use our
// average time between samples to calculate the new sample time. This
// prevents us from hanging while trying to catch up on all the missed time.
// Smoothing of coefficient for the average function. 0.2 should let us track
// the sample rate reasonably tightly without being overly affected by
// occasional delays.
static const double SAMPLE_DUR_WEIGHTING = 0.2;
// If the elapsed time exceeds our expectation by this number of times we'll
// initiate special behaviour to basically ignore the intervening time.
static const double SAMPLE_DEV_THRESHOLD = 200.0;
nsSMILTime elapsedTime =
(nsSMILTime)(aTime - mCurrentSampleTime).ToMilliseconds();
// First sample:
if (mAvgTimeBetweenSamples == 0) {
mAvgTimeBetweenSamples = elapsedTime;
// Unexpectedly long delay between samples:
} else if (elapsedTime > SAMPLE_DEV_THRESHOLD * mAvgTimeBetweenSamples) {
NS_WARNING("Detected really long delay between samples, continuing from "
"previous sample");
mParentOffset += elapsedTime - mAvgTimeBetweenSamples;
// Usual case, update moving average:
} else {
// Due to truncation here the average will normally be a little less than
// it should be but that's probably ok
mAvgTimeBetweenSamples =
(nsSMILTime)(elapsedTime * SAMPLE_DUR_WEIGHTING +
mAvgTimeBetweenSamples * (1.0 - SAMPLE_DUR_WEIGHTING));
}
mCurrentSampleTime = aTime;
Sample();
}
@ -287,6 +326,9 @@ nsSMILAnimationController::StartSampling(nsRefreshDriver* aRefreshDriver)
NS_ABORT_IF_FALSE(!GetRefreshDriverForDoc(mDocument) ||
aRefreshDriver == GetRefreshDriverForDoc(mDocument),
"Starting sampling with wrong refresh driver");
// We're effectively resuming from a pause so update our current sample time
// or else it will confuse our "average time between samples" calculations.
mCurrentSampleTime = mozilla::TimeStamp::Now();
aRefreshDriver->AddRefreshObserver(this, Flush_Style);
}
}

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

@ -203,6 +203,25 @@ protected:
TimeContainerHashtable mChildContainerTable;
mozilla::TimeStamp mCurrentSampleTime;
mozilla::TimeStamp mStartTime;
// Average time between samples from the refresh driver. This is used to
// detect large unexpected gaps between samples such as can occur when the
// computer sleeps. The nature of the SMIL model means that catching up these
// large gaps can be expensive as, for example, many events may need to be
// dispatched for the intervening time when no samples were received.
//
// In such cases, we ignore the intervening gap and continue sampling from
// when we were expecting the next sample to arrive.
//
// Note that we only do this for SMIL and not CSS transitions (which doesn't
// have so much work to do to catch up) nor scripted animations (which expect
// animation time to follow real time).
//
// This behaviour does not affect pausing (since we're not *expecting* any
// samples then) nor seeking (where the SMIL model behaves somewhat
// differently such as not dispatching events).
nsSMILTime mAvgTimeBetweenSamples;
PRPackedBool mResampleNeeded;
// If we're told to start sampling but there are no animation elements we just
// record the time, set the following flag, and then wait until we have an

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

@ -246,6 +246,14 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
mSimpleDuration.IsIndefinite() || mLastValue,
"Unresolved simple duration for active or frozen animation");
// If we want to add but don't have a base value then just fail outright.
// This can happen when we skipped getting the base value because there's an
// animation function in the sandwich that should replace it but that function
// failed unexpectedly.
PRBool isAdditive = IsAdditive();
if (isAdditive && aResult.IsNull())
return;
nsSMILValue result;
if (mSimpleDuration.IsIndefinite() ||
@ -286,7 +294,7 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
}
// If additive animation isn't required or isn't supported, set the value.
if (!IsAdditive() || NS_FAILED(aResult.SandwichAdd(result))) {
if (!isAdditive || NS_FAILED(aResult.SandwichAdd(result))) {
aResult.Swap(result);
// Note: The old value of aResult is now in |result|, and it will get
// cleaned up when |result| goes out of scope, when this function returns.

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

@ -182,10 +182,20 @@ nsSVGTransformSMILType::SandwichAdd(nsSMILValue& aDest,
const TransformArray& srcTransforms
(*static_cast<const TransformArray*>(aValueToAdd.mU.mPtr));
// We're only expecting to be adding 1 src transform on to the list
NS_ASSERTION(srcTransforms.Length() == 1,
// We should have 0 or 1 transforms in the src list.
NS_ASSERTION(srcTransforms.Length() < 2,
"Trying to do sandwich add of more than one value");
// The empty src transform list case only occurs in some limited circumstances
// where we create an empty 'from' value to interpolate from (e.g.
// by-animation) but then skip the interpolation step for some reason (e.g.
// because we have an indefinite duration which means we'll never get past the
// first value) and instead attempt to add that empty value to the underlying
// value.
// In any case, the expected result is that nothing is added.
if (srcTransforms.IsEmpty())
return NS_OK;
// Stick the src on the end of the array
const nsSVGSMILTransform& srcTransform = srcTransforms[0];
nsSVGSMILTransform* result = dstTransforms.AppendElement(srcTransform);

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

@ -250,12 +250,6 @@ interface nsISHEntry : nsIHistoryEntry
attribute unsigned long long docshellID;
};
[scriptable, uuid(e0b0ac6d-cb29-4be2-b685-1755d6301a69)]
interface nsISHEntryInternal : nsISupports
{
[notxpcom] void RemoveFromBFCacheAsync();
[notxpcom] void RemoveFromBFCacheSync();
};
%{ C++
// {BFD1A791-AD9F-11d3-BDC7-0050040A9B44}

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

@ -165,10 +165,10 @@ nsSHEntry::~nsSHEntry()
mChildren.EnumerateForwards(ClearParentPtr, nsnull);
mChildren.Clear();
if (mContentViewer) {
// RemoveFromBFCacheSync is virtual, so call the nsSHEntry version
// explicitly
nsSHEntry::RemoveFromBFCacheSync();
nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
DropPresentationState();
if (viewer) {
viewer->Destroy();
}
mEditorData = nsnull;
@ -187,8 +187,8 @@ nsSHEntry::~nsSHEntry()
// nsSHEntry: nsISupports
//*****************************************************************************
NS_IMPL_ISUPPORTS5(nsSHEntry, nsISHContainer, nsISHEntry, nsIHistoryEntry,
nsIMutationObserver, nsISHEntryInternal)
NS_IMPL_ISUPPORTS4(nsSHEntry, nsISHContainer, nsISHEntry, nsIHistoryEntry,
nsIMutationObserver)
//*****************************************************************************
// nsSHEntry: nsISHEntry
@ -254,7 +254,7 @@ nsSHEntry::SetContentViewer(nsIContentViewer *aViewer)
// the contentviewer
mDocument = do_QueryInterface(domDoc);
if (mDocument) {
mDocument->SetBFCacheEntry(this);
mDocument->SetShellHidden(PR_TRUE);
mDocument->AddMutationObserver(this);
}
}
@ -747,7 +747,7 @@ nsSHEntry::DropPresentationState()
nsRefPtr<nsSHEntry> kungFuDeathGrip = this;
if (mDocument) {
mDocument->SetBFCacheEntry(nsnull);
mDocument->SetShellHidden(PR_FALSE);
mDocument->RemoveMutationObserver(this);
mDocument = nsnull;
}
@ -810,7 +810,7 @@ nsSHEntry::CharacterDataChanged(nsIDocument* aDocument,
nsIContent* aContent,
CharacterDataChangeInfo* aInfo)
{
RemoveFromBFCacheAsync();
DocumentMutated();
}
void
@ -829,7 +829,7 @@ nsSHEntry::AttributeChanged(nsIDocument* aDocument,
nsIAtom* aAttribute,
PRInt32 aModType)
{
RemoveFromBFCacheAsync();
DocumentMutated();
}
void
@ -838,7 +838,7 @@ nsSHEntry::ContentAppended(nsIDocument* aDocument,
nsIContent* aFirstNewContent,
PRInt32 /* unused */)
{
RemoveFromBFCacheAsync();
DocumentMutated();
}
void
@ -847,7 +847,7 @@ nsSHEntry::ContentInserted(nsIDocument* aDocument,
nsIContent* aChild,
PRInt32 /* unused */)
{
RemoveFromBFCacheAsync();
DocumentMutated();
}
void
@ -857,7 +857,7 @@ nsSHEntry::ContentRemoved(nsIDocument* aDocument,
PRInt32 aIndexInContainer,
nsIContent* aPreviousSibling)
{
RemoveFromBFCacheAsync();
DocumentMutated();
}
void
@ -885,27 +885,10 @@ public:
};
void
nsSHEntry::RemoveFromBFCacheSync()
nsSHEntry::DocumentMutated()
{
NS_ASSERTION(mContentViewer && mDocument,
"we're not in the bfcache!");
nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
DropPresentationState();
// Warning! The call to DropPresentationState could have dropped the last
// reference to this nsSHEntry, so no accessing members beyond here.
if (viewer) {
viewer->Destroy();
}
}
void
nsSHEntry::RemoveFromBFCacheAsync()
{
NS_ASSERTION(mContentViewer && mDocument,
"we're not in the bfcache!");
"we shouldn't still be observing the doc");
// Release the reference to the contentviewer asynchronously so that the
// document doesn't get nuked mid-mutation.

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

@ -63,8 +63,7 @@
class nsSHEntry : public nsISHEntry,
public nsISHContainer,
public nsIMutationObserver,
public nsISHEntryInternal
public nsIMutationObserver
{
public:
nsSHEntry();
@ -73,7 +72,6 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIHISTORYENTRY
NS_DECL_NSISHENTRY
NS_DECL_NSISHENTRYINTERNAL
NS_DECL_NSISHCONTAINER
NS_DECL_NSIMUTATIONOBSERVER
@ -88,6 +86,7 @@ public:
private:
~nsSHEntry();
void DocumentMutated();
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mReferrerURI;

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

@ -47,7 +47,6 @@
#include "nsCycleCollectionParticipant.h"
#include "nsDOMEventTargetHelper.h"
#include "nsDOMLists.h"
#include "nsIDocument.h"
class nsIScriptContext;
class nsPIDOMWindow;
@ -110,13 +109,6 @@ public:
return mOwner;
}
already_AddRefed<nsIDocument> GetOwnerDocument()
{
NS_ASSERTION(mOwner, "This should never be null!");
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mOwner->GetExtantDocument());
return doc.forget();
}
bool IsQuotaDisabled();
nsCString& Origin()

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

@ -56,7 +56,6 @@
#include "IDBFactory.h"
#include "LazyIdleThread.h"
#include "TransactionThreadPool.h"
#include "nsISHEntry.h"
// The amount of time, in milliseconds, that our IO thread will stay alive
// after the last event it processes.
@ -163,33 +162,18 @@ public:
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
// Fire version change events at all of the databases that are not already
// closed. Also kick bfcached documents out of bfcache.
// closed.
for (PRUint32 index = 0; index < mWaitingDatabases.Length(); index++) {
nsRefPtr<IDBDatabase>& database = mWaitingDatabases[index];
if (database->IsClosed()) {
continue;
if (!database->IsClosed()) {
nsCOMPtr<nsIDOMEvent> event(IDBVersionChangeEvent::Create(mVersion));
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
PRBool dummy;
database->DispatchEvent(event, &dummy);
}
// First check if the document the IDBDatabase is part of is bfcached
nsCOMPtr<nsIDocument> ownerDoc = database->GetOwnerDocument();
nsISHEntry* shEntry;
if (ownerDoc && (shEntry = ownerDoc->GetBFCacheEntry())) {
nsCOMPtr<nsISHEntryInternal> sheInternal = do_QueryInterface(shEntry);
if (sheInternal) {
sheInternal->RemoveFromBFCacheSync();
}
NS_ASSERTION(database->IsClosed(),
"Kicking doc out of bfcache should have closed database");
continue;
}
// Otherwise fire a versionchange event.
nsCOMPtr<nsIDOMEvent> event(IDBVersionChangeEvent::Create(mVersion));
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
PRBool dummy;
database->DispatchEvent(event, &dummy);
}
// Now check to see if any didn't close. If there are some running still

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

@ -45,13 +45,10 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
TEST_FILES = \
bfcache_iframe1.html \
bfcache_iframe2.html \
event_propagation_iframe.html \
helpers.js \
test_add_twice_failure.html \
test_bad_keypath.html \
test_bfcache.html \
test_clear.html \
test_create_index.html \
test_create_objectStore.html \

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

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script>
moz_indexedDB.open(parent.location).onsuccess = function(e) {
var db = e.result;
// This should never be called
db.onversionchange = function(e) {
db.transaction(["mystore"]).objectStore("mystore").put({ hello: "fail" }, 42);
}
db.setVersion("1.0").onsuccess = function(e) {
trans = e.transaction;
if (db.objectStoreNames.contains("mystore")) {
db.deleteObjectStore("mystore");
}
var store = db.createObjectStore("mystore", "");
store.add({ hello: "world" }, 42);
trans.oncomplete = function() {
parent.postMessage("go", "http://mochi.test:8888");
}
};
};
</script>
</head>
<body>
This is page one.
</body>
</html>

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

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script>
var res = {};
moz_indexedDB.open(parent.location).onsuccess = function(e) {
var db = e.result;
res.version = db.version;
res.storeCount = db.objectStoreNames.length;
req = db.setVersion("2.0");
req.onblocked = function() {
res.blockedFired = true;
}
req.onsuccess = function(e) {
var trans = e.transaction;
trans.objectStore("mystore").get(42).onsuccess = function(e) {
res.value = JSON.stringify(e.result);
}
trans.oncomplete = function() {
parent.postMessage(JSON.stringify(res), "http://mochi.test:8888");
}
}
};
</script>
</head>
<body>
This is page two.
</body>
</html>

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

@ -1,65 +0,0 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>Indexed Database Property Test</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript;version=1.7">
var gOrigMaxTotalViewers = undefined;
function setCachePref(enabled) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (enabled) {
is(typeof gOrigMaxTotalViewers, "undefined", "don't double-enable bfcache");
prefBranch.setBoolPref("browser.sessionhistory.cache_subframes", true);
gOrigMaxTotalViewers = prefBranch.getIntPref("browser.sessionhistory.max_total_viewers");
prefBranch.setIntPref("browser.sessionhistory.max_total_viewers", 10);
}
else {
is(typeof gOrigMaxTotalViewers, "number", "don't double-disable bfcache");
prefBranch.setIntPref("browser.sessionhistory.max_total_viewers", gOrigMaxTotalViewers);
gOrigMaxTotalViewers = undefined;
try {
prefBranch.clearUserPref("browser.sessionhistory.cache_subframes");
} catch (e) { /* Pref didn't exist, meh */ }
}
}
function testSteps()
{
var iframe = $("iframe");
setCachePref(true);
window.onmessage = grabEventAndContinueHandler;
iframe.src = "bfcache_iframe1.html";
var event = yield;
is(event.data, "go", "set up database successfully");
iframe.src = "bfcache_iframe2.html";
res = JSON.parse((yield).data);
is(res.version, "1.0", "version was set correctly");
is(res.storeCount, 1, "correct set of stores");
ok(!("blockedFired" in res), "blocked shouldn't fire");
is(res.value, JSON.stringify({ hello: "world" }),
"correct value found in store");
setCachePref(false);
finishTest();
yield;
}
</script>
<script type="text/javascript;version=1.7" src="helpers.js"></script>
</head>
<body onload="runTest();">
<iframe id="iframe"></iframe>
</body>
</html>

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

@ -169,7 +169,7 @@ parent:
sync GetIMEEnabled() returns (PRUint32 value);
SetInputMode(PRUint32 value, nsString type);
SetInputMode(PRUint32 value, nsString type, nsString actionHint);
sync GetIMEOpenState() returns (PRBool value);

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

@ -495,7 +495,7 @@ TabParent::RecvGetIMEEnabled(PRUint32* aValue)
}
bool
TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType)
TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction)
{
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget || !AllowContentIME())
@ -506,6 +506,7 @@ TabParent::RecvSetInputMode(const PRUint32& aValue, const nsString& aType)
IMEContext context;
context.mStatus = aValue;
context.mHTMLInputType.Assign(aType);
context.mActionHint.Assign(aAction);
widget2->SetInputMode(context);
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();

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

@ -102,7 +102,7 @@ public:
virtual bool RecvEndIMEComposition(const PRBool& aCancel,
nsString* aComposition);
virtual bool RecvGetIMEEnabled(PRUint32* aValue);
virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType);
virtual bool RecvSetInputMode(const PRUint32& aValue, const nsString& aType, const nsString& aAction);
virtual bool RecvGetIMEOpenState(PRBool* aValue);
virtual bool RecvSetIMEOpenState(const PRBool& aValue);
virtual PContentDialogParent* AllocPContentDialog(const PRUint32& aType,

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

@ -346,6 +346,11 @@ abstract public class GeckoApp
return true;
}
break;
case KeyEvent.KEYCODE_ENTER:
if ((event.getFlags() & KeyEvent.FLAG_EDITOR_ACTION) != 0 &&
surfaceView.mIMEActionHint.equalsIgnoreCase("next"))
event = new KeyEvent(event.getAction(), KeyEvent.KEYCODE_TAB);
break;
default:
break;
}

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

@ -256,14 +256,16 @@ class GeckoAppShell
}
}
public static void notifyIMEEnabled(int state, String hint) {
public static void notifyIMEEnabled(int state, String typeHint,
String actionHint) {
if (GeckoApp.surfaceView == null)
return;
/* When IME is 'disabled', IME processing is disabled.
In addition, the IME UI is hidden */
GeckoApp.surfaceView.mIMEState = state;
GeckoApp.surfaceView.mIMEHint = hint;
GeckoApp.surfaceView.mIMETypeHint = typeHint;
GeckoApp.surfaceView.mIMEActionHint = actionHint;
IMEStateUpdater.enableIME();
}

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

@ -87,7 +87,8 @@ class GeckoSurfaceView
mEditableFactory = Editable.Factory.getInstance();
setupEditable("");
mIMEState = IME_STATE_DISABLED;
mIMEHint = "";
mIMETypeHint = "";
mIMEActionHint = "";
}
protected void finalize() throws Throwable {
@ -296,28 +297,40 @@ class GeckoSurfaceView
if (mIMEState == IME_STATE_PASSWORD)
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_PASSWORD;
else if (mIMEHint.equalsIgnoreCase("url"))
else if (mIMETypeHint.equalsIgnoreCase("url"))
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_URI;
else if (mIMEHint.equalsIgnoreCase("email"))
else if (mIMETypeHint.equalsIgnoreCase("email"))
outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
else if (mIMEHint.equalsIgnoreCase("search"))
else if (mIMETypeHint.equalsIgnoreCase("search"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEARCH;
else if (mIMEHint.equalsIgnoreCase("tel"))
else if (mIMETypeHint.equalsIgnoreCase("tel"))
outAttrs.inputType = InputType.TYPE_CLASS_PHONE;
else if (mIMEHint.equalsIgnoreCase("number") ||
mIMEHint.equalsIgnoreCase("range"))
else if (mIMETypeHint.equalsIgnoreCase("number") ||
mIMETypeHint.equalsIgnoreCase("range"))
outAttrs.inputType = InputType.TYPE_CLASS_NUMBER;
else if (mIMEHint.equalsIgnoreCase("datetime") ||
mIMEHint.equalsIgnoreCase("datetime-local"))
else if (mIMETypeHint.equalsIgnoreCase("datetime") ||
mIMETypeHint.equalsIgnoreCase("datetime-local"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_NORMAL;
else if (mIMEHint.equalsIgnoreCase("date"))
else if (mIMETypeHint.equalsIgnoreCase("date"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_DATE;
else if (mIMEHint.equalsIgnoreCase("time"))
else if (mIMETypeHint.equalsIgnoreCase("time"))
outAttrs.inputType = InputType.TYPE_CLASS_DATETIME |
InputType.TYPE_DATETIME_VARIATION_TIME;
if (mIMEActionHint.equalsIgnoreCase("go"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_GO;
else if (mIMEActionHint.equalsIgnoreCase("done"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
else if (mIMEActionHint.equalsIgnoreCase("next"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_NEXT;
else if (mIMEActionHint.equalsIgnoreCase("search"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEARCH;
else if (mIMEActionHint.equalsIgnoreCase("send"))
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEND;
else
outAttrs.actionLabel = mIMEActionHint;
inputConnection.reset();
return inputConnection;
}
@ -404,7 +417,8 @@ class GeckoSurfaceView
Editable.Factory mEditableFactory;
boolean mIMEFocus;
int mIMEState;
String mIMEHint;
String mIMETypeHint;
String mIMEActionHint;
// Software rendering
ByteBuffer mSoftwareBuffer;

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

@ -246,7 +246,7 @@ ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
(drawBounds.y < yBoundary && yBoundary < drawBounds.YMost())) {
// The stuff we need to redraw will wrap around an edge of the
// buffer, so we will need to do a self-copy
if (mBufferRotation == nsIntPoint(0,0)) {
if (mBuffer->SupportsSelfCopy() && mBufferRotation == nsIntPoint(0,0)) {
destBuffer = mBuffer;
} else {
// We can't do a real self-copy because the buffer is rotated.

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

@ -233,6 +233,8 @@ public:
virtual const gfxIntSize GetSize() const { return gfxIntSize(-1, -1); }
virtual PRBool SupportsSelfCopy() { return PR_TRUE; }
protected:
gfxASurface() : mSurface(nsnull), mFloatingRefs(0), mBytesRecorded(0), mSurfaceValid(PR_FALSE)
{

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

@ -108,6 +108,8 @@ public:
virtual already_AddRefed<gfxImageSurface> GetAsImageSurface();
virtual PRBool SupportsSelfCopy() { return PR_FALSE; }
protected:
gfxImageSurface();
void InitWithData(unsigned char *aData, const gfxIntSize& aSize,

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

@ -5582,9 +5582,9 @@ MOZ_ARG_ENABLE_BOOL(ctypes,
JS_HAS_CTYPES= )
AC_SUBST(JS_HAS_CTYPES)
if test "$JS_HAS_CTYPES"; then
if test "$_MSC_VER" -a -z $AS; then
# Error out if we're on MSVC and MASM is unavailable.
AC_MSG_ERROR([No suitable assembler found. An assembler is required to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK.])
dnl Error out if we're on MSVC and MASM is unavailable.
if test -n "$_MSC_VER" -a \( "$AS" != "ml.exe" -a "$AS" != "ml64.exe" \); then
AC_MSG_ERROR([\"$AS\" is not a suitable assembler to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK. Or do not use --enable-ctypes.])
fi
AC_DEFINE(JS_HAS_CTYPES)
fi

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

@ -0,0 +1,12 @@
var isTrue = true;
function g(x) {
return x;
}
function f() {
return g.apply(null, isTrue ? ["happy"] : arguments);
}
for (var i = 0; i < HOTLOOP + 10; ++i)
assertEq(f("sad"), "happy");

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

@ -2474,6 +2474,7 @@ mjit::Compiler::canUseApplyTricks()
jsbytecode *nextpc = PC + JSOP_ARGUMENTS_LENGTH;
return *nextpc == JSOP_FUNAPPLY &&
IsLowerableFunCallOrApply(nextpc) &&
!analysis->jumpTarget(nextpc) &&
!debugMode();
}

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

@ -2117,10 +2117,8 @@ GetElementIC::attachGetProp(JSContext *cx, JSObject *obj, const Value &v, jsid i
if (hasLastStringStub && !buffer.verifyRange(lastStringStub))
return disable(cx, "code memory is out of range");
if ((shouldPatchInlineTypeGuard() || shouldPatchUnconditionalClaspGuard()) &&
!buffer.verifyRange(cx->fp()->jit())) {
if (!buffer.verifyRange(cx->fp()->jit()))
return disable(cx, "code memory is out of range");
}
// Patch all guards.
buffer.maybeLink(atomIdGuard, slowPathStart);

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

@ -1539,7 +1539,6 @@ DocumentViewerImpl::Destroy()
nsresult rv = mDocument->Sanitize();
if (NS_FAILED(rv)) {
// If we failed to sanitize, don't save presentation.
// XXX Shouldn't we run all the stuff after the |if (mSHEntry)| then?
savePresentation = PR_FALSE;
}
}
@ -1561,9 +1560,8 @@ DocumentViewerImpl::Destroy()
// When the presentation is restored, Open() and InitInternal() will reset
// these pointers to their original values.
if (mDocument) {
if (mDocument)
mDocument->SetContainer(nsnull);
}
if (mPresContext) {
mPresContext->SetLinkHandler(nsnull);
mPresContext->SetContainer(nsnull);
@ -1583,8 +1581,6 @@ DocumentViewerImpl::Destroy()
return NS_OK;
}
// The document was not put in the bfcache
if (mDocument) {
mDocument->Destroy();
mDocument = nsnull;

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

@ -393,6 +393,13 @@ nsJAR::GetCertificatePrincipal(const char* aFilename, nsIPrincipal** aPrincipal)
return NS_ERROR_NULL_POINTER;
*aPrincipal = nsnull;
#ifdef MOZ_OMNIJAR
// Don't check signatures in the omnijar - this is only
// interesting for extensions/XPIs.
if (mZip == mozilla::OmnijarReader())
return NS_OK;
#endif
//-- Parse the manifest
nsresult rv = ParseManifest();
if (NS_FAILED(rv)) return rv;

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

@ -145,6 +145,14 @@ XPIDLSRCS = \
nsISerializationHelper.idl \
$(NULL)
ifdef MOZ_IPC
XPIDLSRCS += \
nsIChildChannel.idl \
nsIParentChannel.idl \
nsIParentRedirectingChannel.idl \
nsIRedirectChannelRegistrar.idl
endif
ifdef MOZ_TOOLKIT_SEARCH
XPIDLSRCS += nsIBrowserSearchService.idl
endif

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

@ -0,0 +1,67 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "nsISupports.idl"
interface nsIStreamListener;
/**
* Implemented by content side of IPC protocols.
*/
[scriptable, uuid(c45b92ae-4f07-41dd-b0ef-aa044eeabb1e)]
interface nsIChildChannel : nsISupports
{
/**
* Create the chrome side of the IPC protocol and join an existing 'real'
* channel on the parent process. The id is provided by
* nsIRedirectChannelRegistrar on the chrome process and pushed to the child
* protocol as an argument to event starting a redirect.
*
* Primarilly used in HttpChannelChild::Redirect1Begin on a newly created
* child channel, where the new channel is intended to be created on the
* child process.
*/
void connectParent(in PRUint32 id);
/**
* As AsyncOpen is called on the chrome process for redirect target channels,
* we have to inform the child side of the protocol of that fact by a special
* method.
*/
void completeRedirectSetup(in nsIStreamListener aListener,
in nsISupports aContext);
};

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

@ -0,0 +1,52 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "nsIStreamListener.idl"
interface nsITabParent;
/**
* Implemented by chrome side of IPC protocols.
*/
[scriptable, uuid(723188c3-fff8-4d27-b657-a256e7209be0)]
interface nsIParentChannel : nsIStreamListener
{
/**
* Called to invoke deletion of the IPC protocol.
*/
void delete();
};

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

@ -0,0 +1,78 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "nsIParentChannel.idl"
interface nsITabParent;
interface nsIChannel;
interface nsIAsyncVerifyRedirectCallback;
/**
* Implemented by chrome side of IPC protocols that support redirect responses.
*/
[scriptable, uuid(cb7edc1c-096f-44de-957c-cb93de1545f6)]
interface nsIParentRedirectingChannel : nsIParentChannel
{
/**
* Called when the channel got a response that redirects it to a different
* URI. The implementation is responsible for calling the redirect observers
* on the child process and provide the decision result to the callback.
*
* @param newChannelId
* id of the redirect channel obtained from nsIRedirectChannelRegistrar.
* @param newURI
* the URI we redirect to
* @param callback
* redirect result callback, usage is compatible with how
* nsIChannelEventSink defines it
*/
void startRedirect(in PRUint32 newChannelId,
in nsIChannel newChannel,
in PRUint32 redirectFlags,
in nsIAsyncVerifyRedirectCallback callback);
/**
* Called after we are done with redirecting process and we know if to
* redirect or not. Forward the redirect result to the child process. From
* that moment the nsIParentChannel implementation expects it will be
* forwarded all notifications from the 'real' channel.
*
* Primarilly used by HttpChannelParentListener::OnRedirectResult and kept
* as mActiveChannel and mRedirectChannel in that class.
*/
void completeRedirect(in PRBool succeeded);
};

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

@ -0,0 +1,104 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "nsISupports.idl"
interface nsIChannel;
interface nsIParentChannel;
/**
* Used on the chrome process as a service to join channel implementation
* and parent IPC protocol side under a unique id. Provides this way a generic
* communication while redirecting to various protocols.
*
* See also nsIChildChannel and nsIParentChannel.
*/
[scriptable, uuid (efa36ea2-5b07-46fc-9534-a5acb8b77b72)]
interface nsIRedirectChannelRegistrar : nsISupports
{
/**
* Register the redirect target channel and obtain a unique ID for that
* channel.
*
* Primarily used in HttpChannelParentListener::AsyncOnChannelRedirect to get
* a channel id sent to the HttpChannelChild being redirected.
*/
PRUint32 registerChannel(in nsIChannel channel);
/**
* First, search for the channel registered under the id. If found return
* it. Then, register under the same id the parent side of IPC protocol
* to let it be later grabbed back by the originator of the redirect and
* notifications from the real channel could be forwarded to this parent
* channel.
*
* Primarily used in parent side of an IPC protocol implementation
* in reaction to nsIChildChannel.connectParent(id) called from the child
* process.
*/
nsIChannel linkChannels(in PRUint32 id, in nsIParentChannel channel);
/**
* Returns back the channel previously registered under the ID with
* registerChannel method.
*
* Primarilly used in chrome IPC side of protocols when attaching a redirect
* target channel to an existing 'real' channel implementation.
*/
nsIChannel getRegisteredChannel(in PRUint32 id);
/**
* Returns the stream listener that shall be attached to the redirect target
* channel, all notification from the redirect target channel will be
* forwarded to this stream listener.
*
* Primarilly used in HttpChannelParentListener::OnRedirectResult callback
* to grab the created parent side of the channel and forward notifications
* to it.
*/
nsIParentChannel getParentChannel(in PRUint32 id);
/**
* To not force all channel implementations to support weak reference
* consumers of this service must ensure release of registered channels them
* self. This releases both the real and parent channel registered under
* the id.
*
* Primarilly used in HttpChannelParentListener::OnRedirectResult callback.
*/
void deregisterChannels(in PRUint32 id);
};

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

@ -109,6 +109,10 @@
#include "nsISocketProvider.h"
#include "mozilla/Services.h"
#ifdef MOZ_IPC
#include "nsIRedirectChannelRegistrar.h"
#endif
#ifdef MOZILLA_INTERNAL_API
inline already_AddRefed<nsIIOService>
@ -1780,6 +1784,24 @@ NS_IsInternalSameURIRedirect(nsIChannel *aOldChannel,
return NS_SUCCEEDED(oldURI->Equals(newURI, &res)) && res;
}
#ifdef MOZ_IPC
inline nsresult
NS_LinkRedirectChannels(PRUint32 channelId,
nsIParentChannel *parentChannel,
nsIChannel** _result)
{
nsresult rv;
nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
do_GetService("@mozilla.org/redirectchannelregistrar;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
return registrar->LinkChannels(channelId,
parentChannel,
_result);
}
#endif // MOZ_IPC
/**
* Helper function to create a random URL string that's properly formed
* but guaranteed to be invalid.

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

@ -94,6 +94,10 @@ CPPSRCS = \
nsDNSPrefetch.cpp \
$(NULL)
ifdef MOZ_IPC
CPPSRCS += RedirectChannelRegistrar.cpp
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
CPPSRCS += nsURLHelperOS2.cpp
else

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

@ -0,0 +1,127 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "RedirectChannelRegistrar.h"
namespace mozilla {
namespace net {
template<class KeyClass, class T>
PRBool
RedirectChannelRegistrar::nsCOMPtrHashtable<KeyClass,T>::Get(KeyType aKey, T** retVal) const
{
typename base_type::EntryType* ent = this->GetEntry(aKey);
if (ent) {
if (retVal)
NS_IF_ADDREF(*retVal = ent->mData);
return PR_TRUE;
}
if (retVal)
*retVal = nsnull;
return PR_FALSE;
}
NS_IMPL_ISUPPORTS1(RedirectChannelRegistrar, nsIRedirectChannelRegistrar)
RedirectChannelRegistrar::RedirectChannelRegistrar()
: mId(1)
{
mRealChannels.Init(64);
mParentChannels.Init(64);
}
NS_IMETHODIMP
RedirectChannelRegistrar::RegisterChannel(nsIChannel *channel,
PRUint32 *_retval NS_OUTPARAM)
{
mRealChannels.Put(mId, channel);
*_retval = mId;
++mId;
// Ensure we always provide positive ids
if (!mId)
mId = 1;
return NS_OK;
}
NS_IMETHODIMP
RedirectChannelRegistrar::GetRegisteredChannel(PRUint32 id,
nsIChannel **_retval NS_OUTPARAM)
{
if (!mRealChannels.Get(id, _retval))
return NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
NS_IMETHODIMP
RedirectChannelRegistrar::LinkChannels(PRUint32 id,
nsIParentChannel *channel,
nsIChannel** _retval)
{
if (!mRealChannels.Get(id, _retval))
return NS_ERROR_NOT_AVAILABLE;
mParentChannels.Put(id, channel);
return NS_OK;
}
NS_IMETHODIMP
RedirectChannelRegistrar::GetParentChannel(PRUint32 id,
nsIParentChannel **_retval NS_OUTPARAM)
{
if (!mParentChannels.Get(id, _retval))
return NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
NS_IMETHODIMP
RedirectChannelRegistrar::DeregisterChannels(PRUint32 id)
{
mRealChannels.Remove(id);
mParentChannels.Remove(id);
return NS_OK;
}
}
}

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

@ -0,0 +1,82 @@
/* ***** 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.org code.
*
* The Initial Developer of the Original Code is Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 RedirectChannelRegistrar_h__
#define RedirectChannelRegistrar_h__
#include "nsIRedirectChannelRegistrar.h"
#include "nsIChannel.h"
#include "nsIParentChannel.h"
#include "nsClassHashtable.h"
namespace mozilla {
namespace net {
class RedirectChannelRegistrar : public nsIRedirectChannelRegistrar
{
NS_DECL_ISUPPORTS
NS_DECL_NSIREDIRECTCHANNELREGISTRAR
RedirectChannelRegistrar();
protected:
template<class KeyClass, class T>
class nsCOMPtrHashtable :
public nsBaseHashtable< KeyClass, nsCOMPtr<T>, T* >
{
public:
typedef typename KeyClass::KeyType KeyType;
typedef T* UserDataType;
typedef nsBaseHashtable< KeyClass, nsCOMPtr<T>, T* > base_type;
PRBool Get(KeyType aKey, UserDataType* pData) const;
};
typedef nsCOMPtrHashtable<nsUint32HashKey, nsIChannel>
ChannelHashtable;
typedef nsCOMPtrHashtable<nsUint32HashKey, nsIParentChannel>
ParentChannelHashtable;
ChannelHashtable mRealChannels;
ParentChannelHashtable mParentChannels;
PRUint32 mId;
};
}
}
#endif

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

@ -483,6 +483,17 @@
#define NS_URICLASSIFIERSERVICE_CONTRACTID \
"@mozilla.org/uriclassifierservice"
// Redirect channel registrar used for redirect to various protocols
#define NS_REDIRECTCHANNELREGISTRAR_CONTRACTID \
"@mozilla.org/redirectchannelregistrar;1"
#define NS_REDIRECTCHANNELREGISTRAR_CID \
{ /* {b69043a6-8929-4d60-8d17-a27e44a8393e} */ \
0xb69043a6, \
0x8929, \
0x4d60, \
{ 0x8d, 0x17, 0xa2, 0x7e, 0x44, 0xa8, 0x39, 0x3e } \
}
/******************************************************************************
* netwerk/cache/ classes
*/

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

@ -127,6 +127,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEffectiveTLDService, Init)
#include "nsSerializationHelper.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSerializationHelper)
#ifdef MOZ_IPC
#include "RedirectChannelRegistrar.h"
typedef mozilla::net::RedirectChannelRegistrar RedirectChannelRegistrar;
NS_GENERIC_FACTORY_CONSTRUCTOR(RedirectChannelRegistrar)
#endif
///////////////////////////////////////////////////////////////////////////////
extern nsresult
@ -745,6 +751,9 @@ NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
#ifdef MOZ_IPC
NS_DEFINE_NAMED_CID(NS_REDIRECTCHANNELREGISTRAR_CID);
#endif
static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
{ &kNS_IOSERVICE_CID, false, NULL, nsIOServiceConstructor },
@ -871,6 +880,9 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
{ &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsQtNetworkLinkServiceConstructor },
#endif
{ &kNS_SERIALIZATION_HELPER_CID, false, NULL, nsSerializationHelperConstructor },
#ifdef MOZ_IPC
{ &kNS_REDIRECTCHANNELREGISTRAR_CID, false, NULL, RedirectChannelRegistrarConstructor },
#endif
{ NULL }
};
@ -1004,6 +1016,9 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#endif
{ NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
#ifdef MOZ_IPC
{ NS_REDIRECTCHANNELREGISTRAR_CONTRACTID, &kNS_REDIRECTCHANNELREGISTRAR_CID },
#endif
{ NULL }
};

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

@ -97,12 +97,13 @@ FTPChannelChild::ReleaseIPDLReference()
// FTPChannelChild::nsISupports
//-----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS_INHERITED4(FTPChannelChild,
NS_IMPL_ISUPPORTS_INHERITED5(FTPChannelChild,
nsBaseChannel,
nsIFTPChannel,
nsIUploadChannel,
nsIResumableChannel,
nsIProxiedChannel)
nsIProxiedChannel,
nsIChildChannel)
//-----------------------------------------------------------------------------
@ -439,6 +440,34 @@ FTPChannelChild::DoCancelEarly(const nsresult& statusCode)
Send__delete__(this);
}
class FTPDeleteSelfEvent : public ChannelEvent
{
public:
FTPDeleteSelfEvent(FTPChannelChild* aChild)
: mChild(aChild) {}
void Run() { mChild->DoDeleteSelf(); }
private:
FTPChannelChild* mChild;
};
bool
FTPChannelChild::RecvDeleteSelf()
{
if (ShouldEnqueue()) {
EnqueueEvent(new FTPDeleteSelfEvent(this));
} else {
DoDeleteSelf();
}
return true;
}
void
FTPChannelChild::DoDeleteSelf()
{
if (mIPCOpen)
Send__delete__(this);
}
NS_IMETHODIMP
FTPChannelChild::Cancel(nsresult status)
{
@ -475,6 +504,50 @@ FTPChannelChild::Resume()
return NS_OK;
}
//-----------------------------------------------------------------------------
// FTPChannelChild::nsIChildChannel
//-----------------------------------------------------------------------------
NS_IMETHODIMP
FTPChannelChild::ConnectParent(PRUint32 id)
{
// The socket transport in the chrome process now holds a logical ref to us
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
AddIPDLReference();
if (!gNeckoChild->SendPFTPChannelConstructor(this))
return NS_ERROR_FAILURE;
if (!SendConnectChannel(id))
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP
FTPChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
nsISupports *aContext)
{
LOG(("FTPChannelChild::CompleteRedirectSetup [this=%x]\n", this));
NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
mIsPending = PR_TRUE;
mWasOpened = PR_TRUE;
mListener = listener;
mListenerContext = aContext;
// add ourselves to the load group.
if (mLoadGroup)
mLoadGroup->AddRequest(this, nsnull);
// We already have an open IPDL connection to the parent. If on-modify-request
// listeners or load group observers canceled us, let the parent handle it
// and send it back to us naturally.
return NS_OK;
}
} // namespace net
} // namespace mozilla

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

@ -49,6 +49,7 @@
#include "nsIUploadChannel.h"
#include "nsIProxiedChannel.h"
#include "nsIResumableChannel.h"
#include "nsIChildChannel.h"
#include "nsIStreamListener.h"
@ -66,14 +67,18 @@ class FTPChannelChild : public PFTPChannelChild
, public nsIUploadChannel
, public nsIResumableChannel
, public nsIProxiedChannel
, public nsIChildChannel
, public ChannelEventQueue<FTPChannelChild>
{
public:
typedef ::nsIStreamListener nsIStreamListener;
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIFTPCHANNEL
NS_DECL_NSIUPLOADCHANNEL
NS_DECL_NSIRESUMABLECHANNEL
NS_DECL_NSIPROXIEDCHANNEL
NS_DECL_NSICHILDCHANNEL
NS_IMETHOD Cancel(nsresult status);
NS_IMETHOD Suspend();
@ -85,7 +90,7 @@ public:
void AddIPDLReference();
void ReleaseIPDLReference();
NS_IMETHOD AsyncOpen(::nsIStreamListener* listener, nsISupports* aContext);
NS_IMETHOD AsyncOpen(nsIStreamListener* listener, nsISupports* aContext);
// Note that we handle this ourselves, overriding the nsBaseChannel
// default behavior, in order to be e10s-friendly.
@ -108,6 +113,7 @@ protected:
const PRUint32& count);
NS_OVERRIDE bool RecvOnStopRequest(const nsresult& statusCode);
NS_OVERRIDE bool RecvCancelEarly(const nsresult& statusCode);
NS_OVERRIDE bool RecvDeleteSelf();
void DoOnStartRequest(const PRInt32& aContentLength,
const nsCString& aContentType,
@ -119,11 +125,13 @@ protected:
const PRUint32& count);
void DoOnStopRequest(const nsresult& statusCode);
void DoCancelEarly(const nsresult& statusCode);
void DoDeleteSelf();
friend class FTPStartRequestEvent;
friend class FTPDataAvailableEvent;
friend class FTPStopRequestEvent;
friend class FTPCancelEarlyEvent;
friend class FTPDeleteSelfEvent;
private:
nsCOMPtr<nsIInputStream> mUploadStream;

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

@ -43,6 +43,7 @@
#include "nsFTPChannel.h"
#include "nsNetUtil.h"
#include "nsISupportsPriority.h"
#include "nsIRedirectChannelRegistrar.h"
#include "nsFtpProtocolHandler.h"
#undef LOG
@ -76,8 +77,9 @@ FTPChannelParent::ActorDestroy(ActorDestroyReason why)
// FTPChannelParent::nsISupports
//-----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS3(FTPChannelParent,
NS_IMPL_ISUPPORTS4(FTPChannelParent,
nsIStreamListener,
nsIParentChannel,
nsIInterfaceRequestor,
nsIRequestObserver);
@ -131,6 +133,23 @@ FTPChannelParent::RecvAsyncOpen(const IPC::URI& aURI,
return true;
}
bool
FTPChannelParent::RecvConnectChannel(const PRUint32& channelId)
{
nsresult rv;
LOG(("Looking for a registered channel [this=%p, id=%d]", this, channelId));
nsCOMPtr<nsIChannel> channel;
rv = NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel));
if (NS_SUCCEEDED(rv))
mChannel = static_cast<nsFtpChannel*>(channel.get());
LOG((" found channel %p, rv=%08x", mChannel.get(), rv));
return true;
}
bool
FTPChannelParent::RecvCancel(const nsresult& status)
{
@ -218,6 +237,19 @@ FTPChannelParent::OnDataAvailable(nsIRequest* aRequest,
return NS_OK;
}
//-----------------------------------------------------------------------------
// FTPChannelParent::nsIParentChannel
//-----------------------------------------------------------------------------
NS_IMETHODIMP
FTPChannelParent::Delete()
{
if (mIPCClosed || !SendDeleteSelf())
return NS_ERROR_UNEXPECTED;
return NS_OK;
}
//-----------------------------------------------------------------------------
// FTPChannelParent::nsIInterfaceRequestor
//-----------------------------------------------------------------------------
@ -225,7 +257,7 @@ FTPChannelParent::OnDataAvailable(nsIRequest* aRequest,
NS_IMETHODIMP
FTPChannelParent::GetInterface(const nsIID& uuid, void** result)
{
DROP_DEAD();
return QueryInterface(uuid, result);
}
} // namespace net

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

@ -44,7 +44,7 @@
#include "mozilla/net/PFTPChannelParent.h"
#include "mozilla/net/NeckoCommon.h"
#include "nsIStreamListener.h"
#include "nsIParentChannel.h"
#include "nsIInterfaceRequestor.h"
class nsFtpChannel;
@ -53,13 +53,14 @@ namespace mozilla {
namespace net {
class FTPChannelParent : public PFTPChannelParent
, public nsIStreamListener
, public nsIParentChannel
, public nsIInterfaceRequestor
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIPARENTCHANNEL
NS_DECL_NSIINTERFACEREQUESTOR
FTPChannelParent();
@ -70,6 +71,7 @@ protected:
const PRUint64& startPos,
const nsCString& entityID,
const IPC::InputStream& uploadStream);
NS_OVERRIDE virtual bool RecvConnectChannel(const PRUint32& channelId);
NS_OVERRIDE virtual bool RecvCancel(const nsresult& status);
NS_OVERRIDE virtual bool RecvSuspend();
NS_OVERRIDE virtual bool RecvResume();

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

@ -59,6 +59,7 @@ parent:
AsyncOpen(URI uri, PRUint64 startPos, nsCString entityID,
InputStream uploadStream);
ConnectChannel(PRUint32 channelId);
Cancel(nsresult status);
Suspend();
Resume();
@ -69,6 +70,7 @@ child:
OnDataAvailable(nsCString data, PRUint32 offset, PRUint32 count);
OnStopRequest(nsresult statusCode);
CancelEarly(nsresult statusCode);
DeleteSelf();
};
} // namespace net

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

@ -119,6 +119,8 @@ NS_INTERFACE_MAP_BEGIN(HttpChannelChild)
NS_INTERFACE_MAP_ENTRY(nsIApplicationCacheContainer)
NS_INTERFACE_MAP_ENTRY(nsIApplicationCacheChannel)
NS_INTERFACE_MAP_ENTRY(nsIAsyncVerifyRedirectCallback)
NS_INTERFACE_MAP_ENTRY(nsIChildChannel)
NS_INTERFACE_MAP_ENTRY(nsIHttpChannelChild)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAssociatedContentSecurity, GetAssociatedContentSecurity())
NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
@ -589,60 +591,67 @@ class Redirect1Event : public ChannelEvent
{
public:
Redirect1Event(HttpChannelChild* child,
PHttpChannelChild* newChannel,
const PRUint32& newChannelId,
const IPC::URI& newURI,
const PRUint32& redirectFlags,
const nsHttpResponseHead& responseHead)
: mChild(child)
, mNewChannel(newChannel)
, mNewChannelId(newChannelId)
, mNewURI(newURI)
, mRedirectFlags(redirectFlags)
, mResponseHead(responseHead) {}
void Run()
{
mChild->Redirect1Begin(mNewChannel, mNewURI, mRedirectFlags,
mChild->Redirect1Begin(mNewChannelId, mNewURI, mRedirectFlags,
mResponseHead);
}
private:
HttpChannelChild* mChild;
PHttpChannelChild* mNewChannel;
PRUint32 mNewChannelId;
IPC::URI mNewURI;
PRUint32 mRedirectFlags;
nsHttpResponseHead mResponseHead;
};
bool
HttpChannelChild::RecvRedirect1Begin(PHttpChannelChild* newChannel,
const IPC::URI& newURI,
HttpChannelChild::RecvRedirect1Begin(const PRUint32& newChannelId,
const URI& newUri,
const PRUint32& redirectFlags,
const nsHttpResponseHead& responseHead)
{
if (ShouldEnqueue()) {
EnqueueEvent(new Redirect1Event(this, newChannel, newURI, redirectFlags,
EnqueueEvent(new Redirect1Event(this, newChannelId, newUri, redirectFlags,
responseHead));
} else {
Redirect1Begin(newChannel, newURI, redirectFlags, responseHead);
Redirect1Begin(newChannelId, newUri, redirectFlags, responseHead);
}
return true;
}
void
HttpChannelChild::Redirect1Begin(PHttpChannelChild* newChannel,
HttpChannelChild::Redirect1Begin(const PRUint32& newChannelId,
const IPC::URI& newURI,
const PRUint32& redirectFlags,
const nsHttpResponseHead& responseHead)
{
HttpChannelChild*
newHttpChannelChild = static_cast<HttpChannelChild*>(newChannel);
nsresult rv;
nsCOMPtr<nsIIOService> ioService;
rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
if (NS_FAILED(rv)) {
// Veto redirect. nsHttpChannel decides to cancel or continue.
OnRedirectVerifyCallback(rv);
return;
}
nsCOMPtr<nsIURI> uri(newURI);
nsresult rv =
newHttpChannelChild->HttpBaseChannel::Init(uri, mCaps,
mConnectionInfo->ProxyInfo());
nsCOMPtr<nsIChannel> newChannel;
rv = ioService->NewChannelFromURI(uri, getter_AddRefs(newChannel));
if (NS_FAILED(rv)) {
// Veto redirect. nsHttpChannel decides to cancel or continue.
SendRedirect2Verify(rv, newHttpChannelChild->mRequestHeaders);
// Veto redirect. nsHttpChannel decides to cancel or continue.
OnRedirectVerifyCallback(rv);
return;
}
@ -651,17 +660,22 @@ HttpChannelChild::Redirect1Begin(PHttpChannelChild* newChannel,
SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
PRBool preserveMethod = (mResponseHead->Status() == 307);
rv = SetupReplacementChannel(uri, newHttpChannelChild, preserveMethod);
rv = SetupReplacementChannel(uri, newChannel, preserveMethod);
if (NS_FAILED(rv)) {
// Veto redirect. nsHttpChannel decides to cancel or continue.
SendRedirect2Verify(rv, newHttpChannelChild->mRequestHeaders);
OnRedirectVerifyCallback(rv);
return;
}
mRedirectChannelChild = newHttpChannelChild;
mRedirectChannelChild = do_QueryInterface(newChannel);
if (mRedirectChannelChild) {
mRedirectChannelChild->ConnectParent(newChannelId);
} else {
NS_ERROR("Redirecting to a protocol that doesn't support universal protocol redirect");
}
rv = gHttpHandler->AsyncOnChannelRedirect(this,
newHttpChannelChild,
newChannel,
redirectFlags);
if (NS_FAILED(rv))
OnRedirectVerifyCallback(rv);
@ -690,15 +704,17 @@ HttpChannelChild::RecvRedirect3Complete()
void
HttpChannelChild::Redirect3Complete()
{
nsresult rv;
nsresult rv = NS_OK;
// Chrome channel has been AsyncOpen'd. Reflect this in child.
if (mRedirectChannelChild)
rv = mRedirectChannelChild->CompleteRedirectSetup(mListener,
mListenerContext);
// Redirecting to new channel: shut this down and init new channel
if (mLoadGroup)
mLoadGroup->RemoveRequest(this, nsnull, NS_BINDING_ABORTED);
// Chrome channel has been AsyncOpen'd. Reflect this in child.
rv = mRedirectChannelChild->CompleteRedirectSetup(mListener,
mListenerContext);
if (NS_FAILED(rv))
NS_WARNING("CompleteRedirectSetup failed, HttpChannelChild already open?");
@ -706,7 +722,34 @@ HttpChannelChild::Redirect3Complete()
mRedirectChannelChild = nsnull;
}
nsresult
//-----------------------------------------------------------------------------
// HttpChannelChild::nsIChildChannel
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelChild::ConnectParent(PRUint32 id)
{
mozilla::dom::TabChild* tabChild = nsnull;
nsCOMPtr<nsITabChild> iTabChild;
GetCallback(iTabChild);
if (iTabChild) {
tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
}
// The socket transport in the chrome process now holds a logical ref to us
// until OnStopRequest, or we do a redirect, or we hit an IPDL error.
AddIPDLReference();
if (!gNeckoChild->SendPHttpChannelConstructor(this, tabChild))
return NS_ERROR_FAILURE;
if (!SendConnectChannel(id))
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP
HttpChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
nsISupports *aContext)
{
@ -744,17 +787,30 @@ HttpChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
NS_IMETHODIMP
HttpChannelChild::OnRedirectVerifyCallback(nsresult result)
{
// Cookies may have been changed by redirect observers
mRedirectChannelChild->AddCookiesToRequest();
// Must not be called until after redirect observers called.
mRedirectChannelChild->SetOriginalURI(mRedirectOriginalURI);
nsCOMPtr<nsIHttpChannel> newHttpChannel =
do_QueryInterface(mRedirectChannelChild);
if (newHttpChannel) {
// Must not be called until after redirect observers called.
newHttpChannel->SetOriginalURI(mRedirectOriginalURI);
}
RequestHeaderTuples emptyHeaders;
RequestHeaderTuples* headerTuples = &emptyHeaders;
nsCOMPtr<nsIHttpChannelChild> newHttpChannelChild =
do_QueryInterface(mRedirectChannelChild);
if (newHttpChannelChild && NS_SUCCEEDED(result)) {
newHttpChannelChild->AddCookiesToRequest();
newHttpChannelChild->GetHeaderTuples(&headerTuples);
}
// After we verify redirect, nsHttpChannel may hit the network: must give
// "http-on-modify-request" observers the chance to cancel before that.
if (NS_SUCCEEDED(result))
gHttpHandler->OnModifyRequest(mRedirectChannelChild);
gHttpHandler->OnModifyRequest(newHttpChannel);
return SendRedirect2Verify(result, mRedirectChannelChild->mRequestHeaders);
return SendRedirect2Verify(result, *headerTuples);
}
//-----------------------------------------------------------------------------
@ -1246,7 +1302,22 @@ HttpChannelChild::Flush()
return NS_OK;
}
//-----------------------------------------------------------------------------
// HttpChannelChild::nsIHttpChannelChild
//-----------------------------------------------------------------------------
NS_IMETHODIMP HttpChannelChild::AddCookiesToRequest()
{
HttpBaseChannel::AddCookiesToRequest();
return NS_OK;
}
NS_IMETHODIMP HttpChannelChild::GetHeaderTuples(RequestHeaderTuples **aHeaderTuples)
{
*aHeaderTuples = &mRequestHeaders;
return NS_OK;
}
//------------------------------------------------------------------------------
}} // mozilla::net

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

@ -61,6 +61,8 @@
#include "nsITraceableChannel.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIAssociatedContentSecurity.h"
#include "nsIChildChannel.h"
#include "nsIHttpChannelChild.h"
namespace mozilla {
namespace net {
@ -73,6 +75,8 @@ class HttpChannelChild : public PHttpChannelChild
, public nsIApplicationCacheChannel
, public nsIAsyncVerifyRedirectCallback
, public nsIAssociatedContentSecurity
, public nsIChildChannel
, public nsIHttpChannelChild
, public ChannelEventQueue<HttpChannelChild>
{
public:
@ -84,6 +88,8 @@ public:
NS_DECL_NSIAPPLICATIONCACHECHANNEL
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
NS_DECL_NSIASSOCIATEDCONTENTSECURITY
NS_DECL_NSICHILDCHANNEL
NS_DECL_NSIHTTPCHANNELCHILD
HttpChannelChild();
virtual ~HttpChannelChild();
@ -108,10 +114,6 @@ public:
// nsIResumableChannel
NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString& entityID);
// Final setup when redirect has proceeded successfully in chrome
nsresult CompleteRedirectSetup(nsIStreamListener *listener,
nsISupports *aContext);
// IPDL holds a reference while the PHttpChannel protocol is live (starting at
// AsyncOpen, and ending at either OnStopRequest or any IPDL error, either of
// which call NeckoChild::DeallocPHttpChannel()).
@ -136,7 +138,7 @@ protected:
bool RecvOnProgress(const PRUint64& progress, const PRUint64& progressMax);
bool RecvOnStatus(const nsresult& status, const nsString& statusArg);
bool RecvCancelEarly(const nsresult& status);
bool RecvRedirect1Begin(PHttpChannelChild* newChannel,
bool RecvRedirect1Begin(const PRUint32& newChannel,
const URI& newURI,
const PRUint32& redirectFlags,
const nsHttpResponseHead& responseHead);
@ -149,7 +151,7 @@ protected:
private:
RequestHeaderTuples mRequestHeaders;
nsRefPtr<HttpChannelChild> mRedirectChannelChild;
nsCOMPtr<nsIChildChannel> mRedirectChannelChild;
nsCOMPtr<nsIURI> mRedirectOriginalURI;
nsCOMPtr<nsISupports> mSecurityInfo;
@ -181,7 +183,8 @@ private:
void OnProgress(const PRUint64& progress, const PRUint64& progressMax);
void OnStatus(const nsresult& status, const nsString& statusArg);
void OnCancel(const nsresult& status);
void Redirect1Begin(PHttpChannelChild* newChannel, const URI& newURI,
void Redirect1Begin(const PRUint32& newChannelId,
const URI& newUri,
const PRUint32& redirectFlags,
const nsHttpResponseHead& responseHead);
void Redirect3Complete();

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

@ -42,6 +42,7 @@
#include "mozilla/net/HttpChannelParent.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/net/NeckoParent.h"
#include "mozilla/unused.h"
#include "HttpChannelParentListener.h"
#include "nsHttpChannel.h"
#include "nsHttpHandler.h"
@ -56,6 +57,7 @@
#include "nsIAssociatedContentSecurity.h"
#include "nsIApplicationCacheService.h"
#include "nsIOfflineCacheUpdate.h"
#include "nsIRedirectChannelRegistrar.h"
namespace mozilla {
namespace net {
@ -89,8 +91,31 @@ HttpChannelParent::ActorDestroy(ActorDestroyReason why)
// HttpChannelParent::nsISupports
//-----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS1(HttpChannelParent,
nsIProgressEventSink)
NS_IMPL_ISUPPORTS6(HttpChannelParent,
nsIInterfaceRequestor,
nsIProgressEventSink,
nsIRequestObserver,
nsIStreamListener,
nsIParentChannel,
nsIParentRedirectingChannel)
//-----------------------------------------------------------------------------
// HttpChannelParent::nsIInterfaceRequestor
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelParent::GetInterface(const nsIID& aIID, void **result)
{
if (aIID.Equals(NS_GET_IID(nsIAuthPromptProvider)) ||
aIID.Equals(NS_GET_IID(nsISecureBrowserUI))) {
if (!mTabParent)
return NS_NOINTERFACE;
return mTabParent->QueryInterface(aIID, result);
}
return QueryInterface(aIID, result);
}
//-----------------------------------------------------------------------------
// HttpChannelParent::PHttpChannelParent
@ -156,9 +181,10 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI,
requestHeaders[i].mMerge);
}
mChannelListener = new HttpChannelParentListener(this);
nsRefPtr<HttpChannelParentListener> channelListener =
new HttpChannelParentListener(this);
httpChan->SetNotificationCallbacks(mChannelListener);
httpChan->SetNotificationCallbacks(channelListener);
httpChan->SetRequestMethod(nsDependentCString(requestMethod.get()));
@ -209,23 +235,36 @@ HttpChannelParent::RecvAsyncOpen(const IPC::URI& aURI,
}
}
rv = httpChan->AsyncOpen(mChannelListener, nsnull);
rv = httpChan->AsyncOpen(channelListener, nsnull);
if (NS_FAILED(rv))
return SendCancelEarly(rv);
return true;
}
bool
HttpChannelParent::RecvConnectChannel(const PRUint32& channelId)
{
nsresult rv;
LOG(("Looking for a registered channel [this=%p, id=%d]", this, channelId));
rv = NS_LinkRedirectChannels(channelId, this, getter_AddRefs(mChannel));
LOG((" found channel %p, rv=%08x", mChannel.get(), rv));
return true;
}
bool
HttpChannelParent::RecvSetPriority(const PRUint16& priority)
{
nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get());
httpChan->SetPriority(priority);
if (mChannelListener && mChannelListener->mRedirectChannel &&
mChannelListener->mRedirectChannel != this)
return mChannelListener->mRedirectChannel->RecvSetPriority(priority);
nsCOMPtr<nsISupportsPriority> priorityRedirectChannel =
do_QueryInterface(mRedirectChannel);
if (priorityRedirectChannel)
priorityRedirectChannel->SetPriority(priority);
return true;
}
@ -291,8 +330,21 @@ bool
HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
const RequestHeaderTuples& changedHeaders)
{
if (mChannelListener)
mChannelListener->OnContentRedirectResultReceived(result, changedHeaders);
if (NS_SUCCEEDED(result)) {
nsCOMPtr<nsIHttpChannel> newHttpChannel =
do_QueryInterface(mRedirectChannel);
if (newHttpChannel) {
for (PRUint32 i = 0; i < changedHeaders.Length(); i++) {
newHttpChannel->SetRequestHeader(changedHeaders[i].mHeader,
changedHeaders[i].mValue,
changedHeaders[i].mMerge);
}
}
}
mRedirectCallback->OnRedirectVerifyCallback(result);
mRedirectCallback = nsnull;
return true;
}
@ -315,18 +367,14 @@ HttpChannelParent::RecvMarkOfflineCacheEntryAsForeign()
}
//-----------------------------------------------------------------------------
// nsIRequestObserver and nsIStreamListener methods equivalents
// HttpChannelParent::nsIRequestObserver
//-----------------------------------------------------------------------------
nsresult
NS_IMETHODIMP
HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
{
LOG(("HttpChannelParent::OnStartRequest [this=%x]\n", this));
// We need this member only to call OnContentRedirectResultReceived on it,
// that will for sure not happen when we get here. Throw it away ASAP.
mChannelListener = nsnull;
nsHttpChannel *chan = static_cast<nsHttpChannel *>(aRequest);
nsHttpResponseHead *responseHead = chan->GetResponseHead();
nsHttpRequestHead *requestHead = chan->GetRequestHead();
@ -393,7 +441,7 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
return NS_OK;
}
nsresult
NS_IMETHODIMP
HttpChannelParent::OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aStatusCode)
@ -406,7 +454,11 @@ HttpChannelParent::OnStopRequest(nsIRequest *aRequest,
return NS_OK;
}
nsresult
//-----------------------------------------------------------------------------
// HttpChannelParent::nsIStreamListener
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelParent::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
@ -452,5 +504,62 @@ HttpChannelParent::OnStatus(nsIRequest *aRequest,
return NS_OK;
}
}} // mozilla::net
//-----------------------------------------------------------------------------
// HttpChannelParent::nsIParentChannel
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelParent::Delete()
{
if (!mIPCClosed)
SendDeleteSelf();
return NS_OK;
}
//-----------------------------------------------------------------------------
// HttpChannelParent::nsIParentRedirectingChannel
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelParent::StartRedirect(PRUint32 newChannelId,
nsIChannel* newChannel,
PRUint32 redirectFlags,
nsIAsyncVerifyRedirectCallback* callback)
{
if (mIPCClosed)
return NS_BINDING_ABORTED;
nsCOMPtr<nsIURI> newURI;
newChannel->GetURI(getter_AddRefs(newURI));
nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get());
nsHttpResponseHead *responseHead = httpChan->GetResponseHead();
bool result = SendRedirect1Begin(newChannelId,
IPC::URI(newURI),
redirectFlags,
responseHead ? *responseHead
: nsHttpResponseHead());
if (!result)
return NS_BINDING_ABORTED;
// Result is handled in RecvRedirect2Verify above
mRedirectChannel = newChannel;
mRedirectCallback = callback;
return NS_OK;
}
NS_IMETHODIMP
HttpChannelParent::CompleteRedirect(PRBool succeeded)
{
if (succeeded && !mIPCClosed) {
// TODO: check return value: assume child dead if failed
unused << SendRedirect3Complete();
}
mRedirectChannel = nsnull;
return NS_OK;
}
}} // mozilla::net

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

@ -46,6 +46,7 @@
#include "mozilla/dom/PBrowserParent.h"
#include "mozilla/net/PHttpChannelParent.h"
#include "mozilla/net/NeckoCommon.h"
#include "nsIParentRedirectingChannel.h"
#include "nsIProgressEventSink.h"
#include "nsITabParent.h"
@ -59,24 +60,19 @@ namespace net {
class HttpChannelParentListener;
class HttpChannelParent : public PHttpChannelParent
, public nsIParentRedirectingChannel
, public nsIProgressEventSink
, public nsIInterfaceRequestor
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIPARENTCHANNEL
NS_DECL_NSIPARENTREDIRECTINGCHANNEL
NS_DECL_NSIPROGRESSEVENTSINK
NS_DECL_NSIINTERFACEREQUESTOR
// Make these non-virtual for a little performance benefit
nsresult OnStartRequest(nsIRequest *aRequest,
nsISupports *aContext);
nsresult OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aStatusCode);
nsresult OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
PRUint32 aOffset,
PRUint32 aCount);
HttpChannelParent(PBrowserParent* iframeEmbedding);
virtual ~HttpChannelParent();
@ -100,6 +96,7 @@ protected:
const bool& chooseApplicationCache,
const nsCString& appCacheClientID);
virtual bool RecvConnectChannel(const PRUint32& channelId);
virtual bool RecvSetPriority(const PRUint16& priority);
virtual bool RecvSetCacheTokenCachedCharset(const nsCString& charset);
virtual bool RecvSuspend();
@ -122,9 +119,11 @@ protected:
private:
nsCOMPtr<nsIChannel> mChannel;
nsRefPtr<HttpChannelParentListener> mChannelListener;
nsCOMPtr<nsICacheEntryDescriptor> mCacheDescriptor;
bool mIPCClosed; // PHttpChannel actor has been Closed()
nsCOMPtr<nsIChannel> mRedirectChannel;
nsCOMPtr<nsIAsyncVerifyRedirectCallback> mRedirectCallback;
};
} // namespace net

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

@ -56,6 +56,9 @@
#include "nsISerializable.h"
#include "nsIAssociatedContentSecurity.h"
#include "nsISecureBrowserUI.h"
#include "nsIRedirectChannelRegistrar.h"
#include "nsIFTPChannel.h"
using mozilla::unused;
@ -64,6 +67,7 @@ namespace net {
HttpChannelParentListener::HttpChannelParentListener(HttpChannelParent* aInitialChannel)
: mActiveChannel(aInitialChannel)
, mRedirectChannelId(0)
{
}
@ -137,62 +141,22 @@ HttpChannelParentListener::OnDataAvailable(nsIRequest *aRequest,
NS_IMETHODIMP
HttpChannelParentListener::GetInterface(const nsIID& aIID, void **result)
{
if (aIID.Equals(NS_GET_IID(nsIAuthPromptProvider))) {
if (!mActiveChannel || !mActiveChannel->mTabParent)
return NS_NOINTERFACE;
return mActiveChannel->mTabParent->QueryInterface(aIID, result);
}
if (aIID.Equals(NS_GET_IID(nsISecureBrowserUI))) {
if (!mActiveChannel || !mActiveChannel->mTabParent)
return NS_NOINTERFACE;
return mActiveChannel->mTabParent->QueryInterface(aIID, result);
}
if (aIID.Equals(NS_GET_IID(nsIProgressEventSink))) {
if (!mActiveChannel)
return NS_NOINTERFACE;
return mActiveChannel->QueryInterface(aIID, result);
}
// TODO: 575494: once we're confident we're handling all needed interfaces,
// remove all code below and simply "return QueryInterface(aIID, result)"
if (// Known interface calls:
// FIXME: HTTP Authorization (bug 537782):
// nsHttpChannel first tries to get this as an nsIAuthPromptProvider; if that
// fails, it tries as an nsIAuthPrompt2, and if that fails, an nsIAuthPrompt.
// See nsHttpChannel::GetAuthPrompt(). So if we can return any one of these,
// HTTP auth should be all set. The other two if checks can be eventually
// deleted.
aIID.Equals(NS_GET_IID(nsIAuthPrompt2)) ||
aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
// FIXME: redirects (bug 536294):
// The likely solution here is for this class to implement nsIChannelEventSink
// and nsIHttpEventSink (and forward calls to any real sinks in the child), in
// which case QueryInterface() will do the work here and these if statements
// can be eventually discarded.
aIID.Equals(NS_GET_IID(nsIChannelEventSink)) ||
if (aIID.Equals(NS_GET_IID(nsIChannelEventSink)) ||
aIID.Equals(NS_GET_IID(nsIHttpEventSink)) ||
aIID.Equals(NS_GET_IID(nsIRedirectResultListener)) ||
// FIXME: application cache (bug 536295):
aIID.Equals(NS_GET_IID(nsIApplicationCacheContainer)) ||
// FIXME: bug 561830: when fixed, we shouldn't be asked for this interface
aIID.Equals(NS_GET_IID(nsIDocShellTreeItem)) ||
// Let this return NS_ERROR_NO_INTERFACE: it's OK to not provide it.
aIID.Equals(NS_GET_IID(nsIBadCertListener2)))
aIID.Equals(NS_GET_IID(nsIRedirectResultListener)))
{
return QueryInterface(aIID, result);
} else {
nsPrintfCString msg(2000,
"HttpChannelParentListener::GetInterface: interface UUID=%s not yet supported! "
"Use 'grep -ri UUID <mozilla_src>' to find the name of the interface, "
"check http://tinyurl.com/255ojvu to see if a bug has already been "
"filed, and if not, add one and make it block bug 516730. Thanks!",
aIID.ToString());
NECKO_MAYBE_ABORT(msg);
return NS_NOINTERFACE;
}
nsCOMPtr<nsIInterfaceRequestor> ir;
if (mActiveChannel &&
NS_SUCCEEDED(CallQueryInterface(mActiveChannel.get(),
getter_AddRefs(ir))))
{
return ir->GetInterface(aIID, result);
}
return NS_NOINTERFACE;
}
//-----------------------------------------------------------------------------
@ -206,63 +170,29 @@ HttpChannelParentListener::AsyncOnChannelRedirect(
PRUint32 redirectFlags,
nsIAsyncVerifyRedirectCallback* callback)
{
if (mActiveChannel->mIPCClosed)
return NS_BINDING_ABORTED;
nsresult rv;
// Create new PHttpChannel
PBrowserParent* browser = mActiveChannel->mTabParent ?
static_cast<TabParent*>(mActiveChannel->mTabParent.get()) : nsnull;
mRedirectChannel = static_cast<HttpChannelParent *>
(mActiveChannel->Manager()->SendPHttpChannelConstructor(browser));
// Register the new channel and obtain id for it
nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
do_GetService("@mozilla.org/redirectchannelregistrar;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
// Join it with the correct channel
mRedirectChannel->mChannel = newChannel;
rv = registrar->RegisterChannel(newChannel, &mRedirectChannelId);
NS_ENSURE_SUCCESS(rv, rv);
// Let the new channel also keep the wrapper in case we get another redirect
// response, it wouldn't be able to send back the redirect result.
mRedirectChannel->mChannelListener = this;
LOG(("Registered %p channel under id=%d", newChannel, mRedirectChannelId));
// And finally, let the content process decide to redirect or not.
mRedirectCallback = callback;
nsCOMPtr<nsIURI> newURI;
newChannel->GetURI(getter_AddRefs(newURI));
nsHttpChannel *oldHttpChannel = static_cast<nsHttpChannel *>(oldChannel);
nsHttpResponseHead *responseHead = oldHttpChannel->GetResponseHead();
// TODO: check mActiveChannel->mIPCClosed and return val from Send function
unused << mActiveChannel->SendRedirect1Begin(mRedirectChannel,
IPC::URI(newURI),
redirectFlags,
responseHead ? *responseHead
: nsHttpResponseHead());
// mActiveChannel gets the response in RecvRedirect2Verify and forwards it
// to this wrapper through OnContentRedirectResultReceived
return NS_OK;
}
void
HttpChannelParentListener::OnContentRedirectResultReceived(
const nsresult result,
const RequestHeaderTuples& changedHeaders)
{
nsHttpChannel* newHttpChannel =
static_cast<nsHttpChannel*>(mRedirectChannel->mChannel.get());
if (NS_SUCCEEDED(result)) {
for (PRUint32 i = 0; i < changedHeaders.Length(); i++) {
newHttpChannel->SetRequestHeader(changedHeaders[i].mHeader,
changedHeaders[i].mValue,
changedHeaders[i].mMerge);
}
nsCOMPtr<nsIParentRedirectingChannel> activeRedirectingChannel =
do_QueryInterface(mActiveChannel);
if (!activeRedirectingChannel) {
NS_RUNTIMEABORT("Channel got a redirect response, but doesn't implement "
"nsIParentRedirectingChannel to handle it.");
}
mRedirectCallback->OnRedirectVerifyCallback(result);
mRedirectCallback = nsnull;
return activeRedirectingChannel->StartRedirect(mRedirectChannelId,
newChannel,
redirectFlags,
callback);
}
//-----------------------------------------------------------------------------
@ -272,30 +202,53 @@ HttpChannelParentListener::OnContentRedirectResultReceived(
NS_IMETHODIMP
HttpChannelParentListener::OnRedirectResult(PRBool succeeded)
{
if (!mRedirectChannel) {
// Redirect might get canceled before we got AsyncOnChannelRedirect
return NS_OK;
nsresult rv;
nsCOMPtr<nsIParentChannel> redirectChannel;
if (mRedirectChannelId) {
nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
do_GetService("@mozilla.org/redirectchannelregistrar;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = registrar->GetParentChannel(mRedirectChannelId,
getter_AddRefs(redirectChannel));
if (NS_FAILED(rv) || !redirectChannel) {
// Redirect might get canceled before we got AsyncOnChannelRedirect
LOG(("Registered parent channel not found under id=%d", mRedirectChannelId));
nsCOMPtr<nsIChannel> newChannel;
rv = registrar->GetRegisteredChannel(mRedirectChannelId,
getter_AddRefs(newChannel));
NS_ASSERTION(newChannel, "Already registered channel not found");
if (NS_SUCCEEDED(rv))
newChannel->Cancel(NS_BINDING_ABORTED);
}
// Release all previously registered channels, they are no longer need to be
// kept in the registrar from this moment.
registrar->DeregisterChannels(mRedirectChannelId);
mRedirectChannelId = 0;
}
if (succeeded && !mActiveChannel->mIPCClosed) {
// TODO: check return value: assume child dead if failed
unused << mActiveChannel->SendRedirect3Complete();
}
nsCOMPtr<nsIParentRedirectingChannel> activeRedirectingChannel =
do_QueryInterface(mActiveChannel);
NS_ABORT_IF_FALSE(activeRedirectingChannel,
"Channel finished a redirect response, but doesn't implement "
"nsIParentRedirectingChannel to complete it.");
activeRedirectingChannel->CompleteRedirect(succeeded);
HttpChannelParent* channelToDelete;
if (succeeded) {
// Switch to redirect channel and delete the old one.
channelToDelete = mActiveChannel;
mActiveChannel = mRedirectChannel;
} else {
mActiveChannel->Delete();
mActiveChannel = redirectChannel;
} else if (redirectChannel) {
// Delete the redirect target channel: continue using old channel
channelToDelete = mRedirectChannel;
redirectChannel->Delete();
}
if (!channelToDelete->mIPCClosed)
unused << channelToDelete->SendDeleteSelf();
mRedirectChannel = nsnull;
return NS_OK;
}

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

@ -45,7 +45,7 @@
#include "nsHttp.h"
#include "mozilla/net/NeckoCommon.h"
#include "PHttpChannelParams.h"
#include "nsIStreamListener.h"
#include "nsIParentChannel.h"
#include "nsIInterfaceRequestor.h"
#include "nsIChannelEventSink.h"
#include "nsIRedirectResultListener.h"
@ -76,16 +76,9 @@ public:
HttpChannelParentListener(HttpChannelParent* aInitialChannel);
virtual ~HttpChannelParentListener();
protected:
friend class HttpChannelParent;
void OnContentRedirectResultReceived(
const nsresult result,
const RequestHeaderTuples& changedHeaders);
private:
nsRefPtr<HttpChannelParent> mActiveChannel;
nsRefPtr<HttpChannelParent> mRedirectChannel;
nsCOMPtr<nsIAsyncVerifyRedirectCallback> mRedirectCallback;
nsCOMPtr<nsIParentChannel> mActiveChannel;
PRUint32 mRedirectChannelId;
};
} // namespace net

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

@ -66,6 +66,7 @@ XPIDLSRCS = \
nsIHttpProtocolHandler.idl \
nsIHttpChannelAuthProvider.idl \
nsIHttpAuthenticableChannel.idl \
nsIHttpChannelChild.idl \
$(NULL)
EXPORTS_mozilla/net = \

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

@ -81,6 +81,8 @@ parent:
bool chooseApplicationCache,
nsCString appCacheClientID);
ConnectChannel(PRUint32 channelId);
SetPriority(PRUint16 priority);
SetCacheTokenCachedCharset(nsCString charset);
@ -145,7 +147,7 @@ child:
// Called to initiate content channel redirect, starts talking to sinks
// on the content process and reports result via Redirect2Verify above
Redirect1Begin(PHttpChannel newChannel,
Redirect1Begin(PRUint32 newChannelId,
URI newUri,
PRUint32 redirectFlags,
nsHttpResponseHead responseHead);

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

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** 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.
*
* The Initial Developer of the Original Code is
* Netscape Communications.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Honza Bambas <honzab.moz@firemni.cz>
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#include "nsISupports.idl"
[ptr] native RequestHeaderTuples(mozilla::net::RequestHeaderTuples);
[uuid(40192377-f83c-4b31-92c6-dbc6c767c860)]
interface nsIHttpChannelChild : nsISupports
{
void addCookiesToRequest();
readonly attribute RequestHeaderTuples headerTuples;
};

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

@ -69,7 +69,7 @@
<children/>
<html:input anonid="input" class="autocomplete-textbox textbox-input"
flex="1" allowevents="true"
xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
</xul:hbox>
<children includes="hbox"/>
</xul:hbox>

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

@ -21,7 +21,7 @@
<children/>
<xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
<html:input class="textbox-input" flex="1" anonid="input"
xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus"/>
xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint"/>
</xul:hbox>
</content>
@ -307,8 +307,8 @@
<content>
<children/>
<xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck" align="center">
<html:input class="textbox-input" flex="1" anonid="input"
xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
<html:input class="textbox-input" flex="1" anonid="input" mozactionhint="search"
xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
<xul:deck class="textbox-search-icons" anonid="search-icons">
<xul:image class="textbox-search-icon"
onclick="document.getBindingParent(this)._iconClick();"
@ -435,7 +435,7 @@
<content>
<xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
<html:textarea class="textbox-textarea" flex="1" anonid="input"
xbl:inherits="onfocus,onblur,xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap,placeholder"><children/></html:textarea>
xbl:inherits="onfocus,onblur,xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap,placeholder,mozactionhint"><children/></html:textarea>
</xul:hbox>
</content>
</binding>

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

@ -40,6 +40,13 @@ function init() {
var addon = window.arguments[0];
var extensionsStrings = document.getElementById("extensionsStrings");
document.documentElement.setAttribute("addontype", addon.type);
if (addon.iconURL) {
var extensionIcon = document.getElementById("extensionIcon");
extensionIcon.src = addon.iconURL;
}
document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [addon.name]);
var extensionName = document.getElementById("extensionName");
extensionName.setAttribute("value", addon.name);
@ -56,21 +63,38 @@ function init() {
else
extensionDescription.hidden = true;
var numDetails = 0;
var extensionCreator = document.getElementById("extensionCreator");
extensionCreator.setAttribute("value", addon.creator);
if (addon.creator) {
extensionCreator.setAttribute("value", addon.creator);
numDetails++;
} else {
extensionCreator.hidden = true;
var extensionCreatorLabel = document.getElementById("extensionCreatorLabel");
extensionCreatorLabel.hidden = true;
}
var extensionHomepage = document.getElementById("extensionHomepage");
var homepageURL = addon.homepageURL;
if (homepageURL) {
extensionHomepage.setAttribute("homepageURL", homepageURL);
extensionHomepage.setAttribute("tooltiptext", homepageURL);
numDetails++;
} else {
extensionHomepage.hidden = true;
}
appendToList("extensionDevelopers", "developersBox", addon.developers);
appendToList("extensionTranslators", "translatorsBox", addon.translators);
appendToList("extensionContributors", "contributorsBox", addon.contributors);
numDetails += appendToList("extensionDevelopers", "developersBox", addon.developers);
numDetails += appendToList("extensionTranslators", "translatorsBox", addon.translators);
numDetails += appendToList("extensionContributors", "contributorsBox", addon.contributors);
if (numDetails == 0) {
var groove = document.getElementById("groove");
groove.hidden = true;
var extensionDetailsBox = document.getElementById("extensionDetailsBox");
extensionDetailsBox.hidden = true;
}
var acceptButton = document.documentElement.getButton("accept");
acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");
@ -82,7 +106,7 @@ function appendToList(aHeaderId, aNodeId, aItems) {
if (!aItems || aItems.length == 0) {
header.hidden = true;
return;
return 0;
}
for (let i = 0; i < aItems.length; i++) {
@ -91,6 +115,8 @@ function appendToList(aHeaderId, aNodeId, aItems) {
label.setAttribute("class", "contributor");
node.appendChild(label);
}
return aItems.length;
}
function loadHomepage(aEvent) {

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

@ -23,6 +23,7 @@
#
# Contributor(s):
# Ben Goodger <ben@bengoodger.com>
# Blair McBride <bmcbride@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -52,33 +53,38 @@
<script type="application/javascript" src="chrome://mozapps/content/extensions/about.js"/>
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
<stringbundleset id="aboutSet">
<stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
</stringbundleset>
<vbox id="clientBox" flex="1">
<label id="extensionName" crop="right"/>
<label id="extensionVersion" crop="right"/>
<hbox class="basic-info" align="center">
<image id="extensionIcon"/>
<vbox>
<label id="extensionName" crop="end"/>
<label id="extensionVersion" crop="end"/>
</vbox>
</hbox>
<description id="extensionDescription" class="boxIndent"/>
<label id="extensionCreatorLabel" class="sectionTitle">&creator.label;</label>
<hbox id="creatorBox" class="boxIndent">
<label id="extensionCreator" flex="1" crop="right"/>
<label id="extensionHomepage" onclick="if (event.button == 0) { loadHomepage(event); }"
class="text-link" value="&homepage.label;"/>
</hbox>
<label id="extensionDevelopers" class="sectionTitle">&developers.label;</label>
<vbox flex="1" id="developersBox" class="boxIndent"/>
<label id="extensionTranslators" class="sectionTitle">&translators.label;</label>
<vbox flex="1" id="translatorsBox" class="boxIndent"/>
<label id="extensionContributors" class="sectionTitle">&contributors.label;</label>
<vbox flex="1" id="contributorsBox" class="boxIndent"/>
<separator id="groove" class="groove"/>
<vbox id="extensionDetailsBox" flex="1">
<label id="extensionCreatorLabel" class="sectionTitle">&creator.label;</label>
<hbox id="creatorBox" class="boxIndent">
<label id="extensionCreator" flex="1" crop="end"/>
<label id="extensionHomepage" onclick="if (event.button == 0) { loadHomepage(event); }"
class="text-link" value="&homepage.label;"/>
</hbox>
<label id="extensionDevelopers" class="sectionTitle">&developers.label;</label>
<vbox flex="1" id="developersBox" class="boxIndent"/>
<label id="extensionTranslators" class="sectionTitle">&translators.label;</label>
<vbox flex="1" id="translatorsBox" class="boxIndent"/>
<label id="extensionContributors" class="sectionTitle">&contributors.label;</label>
<vbox flex="1" id="contributorsBox" class="boxIndent"/>
</vbox>
</vbox>
<separator id="groove" class="groove"/>
</dialog>

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

@ -37,7 +37,14 @@
function Startup() {
var bundle = document.getElementById("extensionsStrings");
var label = document.createTextNode(bundle.getFormattedString("eulaHeader", [window.arguments[0].name]));
var addon = window.arguments[0].addon;
document.documentElement.setAttribute("addontype", addon.type);
if (addon.iconURL)
document.getElementById("icon").src = addon.iconURL;
var label = document.createTextNode(bundle.getFormattedString("eulaHeader", [addon.name]));
document.getElementById("heading").appendChild(label);
document.getElementById("eula").value = window.arguments[0].text;
document.getElementById("eula").value = addon.eula;
}

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

@ -59,8 +59,10 @@
<stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
</stringbundleset>
<label id="heading"/>
<hbox id="heading-container">
<image id="icon"/>
<label id="heading" flex="1"/>
</hbox>
<textbox id="eula" multiline="true" readonly="true" flex="1"/>
</dialog>

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

@ -125,7 +125,7 @@ xhtml|link {
#detail-view:not([pending]) .pending,
#detail-view:not([upgrade="true"]) .update-postfix,
#detail-view[active="true"] .disabled-postfix,
#detail-view[loading] > .detail-view-container,
#detail-view[loading] .detail-view-container,
.detail-row:not([value]),
#search-list[remote="false"] #search-allresults-link {
display: none;
@ -144,3 +144,7 @@ xhtml|link {
#addons-page:not([warning="updatesecurity"]) .global-warning-updatesecurity {
display: none;
}
.addon .relnotes {
-moz-user-select: text;
}

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

@ -1349,12 +1349,10 @@ var gCategories = {
var gHeader = {
_search: null,
_searching: null,
_dest: "",
initialize: function() {
this._search = document.getElementById("header-search");
this._searching = document.getElementById("header-searching");
this._search.addEventListener("command", function(aEvent) {
var query = aEvent.target.value;
@ -1408,17 +1406,6 @@ var gHeader = {
set searchQuery(aQuery) {
this._search.value = aQuery;
},
get isSearching() {
return this._searching.hasAttribute("active");
},
set isSearching(aIsSearching) {
if (aIsSearching)
this._searching.setAttribute("active", true);
else
this._searching.removeAttribute("active");
}
};
@ -1508,6 +1495,7 @@ var gSearchView = {
node: null,
_filter: null,
_sorters: null,
_loading: null,
_listBox: null,
_emptyNotice: null,
_allResultsLink: null,
@ -1520,6 +1508,7 @@ var gSearchView = {
this._filter = document.getElementById("search-filter-radiogroup");
this._sorters = document.getElementById("search-sorters");
this._sorters.handler = this;
this._loading = document.getElementById("search-loading");
this._listBox = document.getElementById("search-list");
this._emptyNotice = document.getElementById("search-list-empty");
this._allResultsLink = document.getElementById("search-allresults-link");
@ -1549,9 +1538,9 @@ var gSearchView = {
show: function(aQuery, aRequest) {
gEventManager.registerInstallListener(this);
gHeader.isSearching = true;
this.showEmptyNotice(false);
this.showAllResultsLink(0);
this.showLoading(true);
gHeader.searchQuery = aQuery;
aQuery = aQuery.trim().toLocaleLowerCase();
@ -1650,13 +1639,18 @@ var gSearchView = {
}
});
},
showLoading: function(aLoading) {
this._loading.hidden = !aLoading;
this._listBox.hidden = aLoading;
},
updateView: function() {
var showLocal = this._filter.value == "local";
this._listBox.setAttribute("local", showLocal);
this._listBox.setAttribute("remote", !showLocal);
gHeader.isSearching = this.isSearching;
this.showLoading(this.isSearching && !showLocal);
if (!this.isSearching) {
var isEmpty = true;
var results = this._listBox.getElementsByTagName("richlistitem");
@ -1735,6 +1729,7 @@ var gSearchView = {
showEmptyNotice: function(aShow) {
this._emptyNotice.hidden = !aShow;
this._listBox.hidden = aShow;
},
showAllResultsLink: function(aTotalResults) {
@ -1746,9 +1741,10 @@ var gSearchView = {
var linkStr = gStrings.ext.GetStringFromName("showAllSearchResults");
linkStr = PluralForm.get(aTotalResults, linkStr);
linkStr = linkStr.replace("#1", aTotalResults);
this._allResultsLink.value = linkStr;
this._allResultsLink.setAttribute("value", linkStr);
this._allResultsLink.href = AddonRepository.getSearchURL(this._lastQuery);
this._allResultsLink.setAttribute("href",
AddonRepository.getSearchURL(this._lastQuery));
this._allResultsLink.hidden = false;
},
@ -1764,6 +1760,30 @@ var gSearchView = {
getService(Ci.nsIXULSortService);
sortService.sort(this._listBox, aSortBy, hints);
var item = this._listBox.querySelector("richlistitem[remote='true'][first]");
if (item)
item.removeAttribute("first");
item = this._listBox.querySelector("richlistitem[remote='true'][last]");
if (item)
item.removeAttribute("last");
var items = this._listBox.querySelectorAll("richlistitem[remote='true']");
if (items.length > 0) {
items[0].setAttribute("first", true);
items[items.length - 1].setAttribute("last", true);
}
item = this._listBox.querySelector("richlistitem:not([remote='true'])[first]");
if (item)
item.removeAttribute("first");
item = this._listBox.querySelector("richlistitem:not([remote='true'])[last]");
if (item)
item.removeAttribute("last");
items = this._listBox.querySelectorAll("richlistitem:not([remote='true'])");
if (items.length > 0) {
items[0].setAttribute("first", true);
items[items.length - 1].setAttribute("last", true);
}
this._listBox.appendChild(footer);
},

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

@ -206,6 +206,8 @@
this._progress.value = val;
if (val == this._progress.max)
this.setAttribute("complete", true);
else
this.removeAttribute("complete");
]]></setter>
</property>
@ -338,20 +340,29 @@
var sortBy = this.sortBy;
var checkState = this.ascending ? 2 : 1;
if (sortBy == "name")
if (sortBy == "name") {
this._btnName.checkState = checkState;
else
this._btnName.checked = true;
} else {
this._btnName.checkState = 0;
this._btnName.checked = false;
}
if (sortBy == "dateUpdated")
if (sortBy == "dateUpdated") {
this._btnDate.checkState = checkState;
else
this._btnDate.checked = true;
} else {
this._btnDate.checkState = 0;
this._btnDate.checked = false;
}
if (sortBy == "relevancescore")
if (sortBy == "relevancescore") {
this._btnRelevance.checkState = checkState;
else
this._btnRelevance.checked = true;
} else {
this._btnRelevance.checkState = 0;
this._btnRelevance.checked = false;
}
if (this.handler && "onSortChanged" in this.handler)
this.handler.onSortChanged(sortBy, this.ascending);
@ -473,11 +484,11 @@
<xul:label anonid="message"/>
<xul:progressmeter anonid="progress" class="download-progress"/>
<xul:button anonid="install-remote-btn" hidden="true"
class="addon-control" label="&addon.install.label;"
class="addon-control install" label="&addon.install.label;"
tooltiptext="&addon.install.tooltip;"
oncommand="document.getBindingParent(this).installRemote();"/>
<xul:button anonid="restart-install-btn" hidden="true"
class="addon-control" label="&addon.install.label;"
class="addon-control install" label="&addon.install.label;"
tooltiptext="&addon.install.tooltip;"
oncommand="document.getBindingParent(this).restartInstall();"/>
</content>
@ -586,7 +597,7 @@
<parameter name="aHideProgress"/>
<body><![CDATA[
this._message.setAttribute("hidden", !aHideProgress);
this._progress.setAttribute("hidden", aHideProgress);
this._progress.setAttribute("hidden", !!aHideProgress);
var msg = gStrings.ext.GetStringFromName(aMsgId);
if (aHideProgress)
@ -602,14 +613,13 @@
return;
if (this.mControl.mAddon.eula) {
var eula = {
name: this.mControl.mAddon.name,
text: this.mControl.mAddon.eula,
var data = {
addon: this.mControl.mAddon,
accepted: false
};
window.openDialog("chrome://mozapps/content/extensions/eula.xul", "_blank",
"chrome,dialog,modal,centerscreen,resizable=no", eula);
if (!eula.accepted)
"chrome,dialog,modal,centerscreen,resizable=no", data);
if (!data.accepted)
return;
}
@ -666,6 +676,7 @@
<method name="onInstallStarted">
<body><![CDATA[
this._progress.progress = 0;
this.refreshState();
]]></body>
</method>
@ -757,7 +768,7 @@
</xul:hbox>
<xul:hbox>
<xul:vbox align="center" pack="center" class="icon-container">
<xul:vbox align="center" pack="start" class="icon-container">
<xul:image anonid="icon" class="icon"/>
</xul:vbox>
<xul:vbox flex="1">
@ -773,7 +784,8 @@
</xul:hbox>
<xul:label anonid="creator" class="creator"/>
</xul:vbox>
<xul:label anonid="date-updated" unknown="&addon.unknownDate;"/>
<xul:label anonid="date-updated" class="date-updated"
unknown="&addon.unknownDate;"/>
</xul:hbox>
<xul:hbox flex="1" align="end">
@ -791,7 +803,7 @@
<xul:label anonid="relnotes-loading" value="&addon.loadingReleaseNotes.label;"/>
<xul:label anonid="relnotes-error" hidden="true"
value="&addon.errorLoadingReleaseNotes.label;"/>
<xul:vbox anonid="relnotes"/>
<xul:vbox anonid="relnotes" class="relnotes"/>
</xul:vbox>
<xul:hbox pack="start">
<xul:button anonid="relnotes-toggle-btn" class="relnotes-toggle"
@ -818,7 +830,7 @@
<xul:hbox align="center">
<xul:label class="update-available-notice"
value="&addon.updateAvailable.label;"/>
<xul:button anonid="update-btn" class="addon-control"
<xul:button anonid="update-btn" class="addon-control update"
label="&addon.updateNow.label;"
tooltiptext="&addon.updateNow.tooltip;"
oncommand="document.getBindingParent(this).upgrade();"/>
@ -828,7 +840,8 @@
hidden="true"/>
</xul:hbox>
<xul:hbox anonid="control-container" class="control-container">
<xul:button anonid="preferences-btn" class="addon-control"
<xul:button anonid="preferences-btn"
class="addon-control preferences"
#ifdef XP_WIN
label="&cmd.showPreferencesWin.label;"
tooltiptext="&cmd.showPreferencesWin.tooltip;"

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

@ -142,9 +142,9 @@
<!-- main header -->
<hbox id="header" align="center">
<button id="back-btn" class="nav-button" command="cmd_back"
<toolbarbutton id="back-btn" class="nav-button header-button" command="cmd_back"
tooltiptext="&cmd.back.tooltip;" hidden="true" disabled="true"/>
<button id="forward-btn" class="nav-button" command="cmd_forward"
<toolbarbutton id="forward-btn" class="nav-button header-button" command="cmd_forward"
tooltiptext="&cmd.forward.tooltip;" hidden="true" disabled="true"/>
<spacer flex="1"/>
<hbox id="updates-container" align="center">
@ -164,7 +164,8 @@
label="&updates.restart.label;"
command="cmd_restartApp"/>
</hbox>
<button id="header-utils-btn" type="menu" tooltiptext="&toolsMenu.tooltip;">
<toolbarbutton id="header-utils-btn" class="header-button" type="menu"
tooltiptext="&toolsMenu.tooltip;">
<menupopup id="utils-menu">
<menuitem id="utils-updateNow"
label="&updates.checkForUpdates.label;"
@ -194,10 +195,9 @@
accesskey="&updates.resetUpdatesToManual.accesskey;"
command="cmd_resetAddonAutoUpdate"/>
</menupopup>
</button>
</toolbarbutton>
<textbox id="header-search" type="search" searchbutton="true"
placeholder="&search.placeholder;"/>
<image id="header-searching"/>
</hbox>
<hbox flex="1">
@ -206,34 +206,44 @@
<richlistbox id="categories" persist="last-selected">
<richlistitem id="category-search" value="addons://search/"
class="category"
name="&view.search.label;" disabled="true"/>
name="&view.search.label;"
tooltiptext="&view.search.label;" disabled="true"/>
<richlistitem id="category-discover" value="addons://discover/"
class="category"
name="&view.discover.label;"/>
name="&view.discover.label;"
tooltiptext="&view.discover.label;"/>
<richlistitem id="category-languages" value="addons://list/locale"
class="category"
name="&view.locales.label;"
tooltiptext="&view.locales.label;"
hidden="true" persist="hidden"/>
<richlistitem id="category-searchengines"
value="addons://list/searchengine"
class="category"
name="&view.searchengines.label;"
tooltiptext="&view.searchengines.label;"
hidden="true" persist="hidden"/>
<richlistitem id="category-extensions" value="addons://list/extension"
class="category"
name="&view.features.label;"/>
name="&view.features.label;"
tooltiptext="&view.features.label;"/>
<richlistitem id="category-themes" value="addons://list/theme"
class="category"
name="&view.appearance2.label;"/>
name="&view.appearance2.label;"
tooltiptext="&view.appearance2.label;"/>
<richlistitem id="category-plugins" value="addons://list/plugin"
class="category"
name="&view.plugins.label;"/>
name="&view.plugins.label;"
tooltiptext="&view.plugins.label;"/>
<richlistitem id="category-availableUpdates" value="addons://updates/available"
class="category"
name="&view.availableUpdates.label;" disabled="true"/>
name="&view.availableUpdates.label;"
tooltiptext="&view.availableUpdates.label;"
disabled="true"/>
<richlistitem id="category-recentUpdates" value="addons://updates/recent"
class="category"
name="&view.recentUpdates.label;" disabled="true"/>
name="&view.recentUpdates.label;"
tooltiptext="&view.recentUpdates.label;" disabled="true"/>
</richlistbox>
<box id="view-port-container" flex="1">
@ -249,18 +259,6 @@
<!-- search view -->
<vbox id="search-view" flex="1" class="view-pane">
<hbox id="search-filter" align="center">
<label id="search-filter-label" value="&search.filter2.label;"/>
<radiogroup id="search-filter-radiogroup" orient="horizontal"
align="center" persist="value" value="local">
<radio id="search-filter-local" class="search-filter-radio"
label="&search.filter2.installed.label;" value="local"
tooltiptext="&search.filter2.installed.tooltip;"/>
<radio id="search-filter-remote" class="search-filter-radio"
label="&search.filter2.available.label;" value="remote"
tooltiptext="&search.filter2.available.tooltip;"/>
</radiogroup>
</hbox>
<hbox class="view-header global-warning-container" align="center">
<!-- global warnings -->
<hbox class="global-warning" flex="1">
@ -296,13 +294,36 @@
<hbox id="search-sorters" class="sort-controls"
showrelevance="true" sortby="relevancescore" ascending="false"/>
</hbox>
<vbox id="search-list-empty" class="empty-list-notice"
<hbox id="search-filter" align="center">
<label id="search-filter-label" value="&search.filter2.label;"/>
<radiogroup id="search-filter-radiogroup" orient="horizontal"
align="center" persist="value" value="local">
<radio id="search-filter-local" class="search-filter-radio"
label="&search.filter2.installed.label;" value="local"
tooltiptext="&search.filter2.installed.tooltip;"/>
<radio id="search-filter-remote" class="search-filter-radio"
label="&search.filter2.available.label;" value="remote"
tooltiptext="&search.filter2.available.tooltip;"/>
</radiogroup>
</hbox>
<vbox id="search-loading" class="alert-container"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.search.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
<spacer class="alert-spacer-before"/>
<hbox class="alert loading" align="center">
<image/>
<label value="&loading.label;"/>
</hbox>
<spacer class="alert-spacer-after"/>
</vbox>
<vbox id="search-list-empty" class="alert-container"
flex="1" hidden="true">
<spacer class="alert-spacer-before"/>
<vbox class="alert">
<label value="&listEmpty.search.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
</vbox>
<spacer class="alert-spacer-after"/>
</vbox>
<richlistbox id="search-list" class="list" flex="1">
<hbox pack="center">
@ -348,13 +369,15 @@
<hbox id="list-sorters" class="sort-controls" sortby="name"
ascending="true"/>
</hbox>
<vbox id="addon-list-empty" class="empty-list-notice"
<vbox id="addon-list-empty" class="alert-container"
flex="1" hidden="true">
<spacer flex="1"/>
<label value="&listEmpty.installed.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
<spacer flex="3"/>
<spacer class="alert-spacer-before"/>
<vbox class="alert">
<label value="&listEmpty.installed.label;"/>
<button label="&listEmpty.button.label;" class="addon-control"
command="cmd_goToDiscoverPane"/>
</vbox>
<spacer class="alert-spacer-after"/>
</vbox>
<richlistbox id="addon-list" class="list" flex="1"/>
</vbox>
@ -396,14 +419,16 @@
<hbox id="updates-sorters" class="sort-controls" sortby="dateUpdated"
ascending="false"/>
</hbox>
<vbox id="updates-list-empty" class="empty-list-notice"
<vbox id="updates-list-empty" class="alert-container"
flex="1" hidden="true">
<spacer flex="1"/>
<label id="empty-availableUpdates-msg" value="&listEmpty.availableUpdates.label;"/>
<label id="empty-recentUpdates-msg" value="&listEmpty.recentUpdates.label;"/>
<button label="&listEmpty.findUpdates.label;" class="addon-control"
command="cmd_findAllUpdates"/>
<spacer flex="3"/>
<spacer class="alert-spacer-before"/>
<vbox class="alert">
<label id="empty-availableUpdates-msg" value="&listEmpty.availableUpdates.label;"/>
<label id="empty-recentUpdates-msg" value="&listEmpty.recentUpdates.label;"/>
<button label="&listEmpty.findUpdates.label;" class="addon-control"
command="cmd_findAllUpdates"/>
</vbox>
<spacer class="alert-spacer-after"/>
</vbox>
<hbox id="update-actions" pack="center">
<button id="update-selected-btn" hidden="true"
@ -448,10 +473,14 @@
<hbox flex="1">
<spacer flex="1"/>
<!-- "loading" splash screen -->
<hbox class="loading" flex="1">
<image/>
<label value="&loading.label;"/>
</hbox>
<vbox class="alert-container">
<spacer class="alert-spacer-before"/>
<hbox class="alert loading">
<image/>
<label value="&loading.label;"/>
</hbox>
<spacer class="alert-spacer-after"/>
</vbox>
<!-- actual detail view -->
<vbox class="detail-view-container" flex="3" contextmenu="addonitem-popup">
<vbox id="detail-notifications">
@ -484,7 +513,8 @@
<image id="detail-icon" class="icon"/>
<vbox flex="1">
<vbox id="detail-summary">
<hbox id="detail-name-container" align="start">
<hbox id="detail-name-container" class="name-container"
align="start">
<label id="detail-name" flex="1"/>
<label id="detail-version"/>
<label class="disabled-postfix" value="&addon.disabled.postfix;"/>
@ -493,7 +523,7 @@
</hbox>
<label id="detail-creator" class="creator"/>
</vbox>
<hbox id="detail-desc-container" align="end">
<hbox id="detail-desc-container" align="start">
<image id="detail-screenshot" hidden="true"/>
<description id="detail-desc" flex="1"/>
</hbox>
@ -504,7 +534,7 @@
<hbox align="center">
<label id="detail-contrib-suggested"/>
<spacer flex="1"/>
<button id="detail-contrib-btn" class="addon-control"
<button id="detail-contrib-btn"
label="&cmd.contribute.label;"
accesskey="&cmd.contribute.accesskey;"
tooltiptext="&cmd.contribute.tooltip;"
@ -543,7 +573,7 @@
</row>
<row class="detail-row-complex" id="detail-homepage-row" label="&detail.home;">
<label class="detail-row-label" value="&detail.home;"/>
<label id="detail-homepage" class="detail-row-value text-link"/>
<label id="detail-homepage" class="detail-row-value text-link" crop="end"/>
</row>
<row class="detail-row-complex" id="detail-repository-row" label="&detail.repository;">
<label class="detail-row-label" value="&detail.repository;"/>
@ -562,7 +592,7 @@
</rows>
</grid>
<hbox id="detail-controls">
<button id="detail-prefs-btn" class="addon-control"
<button id="detail-prefs-btn" class="addon-control preferences"
#ifdef XP_WIN
label="&detail.showPreferencesWin.label;"
accesskey="&detail.showPreferencesWin.accesskey;"

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

@ -101,12 +101,8 @@ function getAnonymousElementByAttribute(aElement, aName, aValue) {
* The expected isSearching state
*/
function check_is_searching(aExpectedSearching) {
is(gManagerWindow.gHeader.isSearching, aExpectedSearching,
"Should get expected isSearching state");
var throbber = gManagerWindow.document.getElementById("header-searching");
var style = gManagerWindow.document.defaultView.getComputedStyle(throbber, "");
is(style.visibility, aExpectedSearching ? "visible" : "hidden",
var loading = gManagerWindow.document.getElementById("search-loading");
is(!is_hidden(loading), aExpectedSearching,
"Search throbber should be showing iff currently searching");
}
@ -292,6 +288,26 @@ function check_results(aQuery, aSortBy, aReverseOrder, aShowLocal) {
var totalExpectedResults = expectedOrder.length + unknownOrder.length;
is(actualOrder.length, totalExpectedResults, "Should get correct number of results");
// Check the "first" and "last" attributes are set correctly
for (let i = 0; i < actualResults.length; i++) {
if (i == 0) {
is(actualResults[0].item.hasAttribute("first"), true,
"First item should have 'first' attribute set");
is(actualResults[0].item.hasAttribute("last"), false,
"First item should not have 'last' attribute set");
} else if (i == (actualResults.length - 1)) {
is(actualResults[actualResults.length - 1].item.hasAttribute("first"), false,
"Last item should not have 'first' attribute set");
is(actualResults[actualResults.length - 1].item.hasAttribute("last"), true,
"Last item should have 'last' attribute set");
} else {
is(actualResults[i].item.hasAttribute("first"), false,
"Item " + i + " should not have 'first' attribute set");
is(actualResults[i].item.hasAttribute("last"), false,
"Item " + i + " should not have 'last' attribute set");
}
}
var i = 0;
for (; i < expectedOrder.length; i++)
is(actualOrder[i], expectedOrder[i], "Should have seen expected item");

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

@ -36,55 +36,23 @@
* ***** END LICENSE BLOCK ***** */
#addons-page {
margin: 20px 20px;
-moz-appearance: none;
padding: 18px;
background-color: Window;
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 160px),
-moz-linear-gradient(-moz-dialog, Window 160px);
color: WindowText;
}
#view-port-container {
/* Needed to allow the radius to clip the inner content, see bug 595656 */
overflow: hidden;
background-color: -moz-field;
color: -moz-fieldtext;
border: 1px solid threedshadow;
background-color: -moz-Field;
color: -moz-FieldText;
border: 1px solid ThreeDShadow;
border-radius: 5px;
}
.nav-button {
-moz-appearance: toolbarbutton;
min-width: 0;
}
#back-btn:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar");
}
#forward-btn:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar");
}
#back-btn:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
}
#forward-btn:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
}
#back-btn[disabled="true"]:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
}
#forward-btn[disabled="true"]:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
}
#back-btn[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
}
#forward-btn[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
}
/*** global warnings ***/
.global-warning-container {
@ -93,19 +61,23 @@
.global-warning {
-moz-box-align: center;
margin: 0 8px;
color: #916D15;
text-shadow: #FFFFFF 1px 1px 1px;
padding: 0 8px;
font-weight: bold;
}
#addons-page[warning] .global-warning-container {
background-color: rgba(255, 255, 0, 0.1);
background-image: url("chrome://mozapps/skin/extensions/warning-stripes.png");
background-image: url("chrome://mozapps/skin/extensions/stripes-warning.png");
background-repeat: repeat-x;
}
@media all and (max-width: 700px) {
#detail-view .global-warning {
padding: 4px 12px;
border-bottom: 1px solid ThreeDShadow;
min-height: 41px;
}
@media all and (max-width: 600px) {
.global-warning-text {
display: none;
}
@ -135,6 +107,46 @@
margin: 3px 0;
}
/*** view alert boxes ***/
.alert-container {
-moz-box-align: center;
}
.alert-spacer-before {
-moz-box-flex: 1;
}
.alert-spacer-after {
-moz-box-flex: 3;
}
.alert {
-moz-box-align: center;
padding: 10px;
font-size: 12px;
border: 1px solid ThreeDShadow;
border-radius: 8px;
color: WindowText;
background-color: Window;
}
.alert .alert-title {
font-weight: bold;
font-size: 200%;
margin-bottom: 15px;
}
.alert .addon-control {
margin: 1em 2em;
}
.loading {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
padding-left: 20px;
padding-right: 20px;
}
/*** category selector ***/
#categories {
@ -143,6 +155,7 @@
-moz-margin-end: -1px;
background-color: transparent;
position: relative;
margin-top: 41px;
}
.category {
@ -154,7 +167,8 @@
padding: 10px 4px;
-moz-box-align: center;
overflow: hidden;
min-height: 0px;
min-height: 0;
color: WindowText;
}
.category:-moz-locale-dir(ltr) {
@ -168,7 +182,7 @@
}
.category[disabled] {
height: 0px;
height: 0;
opacity: 0;
-moz-transition-property: height, opacity;
-moz-transition-duration: 1s, 0.8s;
@ -181,21 +195,29 @@
}
.category[selected] {
background-color: -moz-field;
color: -moz-fieldtext;
border-color: threedshadow;
background-color: -moz-Field;
color: -moz-FieldText;
border-color: ThreeDShadow;
font-weight: bold;
}
.category-name {
font-size: 150%;
}
/* Maximize the size of the viewport when the window is small */
@media all and (max-width: 800px) {
.category-name {
display: none;
}
}
.category-badge {
background-color: #55D4FF;
background-color: Highlight;
padding: 2px 8px;
margin: 6px 0px;
margin: 6px 0;
border-radius: 10000px;
color: #FFF;
color: HighlightText;
font-weight: bold;
text-align: center;
}
@ -242,51 +264,67 @@
/*** header ***/
#header {
margin-bottom: 20px;
margin-bottom: 18px;
}
#header-name, #header-link {
color: #555;
text-shadow: 1px 1px 1px #EEE;
.nav-button {
min-width: 0;
}
#header-name {
font-size: 180%;
#back-btn:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar");
}
#header-link {
-moz-appearance: none;
border: none;
background: transparent;
font-size: 120%;
cursor: pointer;
list-style-image: url("chrome://mozapps/skin/extensions/go-back.png");
#forward-btn:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar");
}
#header-link .button-icon {
-moz-margin-end: 6px;
#back-btn:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
}
#header-searching {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
#forward-btn:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
}
#back-btn[disabled="true"]:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
}
#forward-btn[disabled="true"]:-moz-locale-dir(ltr) {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
}
#back-btn[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
}
#forward-btn[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
}
#header-utils-btn {
min-width: 4.5em;
}
#header-utils-btn .button-icon {
list-style-image: url("chrome://mozapps/skin/extensions/utilities.png");
#header-utils-btn .toolbarbutton-icon {
list-style-image: url("moz-icon://stock/gtk-preferences?size=toolbar");
}
#header-utils-btn:-moz-focusring > .button-box {
border: none;
}
#header-search {
margin: 0;
}
.view-header {
padding: 4px;
margin: 0px;
border-bottom: 1px solid #A8A8A8;
margin: 0;
min-height: 41px;
background-color: ThreeDHighlight;
border-bottom: 1px solid ThreeDShadow;
}
@ -296,43 +334,14 @@
-moz-appearance: none;
}
.sorter {
-moz-appearance: none;
border: none;
background-color: transparent;
border-radius: 10000px;
padding: 0px 6px;
margin: 0px 6px;
min-width: 12px !important;
-moz-box-direction: reverse;
.sorter[checkState="1"] .button-icon {
display: -moz-box;
list-style-image: url("moz-icon://stock/gtk-sort-descending?size=16");
}
.sorter[checkState="1"],
.sorter[checkState="2"] {
background-color: #DADADA;
}
.sorter[checkState="1"] {
list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
}
.sorter[checkState="2"] {
list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
}
.sorter .button-icon {
-moz-margin-start: 4px;
}
/*** empty list notification ***/
.empty-list-notice {
-moz-box-align: center;
}
.empty-list-notice > button {
margin: 20px;
.sorter[checkState="2"] .button-icon {
display: -moz-box;
list-style-image: url("moz-icon://stock/gtk-sort-ascending?size=16");
}
@ -340,13 +349,13 @@
.list {
-moz-appearance: none;
margin: 0px;
margin: 0;
border: none;
background-color: transparent;
}
.addon {
border-bottom: 1px solid #F2F2F2;
border-bottom: 1px solid ThreeDLightShadow;
padding: 5px;
}
@ -354,6 +363,11 @@
-moz-box-align: center;
}
.addon[selected] .text-link,
.addon[selected] .button-link {
color: inherit;
}
.details {
cursor: pointer;
margin: 0;
@ -363,7 +377,7 @@
.icon-container {
width: 48px;
height: 48px;
margin: 7px;
margin: 22px 7px 7px 7px;
}
.icon {
@ -372,6 +386,10 @@
max-height: 48px;
}
.addon[active="false"] .icon {
filter: url("chrome://mozapps/skin/extensions/extensions.svg#greyscale");
}
.addon-view[type="theme"] .icon {
list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
}
@ -384,9 +402,19 @@
list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
}
.name-container {
.name-container,
.addon[status="installing"] .name {
font-size: 150%;
margin-bottom: 0px;
margin-bottom: 0;
font-weight: bold;
}
.creator {
font-weight: bold;
}
.addon-view[active="false"]:not([selected]) {
color: GrayText;
}
.description-container {
@ -398,7 +426,9 @@
margin: 0;
}
.warning, .pending, .error, .info {
.warning,
.pending,
.error {
-moz-margin-start: 48px;
}
@ -414,32 +444,45 @@
color: #4F7939;
}
.addon[active="false"] {
background-image: -moz-linear-gradient(rgba(135, 135, 135, 0.2),
rgba(135, 135, 135, 0.1));
}
.addon-view[notification="warning"] {
background-image: -moz-linear-gradient(rgba(255, 255, 0, 0.2), rgba(255, 255, 0, 0.1));
background-image: url("chrome://mozapps/skin/extensions/stripes-warning.png"),
-moz-linear-gradient(rgba(255, 255, 0, 0.04),
rgba(255, 255, 0, 0));
background-repeat: repeat-x;
}
.addon-view[notification="error"] {
background-image: -moz-linear-gradient(rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.1));
}
.addon-view[notification="info"] {
background-image: -moz-linear-gradient(rgba(0, 0, 255, 0.2), rgba(0, 0, 255, 0.1));
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
-moz-linear-gradient(rgba(255, 0, 0, 0.04),
rgba(255, 0, 0, 0));
background-repeat: repeat-x;
}
.addon-view[pending="enable"],
.addon-view[pending="upgrade"],
.addon-view[pending="install"] {
background-image: -moz-linear-gradient(rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1));
background-image: url("chrome://mozapps/skin/extensions/stripes-info-positive.png"),
-moz-linear-gradient(rgba(0, 255, 0, 0.04),
rgba(0, 255, 0, 0));
background-repeat: repeat-x;
}
.addon-view[pending="disable"],
.addon-view[pending="uninstall"] {
background-image: -moz-linear-gradient(rgba(128, 128, 128, 0.2), rgba(128, 128, 128, 0.1));
background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative.png"),
-moz-linear-gradient(rgba(128, 128, 128, 0.04),
rgba(128, 128, 128, 0));
background-repeat: repeat-x;
}
.addon .relnotes-container {
-moz-box-align: start;
height: 0px;
height: 0;
overflow: hidden;
opacity: 0;
-moz-transition-property: height, opacity;
@ -454,7 +497,7 @@
.addon .relnotes-header {
font-weight: bold;
margin: 10px 0px;
margin: 10px 0;
}
.addon .relnotes-toggle {
@ -462,64 +505,30 @@
border: none;
background: transparent;
font-weight: bold;
-moz-box-direction: reverse;
cursor: pointer;
list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
list-style-image: url("moz-icon://stock/gtk-go-down?size=16");
}
.addon .relnotes-toggle > .button-box > .button-icon {
-moz-padding-start: 4px;
display: -moz-box;
}
.addon[show-relnotes] .relnotes-toggle {
list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
list-style-image: url("moz-icon://stock/gtk-go-up?size=16");
}
/*** item - uninstalled ***/
.addon[status="uninstalled"] {
border: none;
}
.addon[status="uninstalled"] > .container {
-moz-box-align: center;
padding: 4px 20px;
background-color: #FDFFA8;
border-radius: 8px;
font-size: 120%;
}
.addon[status="uninstalled"][selected] {
background-color: transparent;
}
/*** search view ***/
#search-filter {
padding: 5px 20px;
font-size: 120%;
overflow-x: hidden;
border-bottom: 1px solid ThreeDShadow;
}
#search-filter-label {
font-weight: bold;
color: grey;
}
.search-filter-radio {
padding: 0px 6px;
margin: 0px 3px;
}
.search-filter-radio .radio-spacer-box {
display: none;
}
.search-filter-radio .radio-icon {
display: none;
}
#search-allresults-link {
@ -549,23 +558,19 @@
-moz-transition-duration: 1s;
}
#detail-view .loading > image {
list-style-image: url("chrome://global/skin/icons/loading_16.png");
}
.detail-view-container {
padding: 2em;
padding: 0 2em 2em 2em;
font-size: 110%;
}
#detail-notifications {
margin-top: 1em;
margin-bottom: 2em;
}
#detail-notifications .warning,
#detail-notifications .pending,
#detail-notifications .error,
#detail-notifications .info {
#detail-notifications .error {
-moz-margin-start: 0;
}
@ -595,14 +600,15 @@
bug 592712*/
outline: solid transparent;
white-space: pre-wrap;
min-width: 8em;
}
#detail-contributions {
border-radius: 5px;
border: 1px solid #B0C8D1;
border: 1px solid ThreeDShadow;
margin-bottom: 2em;
padding: 1em;
background: #D8DDE4;
background: ThreeDHighlight;
}
#detail-contrib-description {
@ -611,7 +617,7 @@
}
#detail-contrib-suggested {
color: grey;
color: GrayText;
}
#detail-grid {
@ -625,7 +631,7 @@
.detail-row,
.detail-row-complex {
border-top: 1px solid grey;
border-top: 1px solid ThreeDHighlight;
-moz-box-align: center;
}
@ -633,12 +639,21 @@
-moz-margin-start: 0;
}
#detail-controls {
margin-bottom: 1em;
}
#detail-view[active="false"]:not([pending]):not([notification]) {
background-image: -moz-linear-gradient(rgba(135, 135, 135, 0.1),
rgba(135, 135, 135, 0));
}
/*** creator ***/
.creator > label {
-moz-margin-start: 0px;
-moz-margin-end: 0px;
-moz-margin-start: 0;
-moz-margin-end: 0;
}
.creator > .text-link {
@ -650,14 +665,14 @@
/*** rating ***/
.meta-rating {
-moz-margin-start: 0px;
-moz-margin-end: 0px;
-moz-margin-start: 0;
-moz-margin-end: 0;
vertical-align: text-top;
}
.meta-rating[showrating="average"] > .star {
list-style-image: url("chrome://mozapps/skin/extensions/rating-not-won.png");
padding: 0px 1px;
padding: 0 1px;
}
.meta-rating[showrating="user"] > .star {
@ -668,68 +683,46 @@
.meta-rating > .star[on="true"],
.meta-rating[showrating="user"] > .star[hover] {
list-style-image: url("chrome://mozapps/skin/extensions/rating-won.png");
padding: 0px 1px;
padding: 0 1px;
}
/*** download progress ***/
.download-progress {
background-image: -moz-linear-gradient(#E1E1E1, #FEFEFE);
border-radius: 10000px;
border: 1px solid #555;
box-shadow: #777 1px 1px 1.5px;
width: 200px;
height: 24px;
margin: 0px 8px;
}
.download-progress .start-cap,
.download-progress[complete] .end-cap,
.download-progress .progress .progress-bar {
-moz-appearance: none;
background-image: -moz-linear-gradient(#84A9D9, #5183C0);
.download-progress .end-cap {
display: none;
}
.download-progress .progress {
background-color: transparent;
}
.download-progress .start-cap, .download-progress .end-cap {
width: 12px;
}
.download-progress .start-cap:-moz-locale-dir(ltr),
.download-progress .end-cap:-moz-locale-dir(rtl) {
border-radius: 10000px 0 0 10000px;
}
.download-progress .end-cap:-moz-locale-dir(ltr),
.download-progress .start-cap:-moz-locale-dir(rtl) {
border-radius: 0 10000px 10000px 0;
}
.download-progress .progress {
-moz-appearance: none;
padding: 0px;
margin: 0px;
padding: 0;
margin: 0;
border: none;
}
.download-progress .pause, .download-progress .cancel {
.download-progress .pause,
.download-progress .cancel {
-moz-appearance: none;
background-image: -moz-linear-gradient(#E1E1E1, #FEFEFE);
border-width: 1px 0px 0px 1px;
padding-right: 1px;
background-color: ButtonFace;
padding-bottom: 1px;
-moz-padding-start: 2px;
border-width: 1px;
border-style: solid;
-moz-border-top-colors: #FFF;
-moz-border-left-colors: #FFF;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
border-radius: 10000px;
min-width: 16px;
width: 16px;
height: 16px;
margin: 3px;
box-shadow: #777 1px 1px 1px;
}
.download-progress .pause:hover,
.download-progress .cancel:hover {
background-color: -moz-ButtonHoverFace;
}
.download-progress .pause {
@ -758,8 +751,8 @@
-moz-box-align: center;
}
#updates-installed, #updates-downloaded {
color: #00BB00;
#updates-installed,
#updates-downloaded {
font-weight: bold;
}
@ -774,6 +767,27 @@
display: none;
}
.addon-control.enable {
list-style-image: url("moz-icon://stock/gtk-yes?size=button");
}
.addon-control.disable {
list-style-image: url("moz-icon://stock/gtk-no?size=button");
}
.addon-control.remove {
list-style-image: url("moz-icon://stock/gtk-remove?size=button");
}
.addon-control.preferences {
list-style-image: url("moz-icon://stock/gtk-preferences?size=button");
}
.addon-control.install,
.addon-control.update {
list-style-image: url("moz-icon://stock/gtk-save?size=button");
}
.button-link {
-moz-appearance: none;
background: transparent;
@ -784,3 +798,12 @@
min-width: 0;
margin: 0 6px;
}
.button-link:active {
color: -moz-activehyperlinktext;
}
.header-button .toolbarbutton-text {
display: none;
}

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

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
<filter id="greyscale">
<feColorMatrix values="0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0 0 0 1 0"/>
</filter>
</svg>

После

Ширина:  |  Высота:  |  Размер: 328 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 167 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 194 B

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 132 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 190 B

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичные данные
toolkit/themes/gnomestripe/mozapps/extensions/stripes-error.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

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

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 946 B

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

@ -3,6 +3,7 @@ toolkit.jar:
+ skin/classic/mozapps/downloads/downloadIcon.png (downloads/downloadIcon.png)
+ skin/classic/mozapps/downloads/downloads.css (downloads/downloads.css)
+ skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css)
+ skin/classic/mozapps/extensions/extensions.svg (extensions/extensions.svg)
+ skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png)
+ skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png)
+ skin/classic/mozapps/extensions/category-languages.png (extensions/category-languages.png)
@ -17,15 +18,15 @@ toolkit.jar:
+ skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png)
+ skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png)
+ skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png)
+ skin/classic/mozapps/extensions/go-back.png (extensions/go-back.png)
+ skin/classic/mozapps/extensions/rating-won.png (extensions/rating-won.png)
+ skin/classic/mozapps/extensions/rating-not-won.png (extensions/rating-not-won.png)
+ skin/classic/mozapps/extensions/rating-unrated.png (extensions/rating-unrated.png)
+ skin/classic/mozapps/extensions/cancel.png (extensions/cancel.png)
+ skin/classic/mozapps/extensions/pause.png (extensions/pause.png)
+ skin/classic/mozapps/extensions/utilities.png (extensions/utilities.png)
+ skin/classic/mozapps/extensions/heart.png (extensions/heart.png)
+ skin/classic/mozapps/extensions/warning-stripes.png (extensions/warning-stripes.png)
+ skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
+ skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
+ skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
+ kin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
+ skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png)
+ skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png)
+ skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png)

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

@ -1,38 +1,62 @@
#genericAbout {
padding: 0px;
min-height: 200px;
max-height: 400px;
width: 30em;
}
#clientBox {
background-color: #FFFFFF;
color: #000000;
background-color: -moz-Dialog;
color: -moz-DialogText;
}
.basic-info {
padding: 10px;
}
#extensionIcon {
list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png");
max-width: 48px;
max-height: 48px;
-moz-margin-end: 6px;
}
#genericAbout[addontype="theme"] #extensionIcon {
list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
}
#genericAbout[addontype="locale"] #extensionIcon {
list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
}
#genericAbout[addontype="plugin"] #extensionIcon {
list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
}
#extensionName {
font-size: large;
font-weight: bold;
font-size: 200%;
font-weight: bolder;
}
#extensionVersion {
font-weight: bold;
color: #909090;
}
#genericAbout {
padding: 0px 0px 10px 0px;
min-height: 200px;
width: 30em;
#extensionDescription {
margin-top: 4px;
}
#groove {
margin-top: 0px;
margin-top: 8px;
}
#clientBox {
padding: 10px;
}
#extensionDescription {
color: #404040;
#extensionDetailsBox {
overflow: auto;
min-height: 100px;
}
.boxIndent {
-moz-margin-start: 6px;
-moz-margin-start: 18px;
}
#extensionCreator, .contributor {
@ -40,9 +64,7 @@
}
.sectionTitle {
border-top: 2px solid #C0C0C0;
padding: 2px 0px 3px 0px;
margin-top: 3px;
font-weight: bold;
}

Двоичные данные
toolkit/themes/pinstripe/mozapps/extensions/alerticon-error.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
toolkit/themes/pinstripe/mozapps/extensions/alerticon-warning.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичные данные
toolkit/themes/pinstripe/mozapps/extensions/background-texture.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.8 KiB

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

@ -1,19 +1,39 @@
#icon {
list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png");
max-width: 48px;
max-height: 48px;
-moz-margin-end: 6px;
}
#eula-dialog[addontype="theme"] #icon {
list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
}
#eula-dialog[addontype="locale"] #icon {
list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
}
#eula-dialog[addontype="plugin"] #icon {
list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
}
#heading-container {
-moz-box-align: center;
}
#heading {
font-size: 120%;
}
#eula {
-moz-appearance: none;
font-family: monospace;
color: -moz-dialogtext;
background-color: window;
margin: 1em 0 1em 0;
color: -moz-FieldText;
background-color: -moz-Field;
margin: 1em;
border: 1px solid;
-moz-border-top-colors: ActiveBorder;
-moz-border-right-colors: ActiveBorder;
-moz-border-bottom-colors: ActiveBorder;
-moz-border-left-colors: ActiveBorder;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
}

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

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

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
<filter id="greyscale">
<feColorMatrix values="0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0.3333 0.3333 0.3333 0 0
0 0 0 1 0"/>
</filter>
</svg>

После

Ширина:  |  Высота:  |  Размер: 328 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 167 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 194 B

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 132 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 190 B

После

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичные данные
toolkit/themes/pinstripe/mozapps/extensions/stripes-error.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

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