2014-06-03 18:36:46 +04:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_DataStoreRevision_h
|
|
|
|
#define mozilla_dom_DataStoreRevision_h
|
|
|
|
|
2014-06-03 18:36:46 +04:00
|
|
|
#include "jsapi.h"
|
2014-06-03 18:36:46 +04:00
|
|
|
#include "nsAutoPtr.h"
|
2014-06-03 18:36:46 +04:00
|
|
|
#include "nsIDOMEventListener.h"
|
2014-06-03 18:36:46 +04:00
|
|
|
#include "nsString.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
namespace indexedDB {
|
|
|
|
class IDBObjectStore;
|
|
|
|
class IDBRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
class DataStoreRevisionCallback;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class DataStoreRevision final : public nsIDOMEventListener
|
2014-06-03 18:36:46 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
enum RevisionType {
|
|
|
|
RevisionVoid
|
|
|
|
};
|
|
|
|
|
|
|
|
nsresult AddRevision(JSContext* aCx,
|
|
|
|
indexedDB::IDBObjectStore* aStore,
|
|
|
|
uint32_t aObjectId,
|
|
|
|
RevisionType aRevisionType,
|
|
|
|
DataStoreRevisionCallback* aCallback);
|
|
|
|
|
|
|
|
// nsIDOMEventListener
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) override;
|
2014-06-03 18:36:46 +04:00
|
|
|
|
|
|
|
private:
|
2014-06-23 23:56:07 +04:00
|
|
|
~DataStoreRevision() {}
|
2014-06-03 18:36:46 +04:00
|
|
|
nsRefPtr<DataStoreRevisionCallback> mCallback;
|
|
|
|
nsRefPtr<indexedDB::IDBRequest> mRequest;
|
|
|
|
nsString mRevisionID;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_DataStoreRevision_h
|