diff --git a/mozilla/xpcom/sample/nsISample.idl b/mozilla/xpcom/sample/nsISample.idl index 4d52137c3f7..db8fd21aad5 100644 --- a/mozilla/xpcom/sample/nsISample.idl +++ b/mozilla/xpcom/sample/nsISample.idl @@ -48,16 +48,4 @@ interface nsISample : nsISupports }; -%{ C++ -/** - * {7CB5B7A0-07D7-11d3-BDE2-000064657374} - * The CID is also a unique number that look just like the IID - * and identifies uniquely an implementation - */ -#define NS_SAMPLE_CID \ -{ 0x7cb5b7a0, 0x7d7, 0x11d3, { 0xbd, 0xe2, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } - -#define NS_SAMPLE_PROGID "component://netscape/sample" -%} - diff --git a/mozilla/xpcom/sample/nsSample.h b/mozilla/xpcom/sample/nsSample.h index 6fae7de8b3d..0347da3ba5c 100644 --- a/mozilla/xpcom/sample/nsSample.h +++ b/mozilla/xpcom/sample/nsSample.h @@ -33,7 +33,18 @@ * there can be more than one implementation of an given interface. Class * IDs (CIDs) uniquely identify a particular implementation of an interface. * Interface IDs (IIDs) uniquely identify an interface. + * + * The CID is also a unique number that looks just like an IID + * and uniquely identifies an implementation + * {7CB5B7A0-07D7-11d3-BDE2-000064657374} */ + +#define NS_SAMPLE_CID \ +{ 0x7cb5b7a0, 0x7d7, 0x11d3, { 0xbd, 0xe2, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } } + +#define NS_SAMPLE_PROGID "component://netscape/sample" + + class nsSampleImpl : public nsISample { public: diff --git a/mozilla/xpcom/sample/xpconnect-sample.html b/mozilla/xpcom/sample/xpconnect-sample.html index db5d890c70f..91362162074 100644 --- a/mozilla/xpcom/sample/xpconnect-sample.html +++ b/mozilla/xpcom/sample/xpconnect-sample.html @@ -125,24 +125,28 @@ dump("sample = " + sample + "\n"); function get() { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); field.value = sample.value; } function set() { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); sample.value = field.value; } function poke() { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); sample.poke(field.value); } -function write() +function sampleWrite() { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); sample.writeValue("here is what I'm writing: "); } @@ -153,7 +157,7 @@ function write() - +

@@ -172,24 +176,25 @@ dump("sample = " + sample + "\n"); function get() { - var field = document.getElementById('Value'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); field.value = sample.value; } function set() { - var field = document.getElementById('Value'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); sample.value = field.value; } function poke() { - var field = document.getElementById('Value'); + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value'); sample.poke(field.value); } -function write() +function sampleWrite() { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); sample.writeValue("here is what I'm writing: "); } </script> @@ -199,7 +204,7 @@ function write() <input type="button" value="Set" onclick="set();"> <input type="button" value="Poke" onclick="poke();"> <input type="text" id="Value"> -<input type="button" value="Write" onclick="write();"> +<input type="button" value="Write" onclick="sampleWrite();"> <form>