2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=2 et tw=80: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef __nsPIDOMStorage_h_
|
|
|
|
#define __nsPIDOMStorage_h_
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
2013-04-15 05:38:48 -07:00
|
|
|
#include "nsString.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2009-01-12 21:52:00 -08:00
|
|
|
class nsIPrincipal;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-04-15 05:38:48 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class DOMStorageCache;
|
|
|
|
class DOMStorageManager;
|
|
|
|
|
|
|
|
} // ::dom
|
|
|
|
} // ::mozilla
|
|
|
|
|
|
|
|
// {09198A51-5D27-4992-97E4-38A9CEA2A65D}
|
2012-04-14 06:06:30 -07:00
|
|
|
#define NS_PIDOMSTORAGE_IID \
|
2013-04-15 05:38:48 -07:00
|
|
|
{ 0x9198a51, 0x5d27, 0x4992, \
|
|
|
|
{ 0x97, 0xe4, 0x38, 0xa9, 0xce, 0xa2, 0xa6, 0x5d } }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsPIDOMStorage : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMSTORAGE_IID)
|
|
|
|
|
2013-04-15 05:38:48 -07:00
|
|
|
enum StorageType {
|
2011-10-09 19:14:00 -07:00
|
|
|
LocalStorage = 1,
|
|
|
|
SessionStorage = 2
|
2013-04-15 05:38:48 -07:00
|
|
|
};
|
2010-01-28 06:53:53 -08:00
|
|
|
|
2013-04-15 05:38:48 -07:00
|
|
|
virtual StorageType GetType() const = 0;
|
|
|
|
virtual mozilla::dom::DOMStorageManager* GetManager() const = 0;
|
|
|
|
virtual const mozilla::dom::DOMStorageCache* GetCache() const = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-04-15 05:38:48 -07:00
|
|
|
virtual nsTArray<nsString>* GetKeys() = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-04-15 05:38:48 -07:00
|
|
|
virtual nsIPrincipal* GetPrincipal() = 0;
|
|
|
|
virtual bool PrincipalEquals(nsIPrincipal* principal) = 0;
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool CanAccess(nsIPrincipal *aPrincipal) = 0;
|
2013-02-12 11:24:23 -08:00
|
|
|
virtual bool IsPrivate() = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMStorage, NS_PIDOMSTORAGE_IID)
|
|
|
|
|
|
|
|
#endif // __nsPIDOMStorage_h_
|