michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_DataStoreCursor_h michael@0: #define mozilla_dom_DataStoreCursor_h michael@0: michael@0: #include "nsAutoPtr.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: michael@0: class nsPIDOMWindow; michael@0: michael@0: namespace mozilla { michael@0: michael@0: class ErrorResult; michael@0: michael@0: namespace dom { michael@0: michael@0: class Promise; michael@0: class DataStore; michael@0: class GlobalObject; michael@0: class DataStoreCursorImpl; michael@0: michael@0: class DataStoreCursor MOZ_FINAL michael@0: { michael@0: public: michael@0: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DataStoreCursor) michael@0: NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(DataStoreCursor) michael@0: michael@0: // WebIDL (internal functions) michael@0: michael@0: static already_AddRefed Constructor(GlobalObject& aGlobal, michael@0: ErrorResult& aRv); michael@0: michael@0: JSObject* WrapObject(JSContext *aCx); michael@0: michael@0: // WebIDL (public APIs) michael@0: michael@0: already_AddRefed GetStore(ErrorResult& aRv); michael@0: michael@0: already_AddRefed Next(ErrorResult& aRv); michael@0: michael@0: void Close(ErrorResult& aRv); michael@0: michael@0: // This internal function (ChromeOnly) is aimed to make the DataStoreCursor michael@0: // keep a reference to the DataStoreCursorImpl which really implements the michael@0: // API's logic in JS. michael@0: void SetDataStoreCursorImpl(DataStoreCursorImpl& aCursor); michael@0: michael@0: protected: michael@0: virtual ~DataStoreCursor() {} michael@0: michael@0: private: michael@0: nsRefPtr mCursor; michael@0: }; michael@0: michael@0: } //namespace dom michael@0: } //namespace mozilla michael@0: michael@0: #endif