Reviewers: shindig.remailer_gmail.com,

Description:
setupReceiver('..') initializes gadget-to-container communication, but
should be called in init() after gadgets.rpc as an object is set up.

Please review this at http://codereview.appspot.com/165052

Affected files:
  features/src/main/javascript/features/rpc/rpc.js


Index: features/src/main/javascript/features/rpc/rpc.js
===================================================================
--- features/src/main/javascript/features/rpc/rpc.js    (revision 887018)
+++ features/src/main/javascript/features/rpc/rpc.js    (working copy)
@@ -530,11 +530,6 @@
     }
   }

- // gadgets.config might not be available, such as when serving container js.
-  if (isChild) {
-    setupReceiver('..');
-  }
-
   return /** @scope gadgets.rpc */ {
     /**
      * Registers an RPC service.
@@ -817,6 +812,9 @@
       if (transport.init(process, transportReady) === false) {
         transport = fallbackTransport;
       }
+      if (isChild) {
+        setupReceiver('..');
+      }
     },

/** Returns the window keyed by the ID. null/".." for parent, else child */


Reply via email to