|
|
|
Lines 222-227
nsJARChannel::nsJARChannel()
|
Link Here
|
|---|
|
| 222 |
, mLoadFlags(LOAD_NORMAL) |
222 |
, mLoadFlags(LOAD_NORMAL) |
| 223 |
, mStatus(NS_OK) |
223 |
, mStatus(NS_OK) |
| 224 |
, mIsPending(PR_FALSE) |
224 |
, mIsPending(PR_FALSE) |
|
|
225 |
, mAllowScripts(PR_FALSE) |
| 225 |
, mJarInput(nsnull) |
226 |
, mJarInput(nsnull) |
| 226 |
{ |
227 |
{ |
| 227 |
#if defined(PR_LOGGING) |
228 |
#if defined(PR_LOGGING) |
|
Lines 243-255
nsJARChannel::~nsJARChannel()
|
Link Here
|
|---|
|
| 243 |
NS_RELEASE(handler); // NULL parameter |
244 |
NS_RELEASE(handler); // NULL parameter |
| 244 |
} |
245 |
} |
| 245 |
|
246 |
|
| 246 |
NS_IMPL_ISUPPORTS6(nsJARChannel, |
247 |
NS_IMPL_ISUPPORTS7(nsJARChannel, |
| 247 |
nsIRequest, |
248 |
nsIRequest, |
| 248 |
nsIChannel, |
249 |
nsIChannel, |
| 249 |
nsIStreamListener, |
250 |
nsIStreamListener, |
| 250 |
nsIRequestObserver, |
251 |
nsIRequestObserver, |
| 251 |
nsIDownloadObserver, |
252 |
nsIDownloadObserver, |
| 252 |
nsIJARChannel) |
253 |
nsIJARChannel, |
|
|
254 |
nsIAllowScriptsChannel) |
| 253 |
|
255 |
|
| 254 |
nsresult |
256 |
nsresult |
| 255 |
nsJARChannel::Init(nsIURI *uri) |
257 |
nsJARChannel::Init(nsIURI *uri) |
|
Lines 323-328
nsJARChannel::EnsureJarInput(PRBool bloc
|
Link Here
|
|---|
|
| 323 |
} |
325 |
} |
| 324 |
|
326 |
|
| 325 |
if (mJarFile) { |
327 |
if (mJarFile) { |
|
|
328 |
mAllowScripts = PR_TRUE; |
| 329 |
|
| 326 |
// NOTE: we do not need to deal with mSecurityInfo here, |
330 |
// NOTE: we do not need to deal with mSecurityInfo here, |
| 327 |
// because we're loading from a local file |
331 |
// because we're loading from a local file |
| 328 |
rv = CreateJarInput(gJarHandler->JarCache()); |
332 |
rv = CreateJarInput(gJarHandler->JarCache()); |
|
Lines 691-696
nsJARChannel::AsyncOpen(nsIStreamListene
|
Link Here
|
|---|
|
| 691 |
} |
695 |
} |
| 692 |
|
696 |
|
| 693 |
//----------------------------------------------------------------------------- |
697 |
//----------------------------------------------------------------------------- |
|
|
698 |
// nsIAllowScriptsChannel |
| 699 |
//----------------------------------------------------------------------------- |
| 700 |
NS_IMETHODIMP |
| 701 |
nsJARChannel::GetAllowScripts(PRBool *allowScripts) |
| 702 |
{ |
| 703 |
*allowScripts = mAllowScripts; |
| 704 |
return PR_TRUE; |
| 705 |
} |
| 706 |
|
| 707 |
//----------------------------------------------------------------------------- |
| 694 |
// nsIDownloadObserver |
708 |
// nsIDownloadObserver |
| 695 |
//----------------------------------------------------------------------------- |
709 |
//----------------------------------------------------------------------------- |
| 696 |
|
710 |
|
|
Lines 703-711
nsJARChannel::OnDownloadComplete(nsIDown
|
Link Here
|
|---|
|
| 703 |
{ |
717 |
{ |
| 704 |
// Grab the security info from our base channel |
718 |
// Grab the security info from our base channel |
| 705 |
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request)); |
719 |
nsCOMPtr<nsIChannel> channel(do_QueryInterface(request)); |
| 706 |
if (channel) |
720 |
if (channel) { |
|
|
721 |
nsCAutoString contentType; |
| 722 |
channel->GetContentType(contentType); |
| 723 |
|
| 724 |
if (contentType == NS_LITERAL_CSTRING("application/java-archive") || |
| 725 |
contentType == NS_LITERAL_CSTRING("application/x-jar")) { |
| 726 |
mAllowScripts = PR_TRUE; |
| 727 |
} |
| 728 |
|
| 707 |
channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); |
729 |
channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); |
| 708 |
|
730 |
} |
|
|
731 |
|
| 709 |
if (NS_SUCCEEDED(status)) { |
732 |
if (NS_SUCCEEDED(status)) { |
| 710 |
mJarFile = file; |
733 |
mJarFile = file; |
| 711 |
|
734 |
|