1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "base/basictypes.h"
10 #include "nsNetUtil.h"
11 #include "nsIClassInfoImpl.h"
12 #include "nsIIOService.h"
13 #include "nsIStandardURL.h"
15 #include "nsReadableUtils.h"
17 #include "nsIObjectInputStream.h"
18 #include "nsIObjectOutputStream.h"
19 #include "nsQueryObject.h"
20 #include "mozilla/ipc/URIUtils.h"
22 using namespace mozilla::ipc
;
24 ////////////////////////////////////////////////////////////////////////////////
26 NS_IMPL_CLASSINFO(nsJARURI
, nullptr, nsIClassInfo::THREADSAFE
, NS_JARURI_CID
)
27 // Empty CI getter. We only need nsIClassInfo for Serialization
28 NS_IMPL_CI_INTERFACE_GETTER0(nsJARURI
)
30 nsJARURI::nsJARURI() {}
32 nsJARURI::~nsJARURI() {}
34 // XXX Why is this threadsafe?
35 NS_IMPL_ADDREF(nsJARURI
)
36 NS_IMPL_RELEASE(nsJARURI
)
37 NS_INTERFACE_MAP_BEGIN(nsJARURI
)
38 NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports
, nsIJARURI
)
39 NS_INTERFACE_MAP_ENTRY(nsIURI
)
40 NS_INTERFACE_MAP_ENTRY(nsIURL
)
41 NS_INTERFACE_MAP_ENTRY(nsIJARURI
)
42 NS_INTERFACE_MAP_ENTRY(nsISerializable
)
43 NS_IMPL_QUERY_CLASSINFO(nsJARURI
)
44 NS_INTERFACE_MAP_ENTRY(nsINestedURI
)
45 NS_INTERFACE_MAP_ENTRY_CONCRETE(nsJARURI
)
48 nsresult
nsJARURI::Init(const char* charsetHint
) {
49 mCharsetHint
= charsetHint
;
53 #define NS_JAR_SCHEME "jar:"_ns
54 #define NS_JAR_DELIMITER "!/"_ns
55 #define NS_BOGUS_ENTRY_SCHEME "x:///"_ns
57 // FormatSpec takes the entry spec (including the "x:///" at the
58 // beginning) and gives us a full JAR spec.
59 nsresult
nsJARURI::FormatSpec(const nsACString
& entrySpec
, nsACString
& result
,
60 bool aIncludeScheme
) {
61 // The entrySpec MUST start with "x:///"
62 NS_ASSERTION(StringBeginsWith(entrySpec
, NS_BOGUS_ENTRY_SCHEME
),
65 nsAutoCString fileSpec
;
66 nsresult rv
= mJARFile
->GetSpec(fileSpec
);
67 if (NS_FAILED(rv
)) return rv
;
70 result
= NS_JAR_SCHEME
;
74 result
.Append(fileSpec
+ NS_JAR_DELIMITER
+
75 Substring(entrySpec
, 5, entrySpec
.Length() - 5));
79 nsresult
nsJARURI::CreateEntryURL(const nsACString
& entryFilename
,
80 const char* charset
, nsIURL
** url
) {
82 // Flatten the concatenation, just in case. See bug 128288
83 nsAutoCString
spec(NS_BOGUS_ENTRY_SCHEME
+ entryFilename
);
84 return NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID
)
85 .Apply(&nsIStandardURLMutator::Init
, nsIStandardURL::URLTYPE_NO_AUTHORITY
,
86 -1, spec
, charset
, nullptr, nullptr)
90 ////////////////////////////////////////////////////////////////////////////////
91 // nsISerializable methods:
94 nsJARURI::Read(nsIObjectInputStream
* aStream
) {
95 MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
96 return NS_ERROR_NOT_IMPLEMENTED
;
99 nsresult
nsJARURI::ReadPrivate(nsIObjectInputStream
* aInputStream
) {
102 nsCOMPtr
<nsISupports
> supports
;
103 rv
= aInputStream
->ReadObject(true, getter_AddRefs(supports
));
104 NS_ENSURE_SUCCESS(rv
, rv
);
106 mJARFile
= do_QueryInterface(supports
, &rv
);
107 NS_ENSURE_SUCCESS(rv
, rv
);
109 rv
= aInputStream
->ReadObject(true, getter_AddRefs(supports
));
110 NS_ENSURE_SUCCESS(rv
, rv
);
112 mJAREntry
= do_QueryInterface(supports
);
113 NS_ENSURE_SUCCESS(rv
, rv
);
115 rv
= aInputStream
->ReadCString(mCharsetHint
);
120 nsJARURI::Write(nsIObjectOutputStream
* aOutputStream
) {
123 rv
= aOutputStream
->WriteCompoundObject(mJARFile
, NS_GET_IID(nsIURI
), true);
124 NS_ENSURE_SUCCESS(rv
, rv
);
126 rv
= aOutputStream
->WriteCompoundObject(mJAREntry
, NS_GET_IID(nsIURL
), true);
127 NS_ENSURE_SUCCESS(rv
, rv
);
129 rv
= aOutputStream
->WriteStringZ(mCharsetHint
.get());
133 ////////////////////////////////////////////////////////////////////////////////
137 nsJARURI::GetSpec(nsACString
& aSpec
) {
138 nsAutoCString entrySpec
;
139 mJAREntry
->GetSpec(entrySpec
);
140 return FormatSpec(entrySpec
, aSpec
);
144 nsJARURI::GetSpecIgnoringRef(nsACString
& aSpec
) {
145 nsAutoCString entrySpec
;
146 mJAREntry
->GetSpecIgnoringRef(entrySpec
);
147 return FormatSpec(entrySpec
, aSpec
);
151 nsJARURI::GetDisplaySpec(nsACString
& aUnicodeSpec
) {
152 return GetSpec(aUnicodeSpec
);
156 nsJARURI::GetDisplayHostPort(nsACString
& aUnicodeHostPort
) {
157 return GetHostPort(aUnicodeHostPort
);
161 nsJARURI::GetDisplayPrePath(nsACString
& aPrePath
) {
162 return GetPrePath(aPrePath
);
166 nsJARURI::GetDisplayHost(nsACString
& aUnicodeHost
) {
167 return GetHost(aUnicodeHost
);
171 nsJARURI::GetHasRef(bool* result
) { return mJAREntry
->GetHasRef(result
); }
174 nsJARURI::GetHasUserPass(bool* result
) {
175 return mJAREntry
->GetHasUserPass(result
);
179 nsJARURI::GetHasQuery(bool* result
) { return mJAREntry
->GetHasQuery(result
); }
181 nsresult
nsJARURI::SetSpecInternal(const nsACString
& aSpec
) {
182 return SetSpecWithBase(aSpec
, nullptr);
185 // Queries this list of interfaces. If none match, it queries mURI.
186 NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJARURI::Mutator
, nsIURISetters
, nsIURIMutator
,
187 nsIURLMutator
, nsISerializable
,
191 nsJARURI::Mutator::SetFileName(const nsACString
& aFileName
,
192 nsIURIMutator
** aMutator
) {
194 return NS_ERROR_NULL_POINTER
;
197 nsCOMPtr
<nsIURIMutator
> mutator
= this;
198 mutator
.forget(aMutator
);
200 return mURI
->SetFileNameInternal(aFileName
);
204 nsJARURI::Mutator::SetFileBaseName(const nsACString
& aFileBaseName
,
205 nsIURIMutator
** aMutator
) {
207 return NS_ERROR_NULL_POINTER
;
210 nsCOMPtr
<nsIURIMutator
> mutator
= this;
211 mutator
.forget(aMutator
);
213 return mURI
->SetFileBaseNameInternal(aFileBaseName
);
217 nsJARURI::Mutator::SetFileExtension(const nsACString
& aFileExtension
,
218 nsIURIMutator
** aMutator
) {
220 return NS_ERROR_NULL_POINTER
;
223 nsCOMPtr
<nsIURIMutator
> mutator
= this;
224 mutator
.forget(aMutator
);
226 return mURI
->SetFileExtensionInternal(aFileExtension
);
230 nsJARURI::Mutate(nsIURIMutator
** aMutator
) {
231 RefPtr
<nsJARURI::Mutator
> mutator
= new nsJARURI::Mutator();
232 nsresult rv
= mutator
->InitFromURI(this);
236 mutator
.forget(aMutator
);
240 nsresult
nsJARURI::SetSpecWithBase(const nsACString
& aSpec
, nsIURI
* aBaseURL
) {
243 nsCOMPtr
<nsIIOService
> ioServ(do_GetIOService(&rv
));
244 NS_ENSURE_SUCCESS(rv
, rv
);
246 nsAutoCString scheme
;
247 rv
= ioServ
->ExtractScheme(aSpec
, scheme
);
249 // not an absolute URI
250 if (!aBaseURL
) return NS_ERROR_MALFORMED_URI
;
252 RefPtr
<nsJARURI
> otherJAR
= do_QueryObject(aBaseURL
);
253 NS_ENSURE_TRUE(otherJAR
, NS_NOINTERFACE
);
255 mJARFile
= otherJAR
->mJARFile
;
257 nsCOMPtr
<nsIURI
> entry
;
259 rv
= NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID
)
260 .Apply(&nsIStandardURLMutator::Init
,
261 nsIStandardURL::URLTYPE_NO_AUTHORITY
, -1, aSpec
,
262 mCharsetHint
.get(), otherJAR
->mJAREntry
, nullptr)
268 mJAREntry
= do_QueryInterface(entry
);
269 if (!mJAREntry
) return NS_NOINTERFACE
;
274 NS_ENSURE_TRUE(scheme
.EqualsLiteral("jar"), NS_ERROR_MALFORMED_URI
);
276 nsACString::const_iterator begin
, end
;
277 aSpec
.BeginReading(begin
);
278 aSpec
.EndReading(end
);
280 while (begin
!= end
&& *begin
!= ':') ++begin
;
282 ++begin
; // now we're past the "jar:"
284 nsACString::const_iterator delim_begin
= begin
;
285 nsACString::const_iterator delim_end
= end
;
286 nsACString::const_iterator frag
= begin
;
288 if (FindInReadable(NS_JAR_DELIMITER
, delim_begin
, delim_end
)) {
291 while (frag
!= end
&& (*frag
!= '#' && *frag
!= '?')) {
295 // there was a fragment or query, mark that as the end of the URL to scan
299 // Search backward from the end for the "!/" delimiter. Remember, jar URLs
301 // jar:jar:http://www.foo.com/bar.jar!/a.jar!/b.html
302 // This gets the b.html document from out of the a.jar file, that's
303 // contained within the bar.jar file.
304 // Also, the outermost "inner" URI may be a relative URI:
305 // jar:../relative.jar!/a.html
310 if (!RFindInReadable(NS_JAR_DELIMITER
, delim_begin
, delim_end
)) {
311 return NS_ERROR_MALFORMED_URI
;
314 rv
= ioServ
->NewURI(Substring(begin
, delim_begin
), mCharsetHint
.get(),
315 aBaseURL
, getter_AddRefs(mJARFile
));
316 if (NS_FAILED(rv
)) return rv
;
318 // skip over any extra '/' chars
319 while (*delim_end
== '/') ++delim_end
;
321 aSpec
.EndReading(end
); // set to the original 'end'
322 return SetJAREntry(Substring(delim_end
, end
));
326 nsJARURI::GetPrePath(nsACString
& prePath
) {
327 prePath
= NS_JAR_SCHEME
;
332 nsJARURI::GetScheme(nsACString
& aScheme
) {
337 nsresult
nsJARURI::SetScheme(const nsACString
& aScheme
) {
338 // doesn't make sense to set the scheme of a jar: URL
339 return NS_ERROR_FAILURE
;
343 nsJARURI::GetUserPass(nsACString
& aUserPass
) { return NS_ERROR_FAILURE
; }
345 nsresult
nsJARURI::SetUserPass(const nsACString
& aUserPass
) {
346 return NS_ERROR_FAILURE
;
350 nsJARURI::GetUsername(nsACString
& aUsername
) { return NS_ERROR_FAILURE
; }
352 nsresult
nsJARURI::SetUsername(const nsACString
& aUsername
) {
353 return NS_ERROR_FAILURE
;
357 nsJARURI::GetPassword(nsACString
& aPassword
) { return NS_ERROR_FAILURE
; }
359 nsresult
nsJARURI::SetPassword(const nsACString
& aPassword
) {
360 return NS_ERROR_FAILURE
;
364 nsJARURI::GetHostPort(nsACString
& aHostPort
) { return NS_ERROR_FAILURE
; }
366 nsresult
nsJARURI::SetHostPort(const nsACString
& aHostPort
) {
367 return NS_ERROR_FAILURE
;
371 nsJARURI::GetHost(nsACString
& aHost
) { return NS_ERROR_FAILURE
; }
373 nsresult
nsJARURI::SetHost(const nsACString
& aHost
) { return NS_ERROR_FAILURE
; }
376 nsJARURI::GetPort(int32_t* aPort
) { return NS_ERROR_FAILURE
; }
378 nsresult
nsJARURI::SetPort(int32_t aPort
) { return NS_ERROR_FAILURE
; }
380 nsresult
nsJARURI::GetPathQueryRef(nsACString
& aPath
) {
381 nsAutoCString entrySpec
;
382 mJAREntry
->GetSpec(entrySpec
);
383 return FormatSpec(entrySpec
, aPath
, false);
386 nsresult
nsJARURI::SetPathQueryRef(const nsACString
& aPath
) {
387 return NS_ERROR_FAILURE
;
391 nsJARURI::GetAsciiSpec(nsACString
& aSpec
) {
392 // XXX Shouldn't this like... make sure it returns ASCII or something?
393 return GetSpec(aSpec
);
397 nsJARURI::GetAsciiHostPort(nsACString
& aHostPort
) { return NS_ERROR_FAILURE
; }
400 nsJARURI::GetAsciiHost(nsACString
& aHost
) { return NS_ERROR_FAILURE
; }
403 nsJARURI::Equals(nsIURI
* other
, bool* result
) {
404 return EqualsInternal(other
, eHonorRef
, result
);
408 nsJARURI::EqualsExceptRef(nsIURI
* other
, bool* result
) {
409 return EqualsInternal(other
, eIgnoreRef
, result
);
414 nsresult
nsJARURI::EqualsInternal(nsIURI
* other
,
415 nsJARURI::RefHandlingEnum refHandlingMode
,
419 if (!other
) return NS_OK
; // not equal
421 RefPtr
<nsJARURI
> otherJAR
= do_QueryObject(other
);
422 if (!otherJAR
) return NS_OK
; // not equal
425 nsresult rv
= mJARFile
->Equals(otherJAR
->mJARFile
, &equal
);
426 if (NS_FAILED(rv
) || !equal
) {
427 return rv
; // not equal
430 return refHandlingMode
== eHonorRef
431 ? mJAREntry
->Equals(otherJAR
->mJAREntry
, result
)
432 : mJAREntry
->EqualsExceptRef(otherJAR
->mJAREntry
, result
);
436 nsJARURI::SchemeIs(const char* i_Scheme
, bool* o_Equals
) {
437 MOZ_ASSERT(o_Equals
);
443 *o_Equals
= nsCRT::strcasecmp("jar", i_Scheme
) == 0;
447 nsresult
nsJARURI::Clone(nsIURI
** result
) {
448 RefPtr
<nsJARURI
> uri
= new nsJARURI();
449 uri
->mJARFile
= mJARFile
;
450 uri
->mJAREntry
= mJAREntry
;
457 nsJARURI::Resolve(const nsACString
& relativePath
, nsACString
& result
) {
460 nsCOMPtr
<nsIIOService
> ioServ(do_GetIOService(&rv
));
461 if (NS_FAILED(rv
)) return rv
;
463 nsAutoCString scheme
;
464 rv
= ioServ
->ExtractScheme(relativePath
, scheme
);
465 if (NS_SUCCEEDED(rv
)) {
466 // then aSpec is absolute
467 result
= relativePath
;
471 nsAutoCString resolvedPath
;
472 mJAREntry
->Resolve(relativePath
, resolvedPath
);
474 return FormatSpec(resolvedPath
, result
);
477 ////////////////////////////////////////////////////////////////////////////////
481 nsJARURI::GetFilePath(nsACString
& filePath
) {
482 return mJAREntry
->GetFilePath(filePath
);
485 nsresult
nsJARURI::SetFilePath(const nsACString
& filePath
) {
486 return NS_MutateURI(mJAREntry
).SetFilePath(filePath
).Finalize(mJAREntry
);
490 nsJARURI::GetQuery(nsACString
& query
) { return mJAREntry
->GetQuery(query
); }
492 nsresult
nsJARURI::SetQuery(const nsACString
& query
) {
493 return NS_MutateURI(mJAREntry
).SetQuery(query
).Finalize(mJAREntry
);
496 nsresult
nsJARURI::SetQueryWithEncoding(const nsACString
& query
,
497 const mozilla::Encoding
* encoding
) {
498 return NS_MutateURI(mJAREntry
)
499 .SetQueryWithEncoding(query
, encoding
)
500 .Finalize(mJAREntry
);
504 nsJARURI::GetRef(nsACString
& ref
) { return mJAREntry
->GetRef(ref
); }
506 nsresult
nsJARURI::SetRef(const nsACString
& ref
) {
507 return NS_MutateURI(mJAREntry
).SetRef(ref
).Finalize(mJAREntry
);
511 nsJARURI::GetDirectory(nsACString
& directory
) {
512 return mJAREntry
->GetDirectory(directory
);
516 nsJARURI::GetFileName(nsACString
& fileName
) {
517 return mJAREntry
->GetFileName(fileName
);
520 nsresult
nsJARURI::SetFileNameInternal(const nsACString
& fileName
) {
521 return NS_MutateURI(mJAREntry
)
522 .Apply(&nsIURLMutator::SetFileName
, fileName
, nullptr)
523 .Finalize(mJAREntry
);
527 nsJARURI::GetFileBaseName(nsACString
& fileBaseName
) {
528 return mJAREntry
->GetFileBaseName(fileBaseName
);
531 nsresult
nsJARURI::SetFileBaseNameInternal(const nsACString
& fileBaseName
) {
532 return NS_MutateURI(mJAREntry
)
533 .Apply(&nsIURLMutator::SetFileBaseName
, fileBaseName
, nullptr)
534 .Finalize(mJAREntry
);
538 nsJARURI::GetFileExtension(nsACString
& fileExtension
) {
539 return mJAREntry
->GetFileExtension(fileExtension
);
542 nsresult
nsJARURI::SetFileExtensionInternal(const nsACString
& fileExtension
) {
543 return NS_MutateURI(mJAREntry
)
544 .Apply(&nsIURLMutator::SetFileExtension
, fileExtension
, nullptr)
545 .Finalize(mJAREntry
);
549 nsJARURI::GetCommonBaseSpec(nsIURI
* uriToCompare
, nsACString
& commonSpec
) {
550 commonSpec
.Truncate();
552 NS_ENSURE_ARG_POINTER(uriToCompare
);
554 commonSpec
.Truncate();
555 nsCOMPtr
<nsIJARURI
> otherJARURI(do_QueryInterface(uriToCompare
));
561 nsCOMPtr
<nsIURI
> otherJARFile
;
562 nsresult rv
= otherJARURI
->GetJARFile(getter_AddRefs(otherJARFile
));
563 if (NS_FAILED(rv
)) return rv
;
566 rv
= mJARFile
->Equals(otherJARFile
, &equal
);
567 if (NS_FAILED(rv
)) return rv
;
570 // See what the JAR file URIs have in common
571 nsCOMPtr
<nsIURL
> ourJARFileURL(do_QueryInterface(mJARFile
));
572 if (!ourJARFileURL
) {
573 // Not a URL, so nothing in common
576 nsAutoCString common
;
577 rv
= ourJARFileURL
->GetCommonBaseSpec(otherJARFile
, common
);
578 if (NS_FAILED(rv
)) return rv
;
580 commonSpec
= NS_JAR_SCHEME
+ common
;
584 // At this point we have the same JAR file. Compare the JAREntrys
585 nsAutoCString otherEntry
;
586 rv
= otherJARURI
->GetJAREntry(otherEntry
);
587 if (NS_FAILED(rv
)) return rv
;
589 nsCOMPtr
<nsIURL
> url
;
590 rv
= CreateEntryURL(otherEntry
, nullptr, getter_AddRefs(url
));
591 if (NS_FAILED(rv
)) return rv
;
593 nsAutoCString common
;
594 rv
= mJAREntry
->GetCommonBaseSpec(url
, common
);
595 if (NS_FAILED(rv
)) return rv
;
597 rv
= FormatSpec(common
, commonSpec
);
602 nsJARURI::GetRelativeSpec(nsIURI
* uriToCompare
, nsACString
& relativeSpec
) {
603 GetSpec(relativeSpec
);
605 NS_ENSURE_ARG_POINTER(uriToCompare
);
607 nsCOMPtr
<nsIJARURI
> otherJARURI(do_QueryInterface(uriToCompare
));
613 nsCOMPtr
<nsIURI
> otherJARFile
;
614 nsresult rv
= otherJARURI
->GetJARFile(getter_AddRefs(otherJARFile
));
615 if (NS_FAILED(rv
)) return rv
;
618 rv
= mJARFile
->Equals(otherJARFile
, &equal
);
619 if (NS_FAILED(rv
)) return rv
;
622 // We live in different JAR files. Nothing in common.
626 // Same JAR file. Compare the JAREntrys
627 nsAutoCString otherEntry
;
628 rv
= otherJARURI
->GetJAREntry(otherEntry
);
629 if (NS_FAILED(rv
)) return rv
;
631 nsCOMPtr
<nsIURL
> url
;
632 rv
= CreateEntryURL(otherEntry
, nullptr, getter_AddRefs(url
));
633 if (NS_FAILED(rv
)) return rv
;
635 nsAutoCString relativeEntrySpec
;
636 rv
= mJAREntry
->GetRelativeSpec(url
, relativeEntrySpec
);
637 if (NS_FAILED(rv
)) return rv
;
639 if (!StringBeginsWith(relativeEntrySpec
, NS_BOGUS_ENTRY_SCHEME
)) {
640 // An actual relative spec!
641 relativeSpec
= relativeEntrySpec
;
646 ////////////////////////////////////////////////////////////////////////////////
647 // nsIJARURI methods:
650 nsJARURI::GetJARFile(nsIURI
** jarFile
) { return GetInnerURI(jarFile
); }
653 nsJARURI::GetJAREntry(nsACString
& entryPath
) {
654 nsAutoCString filePath
;
655 mJAREntry
->GetFilePath(filePath
);
656 NS_ASSERTION(filePath
.Length() > 0, "path should never be empty!");
657 // Trim off the leading '/'
658 entryPath
= Substring(filePath
, 1, filePath
.Length() - 1);
662 nsresult
nsJARURI::SetJAREntry(const nsACString
& entryPath
) {
663 return CreateEntryURL(entryPath
, mCharsetHint
.get(),
664 getter_AddRefs(mJAREntry
));
667 ////////////////////////////////////////////////////////////////////////////////
670 nsJARURI::GetInnerURI(nsIURI
** aURI
) {
671 nsCOMPtr
<nsIURI
> uri
= mJARFile
;
677 nsJARURI::GetInnermostURI(nsIURI
** uri
) {
678 return NS_ImplGetInnermostURI(this, uri
);
681 void nsJARURI::Serialize(URIParams
& aParams
) {
684 SerializeURI(mJARFile
, params
.jarFile());
685 SerializeURI(mJAREntry
, params
.jarEntry());
686 params
.charset() = mCharsetHint
;
691 bool nsJARURI::Deserialize(const URIParams
& aParams
) {
692 if (aParams
.type() != URIParams::TJARURIParams
) {
693 NS_ERROR("Received unknown parameters from the other process!");
697 const JARURIParams
& params
= aParams
.get_JARURIParams();
699 nsCOMPtr
<nsIURI
> file
= DeserializeURI(params
.jarFile());
701 NS_ERROR("Couldn't deserialize jar file URI!");
705 nsCOMPtr
<nsIURI
> entry
= DeserializeURI(params
.jarEntry());
707 NS_ERROR("Couldn't deserialize jar entry URI!");
711 nsCOMPtr
<nsIURL
> entryURL
= do_QueryInterface(entry
);
713 NS_ERROR("Couldn't QI jar entry URI to nsIURL!");
718 mJAREntry
.swap(entryURL
);
719 mCharsetHint
= params
.charset();