1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/storage/nsPIDOMStorage.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set sw=2 ts=2 et tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef __nsPIDOMStorage_h_ 1.11 +#define __nsPIDOMStorage_h_ 1.12 + 1.13 +#include "nsISupports.h" 1.14 +#include "nsString.h" 1.15 +#include "nsTArray.h" 1.16 + 1.17 +class nsIPrincipal; 1.18 + 1.19 +namespace mozilla { 1.20 +namespace dom { 1.21 + 1.22 +class DOMStorageCache; 1.23 +class DOMStorageManager; 1.24 + 1.25 +} // ::dom 1.26 +} // ::mozilla 1.27 + 1.28 +// {09198A51-5D27-4992-97E4-38A9CEA2A65D} 1.29 +#define NS_PIDOMSTORAGE_IID \ 1.30 + { 0x9198a51, 0x5d27, 0x4992, \ 1.31 + { 0x97, 0xe4, 0x38, 0xa9, 0xce, 0xa2, 0xa6, 0x5d } } 1.32 + 1.33 +class nsPIDOMStorage : public nsISupports 1.34 +{ 1.35 +public: 1.36 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMSTORAGE_IID) 1.37 + 1.38 + enum StorageType { 1.39 + LocalStorage = 1, 1.40 + SessionStorage = 2 1.41 + }; 1.42 + 1.43 + virtual StorageType GetType() const = 0; 1.44 + virtual mozilla::dom::DOMStorageManager* GetManager() const = 0; 1.45 + virtual const mozilla::dom::DOMStorageCache* GetCache() const = 0; 1.46 + 1.47 + virtual nsTArray<nsString>* GetKeys() = 0; 1.48 + 1.49 + virtual nsIPrincipal* GetPrincipal() = 0; 1.50 + virtual bool PrincipalEquals(nsIPrincipal* principal) = 0; 1.51 + virtual bool CanAccess(nsIPrincipal *aPrincipal) = 0; 1.52 + virtual bool IsPrivate() = 0; 1.53 +}; 1.54 + 1.55 +NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMStorage, NS_PIDOMSTORAGE_IID) 1.56 + 1.57 +#endif // __nsPIDOMStorage_h_