зеркало из https://github.com/mozilla/gecko-dev.git
Bug 333848 - add full-featured user-defined functions and progress handlers to storage. Patch by Lev Serebryakov <blacklion@gmail.com>. r=cbiesinger, sr=cbiesinger
This commit is contained in:
Родитель
ae472131bb
Коммит
c94d0a239c
|
@ -46,6 +46,7 @@
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
|
#include "nsIVariant.h"
|
||||||
|
|
||||||
#include "mozIStorageService.h"
|
#include "mozIStorageService.h"
|
||||||
#include "mozIStorageStatement.h"
|
#include "mozIStorageStatement.h"
|
||||||
|
@ -202,9 +203,11 @@ GetCacheDataFile(nsIFile *cacheDir, const char *cid, const char *key,
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values)
|
nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values, nsIVariant **_retval)
|
||||||
{
|
{
|
||||||
LOG(("nsOfflineCacheDevice::EvictionObserver\n"));
|
LOG(("nsOfflineCacheDevice::EvictionObserver\n"));
|
||||||
|
|
||||||
|
*_retval = nsnull;
|
||||||
|
|
||||||
PRUint32 numEntries;
|
PRUint32 numEntries;
|
||||||
nsresult rv = values->GetNumEntries(&numEntries);
|
nsresult rv = values->GetNumEntries(&numEntries);
|
||||||
|
@ -762,7 +765,7 @@ nsOfflineCacheDevice::Init()
|
||||||
new nsOfflineCacheEvictionFunction(this);
|
new nsOfflineCacheEvictionFunction(this);
|
||||||
if (!evictionFunction) return NS_ERROR_OUT_OF_MEMORY;
|
if (!evictionFunction) return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
rv = mDB->CreateFunction("cache_eviction_observer", 3, evictionFunction);
|
rv = mDB->CreateFunction(NS_LITERAL_CSTRING("cache_eviction_observer"), 3, evictionFunction);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// create all (most) of our statements up front
|
// create all (most) of our statements up front
|
||||||
|
|
Загрузка…
Ссылка в новой задаче