/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// If we have a data: URI, we know that it is backed by an nsSimpleURI, // and that we don't need to serialize it ahead of time.
nsCString scheme;
mURI->GetScheme(scheme);
if (scheme.EqualsLiteral("data")) { // We know that nsSimpleURI::From returns us a pointer to the same object, // and we hold a strong reference to the object in mURI, so no need to // hold it strongly here as well. (And we'd have to // NS_ReleaseOnMainThread it in our destructor anyway.)
RefPtr<mozilla::net::nsSimpleURI> simpleURI =
mozilla::net::nsSimpleURI::From(aURI);
mSimpleURI = simpleURI;
bool gfxFontSrcURI::Equals(gfxFontSrcURI* aOther) { if (mSimpleURI) { if (aOther->mSimpleURI) { return mSimpleURI->Equals(aOther->mSimpleURI);
}
// The two URIs are probably different. Do a quick check on the // schemes before deciding to serialize mSimpleURI (which might be // quite large).
{
nsCString thisScheme;
mSimpleURI->GetScheme(thisScheme);
nsCString otherScheme; if (!StringBeginsWith(aOther->mSpec, thisScheme)) { returnfalse;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.