1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/datastore/DataStoreCursor.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef mozilla_dom_DataStoreCursor_h 1.9 +#define mozilla_dom_DataStoreCursor_h 1.10 + 1.11 +#include "nsAutoPtr.h" 1.12 +#include "nsCOMPtr.h" 1.13 +#include "nsCycleCollectionParticipant.h" 1.14 + 1.15 +class nsPIDOMWindow; 1.16 + 1.17 +namespace mozilla { 1.18 + 1.19 +class ErrorResult; 1.20 + 1.21 +namespace dom { 1.22 + 1.23 +class Promise; 1.24 +class DataStore; 1.25 +class GlobalObject; 1.26 +class DataStoreCursorImpl; 1.27 + 1.28 +class DataStoreCursor MOZ_FINAL 1.29 +{ 1.30 +public: 1.31 + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DataStoreCursor) 1.32 + NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(DataStoreCursor) 1.33 + 1.34 + // WebIDL (internal functions) 1.35 + 1.36 + static already_AddRefed<DataStoreCursor> Constructor(GlobalObject& aGlobal, 1.37 + ErrorResult& aRv); 1.38 + 1.39 + JSObject* WrapObject(JSContext *aCx); 1.40 + 1.41 + // WebIDL (public APIs) 1.42 + 1.43 + already_AddRefed<DataStore> GetStore(ErrorResult& aRv); 1.44 + 1.45 + already_AddRefed<Promise> Next(ErrorResult& aRv); 1.46 + 1.47 + void Close(ErrorResult& aRv); 1.48 + 1.49 + // This internal function (ChromeOnly) is aimed to make the DataStoreCursor 1.50 + // keep a reference to the DataStoreCursorImpl which really implements the 1.51 + // API's logic in JS. 1.52 + void SetDataStoreCursorImpl(DataStoreCursorImpl& aCursor); 1.53 + 1.54 +protected: 1.55 + virtual ~DataStoreCursor() {} 1.56 + 1.57 +private: 1.58 + nsRefPtr<DataStoreCursorImpl> mCursor; 1.59 +}; 1.60 + 1.61 +} //namespace dom 1.62 +} //namespace mozilla 1.63 + 1.64 +#endif 1.65 \ No newline at end of file