mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1119692 - Part 1: Get cached jar file fd if it exists instead of always openning it. r=smaug, r=jduell
This commit is contained in:
parent
b7149c5d65
commit
c53cabad73
@ -66,6 +66,9 @@
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIWindowMediator.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#ifndef XP_WIN
|
||||
#include "nsJARProtocolHandler.h"
|
||||
#endif
|
||||
#include "nsOpenURIInFrameParams.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowWatcher.h"
|
||||
@ -898,9 +901,21 @@ TabParent::LoadURL(nsIURI* aURI)
|
||||
rv = packageFile->GetPath(path);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
|
||||
nsRefPtr<OpenFileAndSendFDRunnable> openFileRunnable =
|
||||
new OpenFileAndSendFDRunnable(path, this);
|
||||
openFileRunnable->Dispatch();
|
||||
#ifndef XP_WIN
|
||||
PRFileDesc* cachedFd = nullptr;
|
||||
gJarHandler->JarCache()->GetFd(packageFile, &cachedFd);
|
||||
|
||||
if (cachedFd) {
|
||||
FileDescriptor::PlatformHandleType handle =
|
||||
FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(cachedFd));
|
||||
unused << SendCacheFileDescriptor(path, FileDescriptor(handle));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
nsRefPtr<OpenFileAndSendFDRunnable> openFileRunnable =
|
||||
new OpenFileAndSendFDRunnable(path, this);
|
||||
openFileRunnable->Dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -161,6 +161,11 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
|
||||
'/security/sandbox/chromium-shim',
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] != 'WINNT':
|
||||
LOCAL_INCLUDES += [
|
||||
'/modules/libjar',
|
||||
]
|
||||
|
||||
DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk', 'qt'):
|
||||
|
@ -225,6 +225,8 @@ RemoteOpenFileChild::AsyncRemoteFileOpen(int32_t aFlags,
|
||||
MOZ_CRASH("Couldn't get path from file!");
|
||||
}
|
||||
|
||||
mListener = aListener;
|
||||
|
||||
if (mTabChild) {
|
||||
if (mTabChild->GetCachedFileDescriptor(path, this)) {
|
||||
// The file descriptor was found in the cache and OnCachedFileDescriptor()
|
||||
@ -244,7 +246,6 @@ RemoteOpenFileChild::AsyncRemoteFileOpen(int32_t aFlags,
|
||||
// The chrome process now has a logical ref to us until it calls Send__delete.
|
||||
AddIPDLReference();
|
||||
|
||||
mListener = aListener;
|
||||
mAsyncOpenCalled = true;
|
||||
return NS_OK;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user