Bug 847607 - Paris bindings for IDB event, r=khuey

--HG--
extra : rebase_source : de5c4ba79b8d990b25abaabd3892847f286737fd
This commit is contained in:
Olli Pettay 2013-03-12 19:45:59 +02:00
parent ac1e8ea7d8
commit 7cbf366952
5 changed files with 48 additions and 2 deletions

View File

@ -439,6 +439,11 @@ DOMInterfaces = {
'nativeType' : 'mozilla::dom::HTMLSharedListElement'
},
'IDBVersionChangeEvent': {
'nativeType': 'mozilla::dom::indexedDB::IDBVersionChangeEvent',
'headerFile': 'IDBEvents.h',
},
'IID': [
{
'nativeType': 'nsIJSID',

View File

@ -84,6 +84,7 @@ LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/media/webrtc/signaling/src/peerconnection \
-I$(topsrcdir)/dom/base \
-I$(topsrcdir)/dom/battery \
-I$(topsrcdir)/dom/indexedDB \
-I$(topsrcdir)/content/xslt/src/base \
-I$(topsrcdir)/content/xslt/src/xpath \
-I$(topsrcdir)/content/xml/content/src \

View File

@ -13,8 +13,9 @@
#include "nsIRunnable.h"
#include "nsDOMEvent.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/indexedDB/IDBObjectStore.h"
#include "mozilla/dom/IDBVersionChangeEventBinding.h"
#define SUCCESS_EVT_STR "success"
#define ERROR_EVT_STR "error"
@ -50,6 +51,25 @@ public:
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIIDBVERSIONCHANGEEVENT
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
return mozilla::dom::IDBVersionChangeEventBinding::Wrap(aCx, aScope, this,
aTriedToWrap);
}
uint64_t OldVersion()
{
return mOldVersion;
}
mozilla::dom::Nullable<uint64_t> GetNewVersion()
{
return mNewVersion
? mozilla::dom::Nullable<uint64_t>(mNewVersion)
: mozilla::dom::Nullable<uint64_t>();
}
inline static already_AddRefed<nsDOMEvent>
Create(mozilla::dom::EventTarget* aOwner,
int64_t aOldVersion,
@ -101,7 +121,10 @@ public:
protected:
IDBVersionChangeEvent(mozilla::dom::EventTarget* aOwner)
: nsDOMEvent(aOwner, nullptr, nullptr) { }
: nsDOMEvent(aOwner, nullptr, nullptr)
{
SetIsDOMBinding();
}
virtual ~IDBVersionChangeEvent() { }
static already_AddRefed<nsDOMEvent>

View File

@ -0,0 +1,16 @@
/* -*- Mode: IDL; 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/.
*
* IDBVersionChangeEvent is defined in:
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface IDBVersionChangeEvent : Event {
readonly attribute unsigned long long oldVersion;
readonly attribute unsigned long long? newVersion;
};

View File

@ -116,6 +116,7 @@ webidl_files = \
HTMLTimeElement.webidl \
HTMLTitleElement.webidl \
HTMLUListElement.webidl \
IDBVersionChangeEvent.webidl \
ImageData.webidl \
LinkStyle.webidl \
LocalMediaStream.webidl \