1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/base/nsIGlobalObject.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsIGlobalObject_h__ 1.10 +#define nsIGlobalObject_h__ 1.11 + 1.12 +#include "nsISupports.h" 1.13 +#include "js/TypeDecls.h" 1.14 + 1.15 +#define NS_IGLOBALOBJECT_IID \ 1.16 +{ 0xe2538ded, 0x13ef, 0x4f4d, \ 1.17 +{ 0x94, 0x6b, 0x65, 0xd3, 0x33, 0xb4, 0xf0, 0x3c } } 1.18 + 1.19 +class nsIPrincipal; 1.20 + 1.21 +class nsIGlobalObject : public nsISupports 1.22 +{ 1.23 +public: 1.24 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGLOBALOBJECT_IID) 1.25 + 1.26 + virtual JSObject* GetGlobalJSObject() = 0; 1.27 + 1.28 + // This method is not meant to be overridden. 1.29 + nsIPrincipal* PrincipalOrNull(); 1.30 +}; 1.31 + 1.32 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIGlobalObject, 1.33 + NS_IGLOBALOBJECT_IID) 1.34 + 1.35 +#endif // nsIGlobalObject_h__