<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/flashbridge/log-calls.js</filename>
    </added>
    <added>
      <filename>test/flashbridge/test-security.html</filename>
    </added>
    <added>
      <filename>test/flashbridge/test-security.lzx</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -47,6 +47,10 @@ FlashBridge.secure = function() {
     };
 }
 
+FlashBridge.allow = function(name) {
+    this.registeredCallbacks[name] = true;
+}
+
 FlashBridge.call = function(fname) {
     var args = Array.slice(arguments, 1),
         callbacks = this.callbacks,
@@ -91,7 +95,10 @@ FlashBridge.handleException = function(sequenceNumber, result) {
 }
 
 FlashBridge.handleCall = function(path) {
-    if (this.secured &amp;&amp; !this.secured(path[0])) return;
+    if (this.secured &amp;&amp; !this.secured(path[0])) {
+        console.error('FlashBridge: denied access to ' + path[0]);
+        return;
+    }
     var object = _root;
     while (path.length &gt; 1)
         object = object[path.shift()];</diff>
      <filename>lib/flashbridge-plugin.js</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
     &lt;title&gt;FlashBridge: Test Callbacks&lt;/title&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;../../lib/flashbridge-browser.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;log-calls.js&quot;&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
     &lt;h2&gt;Calls from the applet into the browser:&lt;/h2&gt;
@@ -21,28 +22,13 @@
       // Set up an object for the applet to call
       var gBrowserObject = {
         add: function(a, b) {
-          logCall('gBrowserObject.add', arguments);
           return a+b;
         },
         error: function(msg) {
-          logCall('gBrowserObject.error', arguments);
           throw msg;
         }
       };
-      FlashBridge.call('run');
-
-      // Logging, so we can see the output
-      function log() {
-        var msg = Array.prototype.join.call(arguments, ' '),
-            div = document.createElement('div');
-        div.innerHTML = msg.replace(/&amp;/g, '&amp;amp;').replace(/&lt;/g, '&amp;lt;').replace(/&gt;/g, '&amp;gt;').replace(/&quot;/g, '&amp;quote;');
-        document.getElementById('output').appendChild(div);
-      }
-      function logCall(fname, args) {
-      var args = Array.prototype.slice.call(args, 0);
-      args.unshift(fname);
-      log.apply(null, args);
-      }
+      traceMethods('gBrowserObject');
     //]]&gt;&lt;/script&gt;
   &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>test/flashbridge/test-callbacks.html</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,11 @@
   &lt;script&gt;
     var gBrowserObject = FlashBridge.createRemoteProxy('gBrowserObject',
       ['add', 'error']);
-    function run() {
-      gBrowserObject.add(1, 2).onreturn(function(value) {
-	console.info('1 + 2 -&gt; ' + value);
-      });
-      gBrowserObject.error('error msg').onexception(function(value) {
-	console.info('error !&gt; ' + value);
-      });
-    }
+    gBrowserObject.add(1, 2).onreturn(function(value) {
+      console.info('1 + 2 -&gt; ' + value);
+    });
+    gBrowserObject.error('error msg').onexception(function(value) {
+      console.info('error !&gt; ' + value);
+    });
   &lt;/script&gt;
 &lt;/canvas&gt;</diff>
      <filename>test/flashbridge/test-callbacks.lzx</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
     &lt;title&gt;FlashBridge: Test Proxy Objects&lt;/title&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;../../lib/flashbridge-browser.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;log-calls.js&quot;&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
     &lt;h2&gt;Calls from the browser into the applet:&lt;/h2&gt;
@@ -31,19 +32,6 @@
       gAppletObject.f(1, 2);
       gAppletObject.g(3);
       gAppletObject.f(4);
-
-      // Logging, so we can see the output
-      function log() {
-        var msg = Array.prototype.join.call(arguments, ' '),
-            div = document.createElement('div');
-        div.innerHTML = msg.replace(/&amp;/g, '&amp;amp;').replace(/&lt;/g, '&amp;lt;').replace(/&gt;/g, '&amp;gt;').replace(/&quot;/g, '&amp;quote;');
-        document.getElementById('output').appendChild(div);
-      }
-      function logCall(fname, args) {
-      var args = Array.prototype.slice.call(args, 0);
-      args.unshift(fname);
-      log.apply(null, args);
-      }
     //]]&gt;&lt;/script&gt;
   &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>test/flashbridge/test-proxy.html</filename>
    </modified>
    <modified>
      <diff>@@ -3,21 +3,25 @@
     &lt;title&gt;FlashBridge: Test Slow Page Load&lt;/title&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
     &lt;script type=&quot;text/javascript&quot; src=&quot;../../lib/flashbridge-browser.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;log-calls.js&quot;&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
     &lt;h2 id=&quot;countdown&quot;&gt;Loading Applet&lt;/h2&gt;
     &lt;div id=&quot;applet&quot;&gt;
       &lt;p&gt;The applet didn't load.&lt;/p&gt;
     &lt;/div&gt;
+    &lt;h2&gt;Browser log:&lt;/h2&gt;
+    &lt;div id=&quot;output&quot; style=&quot;font-family:monospace&quot;&gt;
+    &lt;/div&gt;
     &lt;script type=&quot;text/javascript&quot;&gt;//&lt;![CDATA[
       var swfUrl = &quot;test-slow-page-load.lzx?lzt=swf&amp;lzr=swf8&quot;;
       swfobject.embedSWF(swfUrl, &quot;applet&quot;, '100%', '50%', '8.0.0');
       log('swfobject.embedSWF');
       
       function add(a, b) {
-	log('add');
 	return a+b;
       }
+      traceFunction('add');
       
       var seconds = 30,
           startTime = new Date;
@@ -31,10 +35,6 @@
         FlashBridge.initialize('applet');
         log('FlashBridge.initialize');
       }, 1000);
-      
-      function log(message) {
-        console &amp;&amp; console.info &amp;&amp; console.info(new Date, message);
-      }
     //]]&gt;&lt;/script&gt;
   &lt;/body&gt;
 &lt;/html&gt;</diff>
      <filename>test/flashbridge/test-slow-page-load.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>10ac35ab280530c7652bdbaaaa668da4244aaf20</id>
    </parent>
  </parents>
  <author>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </author>
  <url>http://github.com/osteele/lzosutils/commit/8b5a293938564d5c5660c328d60158ac5d313d47</url>
  <id>8b5a293938564d5c5660c328d60158ac5d313d47</id>
  <committed-date>2008-04-13T10:47:09-07:00</committed-date>
  <authored-date>2008-04-13T10:47:09-07:00</authored-date>
  <message>test case for security; factor out logging</message>
  <tree>64032a916513358108fdd5e52b8babb0289c0cc5</tree>
  <committer>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </committer>
</commit>
